hi,
heres a known working version, maybe theres a bug above im not seeing.
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, gIcon1, gIcon1Hosted 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 == 2 && $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 == 1 || $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;
?>
let me know if that works