+ Reply to Thread
Results 1 to 7 of 7

Thread: time/date stamp on rss feed

  1. #1
    Senior Member
    Points: 933, Level: 17
    Level completed: 33%, Points required for next Level: 67
    Overall activity: 0%
    Achievements:
    Three FriendsRecommendation Second ClassCreated Blog entryTagger First Class1000 Experience Points
    Awards:
    Master Tagger
    Stephan's Avatar
    Join Date
    Jul 2010
    Location
    Sunny island
    Posts
    591
    Points
    933
    Level
    17
    Blog Entries
    1
    Downloads
    0
    Uploads
    6
    My Mood
    In Love

    time/date stamp on rss feed

    Last week we got 1 rss feed addon for ATS and 1 fix for Academ Pro, now I have a new site/script PHPAS 4 and the rss is not working on the right way for Twitter and Twitterfeed.

    The game added date and time is missing:
    Maybe someone can fix this?

    This is the rss.php now:
    PHP Code:
    <?
    /*
    script: rss.php
    purpose: This script displays the RSS feeds.
    copyright: copyright 2006 phpArcadeScript & Scott Lewis. All Rights Reserved. You may modify this file for use on your
                        site running a licenced copy of phpArcadeScript.
                        You must not distribute this file or derivations of it.
    support: www.phparcadescript.com

    */

    //error_reporting(0);

    /* fix by Clixus Team */
    if(isset($_GET['limit']) and !is_numeric($_GET['limit'])){
      
    header("Location: index.php");
    }

    header('Content-type: text/xml'); 

    include(
    "./includes/config.php");
    include(
    "./includes/functions.php");

    $feed clean_string($_GET['type']);
    $num clean_string($_GET['limit']);

    if (empty(
    $num) || $num 1)
    $num 10;

    if (
    $feed == "newest_content"){
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by dateadded DESC LIMIT $num";
    $feedtitle "Newest Content";
    }
    elseif (
    $feed == "most_popular"){
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by timesplayed DESC LIMIT $num";
    $feedtitle "Most Popular Content";
    }
    elseif (
    $feed == "random_content"){
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by RAND() LIMIT $num";
    $feedtitle "Random Content";
    }
    elseif (
    $feed 0){

    // Need to make sure its a valid category and get category name
            
    $sql_query "SELECT * from categories WHERE catid = '$feed' LIMIT 1";
            
    $result2 mysql_query($sql_query);
            if(
    mysql_num_rows($result2))
            {
            
    //output as long as there are still available fields
            
    while($row mysql_fetch_array($result2))
            {
              
    $categoryname stripslashes($row['catname']);
              
              
    $query "SELECT * from games WHERE gamestatus = 1 && category = '$feed' ORDER by dateadded DESC LIMIT $num";
              
    $feedtitle "Newest $categoryname";

            }
            }
            else{

              
    $query "SELECT * from games WHERE gamestatus = 1 && category = '$feed' ORDER by dateadded DESC LIMIT $num";
              
    $feedtitle "Newest Content";
            
            }

    // End Category Check


    }
    else{
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by dateadded DESC LIMIT $num";
    $feedtitle "Newest Content";
    }
    // open a file pointer to an RSS file
    //$fp = fopen ("rss.xml", "w");
    $site_title stripslashes($site_title);
    $site_desc stripslashes($site_desc);
    // Now write the header information
    $feed "<?xml version='1.0' ?><rss version='2.0'><channel>";

    $feed.="<title>$feedtitle from $site_title</title>";

    $feed.="<link>$base_url</link>";

    $feed.="<description>$sitedescription</description>";

    $feed.="<language>en-us</language>";

    $feed.="<docs>".$base_url."rss.php</docs>";




        
            
    $result mysql_query($query);
            if(
    mysql_num_rows($result))
            {
            
    //output as long as there are still available fields
            
    while($row mysql_fetch_array($result))
            {
                      
    $gametitle stripslashes($row['gametitle']);
                      
    $gametitle ereg_replace("[^a-zA-Z0-9 ]"""$gametitle);
                      
    $gametitle2 make_friendly($gametitle);
                      
    $gamedescription stripslashes($row['gamedesc']);
                      
    $gamedescription ereg_replace("[^a-zA-Z0-9 ]"""$gamedescription);
                      
    $gameid $row['gameid'];
                      
    $gameicon=$row['gameicon'];
                      
    $iconlocation=$row['iconlocation'];
                          
        
                if (
    $rewrite ==0)
                
    $gamelink $base_url."index.php?action=playgame&gameid=".$gameid;
                else
                
    $gamelink $base_url.$sedir."/".$gameid."/".$gametitle2;
                
                if(
    $iconlocation==0)
                
    $gameicon=$base_url."games/images/".$gameicon;
                
                
    $gamelink htmlentities($gamelink); 
        
                        
    $feed.="
                        <item>
                        <title>$gametitle</title>
                        <description>$gamedescription</description>
                        <link>$gamelink</link>
                        <image>$gameicon</image>
                        </item>
                        "
    ;
                        
        
                    
            }
            }

    $feed.="</channel></rss>";
    mysql_close($connection);
    echo 
    $feed;

    ?>
    The games are in the DB taple "games" and the date added in (row?) "dateadded"

    Thanks

  2. #2
    Code Monkey
    Points: 4,025, Level: 42
    Level completed: 50%, Points required for next Level: 75
    Overall activity: 99.2%
    Achievements:
    Tagger First Class1000 Experience Points1 year registered
    Awards:
    User with most referrers
    lfhost's Avatar
    Join Date
    Jul 2010
    Posts
    313
    Points
    4,025
    Level
    42
    Downloads
    0
    Uploads
    0
    My Mood
    Bored
    Try

    PHP Code:
    <? 
    /* 
    script: rss.php 
    purpose: This script displays the RSS feeds. 
    copyright: copyright 2006 phpArcadeScript & Scott Lewis. All Rights Reserved. You may modify this file for use on your 
                        site running a licenced copy of phpArcadeScript. 
                        You must not distribute this file or derivations of it. 
    support: www.phparcadescript.com 

    */ 

    //error_reporting(0); 

    /* fix by Clixus Team */ 
    if(isset($_GET['limit']) and !is_numeric($_GET['limit'])){ 
      
    header("Location: index.php"); 


    header('Content-type: text/xml');  

    include(
    "./includes/config.php"); 
    include(
    "./includes/functions.php"); 

    $feed clean_string($_GET['type']); 
    $num clean_string($_GET['limit']); 

    if (empty(
    $num) || $num 1
    $num 10

    if (
    $feed == "newest_content"){ 
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by dateadded DESC LIMIT $num"
    $feedtitle "Newest Content"

    elseif (
    $feed == "most_popular"){ 
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by timesplayed DESC LIMIT $num"
    $feedtitle "Most Popular Content"

    elseif (
    $feed == "random_content"){ 
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by RAND() LIMIT $num"
    $feedtitle "Random Content"

    elseif (
    $feed 0){ 

    // Need to make sure its a valid category and get category name 
            
    $sql_query "SELECT * from categories WHERE catid = '$feed' LIMIT 1"
            
    $result2 mysql_query($sql_query); 
            if(
    mysql_num_rows($result2)) 
            { 
            
    //output as long as there are still available fields 
            
    while($row mysql_fetch_array($result2)) 
            { 
              
    $categoryname stripslashes($row['catname']); 
               
              
    $query "SELECT * from games WHERE gamestatus = 1 && category = '$feed' ORDER by dateadded DESC LIMIT $num"
              
    $feedtitle "Newest $categoryname"

            } 
            } 
            else{ 

              
    $query "SELECT * from games WHERE gamestatus = 1 && category = '$feed' ORDER by dateadded DESC LIMIT $num"
              
    $feedtitle "Newest Content"
             
            } 

    // End Category Check 



    else{ 
    $query "SELECT * from games WHERE gamestatus = 1 ORDER by dateadded DESC LIMIT $num"
    $feedtitle "Newest Content"

    // open a file pointer to an RSS file 
    //$fp = fopen ("rss.xml", "w"); 
    $site_title stripslashes($site_title); 
    $site_desc stripslashes($site_desc); 
    // Now write the header information 
    $feed "<?xml version='1.0' ?><rss version='2.0'><channel>"

    $feed.="<title>$feedtitle from $site_title</title>"

    $feed.="<link>$base_url</link>"

    $feed.="<description>$sitedescription</description>"

    $feed.="<language>en-us</language>"

    $feed.="<docs>".$base_url."rss.php</docs>"




         
            
    $result mysql_query($query); 
            if(
    mysql_num_rows($result)) 
            { 
            
    //output as long as there are still available fields 
            
    while($row mysql_fetch_array($result)) 
            { 
                      
    $gametitle stripslashes($row['gametitle']); 
                      
    $gametitle ereg_replace("[^a-zA-Z0-9 ]"""$gametitle); 
                      
    $gametitle2 make_friendly($gametitle); 
                      
    $gamedescription stripslashes($row['gamedesc']); 
                      
    $gamedescription ereg_replace("[^a-zA-Z0-9 ]"""$gamedescription); 
                      
    $gameid $row['gameid']; 
                      
    $gameicon=$row['gameicon']; 
                      
    $iconlocation=$row['iconlocation']; 
                           
         
                if (
    $rewrite ==0
                
    $gamelink $base_url."index.php?action=playgame&gameid=".$gameid
                else 
                
    $gamelink $base_url.$sedir."/".$gameid."/".$gametitle2
                 
                if(
    $iconlocation==0
                
    $gameicon=$base_url."games/images/".$gameicon
                 
                
    $gamelink htmlentities($gamelink);  
                
    $dateadded gmdate('r',$row['dateadded']);
                        
    $feed.=
                        <item> 
                        <title>$gametitle</title> 
                        <description>$gamedescription</description> 
                        <link>$gamelink</link> 
                        <image>$gameicon</image> 
                        <pubDate>{$dateadded}</pubDate>
                        </item> 
                        "

                         
         
                     
            } 
            } 

    $feed.="</channel></rss>"
    mysql_close($connection); 
    echo 
    $feed

    ?>

  3. #3
    Senior Member
    Points: 933, Level: 17
    Level completed: 33%, Points required for next Level: 67
    Overall activity: 0%
    Achievements:
    Three FriendsRecommendation Second ClassCreated Blog entryTagger First Class1000 Experience Points
    Awards:
    Master Tagger
    Stephan's Avatar
    Join Date
    Jul 2010
    Location
    Sunny island
    Posts
    591
    Points
    933
    Level
    17
    Blog Entries
    1
    Downloads
    0
    Uploads
    6
    My Mood
    In Love

    You are the man!
    Works

    Thanks,

  4. #4
    Junior Member
    Points: 243, Level: 4
    Level completed: 86%, Points required for next Level: 7
    Overall activity: 0%
    Achievements:
    31 days registeredCreated Blog entryTagger Second Class100 Experience Points
    gmsj's Avatar
    Join Date
    Jan 2011
    Location
    Romania
    Posts
    9
    Points
    243
    Level
    4
    Blog Entries
    1
    Downloads
    0
    Uploads
    0
    My Mood
    Angelic
    I use phparcadescript, and this change was very helpful.
    Thank you, Ifhost
    Jocuri online - Jocuri online
    Jocuri de gatit - Jocuri de gatit

  5. #5
    Junior Member
    Points: 935, Level: 17
    Level completed: 35%, Points required for next Level: 65
    Overall activity: 38.0%
    Achievements:
    Tagger Second Class500 Experience Points1 year registered

    Join Date
    Aug 2010
    Posts
    29
    Points
    935
    Level
    17
    Downloads
    0
    Uploads
    0
    This bug will be corrected in an upcoming release of phpAS v4. (It will also be released as an hotfix for those that already have installed their arcade and don't want to replace files, but rather make the correct changes directly).

  6. #6
    Junior Member
    Points: 237, Level: 4
    Level completed: 74%, Points required for next Level: 13
    Overall activity: 17.0%
    Achievements:
    100 Experience Points3 months registered

    Join Date
    Feb 2011
    Posts
    10
    Points
    237
    Level
    4
    Downloads
    0
    Uploads
    0
    Sorry for the off-topic.
    I know this post might be a little old, but I think the use of ereg functions is outdated and you should change them.
    On-topic:
    Thanks for your effort!

  7. #7
    Junior Member
    Points: 935, Level: 17
    Level completed: 35%, Points required for next Level: 65
    Overall activity: 38.0%
    Achievements:
    Tagger Second Class500 Experience Points1 year registered

    Join Date
    Aug 2010
    Posts
    29
    Points
    935
    Level
    17
    Downloads
    0
    Uploads
    0
    Hey jorje,

    Yup, the ereg function was deprecated as of php 5.3. phpAS v4.1 will be a bug fix version to take care of as many bugs as possible, once we've taken care of them then work will begin immediately on a new update where we will update a lot of the coding.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts