vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   [MOD] RSS last 20 games (https://vborg.vbsupport.ru/showthread.php?t=142991)

robb9 03-24-2007 08:40 AM

[MOD] RSS last 20 games
 
I realized this simple mod for RSS last 20 games:

Create a filename .php example: last20games.php

Code:


<?

$host = "host";
$root = "root";
$password ="pass";
$DataBase = "database";


mysql_connect("$host" ,"$root" ,"$password") or die("problem with database");


mysql_select_db("$DataBase") or die("problem with database");
 

$strsql = "SELECT * FROM games_list WHERE active=1 ORDER BY gid desc limit 20 ";
$query = mysql_query($strsql);
header("Content-type: text/xml");
//xml into the browser
//write on documents


echo "<?xml version=\"1.0\"?>
<rss version=\"2.0\">
<channel>
<title>Your Title</title>
<link>Your site</link>
<description>Feed</description>
<language>language</language>";

//cicle on items
while($row=mysql_fetch_array($query)){

$gid = $row["gid"];
$title = $row["gtitle"];
$gcount = $row["gcount"];
$gname = $row["gname"];

echo "<item>
<title>$title</title>
<link>http://www.yourserver.com/forum/arcade.php?do=play&amp;gameid=$gid</link>
<description>
<![CDATA[
<img src=\"http://http://www.yourserver.com/forum/arcade/images/".$gname."1.gif\" align=\"right\" border=\"0\" width=\"50\" height=\"50\" vspace=\"4\" hspace=\"4\" /><br /><br />
    ]]>
</description>
<played>$gcount</played>
</item>";
}

echo "</channel></rss>";


?>

that's all.

enjoy.

Stifmeister2 03-24-2007 03:00 PM

What exactly is this? Demo please. ;)

robb9 03-25-2007 08:26 AM

Quote:

Originally Posted by Stifmeister2 (Post 1211110)
What exactly is this? Demo please. ;)

ceck here:
http://en.wikipedia.org/wiki/Rss


All times are GMT. The time now is 09:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00962 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete