Help with a Current PHP RSS Feed Script

Discussion in 'PHP' started by misohoni, Jul 6, 2010.

  1. #1
    I've got a php rss script but need help adjusting it for a new site...can anyone help, I know it relates to the tables in the DB...
     
    misohoni, Jul 6, 2010 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    are u using some specific script ?
     
    Bohra, Jul 6, 2010 IP
  3. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Is a custom script which seems to look at active tables and then showcases them in the RSS...thanks
     
    misohoni, Jul 6, 2010 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    umm and which rss script are you talking about its really tough to say anything withour have full info
     
    Bohra, Jul 6, 2010 IP
  5. c_programmer

    c_programmer Peon

    Messages:
    92
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I can most likely help.
     
    c_programmer, Jul 6, 2010 IP
  6. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    There is no tail or body for your question :(
    Be clear in what you say
     
    roopajyothi, Jul 8, 2010 IP
  7. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #7
    I think, he already have some script with him.., and he needs us to change as his wish..!!!

    Am i correct friend.
     
    strgraphics, Jul 10, 2010 IP
  8. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #8
    yea but if he doesnt post anything abt the script or his site how can anyone help
     
    Bohra, Jul 10, 2010 IP
  9. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #9
    Ok the Php source code is below in the rss.php file:

    I know this script relates to sketches, sketch>id fields etc., from the other DB.

    In my current DB I want to use the step1_sets field (see 001.gif) and attach the details within this field to use...see 002.gif. Hope this helps, thanks guys!

    <?php
    
    include("functions/db.php");
    
    header('Content-Type: text/xml; charset=utf-8');
    
    $number_of_items = 20;
    if (isset($_GET['artist']))
    {
     $artist = $_GET['artist'];
     $artist_m = url_2_usr(mysql_real_escape_string($_GET['artist']));
     $where = "WHERE owner = '".$artist_m."' ORDER BY id DESC";
    }
    else
    {
     $where = "ORDER BY id DESC";
    }
    
    $sql = "SELECT * FROM sketches $where LIMIT 0, $number_of_items";
    $sketches = $db->get_results($sql);
    
    echo '<?xml version=\'1.0\' encoding=\'UTF-8\'?>';
    echo '
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> ';
    echo '
    <channel>
    ';
    if (isset($_GET['artist']))
    {
    echo '<title>'.$sketch->owner.' INFO</title>
    <description>DESCRIPTION</description>
    <link>http://www.SITE.COM/artists/'.$artist.'/</link>
    <atom:link href="http://www.SITE.COM/feed/'.$artist.'/" rel="self" type="application/rss+xml" />';
    }
    else
    {
    echo '<title>SITE</title>
    <description>DESCRIPTION</description>
    <link>http://www.SITE.com/</link>
    <atom:link href="http://www.SITE.com/feed/" rel="self" type="application/rss+xml" />';
    }
    
    if ($sketches)
    {
     foreach ($sketches as $sketch)
     {
      $sketch_owner_m = usr_2_url($sketch->owner);
    echo '
    <item>
    <title>'.$sketch->title.' by '.$sketch->owner.'</title>
    <description>'.$sketch->tags.' <![CDATA[<p style="text-align: center"><a href="http://www.SITE.com/artists/'.usr_2_url($sketch->owner).'/'.$sketch->id.'/"><img class="sketch" src="http://www.SITE.com/php/images/'.$sketch->url.'.gif" border="0" alt="'.$sketch->title.'" /></a></p>]]></description>
    <link>http://www.SITE.com/artists/'.$sketch_owner_m.'/'.$sketch->id.'/</link>
    <guid>http://www.SITE.com/artists/'.$sketch_owner_m.'/'.$sketch->id.'/</guid>
    </item>';
    
     }
    }
    echo '
    </channel>
    </rss>';
    ?>
    PHP:
     

    Attached Files:

    • 001.jpg
      001.jpg
      File size:
      8 KB
      Views:
      29
    • 002.jpg
      002.jpg
      File size:
      20.3 KB
      Views:
      19
    misohoni, Jul 11, 2010 IP