<?php
session_start();
include("config.php");
include("core.php");
//header("Cache-Control: no-cache, must-revalidate"); // Prevent caching, HTTP/1.1
//header("Pragma: no-cache");
//session_start();
//header('Content-type: application/vnd.wap.xhtml+xml');
echo '<?xml version="1.0" encoding="UTF-8"?>';
//echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
$bcon = connectdb();
$sid = $_GET['sid'];
echo "<head>";
echo "<title>dating</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
if (!$bcon)
{
echo "<body>";
echo "<p>";
echo "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
echo "ERROR! cannot connect to database<br/><br/>";
echo "This error happens usually when backing up the database, please be patient, The site will be up any minute<br/><br/>";
echo "<b>THANK YOU VERY MUCH</b>";
echo "</p>";
echo "</html>";
exit();
}
$sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
$sitename = $sitename[0];
//include("varsncss.inc.php");
cleardata();
if(isipbanned($uip,$brw))
{
if(!isshield(getuid_sid($sid)))
{
("Ip Blocked");
echo "<p>";
echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
echo "This IP address is blocked<br/>";
echo "<br/>";
echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over<br/><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
//echo mysql_error();
$remain = $banto[0] - time();
$rmsg = gettimemsg($remain);
echo " IP: $rmsg<br/><br/>";
echo "</p>";
echo "<p>";
echo "<img src=\"images/logo.gif\" alt=\"Welcome\"/><br/>";
echo "Welcome to $sitename Community, please Feel Free To Browse<br/><br/>";
echo "Enjoy Loads of outstanding features, and much more to come";
echo "</p>";
echo "<p>";
echo "<form action=\"login.php\" method=\"get\">";
echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/><br/>";
echo "Password: <input type=\"password\" name=\"logpwd\" maxlength=\"30\"/><br/>";
echo "<input name=\"submit\" type=\"submit\" value=\"Submit\"></form>";
//echo "<br/><br/>Not registered yet? <br/><a href=\"register.php\">Sign Up</a><br/>";
echo "<a href=\"index.php?action=terms\">Site Rules</a> <br/>";
echo "</p>";
echo "<p><small>";
$onu = getnumonline();
echo "Members Inside: $onu<br/><br/>";
$norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
echo "We Currently Have <b>$norm[0]</b> Registered Members<br/><br/>";
echo "</small>";
echo "</p>";
echo "</html>";
exit();
}
}
if(($action != "") && ($action!="terms") && ($action!="viewcat") && ($action!="viewtpc") && ($action!="viewfrm") && ($action!="tolog"))
{
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
("Not Logged in");
echo "<p>";
echo "You are not logged in<br/>";
echo "Or Your session has been expired<br/><br/>";
echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</html>";
exit();
}
}
//echo isbanned($uid);
if(isbanned($uid))
{
("You Are Banned");
echo "<p>";
echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
echo "You are <b>Banned</b><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "Time to finish your penalty: $rmsg<br/><br/>";
echo "Ban Reason: $banres[0]";
//echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</html>";
exit();
}
$res = mysql_query("UPDATE ibwf_users SET browserm='".$brw."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
addonline(getuid_sid($sid),"XHTML - Viewing Dating System","dating.php?action=main");
////////////////////////////////////////MAIN PAGE
if($action=="main")
{
$result=mysql_query("select * from ibwf_dating where cat='m4f'");
$mf = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='f4m'");
$fm = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='m4m'");
$mm = mysql_num_rows($result);
$result=mysql_query("select * from ibwf_dating where cat='f4f'");
$ff = mysql_num_rows($result);
echo "<body>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
("Viewing Dating Cards");
}else{
}
echo "<p>";
echo "<div class=\"bar\"><img src=\"../images/dating.png\" alt=\"\"/><u><b>$sitename-Dating</b></u><img src=\"../images/dating.png\" alt=\"\"/></div></p>";
echo "<p><img src=\"../images/dating.png\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=m4f&sid=$sid\">Guys for Girls</a>($mf)<br/>";
echo "<img src=\"../images/dating.png\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=f4m&sid=$sid\">Girls for Guys</a>($fm)<br/>";
echo "<img src=\"../images/dating.png\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=m4m&sid=$sid\">Guys for Guys</a>($mm)<br/>";
echo "<img src=\"../images/dating.png\" alt=\"\"/><a title=\"Enter\" href=\"dating.php?action=datingview&cat=f4f&sid=$sid\">Girls for Girls</a>($ff)<br/>";
echo "<br/><a title=\"Enter\" href=\"dating.php?action=add&sid=$sid\">Add My Card</a>";
echo "<br/><a title=\"Enter\" href=\"index.php?action=main&sid=$sid\">Home</a>";
echo "</p>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
}else{
}
echo "</body>";
}
else if($action=="datingview")
{
echo "<body>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
("Viewing Dating Cards");
}else{
}
$cat=$_GET["cat"];
$page=$_GET["page"];
if($page=="")
{
$page=1;
}
$max_results = 7;
$from = (($page * $max_results) - $max_results);
echo "<p>";
$total_results = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_dating WHERE cat='$cat'"));
if($total_results[0]<1)
{
echo "No Profiles To Show Yet<br/>";
}else{
$total_pages = ceil($total_results[0] / $max_results);
echo "$page Of $total_pages<br/><br/>";
$sql = mysql_query("SELECT * FROM ibwf_dating WHERE cat='$cat' ORDER BY id desc LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){
$name = $row['uid'];
$key = $row['id'];
$sqlthing = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_users WHERE id='$name'"));
$age=getage($sqlthing["birthday"]);
$uname=$sqlthing["name"];
echo "<a href=\"dating.php?action=card&cat=$cat&key=$key&sid=$sid\">~$uname(Age: $age)~</a><br/>" ;
}
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"dating.php?action=datingview&page=$next&cat=$cat&sid=$sid\"><small>Next</small></a><br />";
}
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"dating.php?action=datingview&page=$prev&cat=$cat&sid=$sid\"><small>Prev</small></a><br/>";
}
$i = 1; $i <= $total_pages; $i++ ;
}
echo "<br/><a href=\"dating.php?action=main&sid=$sid\">Dating Index</a>";
echo "</p>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
}else{
}
echo "</body>";
}
else if($action=="card")
{
$key=$_GET["key"];
$cat=$_GET["cat"];
$sql = mysql_fetch_array(mysql_query("SELECT * FROM ibwf_dating WHERE id='$key'"));
$usid=$sql["uid"];
$who=$usid;
$name=getnick_uid($usid);
$about=$sql["aboutme"];
$looking=$sql["lookingfor"];
echo "<body>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
("Viewing Dating Cards");
}else{
}
echo "<p>";
echo "<b>*Username*</b><br/> <a href=\"index.php?action=viewuser&who=$usid&sid=$sid\">$name</a><br/><br/>";
echo "<b>*About*</b><br/> $about<br/><br/>";
echo "<b>*Looking For*</b><br/> $looking<br/>";
echo "<br/>";
echo "<a href=\"inbox.php?action=sendpm&who=$usid&sid=$sid\">[Send $name A PM]</a><br/><br/>";
$uid = getuid_sid($sid);
if(budres($uid, $who)==0)
{
echo "<a href=\"genproc.php?action=bud&who=$who&todo=add&sid=$sid\">Add to buddy list</a><br/>";
}else if(budres($uid, $who)==1)
{
echo "Queued Buddy Requests<br/>";
}else if(budres($uid, $who)==2)
{
echo "<a href=\"genproc.php?action=bud&who=$who&todo=del&sid=$sid\">Remove From buddy list</a><br/>";
}
$ires = ignoreres($uid, $who);
if(es==2)
{
echo "<a href=\"genproc.php?action=ign&who=$who&todo=del&sid=$sid\">Remove From Ignore list</a><br/>";
}else if($ires==1)
{
echo "<a href=\"genproc.php?action=ign&who=$who&todo=add&sid=$sid\">Add to Ignore list</a><br/>";
}
echo "<a href=\"dating.php?action=datingview&cat=$cat&sid=$sid\">Back</a>";
echo "<br/><a href=\"dating.php?action=main&sid=$sid\">Dating Index</a>";
echo "</p>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
}else{
}
echo "</body>";
}
else if($action=="add")
{
echo "<body>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
("Viewing Dating Cards");
}else{
}
echo "<p>";
echo "Here you can Place your own add in our dating system, simply enter the details below to add you card</p>";
echo "<form action=\"dating.php?action=add2&sid=$sid\" method=\"post\">";
echo "<p>";
echo "About Me:<br/>";
echo "<small>hobbies intrests etc</small><br/>";
echo "<input id=\"inputText\" name=\"aboutme\"/><br/>";
echo "Looking For:<br/>";
echo "<input id=\"inputText\" name=\"lookingfor\"/><br/>";
echo "Your Gender:";
echo "<br/><select name=\"first\">";
echo "<option id=\"inputText\" value=\"select\">select</option>";
echo "<option id=\"inputText\" value=\"m\">M</option>";
echo "<option id=\"inputText\" value=\"f\">F</option>";
echo "</select>";
echo "<br/>Gender wanted:";
echo "<br/><select name=\"second\">";
echo "<option id=\"inputText\" value=\"select\">select</option>";
echo "<option id=\"inputText\" value=\"m\">M</option>";
echo "<option id=\"inputText\" value=\"f\">F</option>";
echo "</select>";
$ui=getuid_sid($sid);
echo "<br/><input id=\"inputText\" type=\"hidden\" name=\"ui\" value=\"$ui\"/>";
echo "<br/><input id=\"inputButton\" name=\"submit\" value=\"[Add My Card]\" type=\"submit\"/></p></form><p>";
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a></p>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
}else{
}
echo "</body>";
}
else if($action=="add2")
{
echo "<body>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
("Viewing Dating Cards");
}else{
}
echo "<p>";
$about=$_POST["aboutme"];
$looking=$_POST["lookingfor"];
$cat1=$_POST["first"];
$cat2=$_POST["second"];
$cat=$cat1."4".$cat2;
$ui=$_POST["ui"];
$result=mysql_query("select * from ibwf_dating where uid='$ui' and cat='$cat'");
$number_of_rows = mysql_num_rows($result);
if ($number_of_rows>0){
$problems="1";
echo "You already have a card in this category! =p<br/>";
echo "<br/><a href=\"dating.php?action=main&sid=$sid\">Dating Index</a><br/>";}
if ($problems==""){
echo "<img src=\"images/dating.gif\" alt=\"\"/>$sitename-Dating<img src=\"images/dating.gif\" alt=\"\"/><br/>";
$sql = "INSERT INTO ibwf_dating (uid, cat, aboutme, lookingfor) VALUES ('$ui','$cat','$about','$looking')";
$result = mysql_query($sql);
echo "Cupids arrow has been fired, but were will it land?";
echo "<br/><a href=\"dating.php?action=main&sid=$sid\">Dating Index</a><br/>";
}
echo "<a href=\"index.php?action=main&sid=$sid\">Home</a></p>";
if(stristr($HTTP_USER_AGENT,"Windows NT"))
{
}else{
}
echo "</body>";
}
echo "</html>";
?>