File size: 4.45Kb
<?php
include("config.php");
include("core.php");
echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML Mobile 1.0//EN\"". " \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $sitename; ?></title>
<meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
<meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
<?php
connectdb();
$sid = $_GET["sid"];
?>
</head>
<body>
<?php
$action = $_GET["action"];
$uid = getuid_sid($sid);
if((islogged($sid)==false)||($uid==0))
{
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></div></body></html>";
exit();
}
if(isbanned($uid))
{
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>";
echo "<b>You are Banned</b><br/><br/>";
$banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
$banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
$remain = $banto[0]- time();
$rmsg = gettimemsg($remain);
echo "<b>Time Left: </b>$rmsg<br/>";
$nick = getnick_uid($banto[2]);
echo "<b>By: </b>$nick<br/>";
echo "<b>Reason: </b>$banto[1]";
//echo "<a href=\"index.php\">Login</a>";
echo "</p>";
echo "</div></div></body></html>";
exit();
}
/* if((getposts($sid)<50) AND (getshoutcount($uid)<200)){
("Error!");
echo "To prevent misuse, this feature is available only to those users who have more than 50 posts or 200 shouts.";
echo "</body></html>";
exit();
}
*/
if($action=="main")
{
addonline($uid,"Composing SMS","sms.php?action=$action");
$umsg = getunreadpm($uid);
if($umsg>0){
echo "<p align=\"center\"><a href=\"inbox.php?action=main&sid=$sid\">Inbox($umsg new msg)</a></p>";
}
("Compose SMS");
echo "$sitename allows you to send unlimited SMSes for free to any network's mobile no. in India. <img src=\"http://youngbuzz.net/mobile/images/smiles/dwarf.gif\" alt=\":dwarf\"/>Even the latest 8xxxxxxxxx series numbers are supported. <img src=\"http://youngbuzz.net/mobile/images/smiles/orc.gif\" alt=\":orc\"/><br/>";
echo "<font color=\"red\"><b>Warning: Using this service for abuse will be strictly dealt with, and police action will be taken.</b></font><br/>";
$msglength=131-strlen(getnick_sid($sid));
echo "<form action=\"sms.php?action=send&sid=$sid\" method=\"post\">
Enter the 10 digit Indian mobile no.:<br/>
<input class=\"inputText\" type=\"text\" name=\"mobile\"size=\"20\" maxlength=\"10\" format=\"*N\"/><br/>
Enter your message($msglength chars max):<br/>
<input class=\"inputText\" type=\"Text\" name=\"message\" maxlength=\"$msglength\"></textarea><br/>
<input class=\"inputButton\" type=\"submit\" name=\"Submit\" value=\"Submit\"/>
</form>
";
echo "</body>";
}
else if ($action=="send"){
addonline(getuid_sid($sid), "Sending an SMS", "");
$sms = mysql_fetch_array(mysql_query("SELECT sms FROM ibwf_users WHERE id='".$uid."'"));
("Sending SMS");
echo "<p style=\"text-align: center\">";
$mobno=$_POST["mobile"];
///////Test whether cell number is valid(i.e. starting from 8 or 9 and containing 10 digits only)
if (!preg_match('/^[9|8]\d{9}$/', $mobno)){
echo "This is not a valid Indian mobile number!!! Please <a href=\"sms.php?action=main&sid=$sid\">go back</a> and retry.</p>";
echo "</body></html>";
exit();
}
$message=$_POST["message"];
/////////////if the message + footer is larger than 140 chars truncate the message to fit
$add="#".getnick_sid($sid)."@Youngbuzz";
$count=strlen($add);
$count=140-$count;
if(strlen($message)>$count){
$message=substr($message, 0, $count);
$flag[0]=1;
$flag[1]=strlen($message);
}
$message.=$add;
$bool=sendsms($mobno, $message);
if($bool==true){
if($flag[0]==1){
echo "Your message was longer than $flag[1] characters so it was truncated and first $flag[1] characters have been sent.<br/>";
}
echo "Your SMS has been successfully sent to $mobno<br/>";
$sms[0]++;
$b1 = mysql_query("UPDATE ibwf_users SET sms='$sms[0]' WHERE id='".$uid."'");
}
else{
echo "An error crept in while sending your SMS. Please try after sometime while an admin looks into the issue and fixes it.";
}
//////////////////////
echo "</p>";
echo "</body></html>";
}