שלח תשובה

זירת השאלות

912
צפיות
3
תשובות

יצירת RSS ובו מספר דפים

,‏ 23 ביוני, 2010

אני רוצה ליצור 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 תשובות

  1. dushy_d הגיב:

    דוגמא לקוד של 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/&quot;
                 xmlns_atom="http://www.w3.org/2005/Atom"&gt;
                <channel>
        <title>My Website '.$currentset.'</title>
        <link>http://www.mywebsite.com/</link&gt;
        <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&quot; 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

שלח תשובה