= $cord[1]") or die(mysql_error()); $a = mysql_fetch_array($q); $q2 = mysql_query("SELECT MAX(columnz) AS maxcol, MIN(columnz) AS mincol FROM links WHERE rowz <= $limitx AND rowz >= $cord[0]"); $a2 = mysql_fetch_array($q2); // IF RIGHT $check = $cord[1] + $config[dimension]; $rightbutton = spl('{ifright}','{/ifright}',$templ); if ($check <= $a2[maxcol]) { $rightcord = $cord[0]."-".$check; $rightbutton2 = str_replace('{page}',$rightcord,$rightbutton); $templ = str_replace($rightbutton,$rightbutton2,$templ); } else { $templ = str_replace($rightbutton,'',$templ); } // IF LEFT $check = $cord[1] - $config[dimension]; $leftbutton = spl('{ifleft}','{/ifleft}',$templ); if ($check <= "0") { $templ = str_replace($leftbutton,'',$templ); } else { $leftcord = $cord[0]."-".$check; $leftbutton2 = str_replace('{page}',$leftcord,$leftbutton); $templ = str_replace($leftbutton,$leftbutton2,$templ); } // IF UP $check = $cord[0] - $config[dimension]; $upbutton = spl('{ifup}','{/ifup}',$templ); if ($check <= "0") { $templ = str_replace($upbutton,'',$templ); } else { $upcord = $check."-".$cord[1]; $upbutton2 = str_replace('{page}',$upcord,$upbutton); $templ = str_replace($upbutton,$upbutton2,$templ); } // IF DOWN $check = $cord[0] + $config[dimension]; $downbutton = spl('{ifdown}','{/ifdown}',$templ); if ($check <= $a[maxrow]) { $downcord = $check."-".$cord[1]; $downbutton2 = str_replace('{page}',$downcord,$downbutton); $templ = str_replace($downbutton,$downbutton2,$templ); } else { $templ = str_replace($downbutton,$downbutton2,$templ); } // LOAD CONFIGURATION // CSS STYLE INSERT $table = ' '; // SCAN THE RELATED PAGE AND ASSIGN COORDINATE VALUES TO ARRAY $limiterx2 = $cord[0] + $config[dimension] - 1; $limitery2 = $cord[1] + $config[dimension] - 1; $limiterx1 = $cord[0] - 1; $limitery1 = $cord[1] - 1; $q = mysql_query("SELECT * FROM links WHERE paid='1' AND approved='1'"); while ($a = mysql_fetch_array($q)) { $url = $a[rowz]."-".$a[columnz]."-url"; $title = $a[rowz]."-".$a[columnz]."-title"; $id = $a[rowz]."-".$a[columnz]."-id"; $appkey = $a[rowz]."-".$a[columnz]."-app"; $paykey = $a[rowz]."-".$a[columnz]."-pay"; $coord[$url] = $a[url]; $coord[$title] = $a[title]; $coord[$id] = $a[id]; $coord[$appkey] = $a[approved]; $coord[$paykey] = $a[paid]; } // DRAW X-Y COORDINATES WITH THE ARRAY $table .= '
"; for ($f=1; $f<=$config[dimension]; $f++) { if ($_GET[id] == "1-1") { $var = colprice."$f"; $table .=" | $config[$var] USD Buy Now! | ";
}
else {
$table .= ""; } } $table .= " | $config[$var] USD Buy Now! | ";
}
else {
$table .= ""; } } else { $urlkey = $i."-".$j."-url"; $titlekey = $i."-".$j."-title"; $idkey = $i."-".$j."-id"; $appkey = $i."-".$j."-app"; $paykey = $i."-".$j."-pay"; if (isset($coord[$urlkey]) AND isset($coord[$titlekey]) AND $coord[$paykey] == "1" AND $coord[$appkey] == "1") { $table .= " | "; } if (isset($coord[$urlkey]) AND isset($coord[$titlekey]) AND $coord[$paykey] == "1" AND $coord[$appkey] == "0") { $table .= " | "; } if (!isset($coord[$urlkey]) AND !isset($coord[$titlekey])) { $table .= " | "; } } } // end column for $table .= ""; } // end if firstdraw } // end master for $table .= ' |