View file wapirate/A1/hat.php

File size: 13.29Kb
<?php





include("core.php");

include("config.php");





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\">";





$addy = "wapirate.net";

$bcon = connectdb();

if (!$bcon)

{

        echo "<head>";

    echo "<title>Error!!!</title>";

    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

    echo "</head>";

    echo "<body>";

    echo "<div><br/>Doh!<br/></div>";

    echo "<p align=\"center\">";

    echo "<img src=\"images/error.gif\" alt=\"*\"/><br/>";

    echo "ERROR! cannot connect to database<br/><br/>";

    echo "This error usually happens when backing up the database, please be patient, The site will be up as soon as possible<br/><br/>";

    echo "<b>THANK YOU VERY MUCH</b>";

    echo "</p>";

    echo "<div>$addy</div>";

    echo "</body>";

    echo "</html>";

    exit();

}

$brws = $_SERVER['HTTP_USER_AGENT'];

$ubr = $brws;

$uip = getip();

$action = $_GET["action"];

$sid = $_GET["sid"];

$page = $_GET["page"];

$who = $_GET["who"];

$pmtext = $_POST["pmtext"];

$uid = getuid_sid($sid);

$wnick = getnick_uid($who);

$theme = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));



cleardata();

if(isipbanned($uip,$ubr))

    {

      if(!isshield(getuid_sid($sid)))

      {

  echo "<head>";

  echo "<title>Ip Block!</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

  echo "</head>";

  echo "<body>";

    echo "<div><br/>Doh!<br/></div>";

      echo "<p align=\"center\">";

      echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";

      echo "This IP address is blocked<br/>";

      echo "<br/>";

      echo "However we grant a shield against IP-Ban for our best users, you can try to see if you are shielded by trying to login, if you keep 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 "<form action=\"login.php\" method=\"get\">";

  echo "username:<br/> <input name=\"loguid\" format=\"*x\" size=\"8\" maxlength=\"30\"/><br/>";

  echo "password:<br/> <input type=\"password\" name=\"logpwd\" size=\"8\" maxlength=\"30\"/><br/>";

echo "<input type=\"submit\" value=\"login &#187;\"/>";

echo "</form>"; 

 // echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  echo "</html>";

      exit();

      }

    }

if(($action != "") && ($action!="terms"))

{

    $uid = getuid_sid($sid);

    if((islogged($sid)==false)||($uid==0))

    {

      echo "<head>";

      echo "<title>Error!!!</title>";

      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

      echo "</head>";

      echo "<body>"; 

      echo "<div><br/>Doh!<br/></div>";

      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 "<div>$addy</div>";

  echo "</body>";

  echo "</html>";

      exit();

    }

    

    

    

}

//echo isbanned($uid);

if(isbanned($uid))

    {

      echo "<head>";

      echo "<title>Error!!!</title>";

      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/red_medium.css\">";

      echo "</head>";

      echo "<body>";  

      echo "<div><br/>Doh!<br/></div>";

      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_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 "<div>$addy</div>";

  echo "</body>";

  echo "</html>";

      exit();

    }

$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");



////////////////////////////////////////MAIN PAGE

if($action=="main")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

echo "<p align=\"center\">";

  $name = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'"));

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/>";

  echo "<b>Welcome To The Sorting Hat!</b><br/>";

  echo "<br/>";

$hat = rand(1,4);

if($hat==1){

echo "$name[0] I See Good Things  To Come From You In the Future!<br/><br/>";

}else if($hat==2){

echo "$name[0] Put All Your Thought Into This!<br/><br/>";

}else if($hat==3){

echo "$name[0] Theres Ssssomething Sssstrange About You!<br/><br/>";

}else if($hat==4){

echo "$name[0] Make Sure You Answer As Truthfully As Possible!<br/><br/>";

}

  echo "Place Your Head Inside The Hat And Answer The Hats Questions!<br/>";

     echo "<br/>";

   echo "<a href=\"hat.php?action=q1&amp;sid=$sid\">Place Head Inside Hat</a><br/>";

    echo "</p>";

echo "<p align=\"center\">";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

//////////////////////////////////////////////question 1

else if($action=="q1")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

    echo "<p align=\"center\">";

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/><br/>";

    echo "<b>If You Found Ј10000 On A bus Would You... </b><br/><br/>";

   echo "<a href=\"hat.php?action=q2&amp;a=5&amp;sid=$sid\">Give It To Charity</a><br/>";

   echo "<a href=\"hat.php?action=q2&amp;a=2&amp;sid=$sid\">Keep It</a><br/>";

   echo "<a href=\"hat.php?action=q2&amp;a=3&amp;sid=$sid\">Give It To The Police</a><br/>";

   echo "<a href=\"hat.php?action=q2&amp;a=4&amp;sid=$sid\">Keep Half And Give Half To Charity</a><br/>";



  echo "<br/><br/>";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

//////////////////////////////////////////////question 2

