Block Shoutbox Forum And Inbox

Started on the old forum in January 2010 · view the original in the archive · old links redirect here

4 replies · 1,661 views · started 16 years ago · 1 min read

5 participants
riderz Lead · 975 posts #1

add this code on ur shoutbox

if(!isshoutblocked($uid)){
  if($showshout[0]=="1"){
getshouts($sid);
 }
}

this code u add for ur inbox

     if(!isinboxblocked($uid)){
echo " <a href=\"inbox.php?action=main&sid=$sid\" accesskey=\"1\">Inbox($umsg/$allmsg)</a><br/>";
 echo "<a href=\"inbox.php?action=mmsdisp&sid=$sid\">MMS$inda</a><br/>";

}

and this code u can add all over ur forum menus

 if(!isforumblocked($uid)){

}

block.php

<?php
/////////////////script load time
$time = microtime();
$time = explode(" ", $time);
$time = $time[1] + $time[0];
$start = $time;
//////////////////Includes
include("config.php");
include("core.php");
/////////////////Page headers
//header("Content-type: text/vnd.wap.wml");
//header("Cache-Control: no-store, no-cache, must-revalidate");
echo '<?xml version="1.0"?' . '>';
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MoBileZonez</title>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="must-revalidate" />
<meta name="description" content="mobilezonez Interactive Wap Portal, lots of content." />
<meta name="keywords" content="free, ringtones, download, mp3, tones, nokia, wap portal,chat, themes, games" />
<link rel="shortcut icon" href="images/favicon.ico" />

<?php
$bcon = connectdb();
$sid = $_GET['sid'];
echo gettheme($sid);
?>
</head>
<body>
<?php
echo "<font size=\"".getfontsize($sid)."\">";
///////////////All the GETs//////
$page = $_GET['page'];
$who = $_GET['who'];
$action = $_GET['action'];
$uid = getuid_sid($sid);
//////////////DB connection failed
if (!$bcon){
echo "<p align=\"center\">
ERROR! Couldn't connect to database!<br/><br/>
Sorry for the interruption! Please try <a href=\"index.php?action=main&sid=$sid\">refresh</a>ing this page and if it doesn't work then try after sometime.<br/><br/>
<b>Thanks,<br/>With regards,<br/>$sitename Team!</b>
</p>
</font></body>
</html>";
exit();
}
cleardata();
/////////////Session not legal??
if(($action != "") && ($action!="terms")){
if((islogged($sid)==false)||($uid==0)){
boxstart("Error!");
echo "<center><img src=\"images/notok.gif\" alt=\"\"/>You are not logged in<br/>";
echo "or your session has expired.<br/><br/>";
echo "

			  <form action=\"login.php\" method=\"get\">
			     <img src=\"images/user.gif\" alt=\"\"/>Enter username:<br/>
			       <input id=\"inputText\" name=\"loguid\" maxlength=\"30\"/><br/>
                             <img src=\"images/pass.gif\" alt=\"\"/>Enter password:<br/>
			       <input id=\"inputText\" type=\"password\" format=\"*x\" name=\"logpwd\"  maxlength=\"30\"/><br/>
                               <input id=\"inputButton\" type=\"submit\" value=\"Login\"/><br/>
			  </form>
                          <br/><br/><img src=\"images/register.gif\" alt=\"\"/><a href=\"register.php\">Register</a>
                               <br/><img src=\"images/home.gif\" alt=\"\"/><a href=\"index.php\">Home</a>
			       </center>";
boxend();
echo "</font></body></html>";
exit();
}
}
//////////////////User Banned?
if(isbanned($uid)){
boxstart("Error!");
echo "<img src=\"images/notok.gif\" alt=\"\"/><center>";
echo "You are presently banned!<br/><br/>";
$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<br/><br/>";
echo "</center>";
boxend();
echo "</font></body>";
echo "</html>";
exit();
}
 $stitle = htmlspecialchars(getstitle());
 $sdomain = htmlspecialchars(getsdomain());
 $date = htmlspecialchars(getdate2());
