Hey All,
I wrote this update for my own sites, but thought that others using ATS importer might find it useful.
Please make sure to backup your DB and you files before testing this update.
The way to test the update is to:
1, Import plugs for all your traders before installing this update.
(This will fill your db with all the plugs available from the old/current version of the importer)
2, Install the update and then repeat step 1. Count how many new plugs it finds and post back here your results.
ok, to the mod:
Open admin/get-plugs.php
find
PHP Code:
for ($i=0;$i<count($gamePages);$i++) {
$tempArray = explode(" {%sep%} ", $gamePages[$i]);
$gameArray[strtolower($tempArray[0])] = $tempArray[1];
}
$plugsFound = 0;
$result = mysql_query("SELECT * FROM ats_games WHERE tradeType = '1'") or die(mysql_error());
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_array($result)) {
$gameID = $row['gid'];
$gameName = strtolower(remove_slashes($row['gName']));
if ($gameArray[$gameName] == "0" || $gameArray[$gameName] == "") {
} else {
$gamePage = $gameArray[$gameName];
replace with
PHP Code:
for ($i=0;$i<count($gamePages);$i++) {
$tempArray = explode(" {%sep%} ", $gamePages[$i]);
$tempArrayLower = strtolower($tempArray[0]);
$gameArray[$tempArrayLower] = $tempArray[1];
$tempArrayLower2 = str_replace(array("-","_","'",'"'),"",seo_str(str_replace(" ","",$tempArrayLower)));
$gameArray[$tempArrayLower2] = $tempArray[1];
}
$plugsFound = 0;
$result = mysql_query("SELECT * FROM ats_games WHERE tradeType = '1'") or die(mysql_error());
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_array($result)) {
$gameID = $row['gid'];
$gameName = strtolower(remove_slashes($row['gName']));
$gameName2 = str_replace(array("-","_","'",'"'),"",seo_str(str_replace(" ","",$gameName)));
$gamePage = $gameArray[$gameName];
if(empty($gamePage))
{
$gamePage = $gameArray[$gameName2];
}
if ($gamePage == "0" || $gamePage == "") {
} else {
Basically, it uses the SEO string internal cleaning function to remove all special chars from the game name. This removes all left over space, underscores, dashes etc.
So say there are variations of names, with spaces, some have dashes some dont.
Like
vs
would not be a match on the older importer due to the ' and -
but if you then apply the mod above you would be left with
vs
so now we have a new match.