Jump to content
MakeWebGames

Bwerk01

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by Bwerk01

  1. Yeah he was on my game trying to do all sorts of stuff. He wasn't successful at anything. He tried to gain access to the staff panel, adjust his user level, even tried some stuff with javascript but he didn't get a thing. I let him go at it for a bit to see if he could find a bug or anything but finally just banned him after he didn't get anything.
  2. Re: MainMenu Mod! NEW! Hey I know this is an old topic but i just added it and really like it. Only problem I am having is with the Change Main Menu in the Staff Area. These are the areas I'm getting and I think it may be because I am using MCCodes V2 so i don't have the mysql.php file. I am just wondering if there is an easy way to convert it to work with V2. Here are the errors: Warning: include(mysql.php) [function.include]: failed to open stream: No such file or directory in /home1/mobsterm/public_html/staff_mainmenu.php on line 9 Warning: include() [function.include]: Failed opening 'mysql.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/mobsterm/public_html/staff_mainmenu.php on line 9 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home1/mobsterm/public_html/staff_mainmenu.php on line 11 and this is the code: <?php session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); if($ir['userid'] != 1) { echo 'You are not ment to be here'; $h->endpage(); exit; } $_GET['action'] = ($_GET['action']); switch($_GET['action']) { case "newLink" : new_link(); break; case "editLink" : edit_link(); break; case "deleLink" : dele_link(); break; case "reOrder" : reorder_m(); break; default : index(); break; } function index() { echo '<h3>Mainmenu Settings</h3>'; echo '[url="'. $_SERVER['PHP_SELF'] .'?action=newLink"]Add Menu Link[/url] [url="'. $_SERVER['PHP_SELF'] .'?action=editLink"]Edit Menu Link[/url] [url="'. $_SERVER['PHP_SELF'] .'?action=deleLink"]Delete Menu Link[/url] [url="'. $_SERVER['PHP_SELF'] .'?action=reOrder"]Reorder Menu[/url]'; } function new_link() { global $c; if(!isset($_POST['name'])){ echo '<h3>New Menu</h3>'; echo '<form action="" method="POST">'; echo 'Name: <input type="text" name="name" /> Link: <input type="text" name="link" /> For Staff: <select type="dropdown" name="staff"><option value="0">Everyone</option><option value="1">Staff Only</option><option value="2">Donators Only</option><option value="3">Gangs</option></select> Active: <select type="dropdown" name="active"><option value="0">Yes</option><option value="1">No</option></select> <input type="submit" value="-Add Menu-"></form>'; } else { $name = mysql_real_escape_string(htmlspecialchars($_POST['name'])); $link = mysql_real_escape_string(htmlspecialchars($_POST['link'])); $staff = abs(@intval ($_POST['staff'])); $active = abs(@intval ($_POST['active'])); mysql_query("INSERT INTO `mainmenu` (`name`, `link`, `order`, `staff`, `active`) VALUES('{$name}', '{$link}', '0', '{$staff}', '{$active}')", $c) or die(mysql_error()); echo $name . ' Menu has been added!'; } } function edit_link() { switch($_POST['page']) { case "2": $name = mysql_real_escape_string(htmlspecialchars($_POST['name'])); $link = mysql_real_escape_string(htmlspecialchars($_POST['link'])); $staff = abs(@intval ($_POST['staff'])); $active = abs(@intval ($_POST['active'])); mysql_query("UPDATE `mainmenu` SET `name` = '". $name ."', `link` = '". $link ."', `staff` = '". $staff ."', `active` = '". $active ."' WHERE (`id` = '". $_POST['id'] ."')") or die(mysql_error()); print "Menu has been updated!"; break; case "1": $sql = mysql_query("SELECT * FROM `mainmenu` WHERE (`id` = '". $_POST['mainmenu'] ."')") or die (mysql_error()); $row = mysql_fetch_array($sql); echo '<h3>Editing a menu link</h3><hr /> <form action="'. $_SERVER['PHP_SELF'] .'?action=editLink" method="post"> <input type="hidden" name="page" value="2" /> <input type="hidden" name="id" value="'. $_POST['mainmenu'] .'" /> Name: <input type="text" name="name" value="'. $row['name'] .'" /> Link: <input type="text" name="link" value="'. $row['link'] .'" /> For Staff: <select type="dropdown" name="staff"><option value="0" '; if($row['staff'] == 0) { echo 'selected="selected"'; } echo '>Everyone</option> <option value="1" '; if($row['staff'] == 1) { echo 'selected="selected"'; } echo '>Staff Only</option> <option value="2" '; if($row['staff'] == 2) { echo 'selected="selected"'; } echo '>Donators Only</option> <option value="3" '; if($row['staff'] == 3) { echo 'selected="selected"'; } echo '>Gangs</option></select> Active: <select type="dropdown" name="active"><option value="0" '; if($row['active'] == 0) { echo 'selected="selected"'; } echo '>Yes</option> <option value="1" '; if($row['active'] == 1) { echo 'selected="selected"'; } echo '>No</option></select> <input type="submit" value="-Update Menu-" /></form>'; break; default: echo '<h3>Edit a Menu</h3> <form action="'. $_SERVER['PHP_SELF'] .'?action=editLink" method="POST"> <input type="hidden" name="page" value="1" /> Menu Name: '. mainmenu_dropdown($c, "mainmenu") .' <input type="submit" value="-Edit Menu-" /></form>'; break; } } function dele_link() { if($_POST['mainmenu']) { mysql_query("DELETE FROM `mainmenu` WHERE (`id` = '". $_POST['mainmenu'] ."')") or die (mysql_error()); print "Menu Has just been deleted!"; } else { echo '<h3>Delete a Menu</h3>'; echo 'Make sure you want to delete it, there is no undo, unless you add it back.!'; echo '<form action="'. $_SERVER['PHP_SELF'] .'?action=deleLink" method="POST">'; echo 'Menu Name: '. mainmenu_dropdown($c, "mainmenu") .' '; echo '<input type="submit" value="-Delete Menu, Be Sure-" /></form>'; } } function reorder_m() { global $c, $h; if($_POST['submit']) { unset($_POST['submit']); $used = array(); foreach($_POST as $v) { if(in_array($v, $used)) { echo 'Error, You have used the same Reorder number twice, Please go back and try again!'; $h->endpage(); exit; } $used[] = $v; } foreach($_POST as $k => $v) { $ml = str_replace("order","", $k); if(is_numeric($ml)) { mysql_query("UPDATE `mainmenu` SET `order`='{$v}' WHERE `id`='{$ml}'"); } } echo 'Mainmenu Links has been reordered!'; } else { $sql = mysql_query("SELECT * FROM `mainmenu` ORDER BY `order`"); $rows = mysql_num_rows($sql); $i = 0; echo '<h3>Reorder Mainmenu Links</h3><hr /> <table width="80%" cellspacing="1"> <tr> <th>Menu Names</th> <th>Order</th> </tr> <form action="?action=reOrder" method="POST"> <input type="hidden" name="submit" value="1" />'; while($r = mysql_fetch_array($sql)) { $bgcolor = ($bgcolor == "RED") ? "GREEN" : "RED"; $i++; echo '<tr style="background-color: '. $bgcolor .'"> <td>'. $r['name'] .'</td> <td><select name="order'. $r['id'] .'" type="dropdown">'; for($j = 1; $j <= $rows; $j++) { if($j == $i) { echo '<option value="'. $j .'" selected="selected">'. $j .'</option>'; } else { echo '<option value="'. $j .'">'. $j .'</option>'; } } echo '</select></td></tr>'; } echo '<tr> <td colspan="2" align="center"><input type="submit" value="-Reorder Mainmenu-" /></td> </tr></form></table>'; } } ?>   If anyone has some time and can help me out I'd appreciate it! Thanks!
  3. Re: Lucky Boxes Re-code Just added this to check it out, much better than the original. Good Work!
  4. Re: [MCCODES V2] Forums Fix for Ranks, Number of Posts + Delete Error Sorry, I didn't see that you had posted it above. Thank you for all your help! I really appreciate it!
  5. Re: [MCCODES V2] Forums Fix for Ranks, Number of Posts + Delete Error Ahh perfect, didn't catch that. Do you have any idea what might be going on with the error I get from trying to delete topics?
  6. Re: [MCCODES V2] Forums Fix for Ranks, Number of Posts + Delete Error I have done the fix that you have spelled out here and I am getting this error when I try to delete a topic. QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM forum_topics WHERE ft_id=8' at line 1 Query was SELECT FROM forum_topics WHERE ft_id=8 This is my function deletetopic function deletopic() { global $db; $q=$db->query("SELECT FROM forum_topics WHERE ft_id={$_GET['topic']}"); $topic=$db->fetch_row($q); $db->query("DELETE FROM forum_topics WHERE ft_id={$_GET['topic']}"); $db->query("DELETE FROM forum_posts WHERE fp_topic_id={$_GET['topic']}"); print "Deleting topic... Done "; stafflog_add("Deleted topic {$topic['ft_name']}"); recache_forum($topic['ft_forum_id']); }   and also, I can now delete posts but it still gives me this error: Fatal error: Call to a member function query() on a non-object in /home1/mobsterm/public_html/forums.php on line 593 Line 593 is $q=$db->query("SELECT p.* FROM forum_posts p.* WHERE p.fp_topic_id=$forum ORDER BY p.fp_time DESC LIMIT 1");   Not sure if you know what's going on here or not but if anyone gets a chance to look at it I would appreciate it! :-)
  7. Re: Gang Tag I tried using [{$tag->gangPREF}] and when I did all I was left with was [] also tried it just as {$tag->gangPREF} and nothing showed up. Not really sure what happened.
  8. Hey guys, I'm sure this is pathetically easy and I feel like a real ass posting the question but I've been trying to get a gang tag to show next to the username in the header for quite awhile and just can't seem to get it. This is what I've tried, maybe someone can help me out with where i'm going wrong here. in header.php I added $tag = mysql_fetch_object(mysql_query("SELECT gangPREF FROM gangs WHERE gangID = ".$ir['gang']." "));   right after global $ir, $set;   then, I went down to <td width="25%" valign="top"> [b]Name:[/b] $gn{$u} [{$ir['userid']}] $d [b]Level:[/b] {$ir['level']} [b]Money: [/b] {$fm} [b]Points:[/b] {$crs}   and I added [{$tag}] right in front of $gn{$u}.   Is there any chance someone would be willing to help me out with where I'm going wrong here? I would greatly appreciate it!
  9. Re: Problems with doing Crimes Thank You! It works perfectly now. For V2 is is crimeXP and once I changed it the crimes were awarding EXP as they should. Thank you for your help! :-)
  10. Hello, I have been having a problem with the crimes on my game. When I do the crime and succeed I have it set so that it will give 25 EXP, however, when I watch the EXP it only goes up 2 EXP. Anyone know why this may be? Here is my docrime.php code. <?php $macropage="docrime.php?c={$_GET['c']}"; include "globals.php"; if($ir['jail'] or $ir['hospital']) { die("You cannot perform crimes while in jail or the hospital."); } $_GET['c']=abs((int) $_GET['c']); if(!$_GET['c']) { print "Invalid crime"; } else { $q=mysql_query("SELECT * FROM crimes WHERE crimeID={$_GET['c']}",$c); $r=mysql_fetch_array($q); if($ir['brave'] < $r['crimeBRAVE']) { print "You do not have enough Nerve to perform this crime."; } else { $ec="\$sucrate=".str_replace(array("LEVEL","CRIMEXP","EXP","WILL","IQ"), array($ir['level'], $ir['crimexp'], $ir['exp'], $ir['will'], $ir['IQ']),$r['crimePERCFORM']).";"; eval($ec); print $r['crimeITEXT']; $ir['brave']-=$r['crimeBRAVE']; mysql_query("UPDATE users SET brave={$ir['brave']} WHERE userid=$userid",$c); if(rand(1,100) <= $sucrate) { print str_replace("{money}",$r['crimeSUCCESSMUNY'],$r['crimeSTEXT']); $ir['money']+=$r['crimeSUCCESSMUNY']; $ir['crystals']+=$r['crimeSUCCESSCRYS']; $ir['exp']+=(int) ($r['crimeSUCCESSMUNY']/8); mysql_query("UPDATE users SET money={$ir['money']}, crystals={$ir['crystals']}, exp={$ir['exp']},crimexp=crimexp+{$r['crimeXP']} WHERE userid=$userid",$c); if($r['crimeSUCCESSITEM']) { item_add($userid, $r['crimeSUCCESSITEM'], 1); } } else { if(rand(1, 2) == 1) { print $r['crimeFTEXT']; } else { print $r['crimeJTEXT']; $db->query("UPDATE `users` SET `jail` = '$r[crimeJAILTIME]', `jail_reason` = '$r[crimeJREASON]' WHERE `userid` = '$userid'"); } } print " [url='docrime.php?c={$_GET[']Retry[/url] [url='criminal.php']Back[/url]"; } } $h->endpage(); ?>   Any help would be greatly appreciated. I searched and was unable to find anyone having the same problem as me.
×
×
  • Create New...