-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.php
More file actions
64 lines (62 loc) · 2.29 KB
/
sitemap.php
File metadata and controls
64 lines (62 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/*
*****************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : tangi
| @ Software : ClipBucket , © PHPBucket.com
******************************************************************
*/
require 'includes/config.inc.php';
header("Content-Type: text/xml charset=utf-8");
echo '<?phpxml version="1.0" encoding="UTF-8"?>' . "\n";
$limit = 100;
$videos = get_videos(array('limit'=>$limit,'active'=>'yes','order'=>'date_added DESC'));
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<!-- by fjulio ( tangi @ clipbucket dev. ) -->
<?php
foreach($videos as $video)
{
?>
<url>
<loc><?php echo video_link($video)?></loc>
<video:video>
<video:content_loc><?php echo get_video_file($video)?></video:content_loc>
<video:player_loc allow_embed="yes"><?php echo BASEURL ?>/player/old_players/embed_player.swf?file=<?php echo get_video_file($video)?></video:player_loc>
<video:thumbnail_loc><?php echo get_thumb($video)?></video:thumbnail_loc>
<video:title><![CDATA[<?php echo substr($video['title'],0,50)?>]]></video:title>
<video:description><![CDATA[<?php echo substr($video['description'],0,300)?>]]></video:description>
<video:rating><?php
$vrating = $video['rating'] / 2;
$findcond = strpos($vrating,'.');
if ($findcond == "1"){
$firstrating = str_replace(',','.',$vrating);
echo $firstrating;
}
else { echo $vrating.'.0'; }
?></video:rating>
<video:view_count><?php echo $video['views']?></video:view_count>
<video:publication_date><?php
echo cbdate("Y-m-d\TH:i:s",strtotime($video['date_added'])).'+00:00';
?></video:publication_date>
<?php
$vtags = strip_tags(tags($video['tags'],'video'));
$vtableau = explode (",",$vtags);
for($i=0;$i<sizeof($vtableau);$i++)
{
echo '<video:tag><![CDATA['.trim($vtableau[$i]).']]></video:tag>';
}
?>
<video:category><?php echo strip_tags(categories($video['category'],'video'))?></video:category>
<video:family_friendly>yes</video:family_friendly>
<video:duration><?php
$defaultime = $video['duration'];
$dotfixed = explode (".",$defaultime);
echo $dotfixed[0].$dotfixed[1];
?></video:duration>
</video:video>
</url>
<?php
}
?>
</urlset>