sorry for that......
its not my fault.....
my friend did that.....
i really dont know about that........
i will fix that all........
i just create that for demo........
Aspirewap old sc
Collapse
X
-
Toolcp.php and class.toolcp.php
I just use code form i share below. and it work very well for create chat room
toolcp.php
class.toolcp.phpPHP Code:<?php
$cptool = new cp();
if(staff($u)){
addonline($u, "Staff CP", "$path?a=home&ref=home");
if(!cponline($u)){
$theme->Div("divsub");
echo "<a href=\"$path?a=home&ref=home\">« Back to Home</a>";
$theme->Div("d");
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Staff Login</b>";
$theme->Div("d");
$theme->Div("divsub");
if(isset($_POST["submit"])){
$password = $_POST['password'];
if(trim($password)==""){
header("Location: ".$_SESSION['request']."&do=2");
}else if(checkInfo($password)==0){
header("Location: ".$_SESSION['request']."&do=3");
}else if(checkInfo($password)==1){
$tm = time();
$check = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM onlinecp WHERE user='".$u."'"));
if($check[0]>0){
$res = mysql_query("UPDATE onlinecp SET actvtime='".$tm."' WHERE user='".$u."'");
}else{
$res = mysql_query("INSERT INTO onlinecp SET user='".$u."', actvtime='".$tm."'");
}
header("Location: ".$_SESSION['request']."");
}
exit();
}
if(isset($_GET["do"])){
echo $cptool->MessageCase($_GET["do"]);
}
if($do==""){
$_SESSION['request'] = $_SERVER['REQUEST_URI'];
}
echo "<form action=\"".$_SESSION['request']."\" method=\"POST\">";
echo "Password<br /><input type=\"password\" name=\"password\" class=\"input\" maxlength=\"15\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Login\" class=\"button\"/></form>";
$theme->Div("d");
}else{
if($ref!=""){
$theme->Div("divsub");
echo "<a href=\"$path?a=toolcp\">« Back to Staff CP</a>";
$theme->Div("d");
}
if($ref==""){
$theme->Div("divsub");
echo "<a href=\"$path?a=home&ref=home\">« Back to Home</a>";
$theme->Div("d");
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Staff Tools</b>";
$theme->Div("d");
$theme->Div("divsub");
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE punish='1'"));
echo "<a href=\"$path?a=toolcp&ref=punish&do=1\">".$noi[0]." Muted</a><br />";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE punish='2'"));
echo "<a href=\"$path?a=toolcp&ref=punish&do=2\">".$noi[0]." Banned</a><br />";
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM udelete"));
echo "<a href=\"$path?a=toolcp&ref=suspend\">".$noi[0]." Suspended</a><br />";
echo "<a href=\"$path?a=toolcp&ref=report\">Reports / Logs</a><br />";
if(master($u)){
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE accstat='0'"));
echo "<a href=\"$path?a=toolcp&ref=unacc\">".$noi[0]." Unactive Account</a><br />";
}
if(admin($u)){
echo "<a href=\"$path?a=toolcp&ref=announce\">Add Announcement</a><br />";
}
if(master($u)){
echo "<a href=\"$path?a=toolcp&ref=broadcast\">Broadcasting PM</a><br />";
echo "<a href=\"$path?a=toolcp&ref=pmstaff\">PM All Staff</a><br />";
echo "<a href=\"$path?a=toolcp&ref=password\">Change Tool Password</a><br />";
echo "<a href=\"$path?a=toolcp&ref=fcategory\">Forum Categories</a><br />";
echo "<a href=\"$path?a=toolcp&ref=uploadn\">Icons upload</a><br />";
}
if(smoderate($u)){
echo "<a href=\"$path?a=toolcp&ref=fboard\">Forum Boards</a><br />";
}
echo "<a href=\"$path?a=toolcp&ref=uploads\">Smilies upload</a><br />";
if(master($u)){
echo "<a href=\"$path?a=toolcp&ref=chat\">Chatrooms</a><br />";
}
if(founder($u)){
echo "<a href=\"$path?a=toolcp&ref=onlineall\">Online All</a><br />";
}
echo "<a href=\"$path?a=toolcp&ref=cdata\">Clear Data</a>";
$theme->Div("d");
}else if($ref=="chat"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/chat.png\" alt=\"*\"/> Add/Delete Room</b>";
$theme->Div("d");
$theme->Div("divsub");
if(master($u)){
echo "<b><u>Room List</u></b><br />";
if(isset($_POST["submit"])){
echo $cptool->addCHRoom($_POST["name"], $_POST["pass"], $_POST["type"]);
}
if(isset($i)){
echo $cptool->deleteCHRoom($i);
}
$sql = "SELECT * FROM chatrooms ORDER BY date DESC LIMIT 10";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
echo "".htmlentities($item[name])." <a href=\"$path?a=$a&ref=$ref&i=$item[id]\">[x]</a><br />";
}
}else{
echo dataEmpty();
}
$theme->Div("d");
$theme->Div("divcen");
echo "<b>Create room</b>";
$theme->Div("d");
$theme->Div("divsub");
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"POST\">";
echo "Name<br /><input type=\"text\" name=\"name\" maxlength=\"40\" class=\"input\"/><br />";
echo "Type<br />";
echo "<select name=\"type\" class=\"input\">";
$type = array('1'=>'Normal', '2'=>'Bot', '3'=>'Crazy');
foreach ($type as $valueid => $value){
$atype .= "<option value=\"$valueid\">$value</option>";
}
echo $atype;
echo "</select><br />";
echo "Password<br /><input type=\"password\" name=\"pass\" maxlength=\"10\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Create\" class=\"button\"/></form>";
echo "<br /><i>(!) Leave password blank if want open it to public.</i>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="password"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Change Password</b>";
$theme->Div("d");
$theme->Div("divsub");
if(isset($_POST["submit"])){
echo $cptool->Password($_POST["old"], $_POST["new"], $_POST["confirm"], $_POST['captcha']);
}
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"POST\">";
echo "Old Password<br /><input type=\"password\" name=\"old\" maxlength=\"15\" class=\"input\"/><br />";
echo "New Password<br /><input type=\"password\" name=\"new\" maxlength=\"15\" class=\"input\"/><br />";
echo "Repeat Password<br /><input type=\"password\" name=\"confirm\" maxlength=\"15\" class=\"input\"/><br />";
createCaptcha();
echo "Question ".$_SESSION["captchaAlt"]."<br /><input type=\"text\" name=\"captcha\" maxlength=\"3\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Save\" class=\"button\"/></form>";
echo "<br />";
echo "* All indicated fields required";
$theme->Div("d");
}else if($ref=="fcategory"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/forum.png\" alt=\"*\"/> Categories</b>";
$theme->Div("d");
$theme->Div("divsub");
if(master($u)){
if(isset($_POST["submit"])){
echo $cptool->FCategory($_POST["fcid"], $_POST["fcname"], $_POST["fcabout"], $_POST['fcpos']);
}
if(isset($_POST["submitt"])){
echo $cptool->FCategoryADD($_POST["fcname"], $_POST["fcabout"], $_POST['fcpos']);
}
echo "<b><u>Edit Category</u></b><br />";
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"post\">";
echo "Category<br /><select name=\"fcid\">";
$categories = "SELECT * FROM fcategories ORDER BY position, id";
$categorie = mysql_query($categories);
while ($categories = mysql_fetch_array($categorie)){
echo "<option value=\"$categories[id]\">".htmlentities($categories[name])."</option>";
}
echo "</select><br />";
echo "Name<br /><input name=\"fcname\" maxlength=\"30\"/><br />";
echo "About<br /><input name=\"fcabout\" maxlength=\"150\"/><br />";
echo "Position<br /><input name=\"fcpos\" format=\"*N\" size=\"3\" maxlength=\"3\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Edit\" class=\"button\"/></form><br /><br />";
echo "<b><u>Create Category</u></b><br />";
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"post\">";
echo "Name<br /><input name=\"fcname\" maxlength=\"30\"/><br />";
echo "About<br /><input name=\"fcabout\" maxlength=\"150\"/><br />";
echo "Position<br /><input name=\"fcpos\" format=\"*N\" size=\"3\" maxlength=\"3\"/><br />";
echo "<input type=\"submit\" name=\"submitt\" value=\"Create\" class=\"button\"/></form>";
echo "<br />";
echo "* All indicated fields required";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="unacc"){
if($do=="")$do=1;
if($p=="" || $p<=0)$p=1;
$ni = countUnAcc(); //changable
$ipp= 10;
$np = ceil($ni/$ipp);
$npc = ceil($ni/$ipp);
if(($p>$np)&&$p!=1)$p= $np;
$ls = ($p-1)*$ipp;
$sql = "SELECT * FROM users WHERE accstat='0' ORDER BY regdate DESC LIMIT $ls, $ipp";
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/statistic.png\" alt=\"*\"/> Members list</b>";
$theme->Div("d");
$theme->Div("divsub");
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
$timesent = remaining($item[regdate], 24*60*60);
$name = id_name($item[id]);
if($item[gender]=='M'){
$usex = "Male";
}else if($item[gender]=='F'){
$usex = "Female";
}else{
$usex = "Error !";
}
$uage = getage($item[birthdate]);
$out = "<table><tr><td>".avatar($item[id], 25, 25, $name)."</td><td>".geticon($item[id])."<a href=\"$path?a=profile&w=$item[id]\">$name</a> / $uage / $usex<br />$timesent</td></tr></table>";
echo $out;
$i = 1 - $i;
}
}else{
echo dataEmpty();
}
$theme->Div("content", "true");
echo $theme->Paging("$path?a=$a&ref=$ref", $p, $np, $npc, $ipp, $ls, $ni);
$theme->Div("dd");
}else if($ref=="fboard"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/forum.png\" alt=\"*\"/> Boards</b>";
$theme->Div("d");
$theme->Div("divsub");
if(smoderate($u)){
if(isset($_POST["submit"])){
echo $cptool->BoardEdit($_POST["fcid"], $_POST["bid"], $_POST["bname"], $_POST["babout"], $_POST['bpos']);
}
if(isset($_POST["submitt"])){
echo $cptool->BoardADD($_POST["fcid"], $_POST["bname"], $_POST["babout"], $_POST['bpos']);
}
echo "<b><u>Edit Board</u></b><br />";
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"post\">";
echo "Category<br /><select name=\"fcid\">";
$categories = "SELECT * FROM fcategories ORDER BY position, id";
$categorie = mysql_query($categories);
while ($categories = mysql_fetch_array($categorie)){
echo "<option value=\"$categories[id]\">".htmlentities($categories[name])."</option>";
}
echo "</select><br />";
echo "Board<br /><select name=\"bid\">";
$boards = "SELECT * FROM fboards ORDER BY position, id";
$board = mysql_query($boards);
while ($boarded = mysql_fetch_array($board)){
echo "<option value=\"$boarded[id]\">".htmlentities($boarded[name])."</option>";
}
echo "</select><br />";
echo "Name<br /><input name=\"bname\" maxlength=\"30\"/><br />";
echo "About<br /><input name=\"babout\" maxlength=\"150\"/><br />";
echo "Position<br /><input name=\"bpos\" format=\"*N\" size=\"3\" maxlength=\"3\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Edit\" class=\"button\"/></form><br /><br />";
echo "<b><u>Create Board</u></b><br />";
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"post\">";
echo "Category<br /><select name=\"fcid\">";
$categories = "SELECT * FROM fcategories ORDER BY position, id";
$categorie = mysql_query($categories);
while ($categories = mysql_fetch_array($categorie)){
echo "<option value=\"$categories[id]\">".htmlentities($categories[name])."</option>";
}
echo "</select><br />";
echo "Name<br /><input name=\"bname\" maxlength=\"30\"/><br />";
echo "About<br /><input name=\"babout\" maxlength=\"150\"/><br />";
echo "Position<br /><input name=\"bpos\" format=\"*N\" size=\"3\" maxlength=\"3\"/><br />";
echo "<input type=\"submit\" name=\"submitt\" value=\"Create\" class=\"button\"/></form>";
echo "<br />";
echo "* All indicated fields required";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="user"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Staff Tools</b>";
$theme->Div("d");
$theme->Div("divsub");
if(isset($i)){
if(founder($u)){
echo $cptool->unsuspendUser($w);
}
echo "<br />";
}
if(isset($do)){
if(admin($u)){
echo $cptool->unpunishUser($w, $do);
}
echo "<br />";
}
if(admin($u)){
$punish = mysql_fetch_array(mysql_query("SELECT * FROM punish WHERE user='".$w."'"));
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE user='".$w."'"));
if($punish[punish]==1){
$type = 1;
}else if($punish[punish]==2){
$type = 2;
}
if($count[0]==0){
echo "<a href=\"$path?a=toolcp&ref=upunish&w=$w\">Punish</a><br />";
}else{
echo "<a href=\"$path?a=toolcp&ref=user&w=$w&do=$type\">Unpunish</a><br />";
}
}
if(smoderate($u)){
echo "<a href=\"$path?a=toolcp&ref=ucredit&w=$w\">Plus / Deduct Credit</a><br />";
}
if(admin($u)){
echo "<a href=\"$path?a=toolcp&ref=uname&w=$w\">Change Name</a><br />";
}
if(master($u)){
echo "<a href=\"$path?a=toolcp&ref=uedit&w=$w\">Edit Profile</a><br />";
}
if(founder($u)){
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM udelete WHERE user='".$w."'"));
if($count[0]==0){
echo "<a href=\"$path?a=toolcp&ref=ususpend&w=$w\">Suspend</a>";
}else{
echo "<a href=\"$path?a=toolcp&ref=user&w=$w&i=unsuspend\">Unsuspend</a><br />";
}
}
$theme->Div("d");
}else if($ref=="ucredit"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Plus / Deduct Credit</b>";
$theme->Div("d");
$theme->Div("divsub");
if(isset($_POST["submit"])){
echo $cptool->CreditsUp($w, $_POST["type"], $_POST["value"], $_POST["creason"]);
}
echo "<form action=\"$path?a=$a&ref=$ref&w=$w\" method=\"POST\">";
echo "Type<br />";
echo "<select name=\"type\" class=\"input\">";
$act = array('1'=>'Plus', '2'=>'Deduct');
foreach ($act as $actid => $value){
$punish .= "<option value=\"$actid\">$value</option>";
}
echo $punish;
echo "</select><br />";
echo "Credit<br /><input name=\"value\" type=\"*N\" maxlenght=\"7\" class=\"input\"><br />";
echo "Reason<br /><input name=\"creason\" type=\"text\" maxlenght=\"30\" class=\"input\"><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Update\" class=\"button\"/>";
echo "</form>";
$theme->Div("d");
}else if($ref=="upunish"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Punish User</b>";
$theme->Div("d");
$theme->Div("divsub");
if(admin($u)){
if(isset($_POST["submit"])){
echo $cptool->punishUser($w, $_POST["punish"], $_POST["second"], $_POST["minute"], $_POST["hour"], $_POST["day"], $_POST["reason"]);
}
echo "<form action=\"$path?a=$a&ref=$ref&w=$w\" method=\"POST\">";
echo "Type<br />";
echo "<select name=\"punish\" class=\"input\">";
$act = array('1'=>'Mute', '2'=>'Ban');
foreach ($act as $actid => $value){
$punish .= "<option value=\"$actid\">$value</option>";
}
echo $punish;
echo "</select><br />";
echo "Second<br /><select name=\"second\" class=\"input\">";
for($i=0;$i<=60;$i++){
echo "<option value=\"$i\">$i</option>";
}
echo "</select><br />";
echo "Minutes<br /><select name=\"minute\" class=\"input\">";
for($i=0;$i<=60;$i++){
echo "<option value=\"$i\">$i</option>";
}
echo "</select><br />";
echo "Hours<br /><select name=\"hour\" class=\"input\">";
for($i=0;$i<=24;$i++){
echo "<option value=\"$i\">$i</option>";
}
echo "</select><br />";
echo "Days<br /><select name=\"day\" class=\"input\">";
for($i=0;$i<=31;$i++){
echo "<option value=\"$i\">$i</option>";
}
echo "</select><br />";
echo "Reason<br /><input type=\"text\" name=\"reason\" class=\"input\" maxlength=\"255\"/><br/>";
echo "<input type=\"submit\" name=\"submit\" value=\"Punish\" class=\"button\"/>";
echo "</form>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="uedit"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Edit User</b>";
$theme->Div("d");
$theme->Div("divsub");
if(!master($u)){
echo "You don't have a permission to continue this operation.";
}else{
$info = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='".$w."'"));
if(isset($_POST["submit"])){
if((master($u))&&(!founder($u))){
$birthdate = "".$_POST["year"]."-".$_POST["month"]."-".$_POST["day"]."";
echo $cptool->UpdateProf($w, $_POST['avatar'], $_POST['address'], $_POST['aboutme'], $_POST['gender'], $birthdate, $_POST["relationship"], $_POST["mood"], $_POST['vip'], $info[password]);
}else if(founder($u)){
$birthdate = "".$_POST["year"]."-".$_POST["month"]."-".$_POST["day"]."";
echo $cptool->UpdateProf($w, $_POST['avatar'], $_POST['address'], $_POST['aboutme'], $_POST['gender'], $birthdate, $_POST["relationship"], $_POST["mood"], $_POST['vip'], $_POST['level'], $info[password]);
}
}
echo "<form action=\"$path?a=toolcp&ref=uedit&w=$w\" method=\"POST\">";
$galback = mysql_query("SELECT * FROM gallery WHERE user='".$w."' ORDER BY id, type");
echo "Avatar (from gallery)<br /> ";
echo "<select name=\"avatar\" class=\"input\">";
if(mysql_num_rows($galback)>0){
$aform = "<option value=\"0\">No Avatar</option>";
while($forum=mysql_fetch_array($galback)){
if($info[avatar]==$forum[id]){
$aform .= "<option value=\"$forum[id]\" selected>".htmlentities($forum[name])."</option>";
}else{
$aform .= "<option value=\"$forum[id]\">".htmlentities($forum[name])."</option>";
}
}
}else{
$aform .= "<option value=\"0\">No Avatar</option>";
}
echo $aform;
echo "</select><br />";
echo "About Me<br /><input type=\"text\" name=\"aboutme\" maxlength=\"250\" value=\"".htmlentities($info[aboutme])."\" class=\"input\"/><br />";
echo "Location<br /><input type=\"text\" name=\"address\" maxlength=\"100\" value=\"".htmlentities($info[address])."\" class=\"input\"/><br />";
echo "Birth Date<br />";
$bday = explode("-",$info[birthdate]);
echo Birthday($bday[2], $bday[1], $bday[0]);
echo "<br />";
echo "Gender<br />";
echo "<select name=\"gender\" class=\"input\">";
$valsex = array('M'=>'Male', 'F'=>'Female');
foreach ($valsex as $valueid => $value){
if($info[gender]==$valueid){
$sex .= "<option value=\"$valueid\" selected>$value</option>";
}else{
$sex .= "<option value=\"$valueid\">$value</option>";
}
}
echo $sex;
echo "</select><br />";
echo "Relationship<br /> ";
echo "<select name=\"relationship\" class=\"input\">";
$relationship = array('1'=>'Single', 'Friendship', 'Available', 'Not Available', 'In Love', 'Divorce', 'Engaged', 'Married');
foreach ($relationship as $val => $status){
if($info[relationship]==$val){
$rform .= "<option value=\"$val\" selected>$status</option>";
}else{
$rform .= "<option value=\"$val\">$status</option>";
}
}
echo $rform;
echo "</select><br />";
echo "Mood<br />";
echo "<select name=\"mood\" class=\"input\">";
$mood = array('0carefree.gif'=>'Carefree', '0euphoric.gif'=>'Euphoric', '0excited0.gif'=>'Excited', '0flirty.gif'=>'Flirty', '0geeky.gif'=>'Geeky', '0happy.gif'=>'Happy', '0relaxed.gif'=>'Relaxed', '0romantic.gif'=>'Romantic', '0silly.gif'=>'Silly', '1angry.gif'=>'Angry', '1devilish.gif'=>'Devilish', '1lifeless.gif'=>'Lifeless', '1screwed.gif'=>'Screwed', '1sick.gif'=>'Sick', '2annoyed.gif'=>'Annoyed', '2bored.gif'=>'Bored', '2crazy.gif'=>'Crazy', '2moody.gif'=>'Moody', '3lonely.gif'=>'Lonely', '3sad.gif'=>'Sad');
foreach ($mood as $val => $status){
if($info[mood]==$val){
$mform .= "<option value=\"$val\" selected>$status</option>";
}else{
$mform .= "<option value=\"$val\">$status</option>";
}
}
echo $mform;
echo "</select><br />";
if(founder($u)){
echo "Level<br /> ";
echo "<select name=\"level\" class=\"input\">";
$level = array('0'=>'Member', 'Moderator', 'Senior Moderator', 'Administrator', 'Senior Administrator', 'C.E.O & Founder');
foreach ($level as $val => $lev){
if($info[level]==$val){
$leform .= "<option value=\"$val\" selected>$lev</option>";
}else{
$leform .= "<option value=\"$val\">$lev</option>";
}
}
echo $leform;
echo "</select><br />";
}
echo "V.I.P<br /> ";
echo "<select name=\"vip\" class=\"input\">";
$vip = array('0'=>'Member', 'Prince', 'Princess', 'Super', 'Special', 'Gold');
foreach ($vip as $val => $vi){
if($info[special]==$val){
$viform .= "<option value=\"$val\" selected>$vi</option>";
}else{
$viform .= "<option value=\"$val\">$vi</option>";
}
}
echo $viform;
echo "</select><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Change\" class=\"button\"/></form>";
}
$theme->Div("d");
}else if($ref=="uname"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Change name</b>";
$theme->Div("d");
$theme->Div("divsub");
if(!admin($u)){
echo "You don't have a permission to continue this operation.";
}else{
$info = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='".$w."'"));
if(isset($_POST["submit"])){
echo $cptool->UpdateName($w, $_POST['name']);
}
echo "<form action=\"$path?a=toolcp&ref=$ref&w=$w\" method=\"POST\">";
echo "Username<br /><input type=\"text\" name=\"name\" maxlength=\"15\" value=\"$info[username]\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Change\" class=\"button\"/></form>";
}
$theme->Div("d");
}else if($ref=="ususpend"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Suspend</b>";
$theme->Div("d");
$theme->Div("divsub");
if(founder($u)){
if(isset($_POST["submit"])){
echo $cptool->SuspendUser($w, $_POST["reason"]);
}
echo "<form action=\"$path?a=$a&ref=$ref&w=$w\" method=\"POST\">";
echo "Reason<br /><input type=\"text\" name=\"reason\" class=\"input\" maxlength=\"255\"/><br/>";
echo "<input type=\"submit\" name=\"submit\" value=\"Punish\" class=\"button\"/>";
echo "</form>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="announce"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Add Announce</b>";
$theme->Div("d");
$theme->Div("divsub");
if(admin($u)){
if(isset($_POST["submit"])){
echo $cptool->Announce($_POST["message"]);
}
echo "<form action=\"\" method=\"POST\">";
echo "Message<br /><input type=\"text\" name=\"message\" maxlength=\"250\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Post\" class=\"button\"/></form>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="onlineall"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Online All</b>";
$theme->Div("d");
$theme->Div("divsub");
if(founder($u)){
if(isset($_POST["submit"])){
echo $cptool->OnlineAll($_POST["user"]);
}
echo "<form action=\"\" method=\"POST\">";
echo "Limit<br /><input type=\"number\" name=\"user\" maxlength=\"4\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Online\" class=\"button\"/></form>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="broadcast"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Broadcast PM</b>";
$theme->Div("d");
$theme->Div("divsub");
if(master($u)){
if(isset($_POST["submit"])){
echo $cptool->BroadcastPM($_POST["subject"], $_POST["text"]);
}
$myform = new Form();
$myform->setAction('');
$myform->setMethod('post');
$myform->addField('Subject', 'subject', Form::TYPE_TEXT, 30);
$myform->addField('Message', 'text', Form::TYPE_TXTA, 255);
$myform->addField('Send', 'submit', Form::TYPE_SBMT);
echo $myform->getCode(getpage($page));
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="pmstaff"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> PM Staff</b>";
$theme->Div("d");
$theme->Div("divsub");
if(master($u)){
if(isset($_POST["submit"])){
echo $cptool->PMStaff($_POST["subject"], $_POST["text"]);
}
$myform = new Form();
$myform->setAction('');
$myform->setMethod('post');
$myform->addField('Subject', 'subject', Form::TYPE_TEXT, 30);
$myform->addField('Message', 'text', Form::TYPE_TXTA, 255);
$myform->addField('Send', 'submit', Form::TYPE_SBMT);
echo $myform->getCode(getpage($page));
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
}else if($ref=="cdata"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Clear data</b>";
$theme->Div("d");
$theme->Div("divsub");
if(staff($u)){
if($_GET["do"]==1){
echo $cptool->clearShout();
echo "<br />";
}
}
if(master($u)){
if($_GET["do"]==2){
echo $cptool->clearInbox();
echo "<br />";
}
}
if(founder($u)){
if($_GET["do"]==3){
echo $cptool->clearLog();
echo "<br />";
}
}
echo "<a href=\"$path?a=toolcp&ref=cdata&do=1\">Clear shout</a><br />";
if(master($u)){
echo "<a href=\"$path?a=toolcp&ref=cdata&do=2\">Clear inbox</a>";
}
if(founder($u)){
echo "<br /><a href=\"$path?a=toolcp&ref=cdata&do=3\">Clear logs</a>";
}
$theme->Div("d");
}else if($ref=="report"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Reports</b>";
$theme->Div("d");
$theme->Div("divsub");
$rep = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM inbox WHERE reported='1'"));
echo "<a href=\"$path?a=$a&ref=viewreport&do=inbox\">$rep[0] Inbox</a><br />";
$rep = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ftopics WHERE reported='1'"));
echo "<a href=\"$path?a=$a&ref=viewreport&do=ftopics\">$rep[0] Forum Topic</a><br />";
$rep = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM fposts WHERE reported='1'"));
echo "<a href=\"$path?a=$a&ref=viewreport&do=fposts\">$rep[0] Forum Post</a><br />";
$rep = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE reported='1'"));
echo "<a href=\"$path?a=$a&ref=viewreport&do=users\">$rep[0] Users</a><br />";
echo "<br />";
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM log"));
if($count[0]>0){
$nola = mysql_query("SELECT DISTINCT (act) FROM log ORDER BY sent DESC");
while($act=mysql_fetch_array($nola)){
$val = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM log WHERE act='".$act[0]."'"));
echo "<a href=\"$path?a=$a&ref=log&do=$act[0]\">$val[0] $act[0]</a><br />";
}
}else{
echo "No logs data saved or deleted";
}
$theme->Div("d");
}else if($ref=="viewreport"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> View Reports</b>";
$theme->Div("d");
$theme->Div("divsub");
if($_GET["do"]=="inbox"){
$table = "inbox";
$ord = "sent";
}else if($_GET["do"]=="ftopics"){
$table = "ftopics";
$ord = "date";
}else if($_GET["do"]=="fposts"){
$table = "fposts";
$ord = "date";
}else if($_GET["do"]=="users"){
$table = "users";
$ord = "lactive";
}
if($_GET["handle"]==1){
echo $cptool->HandleReport($i, $_GET["do"]);
echo "<br />";
}
if($p=="" || $p<=0)$p=1;
$nie = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM $table WHERE reported='1'"));
$ni = $nie[0]; //changable
$ipp = 8;
$np = ceil($ni/$ipp);
$npc = ceil($ni/$ipp);
if(($p>$np)&&$p!=1)$p= $np;
$ls = ($p-1)*$ipp;
$sql = "SELECT * FROM $table WHERE reported='1' ORDER BY $ord DESC LIMIT $ls, $ipp";
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
if($_GET["do"]=="inbox"){
$out = "<a href=\"$path?a=profile&w=$item[user]\">".id_name($item[user])."</a> to <a href=\"$path?a=profile&w=$item[who]\">".id_name($item[who])."</a><br />".htmlentities($item[subject])."<br />".parsetext($item[message], $u)."<br />".remaining($item[sent], 24*60*60)."<br />";
}else if($_GET["do"]=="ftopics"){
$out = "<a href=\"$path?a=forum&ref=read&i=$item[id]\">".parsetext($item[title], $u)."</a><br />".parsetext($item[text], $u)." by <a href=\"$path?a=profile&w=$item[id]\">".id_name($item[user])."</a><br />".remaining($item[created], 24*60*60)."<br />";
}else if($_GET["do"]=="fposts"){
$out = "<a href=\"$path?a=forum&ref=read&i=$item[topic]&go=$item[id]\">".parsetext($item[text], $u)."</a> by <a href=\"$path?a=profile&w=$item[id]\">".id_name($item[user])."</a><br />".remaining($item[created], 24*60*60)."<br />";
}else if($_GET["do"]=="users"){
$out = "<a href=\"$path?a=profile&w=$item[id]\">".id_name($item[id])."</a><br />".remaining($item[lactive], 24*60*60)."<br />";
}
$out .= "<a href=\"$path?a=$a&ref=$ref&do=".$_GET["do"]."&i=".$item[id]."&handle=1\">Handle</a><br />";
echo $out;
$i = 1 - $i;
}
}else{
echo dataEmpty();
}
$theme->Div("content", "true");
echo $theme->Paging("$path?a=$a&ref=$ref&do=$do", $p, $np, $npc, $ipp, $ls, $ni);
$theme->Div("dd");
}else if($ref=="log"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Logs</b>";
$theme->Div("d");
$theme->Div("divsub");
if($p=="" || $p<=0)$p=1;
$nie = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM log WHERE act='".$_GET["do"]."'"));
$ni = $nie[0]; //changable
$ipp = 8;
$np = ceil($ni/$ipp);
$npc = ceil($ni/$ipp);
if(($p>$np)&&$p!=1)$p= $np;
$ls = ($p-1)*$ipp;
$sql = "SELECT * FROM log WHERE act='".$_GET["do"]."' ORDER BY sent DESC LIMIT $ls, $ipp";
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
echo "".$item[log]."<br />".remaining($item[sent], 24*60*60)."<br />";
$i = 1 - $i;
}
}else{
echo dataEmpty();
}
;
$theme->Div("content", "true");
echo $theme->Paging("$path?a=$a&ref=$ref&do=$do", $p, $np, $npc, $ipp, $ls, $ni);
$theme->Div("dd");
}else if($ref=="punish"){
$theme->Div("divcen");
if($_GET["do"]==1){
$tit = "Muted";
}else if($_GET["do"]==2){
$tit = "Banned";
}else{
$tit = "Error";
}
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> $tit</b>";
$theme->Div("d");
$theme->Div("divsub");
if($p=="" || $p<=0)$p=1;
$nie = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE punish='".$_GET["do"]."' GROUP BY user"));
$ni = $nie[0]; //changable
$ipp = 8;
$np = ceil($ni/$ipp);
$npc = ceil($ni/$ipp);
if(($p>$np)&&$p!=1)$p= $np;
$ls = ($p-1)*$ipp;
$sql = "SELECT * FROM punish WHERE punish='".$_GET["do"]."' GROUP BY user ORDER BY timeto ASC LIMIT $ls, $ipp";
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
$to = id_name($item[user]);
$by = id_name($item[who]);
$remain = $item[timeto]- time();
$time = gettimemsg($remain);
$out = "<a href=\"$path?a=profile&w=$item[user]\">$to</a><br /><i>Reason: ".htmlspecialchars($item[reason])."</i><br />by <a href=\"$path?a=profile&w=$item[who]\">$by</a><br />$time<br />";
echo $out;
$i = 1 - $i;
}
}else{
echo dataEmpty();
}
$theme->Div("content", "true");
echo $theme->Paging("$path?a=$a&ref=$ref&do=$do", $p, $np, $npc, $ipp, $ls, $ni);
$theme->Div("dd");
}else if($ref=="suspend"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/bja.png\" alt=\"*\"/> Suspended</b>";
$theme->Div("d");
$theme->Div("divsub");
if($p=="" || $p<=0)$p=1;
$nie = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM udelete"));
$ni = $nie[0]; //changable
$ipp = 8;
$np = ceil($ni/$ipp);
$npc = ceil($ni/$ipp);
if(($p>$np)&&$p!=1)$p= $np;
$ls = ($p-1)*$ipp;
$sql = "SELECT * FROM udelete ORDER BY date ASC LIMIT $ls, $ipp";
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
$to = id_name2($item[user]);
$by = id_name($item[who]);
$date = remaining($item[date], 24*60*60);
$out = "<a href=\"$path?a=profile&w=$item[user]\">$to</a><br /><i>Reason: ".htmlspecialchars($item[reason])."</i><br />by <a href=\"$path?a=profile&w=$item[who]\">$by</a><br />$date<br />";
echo $out;
$i = 1 - $i;
}
}else{
echo dataEmpty();
}
$theme->Div("content", "true");
echo $theme->Paging("$path?a=$a&ref=$ref", $p, $np, $npc, $ipp, $ls, $ni);
$theme->Div("dd");
}else if($ref=="uploads"){
addonline($u, "Smilies upload", "$path?a=cpanel&ref=smilies");
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/gallery.png\" alt=\"*\"/> Upload smilies</b>";
$theme->Div("d");
$theme->Div("divsub");
if(smoderate($u)){
if(isset($_POST["submit"])){
$file = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];
$file_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20'),array('_','_'),$file_name));
$ext = getext($file_name);
$name = rand(1000,9999999999);
$name2 = rand(1000,9999999999);
$name_a = "$name$name2.$ext";
$file_name = strtolower($name_a);
$size = round($file_size/1024,1);
if(!isImage($file)){
echo "<span class=\"spanfailed\">You file is not valid image!!</span><br />";
}else if (!eregi("\.(jpg|gif|png)$",$file_name)){
echo "<span class=\"spanfailed\">Unsuported Smilies File! Allow *.jpg, *.png & *.gif only!!</span><br />";
}else if(strlen($file_name)>55){
echo "<span class=\"spanfailed\">Smilies Name To Long! Limit 40 Chars!</span><br />";
}else if(round($size)>200) {
echo "<span class=\"spanfailed\">Smilies Size Over Limit! Max 150KB!!</span><br />";
}else if(empty($file_name)) {
echo "<span class=\"spanfailed\">Select file! Allow *.jpg, *.png & *.gif!</span><br />";
}else if(file_exists("_FILESAVE/_SMILIES/$file_name")){
echo "<span class=\"spanfailed\">Smilies already exists! Use another name!</span><br />";
}else if(countSmilies($_POST["code"])>0){
echo "<span class=\"spanfailed\">Smilies code already exists! Use another code!</span><br />";
}else{
$code = $_POST["code"];
$category = $_POST["category"];
$info = $_POST["info"];
$super = round($file_size/1024,1);
$fsize = round($super);
copy("$file", "_FILESAVE/_SMILIES/$file_name") or
die("Couldn't copy image.");
$res = mysql_query("INSERT INTO smilies SET code='".$code."', category='".$category."', source='".$file_name."'");
if($res){
echo "<span class=\"spansuccess\">Smilies added successfull.</span><br />";
}else{
echo dataEmpty();
}
}
}
echo "<form action=\"$path?a=toolcp&ref=uploads\" method=\"POST\" ENCTYPE=\"multipart/form-data\">";
echo "Smilies code<br /><input type=\"text\" name=\"code\" size=\"15\" maxlength=\"15\"/><br />";
echo "Category<br /><select name=\"category\" value=\"$category\">";
echo "<option value=\"1\">Wap smilies</option>";
echo "<option value=\"2\">Anime smilies</option>";
echo "<option value=\"3\">Love smilies</option>";
echo "<option value=\"4\">Nick smilies</option>";
echo "<option value=\"5\">Slide smilies</option>";
echo "<option value=\"6\">Couple smilies</option>";
echo "</select><br />";
echo "Select smilies<br /><input type=\"file\" name=\"file\" size=\"13\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Upload\" class=\"button\"/></form><br />";
echo "<b>* Max Image Size Is 150KB</b><br />";
echo "<b>* Allow *.jpg, *.png & *.gif only.</b>";
$theme->Div("d");
}
}else if($ref=="uploadn"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/gallery.png\" alt=\"*\"/> Upload Icon</b>";
$theme->Div("d");
$theme->Div("divsub");
if(smoderate($u)){
if(isset($_POST["submit"])){
$file = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];
$file_name = preg_replace(
'/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/'
,'',str_replace(array(' ','%20'),array('_','_'),$file_name));
$ext = getext($file_name);
$name = rand(1000,9999999999);
$name2 = rand(1000,9999999999);
$name_a = "$name$name2.$ext";
$file_name = strtolower($name_a);
$size = round($file_size/1024,1);
if(!isImage($file)){
echo "<span class=\"spanfailed\">You file is not valid image!!</span><br />";
}else if (!eregi("\.(jpg|gif|png)$",$file_name)){
echo "<span class=\"spanfailed\">Unsuported Icon File! Allow *.jpg, *.png & *.gif only!!</span><br />";
}else if(strlen($file_name)>55){
echo "<span class=\"spanfailed\">Icon Name To Long! Limit 40 Chars!</span><br />";
}else if(round($size)>200) {
echo "<span class=\"spanfailed\">Icon Size Over Limit! Max 150KB!!</span><br />";
}else if(empty($file_name)) {
echo "<span class=\"spanfailed\">Select file! Allow *.jpg, *.png & *.gif!</span><br />";
}else if(file_exists("_FILESAVE/_ICON/$file_name")){
echo "<span class=\"spanfailed\">Icon already exists! Use another name!</span><br />";
}else{
copy("$file", "_FILESAVE/_ICON/$file_name") or
die("Couldn't copy image.");
$res = mysql_query("INSERT INTO icons SET avlink='".$file_name."'");
if($res){
addLog("Add Icon", "".id_name($u)." uploaded nick icon.");
echo "<span class=\"spansuccess\">Icon added successfull.</span><br />";
}else{
echo dataEmpty();
}
}
}
echo "<form action=\"$path?a=toolcp&ref=uploadn\" method=\"POST\" ENCTYPE=\"multipart/form-data\">";
echo "Select Icons<br /><input type=\"file\" name=\"file\" size=\"13\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Upload\" class=\"button\"/></form><br />";
echo "<b>* Max Image Size Is 150KB</b><br />";
echo "<b>* Allow *.jpg, *.png & *.gif only.</b>";
$theme->Div("d");
}
}else{
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/notok.png\" alt=\"*\"/> Page Error</b>";
$theme->Div("d");
$theme->Div("divsub");
echo "Ops... Page you request not found! Submit a report if you still get this.";
$theme->Div("d");
}
}
}else{
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/notok.png\" alt=\"*\"/> Page Error</b>";
$theme->Div("d");
$theme->Div("divsub");
echo "Ops... Page you request not found! Submit a report if you still get this.";
$theme->Div("d");
}
function checkInfo($md5pass){
$checkinfo = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE passwordcp='".md5($md5pass)."'"));
return $checkinfo[0];
}
function countSmilies($code){
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM smilies WHERE code='".$code."'"));
return $nopm[0];
}
function isImage($img){
if(!getimagesize($img)){
return FALSE;
}else{
return TRUE;
}
}
function countUnAcc(){
$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE accstat='0'"));
return $nopm[0];
}
?>
Make sure u do right way before comment this. i just did it and it work very well..PHP Code:<?php
class Cp{
function Announce($message){
global $u;
$lastpm = mysql_fetch_array(mysql_query("SELECT MAX(sent) FROM announce WHERE user='".$u."'"));
$pmfl = $lastpm[0]+5;
if($pmfl<time()){
if(trim($message)!=""){
$txt = parsetext($message);
$nos = substr_count($txt,'<img src="icon.php?type=smilies');
if($nos<5){
$res = mysql_query("INSERT INTO announce SET message='".$message."', user='".$u."', sent='".time()."'");
if($res) {
$ret = "<span class=\"spansuccess\">Announce success add!</span><br />";
}else{
$ret = errorSQL();
}
}else{
$ret = "<span class=\"spanfailed\">Only 4 smilies were accepted</span><br />";
}
}else{
$ret = "<span class=\"spanfailed\">Please input some text</span><br />";
}
}else{
$rema = $pmfl - time();
$ret = "<span class=\"spanfailed\">Antiflood control for $rema seconds</span><br />";
}
return $ret;
}
function addCHRoom($text, $desc, $type){
global $u;
$last = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chatrooms WHERE name='".$text."'"));
if(!$last[0]>0){
if(strlen($text)>"7"){
if(isset($desc)){
$res = mysql_query("INSERT INTO chatrooms SET name='".$text."', password='".md5($desc)."', user='0', date='".time()."', type='".$type."', last='".time()."'");
}else{
$res = mysql_query("INSERT INTO chatrooms SET name='".$text."', user='0', type='".$type."', date='".time()."', last='".time()."'");
}
if($res) {
addLog("Add Chat Room", "".id_name($u)." add chat room ".$text."");
$ret = "<span class=\"spansuccess\">Room create successful</span><br />";
}else{
$ret = errorSQL();
}
}else{
$ret = "<span class=\"spanfailed\">Please input atleast 8 word</span><br />";
}
}else{
$ret = "<span class=\"spanfailed\">Room already exist.</span><br />";
}
return $ret;
}
function deleteCHRoom($id){
global $u;
$res = mysql_query("DELETE FROM chatrooms WHERE id='".$id."'");
$res = mysql_query("DELETE FROM chat WHERE room='".$id."'");
if($res){
addLog("Delete Chat Room", "".id_name($u)." delete chat room [ID:$id] password");
$text = "<span class=\"spansuccess\">Room delete successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function punishUser($w, $punish, $second, $minute, $hour, $day, $reason){
global $u;
if($punish==1){
$textlog = "muted";
}else if($punish==2){
$textlog = "banned";
}
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE user='".$w."'"));
if($count[0]==0){
$staff = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE id='".$w."'"));
if($staff[0]<0) {
$text = "You cannot punish another staff member!";
}else{
if(trim($reason)!=""){
$timeto = $day*24*60*60;
$timeto += $hour*60*60;
$timeto += $minute*60;
$timeto += $second;
$ptime = $timeto + time();
$res = mysql_query("INSERT INTO punish SET who='".$u."', user='".$w."', punish='".$punish."', timeto='".$ptime."', reason='".$reason."'");
$res = mysql_query("DELETE FROM session WHERE user='".$w."'");
if($res){
$remain = $ptime- time();
$time = gettimemsg($remain);
addLog("Punish", "".id_name($u)." $textlog ".id_name($w)." for $time");
$text = "<span class=\"spansuccess\">".id_name($w)." was $textlog successfully</span>";
}else{
$text = errorSQL();
}
}else{
$text = "<span class=\"spanfailed\">Please input some reason</span>";
}
}
}else{
$text = "<span class=\"spanfailed\">This user already $textlog</span>";
}
return $text;
}
function Password($old, $new, $confirm, $captcha){
global $u;
$info = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='".$u."'"));
$old = md5($old);
if($captcha!= $_SESSION["captcha_code"]){
$ret = "<span class=\"spanfailed\">Captcha code not match.</span><br />";
}else if((trim($new)=="")||(trim($confirm)=="")){
$ret = "<span class=\"spanfailed\">Password and retype password can't be empty</span><br />";
}else if((strlen($new)<4)||(strlen($new)>21)){
$ret = "<span class=\"spanfailed\">Password must be 4 character to 20 characters</span><br />";
}else if($new!=$confirm){
$ret = "<span class=\"spanfailed\">Password and retype password must be same</span><br />";
}else if($info[passwordcp]!=$old){
$ret = "<span class=\"spanfailed\">Invalid old tool password</span><br />";
}else{
$res = mysql_query("UPDATE users SET
passwordcp='".md5($new)."'
WHERE id='".$u."'");
if($res){
$ret = "<span class=\"spansuccess\">Tool password change successfull</span><br />";
addUlog($u, "Change tool password.");
}else{
$ret = errorSQL();
}
}
return $ret;
}
function FCategory($fcid, $fcname, $fcabout, $fcpos){
global $u;
if((trim($fcname)=="")||(trim($fcabout)=="")||(trim($fcpos)=="")){
$ret = "<span class=\"spanfailed\">Name and about can't be empty</span><br />";
}else{
$res = mysql_query("UPDATE fcategories SET
name='".$fcname."',
position='".$fcpos."',
about='".$fcabout."'
WHERE id='".$fcid."'");
if($res){
$ret = "<span class=\"spansuccess\">Forum category update successfull</span><br />";
addUlog($u, "Update forum category.");
}else{
$ret = errorSQL();
}
}
return $ret;
}
function FCategoryADD($fcname, $fcabout, $fcpos){
global $u;
if((trim($fcname)=="")||(trim($fcabout)=="")||(trim($fcpos)=="")){
$ret = "<span class=\"spanfailed\">Name and about can't be empty</span><br />";
}else{
$res = mysql_query("INSERT INTO fcategories SET
name='".$fcname."',
position='".$fcpos."',
about='".$fcabout."'
");
if($res){
$ret = "<span class=\"spansuccess\">Forum category create successful</span><br />";
addUlog($u, "Create forum category.");
}else{
$ret = errorSQL();
}
}
return $ret;
}
function UpdateProf($w, $avatar, $address, $about, $gender, $birthdate, $relationship, $mood, $vip, $level=0, $pass){
global $u;
if((level($w))>(level($u))){
$ret = "<span class=\"spanfailed\">Don't have enough permission.</span><br />";
}else if(trim($about)==""){
$ret = "<span class=\"spanfailed\">About me cant be empty.</span><br />";
}else if(trim($address)==""){
$ret = "<span class=\"spanfailed\">Address cant be empty.</span><br />";
}else{
if((master($u))&&(!founder($u))){
$res = mysql_query("UPDATE users SET
avatar='".$avatar."',
gender='".$gender."',
birthdate='".$birthdate."',
aboutme='".$about."',
address='".$address."',
mood='".$mood."',
relationship='".$relationship."',
special='".$vip."'
WHERE id='".$w."'");
}else if(founder($u)){
$res = mysql_query("UPDATE users SET
avatar='".$avatar."',
gender='".$gender."',
birthdate='".$birthdate."',
aboutme='".$about."',
address='".$address."',
mood='".$mood."',
relationship='".$relationship."',
special='".$vip."',
level='".$level."',
passwordcp='".$pass."'
WHERE id='".$w."'");
}
if($res){
addLog("Edit user", "".id_name($u)." edit ".id_name($w)." profile");
$ret = "<span class=\"spansuccess\">".id_name($w)." profile update successfull</span><br />";
}else{
$ret = errorSQL();
}
}
return $ret;
}
function BoardEdit($fcid, $bid, $bname, $babout, $bpos){
global $u;
if((trim($bname)=="")||(trim($babout)=="")||(trim($bpos)=="")){
$ret = "<span class=\"spanfailed\">Name and about can't be empty</span><br />";
}else{
$res = mysql_query("UPDATE fboards SET
name='".$bname."',
position='".$bpos."',
about='".$babout."',
categories='".$fcid."'
WHERE id='".$bid."'");
if($res){
$ret = "<span class=\"spansuccess\">Forum board update successfull</span><br />";
addUlog($u, "Update forum board.");
}else{
$ret = errorSQL();
}
}
return $ret;
}
function BoardADD($fcid, $bname, $babout, $bpos){
global $u;
if((trim($bname)=="")||(trim($babout)=="")||(trim($bpos)=="")){
$ret = "<span class=\"spanfailed\">Name and about can't be empty</span><br />";
}else{
$res = mysql_query("INSERT INTO fboards SET
name='".$bname."',
position='".$bpos."',
about='".$babout."',
categories='".$fcid."'
");
if($res){
$ret = "<span class=\"spansuccess\">Forum board create successful</span><br />";
addUlog($u, "Create forum board.");
}else{
$ret = errorSQL();
}
}
return $ret;
}
function UpdateName($w, $name){
global $u;
if((level($w))>(level($u))){
$ret = "<span class=\"spanfailed\">Don't have enough permission.</span><br />";
}else if(trim($name)==""){
$ret = "<span class=\"spanfailed\">Username cant be empty</span><br />";
}else if((strlen($name)<4)||(strlen($name)>20)){
$ret = "<span class=\"spanfailed\">Username must be 4 character to 20 characters</span><br />";
}else if((regchars($name))||(nospace($name))||(checknumber($name))){
$ret = "<span class=\"spanfailed\">Username invalid or reserved</span><br />";
}else if(checknick($name)){
$ret = "<span class=\"spanfailed\">Username already taken</span><br />";
}else{
$res = mysql_query("UPDATE users SET
username='".$name."'
WHERE id='".$w."'");
if($res){
addLog("Edit user", "".id_name($u)." change ".id_name($w)." name");
$ret = "<span class=\"spansuccess\">".id_name($w)." name change successfull</span><br />";
}else{
$ret = errorSQL();
}
}
return $ret;
}
function CreditsUp($w, $type, $value, $creason){
global $u;
$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id='".$u."'"));
if($type==1){
$credit = $user[credits] + $value;
}else{
$credit = $user[credits] - $value;
}
$res = mysql_query("UPDATE users SET
credits='".$credit."',
creason='".$creason."'
WHERE id='".$w."'");
if($res){
addLog("Update credit", "".id_name($u)." update ".id_name($w)." credit");
$ret = "<span class=\"spansuccess\">".id_name($w)." credit update successfull</span><br />";
}else{
$ret = errorSQL();
}
return $ret;
}
function unpunishUser($w, $punish){
global $u;
if($punish==1){
$textlog = "unmuted";
}else if($punish==2){
$textlog = "unbanned";
}
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM punish WHERE user='".$w."'"));
if($count[0]!=0){
$staff = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE id='".$w."'"));
if($staff[0]<0) {
$text = "You cannot unpunish this user!";
}else{
$res = mysql_query("DELETE FROM punish WHERE user='".$w."'");
if($res){
addLog("Unpunish", "".id_name($u)." $textlog ".id_name($w, $u)."");
$text = "<span class=\"spansuccess\">".id_name($w)." was $textlog successfully</span>";
}else{
$text = errorSQL();
}
}
}else{
$text = "<span class=\"spanfailed\">This user already $textlog</span>";
}
return $text;
}
function SuspendUser($w, $reason){
global $u;
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM udelete WHERE user='".$w."'"));
if($count[0]==0){
$staff = mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".$w."'"));
if($staff[0]<0) {
$text = "You cannot suspend another staff member!";
}else{
if(trim($reason)!=""){
$res = mysql_query("INSERT INTO udelete SET user='".$w."', who='".$u."', date='".time()."', reason='".$reason."'");
$res = mysql_query("DELETE FROM session WHERE user='".$w."'");
if($res){
addLog("Suspend", "".id_name($u)." suspended ".id_name($w)."");
$text = "<span class=\"spansuccess\">".id_name($w)." was suspend successfully</span>";
}else{
$text = errorSQL();
}
}else{
$text = "<span class=\"spanfailed\">Please input some reason</span>";
}
}
}else{
$text = "<span class=\"spanfailed\">This user already suspended</span>";
}
return $text;
}
function OnlineAll($limit){
global $u, $path;
$pms = mysql_query("SELECT id, username FROM users WHERE level='' ORDER BY RAND() LIMIT $limit");
while($pm=mysql_fetch_array($pms)){
$num1 = rand(1, 9);
if($num1=='1'){
$lalaha = "Home - Main Menu";
$lala = "$path?a=home&ref=home";
}if($num1=='2'){
$lalaha = "Translator";
$lala = "$path?a=translate";
}if($num1=='3'){
$lalaha = "Chat - Room lists";
$lala = "$path?a=chat";
}if($num1=='4'){
$lalaha = "Setting - Menu";
$lala = "$path?a=cpanel";
}if($num1=='5'){
$lalaha = "Fileshare";
$lala = "$path?a=fileshare";
}if($num1=='6'){
$lalaha = "Forum - Categories";
$lala = "$path?a=forum";
}if($num1=='7'){
$lalaha = "Gallery - Main Menu";
$lala = "$path?a=gallery";
}if($num1=='8'){
$lalaha = "Statistics";
$lala = "$path?a=statistic";
}if($num1=='9'){
$lalaha = "Online lists";
$lala = "$path?a=online";
}
$tm = time();
$res = mysql_query("UPDATE users SET lactive='".$tm."' WHERE id='".$pm[0]."'");
$checks = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM online WHERE user='".$pm[0]."'"));
if($checks[0]<1){
$res = mysql_query("INSERT INTO online SET user='".$pm[0]."', actvtime='".$tm."', placelink='".$lala."', place='".$lalaha."', idle='0', salt='0', auto='1'");
}
}
if($res){
addLog("Online All", "".id_name($u)." Make $limit online :)");
$text = "<span class=\"spansuccess\">$limit users online successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function unsuspendUser($w){
global $u;
$count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM udelete WHERE user='".$w."'"));
if($count[0]!=0){
$staff = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE id='".$w."'"));
if($staff[0]<0) {
$text = "You cannot unsuspend this user!";
}else{
$res = mysql_query("DELETE FROM udelete WHERE user='".$w."'");
if($res){
addLog("Unsuspend", "".id_name($u)." $textlog ".id_name($w, $u)."");
$text = "<span class=\"spansuccess\">".id_name($w)." was unsuspended successfully</span>";
}else{
$text = errorSQL();
}
}
}else{
$text = "<span class=\"spanfailed\">This user already unsuspended</span>";
}
return $text;
}
function clearShout(){
global $u;
$res = mysql_query("DELETE FROM shout");
$res = mysql_query("DELETE FROM slike");
if($res){
$msg = "Old shout clear....... .fpis.";
mysql_query("INSERT INTO shout SET user='1', message='".$msg."', sent='".time()."'");
addLog("Shout", "".id_name($u)." delete all shout");
$text = "<span class=\"spansuccess\">All shout delete successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function clearInbox(){
global $u;
$res = mysql_query("DELETE FROM inbox WHERE unread='0' AND saved='0' AND reported='0'");
if($res){
addLog("Inbox", "".id_name($u)." delete all read inbox");
$text = "<span class=\"spansuccess\">All read inbox were delete successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function clearLog(){
global $u;
$res = mysql_query("DELETE FROM log");
if($res){
addLog("Misc", "".id_name($u)." delete all logs");
$text = "<span class=\"spansuccess\">All logs were delete successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function HandleReport($i, $table){
global $u;
if($table=="inbox"){
$ms = "message";
}else if($table=="ftopics"){
$ms = "forum topic";
}else if($table=="fposts"){
$ms = "forum post";
}
$res = mysql_query("UPDATE $table SET reported='0' WHERE id='".$i."'");
if($res){
addLog("Report", "".id_name($u, $u)." handled $ms report [ID: $i]");
$text = "<span class=\"spansuccess\">Report handled successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
function BroadcastPM($subject, $text){
global $u;
$texts = '[br/][br/][i]p/s: Broadcast PM sent to all users.[/i]';
$text = "".$text."".$texts."";
$pms = mysql_query("SELECT * FROM users WHERE id>'1'");
while($pm=mysql_fetch_array($pms)){
$res = mysql_query("INSERT INTO inbox SET message='".$text."', subject='".$subject."', user='".$u."', who='".$pm[id]."', sent='".time()."'");
}
if($res){
addLog("Broadcast PM", "".id_name($u, $u)." sent broadcast pm");
$text = "<span class=\"spansuccess\">PM Broadcast successful</span>";
}else{
$text = errorSQL();
}
return $text;
}
function BroadcastSMS($message){
global $u;
$message = "From: AspireWap - ".$message." #Join us on www.aspirewap.net - Free Unlimited SMS.";
$message2 = urlencode($message);
$pms = mysql_query("SELECT * FROM users WHERE phone!=''");
while($pm=mysql_fetch_array($pms)){
$no2 = urlencode($pm[phone]);
$target = "http://api.tropo.com/1.0/sessions?action=create&token=019f5510dd4db3459367d3db63cbbcdef68c7b391cd990771a3a288eb6af6dd9cd0ff7e219123e77138b0396&no=$no2&message=$message2";
$ip = getip();
$ejatd29 = curl_init();
curl_setopt($ejatd29, CURLOPT_URL, $target);
curl_setopt($ejatd29, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: $ip", "HTTP_X_FORWARDED_FOR: $ip"));
curl_setopt($ejatd29, CURLOPT_RETURNTRANSFER, 1);
$succeed = curl_exec($ejatd29);
curl_close($ejatd29);
}
if($succeed){
addLog("Broadcast SMS", "".id_name($u, $u)." sent broadcast sms");
$text = "<span class=\"spansuccess\">SMS Broadcast successful</span>";
}else{
$text = errorSQL();
}
return $text;
}
function PMStaff($subject, $text){
global $u;
$texts = '[br/][br/][i]p/s: PM sent to all staff.[/i]';
$text = "".$text."".$texts."";
$pms = mysql_query("SELECT * FROM users WHERE level>'0'");
while($pm=mysql_fetch_array($pms)){
$res = mysql_query("INSERT INTO inbox SET message='".$text."', subject='".$subject."', user='".$u."', who='".$pm[id]."', sent='".time()."'");
}
if($res){
addLog("PM Staff", "".id_name($u, $u)." sent pm to all staff");
$text = "<span class=\"spansuccess\">Staff PM successful</span>";
}else{
$text = errorSQL();
}
return $text;
}
function MessageCase($case){
switch($case){
case 1:
$text = "<span class=\"spanfailed\"><img src=\"_IMAGES/notok.png\" alt=\"*\"/>Database not connected</span><br />";
return $text;
break;
case 2:
$text = "<span class=\"spanfailed\"><img src=\"_IMAGES/notok.png\" alt=\"*\"/>Please input password!</span><br />";
return $text;
break;
case 3:
$text = "<span class=\"spanfailed\"><img src=\"_IMAGES/notok.png\" alt=\"*\"/>Invalid password!</span><br />";
return $text;
break;
}
}
}
?>
Leave a comment:
-
lol, "Created by DjGhai.In",Do you even know how to print out an output in PHP,If you knew,U'd have given some credits to the author
@ghaiji
Leave a comment:
-
i like that ACRONYM game in itOriginally posted by m4ster_v4Others bug maybe you can try to fix it self. start learning bro. anything ask here.
Leave a comment:
-
Try code by your self. Start learning.
This script don't have module for add chat room. i just use phpmyadmin.Originally posted by rdrocks View Posterror in admin cp.... chatroom creation.....
But try this
Put on class.toolcp.php
This in toolcp.phpPHP Code:function addCHRoom($text, $desc, $type){
global $u;
$last = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM chatrooms WHERE name='".$text."'"));
if(!$last[0]>0){
if(strlen($text)>"7"){
if(isset($desc)){
$res = mysql_query("INSERT INTO chatrooms SET name='".$text."', password='".md5($desc)."', user='0', date='".time()."', type='".$type."', last='".time()."'");
}else{
$res = mysql_query("INSERT INTO chatrooms SET name='".$text."', user='0', type='".$type."', date='".time()."', last='".time()."'");
}
if($res) {
addLog("Add Chat Room", "".id_name($u)." add chat room ".$text."");
$ret = "<span class=\"spansuccess\">Room create successful</span><br />";
}else{
$ret = errorSQL();
}
}else{
$ret = "<span class=\"spanfailed\">Please input atleast 8 word</span><br />";
}
}else{
$ret = "<span class=\"spanfailed\">Room already exist.</span><br />";
}
return $ret;
}
function deleteCHRoom($id){
global $u;
$res = mysql_query("DELETE FROM chatrooms WHERE id='".$id."'");
$res = mysql_query("DELETE FROM chat WHERE room='".$id."'");
if($res){
addLog("Delete Chat Room", "".id_name($u)." delete chat room [ID:$id] password");
$text = "<span class=\"spansuccess\">Room delete successfully</span>";
}else{
$text = errorSQL();
}
return $text;
}
Good LuckPHP Code:}else if($ref=="chat"){
$theme->Div("divcen");
echo "<b><img src=\"_IMAGES/chat.png\" alt=\"*\"/> Add/Delete Room</b>";
$theme->Div("d");
$theme->Div("divsub");
if(master($u)){
echo "<b><u>Room List</u></b><br />";
if(isset($_POST["submit"])){
echo $cptool->addCHRoom($_POST["name"], $_POST["pass"], $_POST["type"]);
}
if(isset($i)){
echo $cptool->deleteCHRoom($i);
}
$sql = "SELECT * FROM chatrooms ORDER BY date DESC LIMIT 10";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
echo "".htmlentities($item[name])." <a href=\"$path?a=$a&ref=$ref&i=$item[id]\">[x]</a><br />";
}
}else{
echo dataEmpty();
}
$theme->Div("d");
$theme->Div("divcen");
echo "<b>Create room</b>";
$theme->Div("d");
$theme->Div("divsub");
echo "<form action=\"$path?a=$a&ref=$ref\" method=\"POST\">";
echo "Name<br /><input type=\"text\" name=\"name\" maxlength=\"40\" class=\"input\"/><br />";
echo "Type<br />";
echo "<select name=\"type\" class=\"input\">";
$type = array('1'=>'Normal', '2'=>'Bot', '3'=>'Crazy');
foreach ($type as $valueid => $value){
$atype .= "<option value=\"$valueid\">$value</option>";
}
echo $atype;
echo "</select><br />";
echo "Password<br /><input type=\"password\" name=\"pass\" maxlength=\"10\" class=\"input\"/><br />";
echo "<input type=\"submit\" name=\"submit\" value=\"Create\" class=\"button\"/></form>";
echo "<br /><i>(!) Leave password blank if want open it to public.</i>";
}else{
echo "You don't have a permission to continue this operation.";
}
$theme->Div("d");
Last edited by m4ster_v4; 19.02.12, 00:01.
Leave a comment:
-
Rep me if you like this release. Thanks.
Any problem regarding this script just asking here.
Someone may claim it as lava edit. but i don't care because it's not. ^^
Minor bug forum quote. try fix it. Others bug i didn't recognize yet.Last edited by m4ster_v4; 18.02.12, 08:47.
Leave a comment:
-
Aspirewap old sc
Script 2011
When you install this script
ID: 1
Username: ejatd29
Password: haha
Password CP: haha
Enjoy this release.
1st. Upload all script into your server.
2nd. Install database.
3rd. Edit setting config.inc.php in folder _E29.
Good luck.
Respect my code and lan89;
Old script. OOP
Demo: AspireWap.Net | Created by eJaTd29
Register to use.
Script 2010
Some bugs fix.
Who download before this try re-download this script. ^^
P/S: DON'T EVER THINK TO CLAIM THIS SCRIPT AS YOURS! I'M THE ONLY ONE WHO CREATE THIS AND THANKS TO LAN89.Attached FilesLast edited by m4ster_v4; 23.02.12, 04:45.
Leave a comment: