+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 40

Thread: RSS feed for ATS?

  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

    RSS feed for ATS?

    Anybody know how to setup RSS feed for ATS? I try to find some code but can't find anything, should not be so complicated to pull the game name, description and URL!?

  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 this, save as rss.php and place into your root (built based on ats-plug-helper.php)

    PHP Code:
    <?php
    /*
    #################################################################
    ## Script is copyrighted to ArcadeTradeScript.com and you are free
    ## modify it as you wish as long as credit is given back to us.
    ## 
    ## This is a free Script provided by Lfhost and
    ## was made for arcades using ArcadeTradeScript.

    #################################################################
    */
    include("./inc/main-func.php");
    include(
    "./admin/config.php");
    //##############################################
    // You need to edit this part.
    // What is the URL Structure for your  hosted game pages?
    // Below are the default URL structures. If you have not 
    // changed them at all then you don't need to edit these.

    if ($seoFriendly == 1) {
        
    $preGameStructure "[basedir][category]/play-[gamename]"// The exact URL structure for your pre game pages.
        
    $playGameStructure "[basedir][seodir]/[gamename]"// The exact URL structure for your play game pages.
    } else {
        
    $preGameStructure "[basedir]index.php?a=play&id=[gameid]"// The exact URL structure for your pre game pages.
        
    $playGameStructure "[basedir]index.php?a=play&id=[gameid]&cont=1"// The exact URL structure for your play game pages.
    }

    /*
    This is made easy to edit by the use of special variables.
      [basedir] = this will be replace automatically with the base directory of 
      your arcade that you set in your admin.
      
      [seodir] = this will be replace automatically with the SEO directory of 
      play game pages that you set in your admin.
      
      [gameid] = this will be replace automatically with the ID of the game
      that is found.
      
      [gamename] = this will be replace automatically with the name of the game
      that is found (ex: my-game-name-3).
      
      [category] = this will be replace automatically with the name of the category
      for the game that is found (ex: my-category-name).
    */
    //##############################################

    $result mysql_query("SELECT gid, gName, cat, tradeType, gDesc, addedOn FROM ats_games WHERE gStatus = 1 ") or die(mysql_error());
    if (
    mysql_num_rows($result)) {
        while(
    $row mysql_fetch_array($result)) {
            
    $gameID $row['gid'];
            
    $gameName remove_slashes($row['gName']);
            
    $catID $row['cat'];
            
    $tradeType $row['tradeType'];
            
            
    $gDesc remove_slashes($row['gDesc']);
            
    $addedOn $row['addedOn'];
            
            
    $gameCat getGameCat($catID);
            
    // Getting the actual game page URL
            
    $preGameStructure2 str_replace("[basedir]"$baseDir$preGameStructure);
            
    $preGameStructure2 str_replace("[seodir]"$seoDir$preGameStructure2);
            
    $preGameStructure2 str_replace("[gameid]"$gameID$preGameStructure2);
            
    $preGameStructure2 str_replace("[gamename]"seo_str_plain($gameName), $preGameStructure2);
            if (
    preg_match("/\[category\]/",$preGameStructure2)) {
                
    $preGameStructure str_replace("[category]"seo_str_plain($gameCat), $preGameStructure);
            }
            
            
    $playGameStructure2 str_replace("[basedir]"$baseDir$playGameStructure);
            
    $playGameStructure2 str_replace("[seodir]"$seoDir$playGameStructure2);
            
    $playGameStructure2 str_replace("[gameid]"$gameID$playGameStructure2);
            
    $playGameStructure2 str_replace("[gamename]"seo_str_plain($gameName), $playGameStructure2);
            if (
    preg_match("/\[category\]/",$playGameStructure)) {
                
    $playGameStructure str_replace("[category]"seo_str_plain($gameCat), $playGameStructure2);
            }
                    
            if (
    $preGamePageStatus == "0" || ($preGamePageStatus == && $tradeType == "0")) {
                
    $items_output .= "<item> 
                    <title><![CDATA[{$gameName}]]></title> 
                    <link>{$preGameStructure2}</link>
                    <description> 
                        <![CDATA[{$gDesc}]]>
                    </description> 
                    <category>{$gameCat}</category>
                    <pubDate>{$addedOn}</pubDate>{$author}
                    <guid>{$preGameStructure2}</guid>
                </item> "
    ;
            } elseif ((
    $preGamePageStatus == || $preGamePageStatus == 2) && $tradeType == 1) {
                
    $items_output .= "<item> 
                    <title><![CDATA[{$gameName}]]></title> 
                    <link>{$playGameStructure2}</link>
                    <description> 
                        <![CDATA[{$gDesc}]]>
                    </description> 
                    <category>{$gameCat}</category>
                    <pubDate>{$addedOn}</pubDate>{$author}
                    <guid>{$playGameStructure2}</guid>
                </item> "
    ;
            } else {
            }
        }
    }
    $pageTitle seoMiscTitle($siteName,$homePageTitle);
    $encoding    'ISO-8859-1'
    $copyright   "<copyright>".date('Y')." ".$pageTitle."</copyright>"
    $pubdate     "<pubDate>".gmdate('r')."</pubDate>"
    $language    "<language>en-us</language>"
    $output "<?xml version=\"1.0\" encoding=\"{$encoding}\" ?> 
    <rss version=\"2.0\"> 
        <channel> 
            <title>{$pageTitle} Feed</title> 
            <link>"
    .$baseDir."</link> 
            <description>{$pageTitle}Feed</description>{$copyright}{$pubdate}{$language}{$items_output} 
        </channel> 
    </rss> 
    "

    header("Content-type: application/rss+xml; charset={$encoding}"); 
    echo 
    $output
    ?>
    If you find any bugs, let me know and I'll fix em up.

  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

    Hey this works
    http://www.sniperflashgames.com/rss.php

    Just 3 things:
    How to display only the last 20 new games? (don't know if its good to display all?)
    How to display the time added
    The RSS sign is not showing in the browser

    Thanks a lot

  4. #4
    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

    Just see the games are displayed from old to new, should be new to old

  5. #5
    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 this

    fixes,

    1, ID in url.
    2, 20 Games limit
    3, New to Old
    4, RSS date added.

    It wont show the RSS icon, as its a PHP page, but it is a valid RSS feed, you can use a feed validator.

    You could probably add a line to your .htaccess like

    PHP Code:
    ##RSS
    RewriteRule ^rss.xml rss.php             [L
    then you can call rss.xml instead of the PHP page.

    PHP Code:
    <?php
    /*
    #################################################################
    ## Script is copyrighted to ArcadeTradeScript.com and you are free
    ## modify it as you wish as long as credit is given back to us.
    ## 
    ## This is a free Script provided by Lfhost and
    ## was made for arcades using ArcadeTradeScript.

    #################################################################
    */
    include("./inc/main-func.php");
    include(
    "./admin/config.php");
    //##############################################
    // You need to edit this part.
    // What is the URL Structure for your  hosted game pages?
    // Below are the default URL structures. If you have not 
    // changed them at all then you don't need to edit these.

    if ($seoFriendly == 1) {
        
    $preGameStructure "[basedir][category]/[gameid]/play-[gamename]"// The exact URL structure for your pre game pages.
        
    $playGameStructure "[basedir][seodir]/[gameid]/[gamename]"// The exact URL structure for your play game pages.
    } else {
        
    $preGameStructure "[basedir]index.php?a=play&id=[gameid]"// The exact URL structure for your pre game pages.
        
    $playGameStructure "[basedir]index.php?a=play&id=[gameid]&cont=1"// The exact URL structure for your play game pages.
    }

    /*
    This is made easy to edit by the use of special variables.
      [basedir] = this will be replace automatically with the base directory of 
      your arcade that you set in your admin.
      
      [seodir] = this will be replace automatically with the SEO directory of 
      play game pages that you set in your admin.
      
      [gameid] = this will be replace automatically with the ID of the game
      that is found.
      
      [gamename] = this will be replace automatically with the name of the game
      that is found (ex: my-game-name-3).
      
      [category] = this will be replace automatically with the name of the category
      for the game that is found (ex: my-category-name).
    */
    //##############################################

    $result mysql_query("SELECT gid, gName, cat, tradeType, gDesc, addedOn FROM ats_games WHERE gStatus = 1 order by gid DESC limit 0,20 ") or die(mysql_error());
    if (
    mysql_num_rows($result)) {
        while(
    $row mysql_fetch_array($result)) {
            
    $gameID $row['gid'];
            
    $gameName remove_slashes($row['gName']);
            
    $catID $row['cat'];
            
    $tradeType $row['tradeType'];
            
            
    $gDesc remove_slashes($row['gDesc']);
            
    $addedOn gmdate('r',$row['addedOn']);
            
            
    $gameCat getGameCat($catID);
            
    // Getting the actual game page URL
            
    $preGameStructure2 str_replace("[basedir]"$baseDir$preGameStructure);
            
    $preGameStructure2 str_replace("[seodir]"$seoDir$preGameStructure2);
            
    $preGameStructure2 str_replace("[gameid]"$gameID$preGameStructure2);
            
    $preGameStructure2 str_replace("[gamename]"seo_str_plain($gameName), $preGameStructure2);
            if (
    preg_match("/\[category\]/",$preGameStructure2)) {
                
    $preGameStructure str_replace("[category]"seo_str_plain($gameCat), $preGameStructure);
            }
            
            
    $playGameStructure2 str_replace("[basedir]"$baseDir$playGameStructure);
            
    $playGameStructure2 str_replace("[seodir]"$seoDir$playGameStructure2);
            
    $playGameStructure2 str_replace("[gameid]"$gameID$playGameStructure2);
            
    $playGameStructure2 str_replace("[gamename]"seo_str_plain($gameName), $playGameStructure2);
            if (
    preg_match("/\[category\]/",$playGameStructure)) {
                
    $playGameStructure str_replace("[category]"seo_str_plain($gameCat), $playGameStructure2);
            }
                    
            if (
    $preGamePageStatus == "0" || ($preGamePageStatus == && $tradeType == "0")) {
                
    $items_output .= "<item> 
                    <title><![CDATA[{$gameName}]]></title> 
                    <link>{$preGameStructure2}</link>
                    <description> 
                        <![CDATA[{$gDesc}]]>
                    </description> 
                    <category>{$gameCat}</category>
                    <pubDate>{$addedOn}</pubDate>{$author}
                    <guid>{$preGameStructure2}</guid>
                </item> "
    ;
            } elseif ((
    $preGamePageStatus == || $preGamePageStatus == 2) && $tradeType == 1) {
                
    $items_output .= "<item> 
                    <title><![CDATA[{$gameName}]]></title> 
                    <link>{$playGameStructure2}</link>
                    <description> 
                        <![CDATA[{$gDesc}]]>
                    </description> 
                    <category>{$gameCat}</category>
                    <pubDate>{$addedOn}</pubDate>{$author}
                    <guid>{$playGameStructure2}</guid>
                </item> "
    ;
            } else {
            }
        }
    }
    $pageTitle seoMiscTitle($siteName,$homePageTitle);
    $encoding    'ISO-8859-1'
    $copyright   "<copyright>".date('Y')." ".$pageTitle."</copyright>"
    $pubdate     "<pubDate>".gmdate('r')."</pubDate>"
    $language    "<language>en-us</language>"
    $output "<?xml version=\"1.0\" encoding=\"{$encoding}\" ?> 
    <rss version=\"2.0\"> 
        <channel> 
            <title>{$pageTitle} Feed</title> 
            <link>"
    .$baseDir."</link> 
            <description>{$pageTitle}Feed</description>{$copyright}{$pubdate}{$language}{$items_output} 
        </channel> 
    </rss> 
    "

    header("Content-type: application/rss+xml; charset={$encoding}"); 
    echo 
    $output
    ?>

  6. #6
    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

    The rewrite rule didn't work bud the feed works very good now
    http://www.sniperflashgames.com/rss.php

    I will get a twitter account for it now

    Thanks a lot!

  7. #7
    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
    make sure to put it above all the other rules
    it should work, I do it on my custom CMS for the sitemap.

    Feel free to share it on the ATS/TA forums if you want to.
    Woochoo is free to use it in the core script if he wants it,

    Enjoy,

  8. #8
    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

    I will post it on the ATS forum, many webmasters will like this!
    Thank you

  9. #9
    Senior Member
    Points: 3,536, Level: 39
    Level completed: 24%, Points required for next Level: 114
    Overall activity: 0%
    Achievements:
    Three FriendsTagger First Class1000 Experience PointsRecommendation Second Class1 year registered
    Awards:
    Community Award
    ZyPhiX's Avatar
    Join Date
    Jul 2010
    Location
    the netherlands
    Posts
    112
    Points
    3,536
    Level
    39
    Downloads
    1
    Uploads
    4
    My Mood
    Chatty
    a good option would be to get a random game. That way you can use it to post games on twitter, several times a day :-)

  10. #10
    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
    Quote Originally Posted by ZyPhiX View Post
    a good option would be to get a random game. That way you can use it to post games on twitter, several times a day :-)
    Just change

    PHP Code:
    SELECT gidgNamecattradeTypegDescaddedOn FROM ats_games WHERE gStatus 1 order by gid DESC limit 0,20 
    to

    PHP Code:
    SELECT gidgNamecattradeTypegDescaddedOn FROM ats_games WHERE gStatus 1 order by rand() limit 0,

+ 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