If researched my script to see whats taking my pages so long to load. I found the part
$results = mysql_query("SELECT link FROM clicked WHERE user='$user' AND link='$active[0]'",$db);
$tim = mysql_fetch_row($results);
if($tim) {
$a = "<p><font color=\"FF0000\">\$.</font> $a<a href=\"links.php?ad=$active[0]&id=$user\" target=_blank>$active[1]</a> $b</p>";
} else {
$a = "<p><font color=\"006600\">\$.</font> $a<a href=\"links.php?ad=$active[0]&id=$user\" target=_blank>$active[1]</a> $b</p>";
}
That code you can find in the whole code below.
Im just wondering why that section takes so LONG!
function active($right, $user) {
global $do;
$t = array();
global $db;
$result = mysql_query("SELECT * FROM links WHERE status='active' ORDER BY id DESC",$db);
if($result) {
while ($active = mysql_fetch_row($result)) {
if($active[11] == 2) {
$money = "1/2";
} elseif($active[11] == 3) {
$money = "1/4";
} else {
$money = "1";
}
$a = '';
$b = '';
if($active[6] == "yes") {
$a = "<span class=\"highlighted\">";
$b = "</span>";
}
if($active[4] == "yes") {
$a = "$a" . "<b>";
$b = "</b>" . "$b";
}
if($active[5] == "yes") {
$a = "$a". "<i>";
$b = "</i>" . "$b";
}
if($right && $do != "logout") {
$c = "
<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" bgcolor=\"#000000\">
<tr>
<td bgcolor=\"#009933\" align=\"center\" class=\"light\"><b>Active Key</b></td>
</tr>
<tr>
<td bgcolor=\"#EEEEEE\" class=\"text\"><font color=\"006600\"><b>\$:</b></font>
New link, get paid!<font color=\"FF0000\"><br>
\$:</font> You already been paid for that link</td>
</tr>
</table>
";
$results = mysql_query("SELECT link FROM clicked WHERE user='$user' AND link='$active[0]'",$db);
$tim = mysql_fetch_row($results);
if($tim) {
$a = "<p><font color=\"FF0000\">\$.</font> $a<a href=\"links.php?ad=$active[0]&id=$user\" target=_blank>$active[1]</a> $b</p>";
} else {
$a = "<p><font color=\"006600\">\$.</font> $a<a href=\"links.php?ad=$active[0]&id=$user\" target=_blank>$active[1]</a> $b</p>";
}
} else {
$a = "<p><font color=\"336699\">\$.</font> $a<a href=\"links.php?ad=$active[0]\" target=_blank>$active[1]</a> $b</p>";
}
array_push($t, $a);
}
$t = implode('', $t);
$aasg = "(<a href=\"links_page.php\">More Links</a>)<br>";
return("$t<p align=\"center\">$aasg(<a href=\"http://webewebin.com/advertise.php\">Advertise</a>)</p>$c");
} else {
$b = "
No current active links available.<br>
<br>
<b>Advertisers</b>, you can add your link here for only
\$5.00, and get 1000 unique members to your site.
<p class=\"bigtext\" align=\"center\">
( <a href=\"advertise.php\">Advertise</a> )
</p>
";
return("$b");
}
}