Code:
<?php 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\">"; ?> ////////////////// ///Hype Type///// //htportal.net// /////////////// <wml> <?php include("config.php"); include("core.php"); connectdb(); $action = $_GET['action']; $sid = $_GET['sid']; $page = $_GET['page']; $who = $_GET['who']; $pmid = $_GET['pmid']; if(islogged($sid)==false) { echo "<card id=\"main\" title=\"$sitename\">"; echo "<p align=\"center\">"; echo "You are not logged in "; echo "Or Your session has been expired "; echo "<a href=\"index.php\">Login</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } $uid = getuid_sid($sid); if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo "<p align=\"center\">"; echo "<img src=\"images/notok.gif\" alt=\"x\"/> "; echo "You are [b]Banned[/b] "; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Time to finish your penalty: $rmsg "; //echo "<a href=\"index.php\">Login</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } else if($action=="main") { addonline(getuid_sid($sid),"Playing Hang Man :)",""); echo "<card id=\"main\" title=\"Hang Man\">"; echo "<p align=\"center\">"; // words $list = " ht portal hypetype energy game over earth google anmial food i love you flowers monster globe heaven computer love hate rainbow sunshine master ugly wallpaper "; // letters to choose from $alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; $additional_letters = " -.,;!?%&0123456789"; $len_alpha = strlen($alpha); if(isset($_GET["n"])) $n=$_GET["n"]; if(isset($_GET["letters"])) $letters=$_GET["letters"]; if(!isset($letters)) $letters=""; if(isset($PHP_SELF)) $self=$PHP_SELF; else $self=$_SERVER["PHP_SELF"]; $links=""; // Numar maxim de greseli $max=6; # error_reporting(0); $list = strtoupper($list); $words = explode("\n",$list); srand ((double)microtime()*1000000); $all_letters=$letters.$additional_letters; $wrong = 0; if (!isset($n)) { $n = rand(1,count($words)) - 1; } $word_line=""; $word = trim($words[$n]); $done = 1; for ($x=0; $x < strlen($word); $x++) { if (strstr($all_letters, $word[$x])) { if ($word[$x]==" ") $word_line.=" "; else $word_line.=$word[$x]; } else { $word_line.="_ "; $done = 0; } } if (!$done) { for ($c=0; $c<$len_alpha; $c++) { if (strstr($letters, $alpha[$c])) { if (strstr($words[$n], $alpha[$c])) {$links .= "[b]$alpha[$c][/b] "; } else { $links .= "$alpha[$c]"; $wrong++; } } else { $links .= "<a href=\"hang.php?action=main&sid=$sid&letters=$alpha[$c]$letters&n=$n\">$alpha[$c]</a>"; } } if (strstr($word, " ")) $term="word"; else $term="word"; echo "[size="1"]Guess The $term:[/size] "; echo $word_line; $nwrong=$wrong; if ($nwrong>6) $nwrong=6; echo " [size="1"]<img src=\"/sp_$nwrong.gif\" alt=\"*\"/>[/size] "; if ($wrong >= $max) { $n++; if ($n>(count($words)-1)) $n=0; ////////////////////////if lose u then u have lost some plusses :( $usts = mysql_fetch_array(mysql_query("SELECT gplus, plusses FROM ibwf_users WHERE id='".$uid."'")); $gups = $usts[0]-10; $upl = $usts[1]-10; mysql_query("UPDATE ibwf_users SET gplus='".$gups."', plusses='".$upl."' WHERE id='".$uid."'"); // echo " [size="1"]$word_line[/size] "; echo " [size="1"]LOSER![/size] "; if (strstr($word, " ")) $term="the"; else $term="the"; echo "[size="1"]$term word is: [b]$word[/b] You lost [b]10 game plusses[/b] and [b]10 plusses[/b][/size] "; echo "[size="1"]<a href=\"hang.php?action=main&sid=$sid\">Play Again?</a>[/size]"; } else { echo "[size="1"]Choose a letter:[/size] "; echo $links; echo " [size="1"]Chances Left: $wrong wrong of $max[/size]"; // echo " [size="1"]Greseli ramase:".($max-$wrong)."[/size] "; } } else { $n++; if ($n>(count($words)-1)) $n=0; ////////////////////////if win u get free plusses and game plusses :) $usts = mysql_fetch_array(mysql_query("SELECT gplus, plusses FROM ibwf_users WHERE id='".$uid."'")); $gups = $usts[0]+10; $upl = $usts[1]+1; mysql_query("UPDATE ibwf_users SET gplus='".$gups."', plusses='".$upl."' WHERE id='".$uid."'"); echo "The word is:"; echo $word_line; $nick = getnick_sid($sid); echo " [size="1"]CONGRATULATIONS!!! $nick you WIN!!! You get [b]10 game plusses[/b] and [b]1 extra plusses[/b][/size] "; echo "[size="1"]<a href=\"hang.php?action=main&sid=$sid\">Play Again?</a>[/size]"; } //echo " [size="1"]<a href=\"hangman.php?nick=$nick&pass=$pass\">Choose another category</a>[/size]"; //echo " [size="1"]<a href=\"index.php?nick=$nick&pass=$pass\">Sistem index</a>[/size]"; //echo " "; //echo "[size="1"]© <a href=\"index.php?nick=$nick&pass=$pass\">HT Portal</a>[/size] "; echo " --- <a href=\"index.php?action=main&sid=$sid\">Home</a>"; } echo "</p>"; echo "</card>"; ?> </wml>
Comment