also, i made a new page for my general menu. i guess i missed some codes here, it works well in opera 9.50 but not in default browsers of cellphones. here's my code.
<?php
include("config.php");
include("core.php");
//session_start();
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
$bcon = connectdb();
if (!$bcon)
{
echo "<card id=\"main\" title=\"site\">";
echo "
";
echo "<img src=\"images/exit.gif\" alt=\"*\"/>
";
echo "ERROR! cannot connect to database
";
echo "This error happens usually when backing up the database, please be patient, The site will be up any minute
";
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
";
echo "**THANK YOU VERY MUCH**";
echo "
";
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);
cleardata();
if(isipbanned($uip,$ubr))
{
if(!isshield(getuid_sid($sid)))
{
echo "<card id=\"main\" title=\"site\">";
echo "
";
echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
echo "This IP address is blocked
";
echo "
";
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
";
$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 "Time to unblock the IP: $rmsg
";
echo "
";
echo "
";
echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/>
";
echo "Password: <input type=\"password\" name=\"logpwd\" maxlength=\"30\"/>
";
echo "<anchor>LOGIN<go href=\"login.php\" method=\"get\">";
echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
echo "</go></anchor>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
}
if(($action != "") && ($action!="terms"))
{
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
echo "<card id=\"main\" title=\"site\">";
echo "
";
echo "You are not logged in
";
echo "Or Your session has been expired
";
echo "<a href=\"index.php\">Login</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
}
//echo isbanned($uid);
if(isbanned($uid))
{
echo "<card id=\"main\" title=\"site\">";
echo "
";
echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
echo "You are **Banned**
";
$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
";
echo "Ban Reason: $banres[0]";
//echo "<a href=\"index.php\">Login</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
////////////////////////////////////////MAIN PAGE
if($action=="genm")
{
addonline(getuid_sid($sid),"General Menu","");
echo "<card id=\"main\" title=\"Menu\">";
echo "
";
echo waphead($sid);
echo "
";
echo mailbox($sid);
echo "
";
echo getshoutbox($sid);
echo "
";
$tbday=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate());"));
echo "GENERAL MENU";
echo "
";
echo "
";
echo "<a href=\"lists.php?action=bdy&sid=$sid\">+ Today's Birthday ($tbday[0])</a>
";
echo "
";
echo "";
echo "<a href=\"news/index.php?sid=$sid\">+ News</a>
";
$chs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubs"));
echo "<a href=\"home.php?action=clmenu&sid=$sid\">+ Clubs ($chs[0])</a>
";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs"));
echo "<a href=\"lists.php?action=allbl&sid=$sid\">+ Blogs ($noi[0])</a>
";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE pollid>'0'"));
echo "<a href=\"lists.php?action=polls&sid=$sid\">+ Polls ($noi[0])</a>
";
echo "<a href=\"genm.php?action=funm&sid=$sid\">+ Fun Zone</a>
";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault"));
echo "<a href=\"lists.php?action=vault&sid=$sid\">+ Vaults ($noi[0])</a>
";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery"));
echo "<a href=\"usergallery.php?action=main&sid=$sid\">+ User Gallery</a>($noi[0])
";
echo "--------
";
echo "<a href=\"help.php?sid=$sid\">+ Help Menu</a>
";
echo "<a href=\"lists.php?action=faqs&sid=$sid\">+ Faq's</a>
";
echo "<a href=\"terms.php?action=terms&sid=$sid\">+ Terms</a>
";
echo "
";
echo wapfoot($sid);
echo "</card>";
echo "</wml>";
exit();
}
else if($action=="funm")
{
addonline(getuid_sid($sid),"Fun/Games Menu","");
echo "<card id=\"viewforum\" title=\"Fun/Games Menu\">";
echo "
";
echo "<img src=\"images/roll.gif\" alt=\"*\"/>
";
echo "Yeah! Lets have some fun!";
echo "
";
echo "
";
///echo "<a href=\"hangman/index.php?sid=$sid\">»Hangman</a>
";
echo "<a href=\"games.php?action=fci&sid=$sid\">»Fortune Cookie</a>
";
echo "-----";
echo "
";
echo "<a href=\"hilow.php?action=hilow&sid=$sid\">»HiLow</a>
";
echo "<a href=\"hangman.php?action=hangman&sid=$sid\">»Hangman</a>
";
echo "<a href=\"hangman.php?action=scramble&sid=$sid\">»Twist</a>
";
echo "<a href=\"games.php?action=guessgm&sid=$sid\">»Guess The Number</a>
";
echo "<a href=\"games.php?action=casinoi&sid=$sid\">»Casino</a>
";
echo "<a href=\"games.php?action=lottoi&sid=$sid\">»Lotto</a>
";
echo "-----
";
echo "<a href=\"games.php?action=mixabud&sid=$sid\">»Mix a Buddy</a>
";
echo "<a href=\"games.php?action=mixabudguy&sid=$sid\">»Mix a Guy (For Girls Only)</a>
";
echo "<a href=\"games.php?action=mixabudgirl&sid=$sid\">»Mix a Girl (For Guys Only)</a>
";
//echo "»Dares Box
";
echo "
";
echo "
";
echo "";
echo "
";
echo "";
echo "<a href=\"home.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
else if($action=="partners")
{
addonline(getuid_sid($sid),"Partner List","");
echo "<card id=\"viewforum\" title=\"Partners\">";
echo "
";
echo "Partner Sites
";
echo "
";
echo "
";
echo "<a href=\"http://site.wen.ru\">Link</a>
";
echo "<a href=\"http://site.org\">Link</a>
";
echo "
";
echo "
";
echo "
<a href=\"home.php?action=main&sid=$sid\">";
echo "Home</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
else{
addonline(getuid_sid($sid),"Lost in Games lol","");
echo "<card id=\"main\" title=\"Inbox\">";
echo "
";
echo "I don't know how did you get into here, but there's nothing to show
";
echo "<a href=\"home.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "
";
echo "</card>";
echo "</wml>";
exit();
}
?>
</wml>