View file retrivewap/uinfo.php

File size: 11.63Kb
<?php

//» &#187;
//« &#171;
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

?>

<wml>


<?php
include("config.php");
include("core.php");
$bcon = connectdb();
if (!$bcon)
{
    echo "<card id=\"main\" title=\"$stitle (ERROR!)\">";
    echo "<p align=\"center\">";
    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 "Soon, we will offer services that doesn't depend on MySQL databse to let you enjoy our site, while the database is not connected<br/>";
    echo "<b>THANK YOU VERY MUCH</b>";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
}
$brws = explode(" ",$HTTP_USER_AGENT);
$ubr = $brws[0];
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];

$uid = getuid_sid($sid);

    if((islogged($sid)==false)||($uid==0))
    {
        echo "<card id=\"main\" title=\"$stitle\">";
      echo "<p align=\"center\">";
      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 "</card>";
      echo "</wml>";
      exit();
    }
if(isbanned($uid))
    {
        echo "<card id=\"main\" title=\"$stitle\">";
      echo "<p align=\"center\">";
      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_metpenaltiespl WHERE uid='".$uid."' AND penalty='1'"));
      $remain = $banto[0]- (time() - $timeadjust);
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg<br/><br/>";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
if($action=="")
{
  addonline($uid,"Viewing User Profile","");
  echo "<card id=\"main\" title=\"$stitle\">";
  echo "<p align=\"center\">";
  $whonick = getnick_uid($who);
  echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick's Basic Profile</a>";
  echo "</p>";
  echo "<p><small>";
  $regd = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'"));
  $sage = (time() - $timeadjust)-$regd[0];
  $rwage = ceil($sage/(24*60*60));
  echo "&#187;$stitle age: <b>$rwage days</b><br/>";
  echo "&#187;$stitle rating(0-5): <b>".geturate($who)."</b><br/>";
  $pstn = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$who."'"));
  $ppd = $pstn[0]/$rwage;
  echo "&#187;Posts info: <b>$pstn[0]</b> posts, with average of <b>$ppd</b> posts/day<br/>";
  $chpn = mysql_fetch_array(mysql_query("SELECT chmsgs FROM ibwf_users WHERE id='".$who."'"));
  $cpd = $chpn[0]/$rwage;
  echo "&#187;Chating info: <b>$chpn[0]</b> chat messages, with average of <b>$cpd</b> chat messages/day<br/>";
  $gbsg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbsigner='".$who."'"));
  echo "&#187;Have signed: <b>$gbsg[0] Guestbooks</b><br/>";
  $brts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_brate WHERE uid='".$who."'"));
  echo "&#187;Have rated: <b>$brts[0] Blogs</b><br/>";
  $pvts = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$who."'"));
  echo "&#187;Have voted in <b>$pvts[0] Polls</b><br/>";
  $strd = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$who."' AND starred='1'"));
  echo "&#187;Starred PMs: <b>$strd[0]</b><br/><br/>";
  echo "<a href=\"uinfo.php?action=fsts&amp;sid=$sid&amp;who=$who\">&#187;Posts In forums</a><br/>";
  echo "<a href=\"uinfo.php?action=cinf&amp;sid=$sid&amp;who=$who\">&#187;Contact Info</a><br/>";
  echo "<a href=\"uinfo.php?action=look&amp;sid=$sid&amp;who=$who\">&#187;Looking</a><br/>";
  echo "<a href=\"uinfo.php?action=pers&amp;sid=$sid&amp;who=$who\">&#187;Personality</a><br/>";
  echo "<a href=\"uinfo.php?action=rwidc&amp;sid=$sid&amp;who=$who\">&#187;$stitle ID Card</a><br/>";
  echo "</small></p>";
  echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}

else if($action=="rwidc")
{
    addonline(getuid_sid($sid),"$stitle ID","");
    echo "<card id=\"main\" title=\"$stitle ID\">";
    echo "<p align=\"center\">";
    echo "<b>M! ID card</b><br/>";
    echo "<img src=\"rwidc.php?id=$who\" alt=\"rw id\"/><br/><br/>";
    echo "The source for this ID card is http://$stitle.co.za/rwidc.php?id=$who<br/><br/>";
    echo "To look at your card Go to CPanel&gt; $stitle ID Card.";
    
    echo "</p>";
    echo "<p align=\"center\">";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
    echo "</card>";
}

else if($action=="fsts")
{
    addonline($uid,"Viewing User Profile","");
    $whonick = getnick_uid($who);
    echo "<card id=\"main\" title=\"$stitle\">";
    echo "<p><small>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Posts in forums<br/><br/>";
    $pst = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$who."'"));
    $frms = mysql_query("SELECT id, name FROM ibwf_forums WHERE clubid='0' ORDER BY name");
    while ($frm=mysql_fetch_array($frms))
    {
      $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) as nops, a.uid FROM ibwf_posts a INNER JOIN ibwf_topics b ON a.tid = b.id WHERE a.uid='".$who."' AND b.fid='".$frm[0]."' GROUP BY a.uid "));
      $prc = ceil(($nops[0]/$pst[0])*100);
      echo htmlspecialchars($frm[1]).": <b>$nops[0] ($prc%)</b><br/>";
    }
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";
    
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Posts in forums";
    echo "</small></p>";
    echo "</card>";
}

