PHP Classes

File: modules/sitemap/views/sitemap.php

Recommend this page to a friend!
  Classes of Aby Dahana   Dwitri PHP Social Network Platform   modules/sitemap/views/sitemap.php   Download  
File: modules/sitemap/views/sitemap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Dwitri PHP Social Network Platform
Create a community site like a social network
Author: By
Last change:
Date: 3 years ago
Size: 2,107 bytes
 

Contents

Class file image Download
<?php header ("Content-Type:text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc><?php echo base_url();?></loc>
        <priority>1.0</priority>
    </url>
    <url>
        <loc><?php echo base_url('posts');?></loc>
        <priority>0.5</priority>
    </url>
    <url>
        <loc><?php echo base_url('snapshots');?></loc>
        <priority>0.5</priority>
    </url>
    <url>
        <loc><?php echo base_url('openletters');?></loc>
        <priority>0.5</priority>
    </url>
    <url>
        <loc><?php echo base_url('tv');?></loc>
        <priority>0.5</priority>
    </url>
    <url>
        <loc><?php echo base_url('search');?></loc>
        <priority>0.5</priority>
    </url>
   
    <?php
       
foreach($sitemap as $url)
        {
            if(isset(
$url['categoryID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('posts/' . $url['categorySlug']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['postID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('posts/' . $url['postSlug']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['snapshotID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('snapshots/' . $url['snapshotSlug']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['letterID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('openletters/' . $url['slug']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['tvID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('tv/' . $url['tvSlug']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['userID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url($url['userName']) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
            elseif(isset(
$url['searchID']))
            {
                echo
'
                    <url>
                        <loc>'
. base_url('search/' . format_uri($url['query'])) . '</loc>
                        <priority>0.5</priority>
                    </url>
                '
;
            }
        }
   
?>

</urlset>