else if($action=="q2")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

    echo "<p align=\"center\">";

    $a=$_GET["a"];

$sc = $a;

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/><br/>";

    echo "<b>What Animal Would You Choose... </b><br/><br/>";

   echo "<a href=\"hat.php?action=q3&amp;a=2&amp;sc=$sc&amp;sid=$sid\">Snake</a><br/>";

   echo "<a href=\"hat.php?action=q3&amp;a=5&amp;sc=$sc&amp;sid=$sid\">Owl</a><br/>";

   echo "<a href=\"hat.php?action=q3&amp;a=3&amp;sc=$sc&amp;sid=$sid\">Rat</a><br/>";

   echo "<a href=\"hat.php?action=q3&amp;a=4&amp;sc=$sc&amp;sid=$sid\">Cat</a><br/>";



  echo "<br/><br/>";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

//////////////////////////////////////////////question 3

else if($action=="q3")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

    echo "<p align=\"center\">";

    $a=$_GET["a"];

    $sc=$_GET["sc"];

$sc = $a + $sc;

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/><br/>";

    echo "<b>What Flavour Jelly Bean Do You Like... </b><br/><br/>";

   echo "<a href=\"hat.php?action=q4&amp;a=5&amp;sc=$sc&amp;sid=$sid\">Lime</a><br/>";

   echo "<a href=\"hat.php?action=q4&amp;a=3&amp;sc=$sc&amp;sid=$sid\">Brussel Sprout</a><br/>";

   echo "<a href=\"hat.php?action=q4&amp;a=4&amp;sc=$sc&amp;sid=$sid\">Chocolate</a><br/>";

   echo "<a href=\"hat.php?action=q4&amp;a=2&amp;sc=$sc&amp;sid=$sid\">Boggie</a><br/>";

  echo "<br/><br/>";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

//////////////////////////////////////////////question 4

else if($action=="q4")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

    echo "<p align=\"center\">";

    $a=$_GET["a"];

    $sc=$_GET["sc"];

$sc = $a + $sc;

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/><br/>";

    echo "<b>Which Magical Power Would You Choose... </b><br/><br/>";

   echo "<a href=\"hat.php?action=end&amp;a=2&amp;sc=$sc&amp;sid=$sid\">Read Peoples Minds</a><br/>";

   echo "<a href=\"hat.php?action=end&amp;a=4&amp;sc=$sc&amp;sid=$sid\">Move Things With Your Mind</a><br/>";

   echo "<a href=\"hat.php?action=end&amp;a=5&amp;sc=$sc&amp;sid=$sid\">Invisability</a><br/>";

   echo "<a href=\"hat.php?action=end&amp;a=3&amp;sc=$sc&amp;sid=$sid\">Fly</a><br/>";

  echo "<br/><br/>";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

//////////////////////////////////////////////end

else if($action=="end")

{

  addvisitor();

  addonline(getuid_sid($sid),"Sorting Hat","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Sorting Hat<br/></div>";

    echo "<p align=\"center\">";

    $a=$_GET["a"];

    $sc=$_GET["sc"];

$sc = $a + $sc;

 echo "<img src=\"/images/hat.jpg\" alt=\"*\"/><br/><br/>";

if($sc<11){

  echo "Your Best Suited For Slytherin!<br/>";

echo "<img src=\"/images/slyth.jpg\" alt=\"Slytherin\"/><br/>";

$house = "Slytherin";  

}else if($sc>10&&$sc<14){

     echo "Your Best Suited For Hufflepuff<br/>";

echo "<img src=\"/images/huff.jpg\" alt=\"Hufflepuff\"/><br/>";

$house = "Hufflepuff";

}else if($sc>13&&$sc<17){

     echo "Your Best Suited For Ravenclaw!<br/>";

echo "<img src=\"/images/raven.jpg\" alt=\"Ravenclaw\"/><br/>";

$house = "Ravenclaw";

}else if($sc>16){

     echo "Your Best Suited For Gryffindor<br/>";

echo "<img src=\"/images/gryff.jpg\" alt=\"Gryffindor\"/><br/>";

$house = "Gryffindor";

}

  $name = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'"));

    $who = $name[0];

	$message = "[id=$uid]$who [/id] Has Visited The Sorting Hat. [br/] The Sorting Hat Has Placed Them In [b] $house [/b] :wizard ";

	autopm($message, 1781);

  echo "<br/><br/>";

   echo "<a href=\"index.php?action=viewtpc&amp;tid=1295&amp;sid=$sid\">Back To Topic</a><br/><br/>";

  echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";

  echo "Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}

else{

  addonline(getuid_sid($sid),"Lost in sorting hat lol","");

  echo "<head>";

  echo "<title>wapirate</title>";

  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

  echo "</head>";

  echo "<body>"; 

    echo "<div><br/>Doh!<br/></div>";

  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=\"/xhtml/index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";

  echo "</p>";

    echo "<div>$addy</div>";

  echo "</body>";

  exit();

}







	echo "</html>";

?>