else if($action=="cinf")
{
    addonline($uid,"Viewing User Profile","");
    $whonick = getnick_uid($who);
    echo "<card id=\"main\" title=\"$stitle\">";
    echo "<p><small>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Contact Info<br/><br/>";
    //duh
    $inf1 = mysql_fetch_array(mysql_query("SELECT country, city, street, phoneno, realname, budsonly, sitedscr FROM ibwf_xinfo WHERE uid='".$who."'"));
    
    $inf2 = mysql_fetch_array(mysql_query("SELECT site, email FROM ibwf_users WHERE id='".$who."'"));
    if($inf1[5]=='1')
    {
    if(($uid==$who)||(arebuds($uid, $who)))
    {
        $rln = $inf1[4];
        $str = $inf1[2];
        $phn = $inf1[3];
    }else{
        $rln = "Can't view";
        $str = "Can't view";
        $phn = "Can't view";
    }
    }else{
      $rln = $inf1[4];
      $str = $inf1[2];
      $phn = $inf1[3];
    }
    echo "Real Name: $rln<br/>";
    echo "Country: $inf1[0]<br/>";
    echo "City: $inf1[1]<br/>";
    echo "Street: $str<br/>";
    echo "Site: <a href=\"$inf2[0]\">$inf2[0]</a><br/>";
    echo "Site description: $inf1[6]<br/>";
    echo "Phone No.: $phn<br/>";
    echo "E-Mail: $inf2[1]<br/>";
    //tuh
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Contact Info";
    echo "</small></p>";
    echo "</card>";
}

else if($action=="look")
{
    addonline($uid,"Viewing User Profile","");
    $whonick = getnick_uid($who);
    echo "<card id=\"main\" title=\"$stitle\">";
    echo "<p><small>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Looking<br/><br/>";
    //duh
    $inf1 = mysql_fetch_array(mysql_query("SELECT sexpre, height, weight, racerel, hairtype, eyescolor FROM ibwf_xinfo WHERE uid='".$who."'"));
    $inf2 = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
    if($inf1[0]=="M" && $inf2[0]=="F")
    {
      $sxp = "Straight";
    }else if($inf1[0]=="F" && $inf2[0]=="M")
    {
      $sxp = "Straight";
    }else if($inf1[0]=="M" && $inf2[0]=="M"){
      $sxp = "Gay";
    }else if($inf1[0]=="F" && $inf2[0]=="F"){
      $sxp = "Lesbian";
    }else if($inf1[0]=="B"){
      $sxp = "Bisexual";
    }else{
      $sxp = "inapplicable";
    }
    if($inf2[0]=="M")
    {
      $usx = "Male";
    }else if($inf2[0]=="F")
    {
      $usx = "Female";
    }else{
      $usx = "Shemale";
    }
    echo "Sex: $usx<br/>";
    echo "Orientation: $sxp<br/>";
    echo "Height: $inf1[1]<br/>";
    echo "Weight: $inf1[2]<br/>";
    echo "Ethnic origin: $inf1[3]<br/>";
    echo "Hair: $inf1[4]<br/>";
    echo "Eyes: $inf1[5]<br/>";
    //tuh
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Looking";
    echo "</small></p>";
    echo "</card>";
}

else if($action=="pers")
{
    addonline($uid,"Viewing User Profile","");
    $whonick = getnick_uid($who);
    echo "<card id=\"main\" title=\"$stitle\">";
    echo "<p><small>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Personality<br/><br/>";
    //duh
    $inf1 = mysql_fetch_array(mysql_query("SELECT likes, deslikes, habitsb, habitsg, favsport, favmusic, moretext FROM ibwf_xinfo WHERE uid='".$who."'"));
    echo "<b>Likes:</b> ".parsemsg($inf1[0])."<br/>";
    echo "<b>Dislikes:</b> ".parsemsg($inf1[1])."<br/>";
    echo "<b>Bad Habits:</b> ".parsemsg($inf1[2])."<br/>";
    echo "<b>Good Habits:</b> ".parsemsg($inf1[3])."<br/>";
    echo "<b>Sport:</b> ".parsemsg($inf1[4])."<br/>";
    echo "<b>Music:</b> ".parsemsg($inf1[5])."<br/>";
    echo "<b>More text:</b> ".parsemsg($inf1[6])."<br/>";
    //tuh
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Home</a>&gt;";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$who\">$whonick</a><br/>";
    echo "&gt;<a href=\"uinfo.php?sid=$sid&amp;who=$who\">Extended Info</a>&gt;Personality";
    echo "</small></p>";
    echo "</card>";
}

else{
  echo "<card id=\"main\" title=\"$stitle\">";
  echo "<p align=\"center\">";
  echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
  echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}
?></wml>