can anyone share us this script, only staffmemberz can shout in this staff shoutbox
staff shout
Collapse
X
-
yep i remember this code which me n quik has updated in 2006 with lavalair
put this in your core.php
PHP Code:function getstaffshout($sid)
{
$shbox = "<small>";
$shbox .= "<b>ShoutBox</b><br/>";
$lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM staff_shouts ORDER BY shtime DESC LIMIT 1"));
$shnick = getnick_uid($lshout[1]);
$shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$shnick."</a></i>: ";
$shbox .= htmlspecialchars($lshout[0]);
$shbox .= "<br/>";
$shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>, ";
f (ismod(getuid_sid($sid)))
{
$shbox .= "<a href=\"index.php?action=shout&sid=$sid\">shout</a>";
$shbox .= ", <a href=\"modproc.php?action=delstsh&sid=$sid&shid=$lshout[2]\">delete</a>";
}
//$shbox .= "<br/>";
$shbox .= "</small>";
return $shbox;
}
PHP Code:echo "<p align=\"center\">";
echo getstaffshout($sid);
echo "</p>";
PHP Code:-- Table structure for table `staff_shouts`
--
CREATE TABLE `staff_shouts` (
`id` int(100) NOT NULL auto_increment,
`shout` varchar(100) NOT NULL default '',
`shouter` int(100) NOT NULL default '0',
`shtime` int(100) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=36726 ;
E107 Security Team Leader
Proudly Support AccountLab Plus Billing Software
Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
------------------
-
this is for the wapdesire v2.
Code:$main.="<div class=".align().">\n"; $main.="<b>Staff ShoutBox</b>"; if($page=="" || $page<=0)$page=1; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM shouts")); $num_items = $noi[0]; //changable $items_per_page= 1; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages;$limit_start = ($page-1)*$items_per_page; $sql = "SELECT shout, uid, id FROM staff_shouts ORDER BY shtime DESC LIMIT $limit_start, $items_per_page"; $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) while ($item = mysql_fetch_array($items)) { $sex=mysql_fetch_array(mysql_query("SELECT sex, image FROM profiles WHERE uid='".$item[1]."'")); if($sex[0]=="M"){$color="#0000FF";} if($sex[0]=="F"){$color="#FF0066";} if($sex[1]!=""){$usersex=getbbcode($sex[1],$sid,1);} $shnick=getnick_uid($item[1]); $main.="<br/><i><a href=\"./profile.php?who=$item[1]&sid=$sid\" style=\"color:$color;\"><b>".$shnick."</b></a></i> - ".getbbcode($item[0],$sid,1); if(delshout(getuid_sid($sid),$item[2])){ $main.=" <a href=\"./staffshoutbox/delete.php?sid=$sid&delete=$item[2]\"> <img src=\"./images/error.gif\" alt=\"[x]\"/></a>\n"; } } $main.="<br/><a href=\"./staffshoutbox/history.php?sid=$sid\">History</a>\n"; if(isowner(getuid_sid($sid))||isheadadmin(getuid_sid($sid))||isadmin(getuid_sid($sid))||ismod(getuid_sid($sid))){ $main.="<br/>Staff ShoutBox Message:<br/> <form action=\"./staffshoutbox/shout.php?sid=$sid\" method=\"post\"> <input name=\"shtxt\" maxlength=\"100\"/><br/> <input type=\"submit\" value=\"Add Shout\"/><br/> </form></div>";}
Comment
-
icen01 put any where in core.php lol that code is for general lavalairE107 Security Team Leader
Proudly Support AccountLab Plus Billing Software
Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
------------------
Comment
-
why make it hard..i suggest to just display two shoutbox..for staff and for members..in staff's shoutbox, just fetch shouts where perm > 0..just giving my suggestion..i don't have this on my site..add perm row to shoutbox table..when shouting, perm should also be set..fetch shouters perm from users and then update to shoutbox table..Last edited by kiLLeR-eyEd_14; 23.09.09, 08:13.My Blog: http://jhommark.blogspot.com
My Facebook: http://www.facebook.com/jhommark
My Official Site: http://www.undergroundweb.tk
My Community Site: http://undergroundwap.xtreemhost.com
Comment
-
which code u putted mine? show me ur core.php i will help uE107 Security Team Leader
Proudly Support AccountLab Plus Billing Software
Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com
------------------
Comment
-
try this there were one letter left out u must not just copy and paste look how the coding are done
Code:function getstaffshout($sid) { $shbox = "<small>"; $shbox .= "<b>ShoutBox</b><br/>"; $lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM staff_shouts ORDER BY shtime DESC LIMIT 1")); $shnick = getnick_uid($lshout[1]); $shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$shnick."</a></i>: "; $shbox .= htmlspecialchars($lshout[0]); $shbox .= "<br/>"; $shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>, "; if (ismod(getuid_sid($sid))) { $shbox .= "<a href=\"index.php?action=shout&sid=$sid\">shout</a>"; $shbox .= ", <a href=\"modproc.php?action=delstsh&sid=$sid&shid=$lshout[2]\">delete</a>"; } //$shbox .= "<br/>"; $shbox .= "</small>"; return $shbox; }
Comment
-
While Copying And Pasting U Will get the option but shout will go to the normal one... Here I am to help The Newbies Just Foolow Bellow Steps
Copy And Paste it To ur genproc.phpPHP Code://////////////////////////////////////////shout2
else if($action=="shout2")
{
$shtxt = $_POST["shtxt"];
addonline(getuid_sid($sid),"Shouting","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
if(getplusses(getuid_sid($sid))<75)
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>You should have at least 75 plusses to shout!<br/><br/>";
echo "<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
if(istrashed(getuid_sid($sid)))
{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>Unknown error cannot shout!<br/>please try again later...<br/><br/>";
echo "<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}else{
$shtm = time();
if(!isblocked($shtxt,$uid))
{
$res = mysql_query("INSERT INTO staff_shouts SET shout='".$shtxt."', shouter='".$uid."', shtime='".$shtm."'");
$usts = mysql_fetch_array(mysql_query("SELECT shouts, plusses FROM ibwf_users WHERE id='".$uid."'"));
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET shouts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Shout added successfully";
}else{
$bantime = time() + (30*24*60*60);
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>";
echo "Can't Post Shout Message<br/><br/>";
echo "You just shouted a link to one of the crapiest sites on earth<br/> The members of these sites spam here a lot, so go to that site and stay there if you don't like it here<br/> as a result of your stupid action:<br/>1. you have lost your sheild<br/>2. you have lost all your plusses<br/>3. You are BANNED!";
$user = getnick_sid($sid);
mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='<b>Wap Desire</b> auto banned $user for spamming shoutbox', actdt='".time()."'");
mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'");
mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'");
echo "</body>";
echo "</html>";
exit;
}
}
echo "<br/><br/><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
}
Enter This To Ur Core.phpPHP Code://///////////////////////////////////////////function Shoutbox staff
function getstaffshout($sid)
{
$shbox .= "<form action=\"genproc.php?action=shout2&sid=$sid\" method=\"post\"><center>";
$shbox .= "<b><div>-= Staff Shout =-</div></b><br/>";
$lshout = mysql_fetch_array(mysql_query("SELECT shout, shouter, id FROM staff_shouts ORDER BY shtime DESC LIMIT 1"));
$shnick = getnick_uid($lshout[1]);
$shbox .= "<i><a href=\"index.php?action=viewuser&sid=$sid&who=$lshout[1]\">".$shnick."</a></i> - ";
$text = parsepm($lshout[0], $sid);
$shbox .= $text;
$shbox .= "<br/>";
$shbox .= "<a href=\"lists.php?action=shouts&sid=$sid\">more</a>";
if (ismod(getuid_sid($sid)))
{
$shbox .= " <a href=\"modproc.php?action=delsh&sid=$sid&shid=$lshout[2]\">delete</a>";
$shbox .= "<br/>ShoutBox Message:<br/><input name=\"shtxt\" maxlength=\"100\"/><br/>";
$shbox .= "<input type=\"Submit\" name=\"shout\" Value=\"Add Shout\"></center></form>";
}
return $shbox;
}
PHP Code:echo "<p align=\"center\">";
echo getstaffshout($sid);
echo "</p>";
PHP Code:-- Table structure for table `staff_shouts`
--
CREATE TABLE `staff_shouts` (
`id` int(100) NOT NULL auto_increment,
`shout` varchar(100) NOT NULL default '',
`shouter` int(100) NOT NULL default '0',
`shtime` int(100) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=36726 ;
ImPoSsIbLe iS nOthInG aS ImPoSsible ItSelF SaYs "I M POSSIBLE"
Comment
Comment