<?php
session_name("PHPSESSID");
session_start();
include("ads.php");
admob_setcookie();
header("Content-type: text/html; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
?>
<?php
$pg = $_GET["pg"];
$sid = $_GET["sid"];
$cid = $_GET["cid"];
$reg = $_GET["reg"];
$pwd = $_GET["pwd"];
$action = $_GET["action"];
$uid = $_GET["uid"];
include ("captainsafefunc.php");
include ("captainsafeconf.php");
include ("admob.php");
connect($dbserver,$dbname,$dbuser,$captainsafedbpass);
resetcou();
sitein();
/////////////////////////////////////////////main page
if($action=="")
{
echo "<head><title>wapirate.net top sites</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
$rgs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites WHERE dhits>='1'"));
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<a href="http://wapirate.net">Chat Community</a><br/>
<a href="http://web.mobpartner.com/?affi=33591">Web/Wap Masters Earn Money</a><br/>
Recomended site:<br/>
<a href="http://wapdare.co.uk/?ref=42"><img src="http://wapdare.co.uk/images/wapdare.png" alt=""/></a><br/><br/>
<a href="index.php?action=top20&uid=<?=$uid?>&pwd=<?=$pwd?>">Top 20</a><br/>
<a href="http://click.buzzcity.net/click.php?partnerid=18406"><img src="http://ads.buzzcity.net/show.php?partnerid=18406" alt="" /></a><br/>
<?php
//echo "<a href=\"index.php?action=counter&uid=$uid&pwd=$pwd\">Counter Top($rgs[0])</a><br/>";
echo admob_request($admob_params);
?>
<br/><br/>
</p>
<p>
<?php
$sql = mysql_query("SELECT * FROM sites WHERE name = '$name1' ");
$query = "SELECT * from sites WHERE hin >='2' and banned='0' ORDER BY RAND(" . time() . " * " . time() . ") LIMIT 1";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
$rowrandy = mysql_fetch_array($result);
$sitename = $rowrandy["sitename"];
$id = $rowrandy["id"];
$snm=htmlspecialchars($sitename);
$rgs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites"));
if($rgs>0){
echo "<b>Random Site</b><br/>";
echo "<a href=\"index.php?action=vsite&sid=".$id."&uid=$uid&pwd=$pwd\"><img src=\"images/site.gif\" alt=\"*\"/>$snm</a><br/><br/>";}
echo "<b>Categories:</b><br/>";
?>
<?php
$cats = mysql_query("SELECT * FROM cats;");
while ($cat = mysql_fetch_array($cats))
{
$sno = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites WHERE cid='".$cat[0]."' and banned='0' AND hin >= '2'"));
$admintext = "";
if(isadmin($uid,$pwd))
{
$admintext= ": <a href=\"delcat.php?cid=$cat[0]&uid=$uid&pwd=$pwd\">[X]</a>";
}
?>
<?php
/*With Differnt Cat Pics
echo "<a href=\"index.php?action=vsites&cid=$cat[0]&uid=$uid&pwd=$pwd\"><img src=\"images/$cat[0].gif\" alt=\"»\"/>$cat[1]($sno[0])</a> $admintext<br/>";
Without Below*/
echo "<a href=\"index.php?action=vsites&cid=$cat[0]&uid=$uid&pwd=$pwd\"><img src=\"images/1.gif\" alt=\"»\"/>$cat[1]($sno[0])</a> $admintext<br/>";
}
?>
<br/>
</p>
<p align="center">
<?php
$rgs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites"));
echo "<b>$rgs[0]</b> Registered sites!<br/>";
$cvs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites where hin>='2'"));
echo "<b>$cvs[0]</b> Sent hits!<br/>";
$lrd = mysql_fetch_array(mysql_query("SELECT text FROM misc where dscr='CLR'"));
$lrd = strtotime($lrd[0]);
$nrd = mktime(0,0,0,date("m",$lrd),date("d",$lrd)+1,date("Y",$lrd));
$active = mysql_fetch_array(mysql_query("SELECT active,email,sitename,id FROM sites"));
$ttr = $nrd -time();
$dz = ceil($ttr/60/60/24);
$date = date("H:i:s");
$hr = date("H");
$hour = (23-$hr);
$mn = date("i");
$min = (60-$mn);
$min1 = $min-1;
//echo "Counters will reset in <b>$hour</b> hours <b>$min1</b> minutes.<br/>";
echo "Counters Reset At The Start Of Every Month!<br/>";
$res = login($uid,$pwd);
if($res==1)
{
?>
<br/><a href="index.php?action=login">Log in</a>
<br/>
<a href="index.php?action=readtc&reg=1">Register</a><br/>
<?php
}else{
?>
<br/><a href="cpanel.php?uid=<?=$uid?>&pwd=<?=$pwd?>&logm=gt">CPanel</a><br/>
<a href="index.php">Log out</a><br/>
<?php
}
echo "<a href=\"index.php?action=readtc&uid=$uid&pwd=$pwd\">Terms & Conditions</a><br/><br/>";
echo "<a href=\"index.php?action=search2&uid=$uid&pwd=$pwd\">Search</a>";
echo "<br/>";
//echo mobads();
?>
</p>
<p align="center">
<?
echo admob_request($admob_params);
?>
<br/><a href="http://gameloft.4-your-mobile.co.uk"><img src="http://r.mobpartner.mobi/?s=7286&p=437" alt="Clic here" border="1" /></a><br/>
<a href="http://c.mobpartner.mobi/?s=75395&a=249&p=1710"><img src="http://r.mobpartner.mobi/?s=75395&a=249&p=1710" alt="Click here !" border="1" /></a><br/>
<a href="http://mob.urban-fish.co.uk">FREE Mobile Downloads</a><br/>
<a href="http://games.urban-fish.co.uk">FREE Mobile Games</a><br/>
<a href="http://wapirate.net">wapirate.net</a><br/><br/>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
///////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////Terms And Conditions
if($action=="readtc")
{
echo "<head><title>Register-T/C</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<b>Terms And Conditions</b></p>
<b>If you dont own a site you do not need to register</b></p>
<p>
<img src="images/point.gif" alt="!"/>
Do not create more than one account, if you have more than one site you still can register them using the same account<br/>
<img src="images/point.gif" alt="!"/>
The link to our service should be in the same page as the page you registered here. Your Site will be checked, if no link back to our service is found within 24 hours your account will be terminated<br/>
<img src="images/point.gif" alt="!"/>
The contents of your site should match the description and the category you register here<br/>
<img src="images/point.gif" alt="!"/>
We have zero tolerence against cheating, so don't try fake hits<br/>
<img src="images/point.gif" alt="!"/>
You can't register more than 1 Account for each domain<br/>
<img src="images/point.gif" alt="!"/>
Any violation of the rules will have your account terminated<br/>
<img src="images/point.gif" alt="!"/>
You must send us two hits before we show the link to your site<br/>
<img src="images/point.gif" alt="!"/>
Any sites containing illegal pornographic content are NOT accepted<br/>
</p>
<p align="center">
<?php
if($reg=="1")
{
?>
<a href="index.php?action=reg">I Agree</a>, <a href="index.php">I Decline</a>
<?php
}else{
echo "<a href=\"index.php?uid=$uid&pwd=$pwd\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
}
?>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////// Register
if($action=="reg")
{
echo "<head><title>Register-T/C</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<b>Registration</b></p>
<p>
<img src="images/point.gif" alt="!"/>
Do not include spaces or special characters in userid or password<br/>
<img src="images/point.gif" alt="!"/>
No vulgar words are accepted in UserID<br/>
<img src="images/point.gif" alt="!"/>
UserID and Password must contain at least 4 characters<br/>
<img src="images/point.gif" alt="!"/>
UserID must begin with a letter<br/>
<img src="images/point.gif" alt="!"/>
UserID and Password should Not contain any uppercase letter <br/>
</p>
<?php
echo "<form action=\"register.php\" method=\"post\">";
echo "UserID:<br/> <input name=\"uid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";
echo "Password:<br/> <input type=\"password\" name=\"pwd\" size=\"8\" maxlength=\"30\"/><br/>";
echo "Confirm Password:<br/> <input type=\"password\" name=\"cpwd\" size=\"8\" maxlength=\"30\"/><br/>";
echo '<img src="captcha.php" alt="captcha"/><br/>Enter text above:<br/><input type="text" maxlength="6" name="auth"/><br/>';
echo "<input type=\"submit\" value=\"Register\"/>";
?>
<p align="center">
<br/><br/>
<a href="index.php"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
////////////////////////////////////// login
if($action=="login")
{
echo "<head><title>Log in</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<b>Log in</b><br/><br/>
</p>
<?php
echo "<form action=\"cpanel.php\" method=\"post\">";
echo "UserID:<br/> <input name=\"uid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";
echo "Password:<br/> <input type=\"password\" name=\"pwd\" size=\"8\" maxlength=\"30\"/><br/>";
echo "<input type=\"submit\" value=\"Log In\"/>";
?>
<p align="center">
<br/><br/>
<a href="index.php"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
?>
<?php
////////////////////////////////////view all sites
if($action=="vsites")
{
$catnm = mysql_fetch_array(mysql_query("SELECT name FROM cats where id='".$cid."'"));
echo "<head><title>$catnm[0]</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<?php
echo "</p><p>";
if($pg==0)$pg=1;
$pg--;
$lmt = $pg*10;
$pg++;
$cou =$lmt+1;
$scount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites where cid='".$cid."' and banned='0' AND hin >= '2'"));
$pgs = ceil($scount[0]/10);
$sql ="SELECT * FROM sites where cid='".$cid."' AND banned='0' AND hin >= '2' ORDER BY hin DESC LIMIT ".$lmt.", 20;";
$sites = mysql_query($sql);
while ($site = mysql_fetch_array($sites))
{
$snm=htmlspecialchars($site[1]);
echo "$cou. <a href=\"index.php?action=vsite&sid=$site[0]&uid=$uid&pwd=$pwd\"><img src=\"images/site.gif\" alt=\"*\"/>$snm ($site[6]/$site[7])</a><br/>";
$cou++;
}
$npage = $pg+1;
$ppage = $pg-1;
if($pg<$pgs)
{
$nlink = "<a href=\"index.php?action=vsites&pg=$npage&uid=$uid&pwd=$pwd&cid=$cid\">Next</a>";
}
if($pg >1)
{
$plink = "<a href=\"index.php?action=vsites&pg=$ppage&uid=$uid&pwd=$pwd&cid=$cid\">Prev</a>";
}
echo "<br/>Active sites:$scount[0]<br/>";
echo "$plink $pg/$pgs $nlink</p><p align=\"center\">";
?>
<br/>
<a href="index.php?uid=<?=$uid?>&pwd=<?=$pwd?>"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
/////////////////////////////////// counter
if($action=="counter")
{
$catnm = mysql_fetch_array(mysql_query("SELECT name FROM cats where id='".$cid."'"));
echo "<head><title>Counter Top</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<?php
echo "</p><p>";
if($pg==0)$pg=1;
$pg--;
$lmt = $pg*10;
$pg++;
$cou =$lmt+1;
$scount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sites where banned='0' AND dhits >= '1'"));
$pgs = ceil($scount[0]/10);
$sql ="SELECT * FROM sites where banned='0' AND dhits >= '1' ORDER BY dhits DESC LIMIT ".$lmt.", 20;";
$sites = mysql_query($sql);
while ($site = mysql_fetch_array($sites))
{
$snm=htmlspecialchars($site[1]);
echo "$cou. <a href=\"index.php?action=vsite&sid=$site[0]&uid=$uid&pwd=$pwd\"><img src=\"images/site.gif\" alt=\"*\"/>$snm ($site[8])</a><br/>";
$cou++;
}
$npage = $pg+1;
$ppage = $pg-1;
if($pg<$pgs)
{
$nlink = "<a href=\"index.php?action=vsites&pg=$npage&uid=$uid&pwd=$pwd&cid=$cid\">Next</a>";
}
if($pg >1)
{
$plink = "<a href=\"index.php?action=vsites&pg=$ppage&uid=$uid&pwd=$pwd&cid=$cid\">Prev</a>";
}
echo "<br/>Active sites:$scount[0]<br/>";
echo "$plink $pg/$pgs $nlink</p><p align=\"center\">";
?>
<br/>
<a href="index.php?uid=<?=$uid?>&pwd=<?=$pwd?>"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
////////////////////////////////////////////////// top 20
if($action=="top20")
{
$catnm = mysql_fetch_array(mysql_query("SELECT name FROM cats where id='".$cid."'"));
echo "<head><title>$catnm[0]</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<p align="center">
<?php
?>
<?php
echo "</p><p>";
$sql ="SELECT * FROM sites where banned='0' AND hin >= '1' ORDER BY hin DESC LIMIT 0, 20;";
$sites = mysql_query($sql);
$cou =1;
while ($site = mysql_fetch_array($sites))
{
$snm=htmlspecialchars($site[1]);
echo "$cou. <a href=\"index.php?action=vsite&sid=$site[0]&uid=$uid&pwd=$pwd\"><img src=\"images/site.gif\" alt=\"*\"/>$snm ($site[6]/$site[7])</a><br/>";
$cou++;
}
echo "</p><p align=\"center\">";
?>
<a href="index.php?uid=<?=$uid?>&pwd=<?=$pwd?>"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
//////////////////////////////view 1 site
if($action=="vsite")
{
$sql ="SELECT * FROM sites where id='".$sid."' and banned='0';";
$sites = mysql_fetch_array(mysql_query($sql));
$snm=htmlspecialchars($sites[1]);
$slk=htmlspecialchars($sites[3]);
$dscr =htmlspecialchars($sites[11]);
$ilk = htmlspecialchars($sites[4]);
echo "<head><title>$snm</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<?php
?>
<?php
$catnm = mysql_fetch_array(mysql_query("SELECT name FROM cats where id='".$sites[2]."'"));
if(($ilk != "") && ($ilk != "http://"))
{
echo "<p align=\"left\">";
echo "<img src=\"$ilk\" alt=\"*\"/>";
echo "</p>";
}
echo "<p>";
echo "<img src=\"images/site.gif\" alt=\"*\"/>";
echo "<a href=\"out.php?sid=$sites[0]\">$snm</a><br/>";
echo "<b>ID:</b> $sites[0]<br/><b>Description:</b>$dscr<br/>";
echo "<b>Category:</b><a href=\"index.php?action=vsites&uid=$uid&pwd=$pwd?&cid=$sites[2]\">$catnm[0]</a><br/>";
//echo "<b>Month's Hits</b>: $sites[8]<br/>";
echo "<b>Total Hits:</b>$sites[9]<br/>";
echo"<b>URL:</b><a href=\"out.php?sid=$sites[0]\">$slk</a><br/>";
echo "<b>In/out:</b>$sites[6]/$sites[7]<br/>";
if(isadmin($uid,$pwd))
{
$unm = mysql_fetch_array(mysql_query("SELECT name FROM tusers WHERE id='".$sites[5]."'"));
echo "<br/><a href=\"edts.php?uid=$uid&pwd=$pwd&sid=$sid\">Edit This Site</a>";
echo "<br/><a href=\"banu.php?uid=$uid&pwd=$pwd&who=$sites[5]\">Ban $unm[0]</a>";
}
echo "</p><p align=\"center\">";
?>
<br/><a href="index.php?uid=<?=$uid?>&pwd=<?=$pwd?>"><img src="images/home.gif" alt="*"/>Home</a>
</p>
<div>top.wapirate.net</div>
</body>
</html>
<?php
}
////////////////////////////////////////////search
if($action=="search2")
{
echo "<head><title>$snm</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\" wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<?php
echo "<form action=\"index.php?action=search&sid=$id&uid=$uid&pwd=$pwd\" method=\"post\">";
echo "Site Keywords:<br/> <input name=\"q\" format=\"*x\" size=\"8\" maxlength=\"128\"/><br/>";
echo "<input type=\"submit\" value=\"»Search\"/><br/></form>";
echo "<p align=\"center\">";
echo "---<br/><a href=\"index.php?uid=$uid&pwd=$pwd\">Top sites</a>";
echo "</p>
<div>top.wapirate.net</div>";
echo "</body>";
echo "</html>";
}
/////////////////////////////////////////search find
if($action=="search")
{
echo "<head><title>$snm</title>";
echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />";
echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />
<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>
<meta name=\"description\" content=\"wapirate.net Chatheaven :)\">
<meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>";
echo "<body>";
?>
<div>
<?php
echo "".date("D d M y - ")."\n";
//$time = date("H:i");
$wapirateNew_Time = time() + (23 * 60 * 60);
$wapiratetime=date("H:i",$wapirateNew_Time);
echo "$wapiratetime<br/>";
?>
<img src="logo.gif" alt="wapirate.net"/><br/>
</div>
<?php
echo "<p align=\"left\">";
// Database Connection
// If current page number, use it
// if not, set one!
if(!isset($_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
// Define the number of results per page
$max_results = 10;
// Figure out the limit for the query based
// on the current page number.
$from = (($page * $max_results) - $max_results);
// Perform MySQL query on only the current page number's results
$sql = mysql_query("SELECT * FROM sites WHERE keywords LIKE '%".$search."%' AND hin>='2' and banned ='0' ORDER BY hin desc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
// Build your formatted results here.
$sname = $row['sitename'];
$id = $row['id'];
$from=$from+1;
$snm=htmlspecialchars($sname);
echo "$from. <a href=\"index.php?action=vsite&sid=$id&uid=$uid&pwd=$pwd\"><img src=\"images/site.gif\" alt=\"*\"/>$snm</a><br/>";
}
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM sites WHERE cid = '$cid' AND hin>='2'"),0);
// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);
// Build Previous Link
if($page > 1){
$prev = ($page - 1);
echo "<br /><a href=\"".$_SERVER['PHP_SELF']."?page=$prev&cid=$cid&uid=$uid&pwd=$pwd\">Previous</a>";
}
// Build Next Link
if($page < $total_pages){
$next = ($page + 1);
echo "<br/><a href=\"".$_SERVER['PHP_SELF']."?page=$next&cat=$cid&uid=$uid&pwd=$pwd\">Next</a><br />";
}
$i = 1; $i <= $total_pages; $i++ ;
print "---<br/><a href=\"index.php?uid=$uid&pwd=$pwd\">Top sites</a>";
echo "</p>
<div>top.wapirate.net</div>";
echo "</body></html>";
}
?>