-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgallery.php
77 lines (58 loc) · 1.82 KB
/
gallery.php
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
65
66
67
68
69
70
71
72
73
74
75
76
<?php
header( 'Content-type: text/xml' );
define( 'ROOT', '' );
require_once( 'priedai/conf.php' );
if ( isset( $conf['puslapiai']['galerija.php'] ) ) {
$rss = new RssGallery;
//$rss->display(adresas());
} else {
echo $lang['admin']['gallery_noimages'];
}
class RssGallery
{
function __construct() {
echo $this->header();
echo $this->GetGallery();
echo $this->footer();
}
function header() {
return '
<rss version="2.0"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>' . $conf['Pavadinimas'] . '</title>
<link>' . adresas() . '</link>
<description>' . strip_tags( $conf['Apie'] ) . '</description>
<language>en-us</language>
<lastBuildDate>' . date( "D, d M Y h:i:s" ) . ' EST</lastBuildDate>
<atom:link href="' . adresas() . 'gallery.php" rel="self" type="application/rss+xml" />
';
}
function footer() {
return ' </channel>
</rss>';
}
function GetGallery() {
global $conf;
$rssItems = '';
$query = "SELECT * FROM `" . LENTELES_PRIESAGA . "galerija` WHERE `rodoma` = 'TAIP' ORDER BY id DESC";
$query = mysql_query1( $query, 3600 );
foreach ( $query as $row ) {
$id = $row['ID'];
$title = trimlink( $row["pavadinimas"], 50 );
$text = input( $row["apie"] );
$img_id = $row["file"];
$timestamp = $row["data"];
$rssItems .= " <item>
<title>" . $title . "</title>
<link>" . url( "?id," . $conf['puslapiai']['galerija.php']['id'] . ";m," . $id ) . "</link>
<media:thumbnail url=\"" . adresas() . "images/galerija/" . $img_id . " \"/>
<media:content url=\"" . adresas() . "images/galerija/originalai/" . $img_id . " \"/>
<guid isPermaLink=\"false\">" . $img_id . "</guid>
</item>\r\n";
}
return $rssItems;
}
}
?>