///////////////////////////////////////Unblock inbox
 if($action=="openinbox"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET inboxb='0' WHERE id='".$who."'");
$res1 = mysql_query("DELETE FROM ibwf_penalties WHERE penalty='2' AND uid='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> inbox', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick inbox unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/></p>";
getfooter($sid);
}
///////////////////////////////////////Unblock forum
 else if($action=="openforum"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET forumb='0' WHERE id='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> forum access', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick forum unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><p/>";
getfooter($sid);
}
///////////////////////////////////////Unblock Shoutbox
 else if($action=="openshout"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET shoutb='0' WHERE id='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> shoutbox', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick Shoutbox unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/></p>";
getfooter($sid);
}
/////////////////////////////////////////////////////////////////Block
///////////////////////////////////////Block inbox
 else if($action=="blockinbox"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET inboxb='1' WHERE id='".$who."'");
$res1 = mysql_query("DELETE FROM ibwf_penalties WHERE penalty='2' AND uid='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> inbox', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick inbox unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/></p>";
getfooter($sid);
}
///////////////////////////////////////Block forum
 else if($action=="blockforum"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET forumb='1' WHERE id='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> forum access', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick forum unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/><p/>";
getfooter($sid);
}
///////////////////////////////////////Block Shoutbox
 else if($action=="blockshout"){
$who = $_GET["who"];
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET shoutb='1' WHERE id='".$who."'");
if($res){
$unick = getnick_uid($who);
mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='<b>".getnick_uid(getuid_sid($sid))."</b> unblocked the user <b>".$unick."</b> shoutbox', actdt='".time()."'");
echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick Shoutbox unblocked";
}else{
echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
}
echo "<br/></p>";
getfooter($sid);
}
echo "<div class=\"footer\"><small><center>";

  echo "</small></div>";

?>
</font></body>
</html>

core.php

	function isforumblocked($uid){

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

if($not[0]==1){

return true;

}else{

return false;

}

}

function isshoutblocked($uid){

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

if($not[0]==1){

return true;

}else{

return false;

}

}function isinboxblocked($uid){

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

if($not[0]==1){

return true;

}else{

return false;

}

}

mcppl.php mccpl.php?action=user

echo "<a href=\"mcppl.php?action=block&sid=$sid&who=$who\">»Block Items</a><br/>";
if(isshoutblocked($who)){
echo "<a href=\"block.php?action=openshout&sid=$sid&who=$who\">»Unblock Shoutbox</a><br/>";
}
if(isforumblocked($who)){
echo "<a href=\"block.php?action=openforum&sid=$sid&who=$who\">»Unblock Forum Access</a><br/>";
}
if(isinboxblocked($who)){
echo "<a href=\"block.php?action=openinbox&sid=$sid&who=$who\">»Unblock Inbox</a><br/>";
}

mccpl.php?action=block

//////////////////////////////////////Block Options

else if($action=="block")
{
    $who = $_GET["who"];
    echo "<card id=\"main\" title=\"Mod CP\">";
    echo "<p align=\"center\">";
echo "<a href=\"block.php?action=blockshout&sid=$sid&who=$who\">»Block Shoutbox</a><br/>";
echo "<a href=\"block.php?action=blockinbox&sid=$sid&who=$who\">»Block Inbox</a><br/>";
echo "<a href=\"block.php?action=blockforum&sid=$sid&who=$who\">»Block Forum Access</a><br/>";
   echo "</p>";
    echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}

sql ibwf_users

inboxb int 1  default 0
forumb int 1 default 0
shoutb int 1 default 0

Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

rashod Junior · 12 posts #2

i think this one is grate .havent try yet lets see.Thanks dude.I know you are Very helpfull to others

***Im here with your help.Im now im here to help you.Asdk any thing,Help to each other.***And visit www.zaraawap.net

mafia Newbie · 5 posts #3

did that work for ny1 i tried it for whole day still confused not working :\

Probably m a new Bie So i Cldnt Crack it

if Possible CN u Make a Detailed Tut For it

PLezZzz

nclemale36 Lead · 537 posts #4

i added it to mine a while ago . didnt use block.php did it my own way was much easier just add the bits to your tool files.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close