912
צפיות
צפיות
3
תשובות
תשובות
יצירת RSS ובו מספר דפים
אני רוצה ליצור RSS ובו מספר דפים
יש פה דוגמא לקוד ב PHP + mysql
http://www.cooliris.com/developer/reference/media-rss/php_rss.html
אני צריך ליצור את זה באופן דינאמי ב asp + sql server
ע"מ להציג את הגלרייה של cooliris – http://www.cooliris.com/yoursite/express/builder/
אנא עזרו לי
3 תשובות
דוגמא לקוד של PHP
<? header('Content-type: text/xml'); ?>
<?php
require("../lib/config.php");
require("../lib/functions.php");
require("../lib/tag_functions.php");
require("../user/database.php");
require("../user/user.php");
require("../lib/forms.php");
?>
<?php
$pbpathrev = strrev($PATH_INFO);
$pbslashpos = strpos($pbpathrev, '-');
$pbpathcut = substr($pbpathrev, 0, $pbslashpos);
$pbdotpos = strpos($pbpathcut, '.');
$pbrevimgid = substr($pbpathcut, ($pbdotpos +1));
$currentset = strrev($pbrevimgid);
$rssWriter = new PhotoRSSWriter;
$rssWriter->display($currentset);
class PhotoRSSWriter{
function display($currentset){
echo $this->getRss($currentset);
}
function getRss($currentset){
$rss = $this->getRssHeader($currentset);
$rss .= $this->getRssItems($currentset);
$rss .= $this->getRssFooter();
return $rss;
}
function getRssHeader($currentset){
$rssHeader = '<rss version="2.0"
xmlns_media="http://search.yahoo.com/mrss/"
xmlns_atom="http://www.w3.org/2005/Atom">
<channel>
<title>My Website '.$currentset.'</title>
<link>http://www.mywebsite.com/</link>
<description>My Website is a great collection of my things.</description>
<language>en-us</language>
<lastBuildDate>' . date("D, d M Y h:i:s") . ' EST</lastBuildDate>
<atom:link href="http://mywebsite.com/photos.rss" rel="self" type="application/rss+xml" />
if($currentset > 0)
{
$rssHeader .='<atom:link rel="previous" href="http://www.mywebsite.com/rss/photos-'.($currentset-1).'.rss" />
}
$rssHeader .='<atom:link rel="next" href="http://www.mywebsite.com/rss/photos-'.($currentset+1).'.rss" />
return $rssHeader;
}
function getRssFooter(){
$rssFooter .= ' </channel>
</rss>';
return $rssFooter;
}
function getRssItems($currentset){
//Set up Database connection
mysql_connect ('localhost:3306','weblog','weblog');
mysql_select_db ('weblog_new');
$query = "select c.id from content c inner join content_images ci on c.id = ci.content_id";
$exec = mysql_query($query);
&nbs
צריך את הקוד ב ASP + SQL SERVER
בבקשה עזרה דחופה !