-
Posts
2,657 -
Joined
-
Last visited
-
Days Won
74
Content Type
Profiles
Forums
Events
Everything posted by Uridium
-
Re: Need Items sql do you just want the standard V2 sqls for items ? CREATE TABLE `items` ( `itmid` int(11) NOT NULL auto_increment, `itmtype` int(11) NOT NULL default '0', `itmname` varchar(255) NOT NULL default '', `itmdesc` text NOT NULL, `itmbuyprice` int(11) NOT NULL default '0', `itmsellprice` int(11) NOT NULL default '0', `itmbuyable` int(11) NOT NULL default '0', `effect1_on` tinyint(4) NOT NULL default '0', `effect1` text NOT NULL, `effect2_on` tinyint(4) NOT NULL default '0', `effect2` text NOT NULL, `effect3_on` tinyint(4) NOT NULL default '0', `effect3` text NOT NULL, `weapon` int(11) NOT NULL default '0', `armor` int(11) NOT NULL default '0', PRIMARY KEY (`itmid`) ) ENGINE=MyISAM ; CREATE TABLE `itemtypes` ( `itmtypeid` int(11) NOT NULL auto_increment, `itmtypename` varchar(255) NOT NULL default '', PRIMARY KEY (`itmtypeid`) ) ENGINE=MyISAM ;
-
Re: [MCCODES V2] Mobile text messaging I'll update the prefs and repost when its done
-
Re: [MCCODES V2] Mobile text messaging kk and where do we add that line? lol That is just an example of the SQL youd need to add to update the credits per user.
-
Re: [MCCODES V2] Mobile text messaging Ooops i knew there was something id forgotten i'll write up a script for it SORRY about that was also trying to do other tasks aswell...
-
Re: [MCCODES V2] Mobile text messaging PART 2 open up mainmenu.php find $mc=$ir['new_mail']; near top of page Underneath add $tm=$ir['new_textmessage']; Now goto the Announcements part on the same file after the fine } Add if($tm > 0) { print "[url='textmessage.php']Text Message ($tm)[/url] "; } else { print "[url='textmessage.php']Create Text message[/url] "; } Now open up preferences.php wheres the Cases are Under the pass_change and after the break(); } add case 'mobilenumchange2': do_mobilenum_change(); break; case 'mobilenumchange': mobilenum_change(); break; Now for the link add this with the rest of the links Create or Change Mobile Number And after the Password function section add this... function mobilenum_change() { global $db, $ir,$c,$userid,$h; $mobi=$db->query("SELECT mobilenumber FROM users WHERE userid=$userid"); if($db->fetch_row($mobi)) { print "<h2>Your Current Mobile Number Is: </h2><h1>".$ir['mobilenumber']."</h1><h3>Change Mobile Number</h3> If this is your first visit Then please change your number to one other than the selected <form action='preferences.php?action=mobilenumchange2' method='post'>Current Mobile Number: <input type='text' name='oldmobinum' value=".$ir['mobilenumber']." > New Mobile Number: <input type='text' name='newmobic' /> Confirm: <input type='text' name='newmobid' /> <input type='submit' value='Change Mobile Number' /></form>"; } } function do_mobilenum_change() { global $db, $ir,$c,$userid,$h; if($_POST['oldmobinum'] != $ir['mobilenumber']) { print "The current Mobile Number you entered was wrong. [url='preferences.php?action=mobilenumchange']> Back[/url]"; } else if($_POST['newmobic'] !== $_POST['newmobid']) { print "The new Mobile Numbers you entered did not match! [url='preferences.php?action=mobilenumchange']> Back[/url]"; } else { $db->query("UPDATE users SET mobilenumber='{$_POST['newmobic']}' WHERE userid=$userid"); print "<h2>Mobile Number changed to </h2><h1>".$_POST['newmobic']."</h1><h2> Keep note for future Reference</h2> [url='preferences.php?action=mobilenumchange']> Back[/url]"; } } And your done if you want to make it so users have to donate then the $ for this is $db->query("UPDATE users SET tcredits=10 WHERE userid=$userid"); im using 10 as a guidline you can use what you want and thats it your done,.
-
Re: [MCCODES V2] Mobile text messaging SQLS CREATE TABLE `textmessage` ( `textmessage_id` int(11) NOT NULL auto_increment, `textmessage_read` int(11) NOT NULL default '0', `textmessage_from` int(11) NOT NULL default '0', `textmessage_to` int(11) NOT NULL default '0', `textmessage_time` int(11) NOT NULL default '0', `textmessage_subject` int(11) NOT NULL default '555656565', `textmessage_text` text NOT NULL, PRIMARY KEY (`textmessage_id`) ) ENGINE=MyISAM ; CREATE TABLE `textcontacts` ( `cl_ID` int(11) NOT NULL auto_increment, `cl_ADDER` int(11) NOT NULL default '0', `cl_ADDED` int(11) NOT NULL default '0', PRIMARY KEY (`cl_ID`) ) ENGINE=MyISAM ; ALTER TABLE users ADD new_textmessage int(11) NOT NULL default '0'; ALTER TABLE users ADD mobilenumber int(11) NOT NULL default '0'; ALTER TABLE users ADD tcredits int(11) NOT NULL default '0'; call this file textmessage.php <?php include "globals.php"; /*if($ir['tcredits'] < 0) { print"<font color=red><h1>! TOPUP REQUIRED</h1> <h2>You have run out of Text Credits you can read but cannot Reply</h2> </font>[/b]"; }*/ if($ir['mobilenumber'] < 1) { echo '<font color=red><h3>You Dont Have A Mobile Number</h3> <h2>You will need one to start sending texts</h2> </font>[/b] '; //$h->endpage(); exit; } $_GET['ID'] = abs((int) $_GET['ID']); print "<font size+3> Your Mobile Number is ".$ir['mobilenumber']." </font> <table width=85% class='table' cellspacing='1'><tr><td>[url='textmessage.php?action=inbox']Inbox[/url]</td> <td>[url='textmessage.php?action=outbox']Sent Texts[/url]</td> <td>[url='textmessage.php?action=compose']Compose Text[/url]</td> <td>[url='textmessage.php?action=delall']Delete All Texts[/url]</td> <td>[url='textmessage.php?action=archive']Archive Texts[/url]</td><td>[url='textcontacts.php']My Contacts[/url]</td></tr> </table> "; switch($_GET['action']) { case 'inbox': textmessage_inbox(); break; case 'outbox': textmessage_outbox(); break; case 'compose': textmessage_compose(); break; case 'delete': textmessage_delete(); break; case 'send': textmessage_send(); break; case 'delall': textmessage_delall(); break; case 'delall2': textmessage_delall2(); break; case 'archive': textmessage_archive(); break; default: textmessage_inbox(); break; } function textmessage_inbox() { global $db,$ir,$c,$userid,$h; print <<<OUT Only the last 25 Mobile Messages sent to you are visible. <table width=75% class="table" border="0" cellspacing="1"> <tr> <td class="h" width="30%">From</td> <td class="h" width="70%">Subject/Message</td> </tr> OUT; $q=$db->query("SELECT m.*,u.* FROM textmessage m LEFT JOIN users u ON m.textmessage_from=u.mobilenumber WHERE m.textmessage_to=$userid ORDER BY textmessage_time DESC LIMIT 25"); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['textmessage_time']); print "<tr><td>"; if($r['userid']) { print "[url='viewuser.php?u={$r[']0{$r['mobilenumber']}[/url]"; } else { print "SYSTEM"; } $fm=urlencode($r['textmessage_text']); print <<<EOF </td> <td>{$r['textmessage_subject']}</td> </tr> <tr> <td>Sent at: {$sent} [url='textmessage.php?action=compose&ID={$r[']Reply[/url] [url='textmessage.php?action=delete&ID={$r[']Delete[/url] [url='preport.php?ID={$r[']Report[/url] </td> <td>{$r['textmessage_text']}</td> </tr> EOF; } if($ir['new_textmessage'] > 0) { $db->query("UPDATE textmessage SET textmessage_read=1 WHERE textmessage_to=$userid"); $db->query("UPDATE users SET new_textmessage=0 WHERE userid=$userid"); } echo '</table>'; } function textmessage_outbox() { global $db,$ir,$c,$userid,$h; print "Only the last 25 messages you have sent are visible. <table width=75% cellspacing=1 class='table'><tr style='background:gray'><th>To</th><th>Subject/Message</th></tr>"; $q=$db->query("SELECT m.*,u.* FROM textmessage m LEFT JOIN users u ON m.textmessage_to=u.mobilenumber WHERE m.textmessage_from=$userid ORDER BY textmessage_time DESC LIMIT 25"); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['textmessage_time']); print "<tr><td>[url='viewuser.php?u={$r[']{$r['mobilenumber']}[/url] [{$r['mobilenumber']}]</td><td>{$r['textmessage_subject']}</td></tr><tr><td>Sent at: $sent </td><td>{$r['textmessage_text']}</td></tr>"; } } function textmessage_compose() { global $db,$ir; if($ir['tcredits'] < 1) { echo '<font color=red><h3>Thats not going to work</h3> <h2>You need to Top Up Your Credits</h2> </font>[/b] '; //$h->endpage(); exit; } global $db,$ir,$c,$userid,$h; print "<form action='textmessage.php?action=send' method='post'> <table width=75% cellspacing=1 class='table'> <tr> <td>Contact to send to:</td> <td>"; $q=$db->query("SELECT c.*, u.mobilenumber FROM textcontacts c LEFT JOIN users u ON c.cl_ADDED=u.mobilenumber WHERE c.cl_ADDER={$userid} ORDER BY u.username ASC"); if($db->num_rows($q) == 0) { print "You have no contacts!"; } else { print "<select name='user1' type='dropdown'><option value=''><select a contact...></option>"; while($r=$db->fetch_row($q)) { print "<option value='{$r['mobilenumber']}'>{$r['mobilenumber']}</option>"; } print "</select>"; } if($_GET['ID']) { $user=$db->fetch_single($db->query("SELECT mobilenumber FROM users WHERE userid={$_GET['ID']}")); } print "</td></tr><tr> <td>[b]OR[/b] Enter a mobilenumber to send to:</td><td><input type='text' name='user2' value='{$user}' /></td></tr><tr> <td>Subject:</td> <td><input type='text' name='subject' /></td></tr><tr> <td>Message:</td> <td><textarea rows=5 cols=40 name='message'></textarea></td></tr><tr> <td colspan=2><input type='submit' value='Send' /></td></tr></table></form>"; if($_GET['ID']) { print " <table width=75% border=2><tr><td colspan=2>[b]Your last 5 text messages to/from this person:[/b]</td></tr>"; $q=$db->query("SELECT m.*,u1.mobilenumber as sender from textmessage m left join users u1 on m.textmessage_from=u1.userid WHERE (m.textmessage_from=$userid AND m.textmessage_to={$_GET['ID']}) OR (m.textmessage_to=$userid AND m.textmessage_from={$_GET['ID']}) ORDER BY m.textmessage_time DESC LIMIT 5"); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['textmessage_time']); print "<tr><td>$sent</td> <td>[b]{$r['sender']} wrote:[/b] {$r['textmessage_text']}</td></tr>"; } print "</table>"; } } function textmessage_send() { global $db,$ir,$c,$userid,$h; $subj=str_replace(array("\n"),array(" "),strip_tags($_POST['subject'])); $msg=str_replace(array("\n"),array(" "),strip_tags($_POST['message'])); if($_POST['user1'] && $_POST['user2']) { die("Please do not select a contact AND enter a mobilenumber, only do one. [url='textmessage.php']> Back[/url]"); } if(!$_POST['user1'] && !$_POST['user2']) { die("You must select a contact or enter a mobilenumber. [url='textmessage.php']> Back[/url]"); } $sendto=($_POST['user1']) ? $_POST['user1'] : $_POST['user2']; $q=$db->query("SELECT userid FROM users WHERE mobilenumber='{$sendto}'"); if($db->num_rows($q)==0) { die("<h2>That Mobile Number does not Exsist Sorry</h2> . [url='textmessage.php']> Back[/url]"); } $to=$db->fetch_single($q); $db->query("INSERT INTO textmessage VALUES ('',0,{$ir['mobilenumber']},$to,unix_timestamp(),'$subj','$msg')"); $db->query("UPDATE users SET new_textmessage=new_textmessage+1 WHERE userid={$to}"); $db->query("UPDATE users SET tcredits=tcredits-1 WHERE userid={$ir['userid']}"); print "Your Message was sent to <font size='3'> ".$r['username']." </font>and one Mobile Credit was deducted from your account you have You have ".$ir['tcredits']." Credits Remaining [url='textmessage.php']> Back[/url]"; } function textmessage_delete() { global $db,$ir,$c,$userid,$h; $db->query("DELETE FROM textmessage WHERE textmessage_id={$_GET['ID']} AND textmessage_to=$userid"); print "Message deleted. [url='textmessage.php']> Back[/url]"; } function textmessage_delall() { global $ir,$c,$userid,$h; print "This will delete all the messages in your inbox. There is [b]NO[/b] undo, so be sure. [url='textmessage.php?action=delall2']> Yes, delete all messages[/url] [url='textmessage.php']> No, go back[/url]"; } function textmessage_delall2() { global $db,$ir,$c,$userid,$h; $db->query("DELETE FROM textmessage WHERE textmessage_to=$userid"); print "All ".$db->affected_rows()." textmessages in your inbox were deleted. [url='textmessage.php']> Back[/url]"; } function textmessage_archive() { global $ir,$c,$userid,$h; print "This tool will download an archive of all your messages. [url='textdlarchive.php?a=inbox']> Download Inbox[/url] [url='textdlarchive.php?a=outbox']> Download Outbox[/url]"; } $h->endpage(); ?> Call this file textcontacts.php <?php include "globals.php"; print "<h3>My Contacts</h3>"; print "<table width=85% class='table' cellspacing='1'><tr><td>[url='textmessage.php?action=inbox']Inbox[/url]</td> <td>[url='textmessage.php?action=outbox']Sent Messages[/url]</td> <td>[url='textmessage.php?action=compose']Compose Message[/url]</td> <td>[url='textmessage.php?action=delall']Delete All Messages[/url]</td> <td>[url='textmessage.php?action=archive']Archive Messages[/url]</td><td>[url='textcontacts.php']My Contacts[/url]</td></tr> </table> "; switch($_GET['action']) { case "add": add_friend(); break; case "remove": remove_friend(); break; default: friends_list(); break; } function friends_list() { global $db,$ir,$c,$userid; print "[url='textcontacts.php?action=add']> Add a Contact[/url] These are the people on your contact list. "; print " <table width=90% class='table' cellspacing='1'><tr style='background:gray'> <th>Mobile Number</th> <th>Contacts Name</th> <th>Send Text</th> <th>Remove</th> </tr>"; $q=$db->query("SELECT fl.*,u.* FROM textcontacts fl LEFT JOIN users u ON fl.cl_ADDED=u.mobilenumber WHERE fl.cl_ADDER=$userid ORDER BY u.username ASC"); while($r=$db->fetch_row($q)) { $d=""; if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; } print "<tr> <td>{$r['mobilenumber']}</td> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] $d</td> <td>[url='textmessage.php?action=compose&ID={$r[']Mail[/url]</td> <td>[url='textcontacts.php?action=remove&cl={$r[']Remove[/url]</td> </tr>"; } print "</table>"; } function add_friend() { global $db,$ir,$c,$userid; $_POST['ID'] = abs((int) $_POST['ID']); if($_POST['ID']) { $qc=$db->query("SELECT * FROM textcontacts WHERE cl_ADDER=$userid AND cl_ADDED={$_POST['ID']}"); $q=$db->query("SELECT * FROM users WHERE mobilenumber={$_POST['ID']}"); if($db->num_rows($qc)) { print "You cannot add the same person twice."; } else if($userid==$_POST['ID']) { print "There is no point in adding yourself to your own list."; } else if($db->num_rows($q)==0) { print "That Mobile Number does not Exsist Sorry [url='textcontacts.php'] >> BACK << [/url]"; } else { $db->query("INSERT INTO textcontacts VALUES('', $userid, {$_POST['ID']})"); $r=$db->fetch_row($q); print "{$r['username']} was added to your contact list. [url='textcontacts.php']> Back[/url]"; } } else { print "Adding a contact!<form action='textcontacts.php?action=add' method='post'> Contact's Mobile Number: <input type='text' name='ID' value='{$_GET['ID']}' /> <input type='submit' value='Add Contact' /></form>"; } } function remove_friend() { global $db,$ir,$c,$userid; $db->query("DELETE FROM textcontacts WHERE cl_ID={$_GET['cl']} AND cl_ADDER=$userid"); print "Contact list entry removed! [url='textcontacts.php']> Back[/url]"; } $h->endpage(); ?> call this file textdlarchive.php <?php session_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $ir=$db->fetch_row($is); if($_GET['a']=='inbox') { // We'll be outputting a PDF header('Content-type: text/html'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="inbox_archive_'.$userid.'_'.time().'.htm"'); print "<table width=75% border=2><tr style='background:gray'><th>From</th><th>Subject/Message</th></tr>"; $q=$db->query("SELECT m.*,u.* FROM textmessage m LEFT JOIN users u ON m.textmessage_from=u.userid WHERE m.textmessage_to=$userid ORDER BY textmessage_time DESC "); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['textmessage_time']); print "<tr><td>"; if($r['userid']) { print "{$r['username']} [{$r['userid']}]"; } else { print "SYSTEM"; } print "</td>\n<td>{$r['textmessage_subject']}</td></tr><tr><td>Sent at: $sent </td><td>{$r['textmessage_text']}</td></tr>"; } print "</table>"; } else if($_GET['a']=='outbox') { // We'll be outputting a PDF header('Content-type: text/html'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="outbox_archive_'.$userid.'_'.time().'.htm"'); print "<table width=75% border=2><tr style='background:gray'><th>To</th><th>Subject/Message</th></tr>"; $q=$db->query("SELECT m.*,u.* FROM textmessage m LEFT JOIN users u ON m.textmessage_to=u.userid WHERE m.textmessage_from=$userid ORDER BY textmessage_time DESC"); while($r=$db->fetch_row($q)) { $sent=date('F j, Y, g:i:s a',$r['textmessage_time']); print "<tr><td>{$r['username']} [{$r['userid']}]</td><td>{$r['textmessage_subject']}</td></tr><tr><td>Sent at: $sent </td><td>{$r['textmessage_text']}</td></tr>"; } print "</table>"; } ?> Part 2 Below
-
Re: [MCCODES V2] Mobile text messaging I'll post the script in a few just need some people on the TESTSITE to test the texts and stuff are woking for them
-
Re: [MCCODES V2] Mobile text messaging Working Demo each user when regd or those that are reg are given 10 credits you will need to goto Preferences and Create your mobile number make sure its not your own just make one up...... the send a message via the normal mailbox to the person you want to contact giving your mobile number... My mobile number on the test site is 07772323 http://www.mccode.doom-nights.com
-
Re: Gang Orginised Request .... Ahh those dodgey MCC copies will always bite you in the butt :)
-
Was bored so came up with this little addition it allows users to send Text Messages to each other. users must register a Mobile number (Not Thier Personal one) just one thats made up by themselves All users start with 10 credits and they depleet as they send messages. Once they are out of Credit they can either purchase more with cash or crystals or use as donator based addition for extra cash. Users that dont have credit can read texts but cant send texts. Users can change their Mobile Number when ever they wish. But bare in mind once changed they will have to tell their friends or they will be sending messages to a number thats no longer vaild... heres a few screenies.... yes its the MAILBOX but with a little more fun.
-
This little fix will show Ranks, number of posts per user and fix the Delete error from the orig V2 fourms open up forums.php find $rank=forums_rank($memb['posts']); if($memb['forums_avatar']) { $av="[img={$memb[]"; } else { $av="[img=noav.gif]"; } if(!$memb['forums_signature']) { $memb['forums_signature']="No Signature"; } else {$memb['forums_signature']=$bbc->bbcode_parse($memb['forums_signature']); } $r['fp_text']=$bbc->bbcode_parse($r['fp_text']); print "<tr> <th align='center'>Post #{$no}</th> <th align='center'>Subject: {$r['fp_subject']} Posted at: $t $qlink$elink$dlink</th> </tr> <tr> <td valign=top>[url='viewuser.php?u={$r[']{$r['fp_poster_name']}[/url] [{$r['fp_poster_id']}] $av Level: {$memb['level']}</td> <td valign=top>{$r['fp_text']} {$edittext} ------------------- {$memb['forums_signature']}</td> </tr>"; } Overwrite with $rank=forums_rank($memb['posts']); if($memb['forums_avatar']) { $av="[img={$memb[]"; } else { $av="[img=noav.gif]"; } if(!$memb['forums_signature']) { $memb['forums_signature']="No Signature"; } else {$memb['forums_signature']=$bbc->bbcode_parse($memb['forums_signature']); } $r['fp_text']=$bbc->bbcode_parse($r['fp_text']); print "<tr> <th align='center'>Post #{$no}</th> <th align='center'>Subject: {$r['fp_subject']} Posted at: $t $qlink$elink$dlink</th> </tr> <tr> <td valign=top>[url='viewuser.php?u={$r[']{$r['fp_poster_name']}[/url] [{$r['fp_poster_id']}] $av Level: {$memb['level']} Post Count: $rank Posts: ".$memb['posts']."</td> <td valign=top>{$r['fp_text']} {$edittext} ------------------- {$memb['forums_signature']}</td> </tr>"; } Ranks now fixed to fix the delete topic find function deletopic() { Just underneath that add global $db; And move recache_forum($topic['ft_forum_id']); so its underneath the stafflog_add statement and your done SCREENIE
-
Re: Mafia Text Based Game? Putting this Post in the Correct fourm whould help all your doing is cluttering this one up.
-
Re: New Houses Mod [Mccodes V2] They dont really need to be online. I did a script for Streets that uses the same principal where by users could be attacked whilst searching streets.
-
Re: New Houses Mod [Mccodes V2] I dont really know much about the upgrade script and if its a paid mod its best not to post extracts on here but send to my mailbox wht you think maybe the error script and i'll take a look
-
Re: New Houses Mod [Mccodes V2] I just moved the functions around to match the case types in order and moved the defaul statement up with the cases.
-
Re: New Houses Mod [Mccodes V2] Just for future Reference try to keep the CASES types in the same order as your Functions that way you will kill 99% of function errors. Most common errors for functions are missing $db from a global. if you experience a unexpected endpage error thats usually caused by a missing { or } usually place these at the very end of a function or before the endpage statement
-
Re: New Houses Mod [Mccodes V2] as well as what youve just mentioned your Functions are also causing the issues. I'll post a fix for you in a sec... This should fix the Functions error <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; case "addupgrade": addupgrade(); break; case "editupgrade": editupgrade(); break; case "delupgrade": delupgrade(); break; case "delupgradesub": delupgradesub(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $name=$_POST['name']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $will=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL=$will, hPRICE=$price, hNAME='$name' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")." <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")." <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted! [url='staff_users.php?action=reportsview']> Back[/url]"; } function addupgrade() { global $db, $ir, $c, $h, $userid; $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $uname=$_POST['name']; if($uprice and $uwill and $uname) { $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeName='{$_POST['name']}'"); if($db->num_rows($q) != 0) { print "<h3>Sorry, you cannot have two upgrades with the same name.</h3> "; $h->endpage(); exit; } $db->query("INSERT INTO house_upgrades VALUES(NULL, '$uname', '$uprice', '$uwill')"); print "<h3>House upgrade {$uname} added to the game.</h3> "; stafflog_add("Created House Upgrade $uname"); } else { print "<h3>Add House Upgrade</h3> <form action='staff_houses.php?action=addupgrade' method='post'> Name: <input type='text' name='name' /> Price: <input type='text' name='price' /> Max Will: <input type='text' name='will' /> <input type='submit' value='Add Upgrade' /></form>"; } } function editupgrade() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $uprice=abs((int) $_POST['price']); $uwill=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeMood={$uwill} AND upgradeId!={$_POST['upgrade']}"); if($db->num_rows($q)) { print "<h3>Sorry, you cannot have two upgrades with the same maximum will.</h3> "; $h->endpage(); exit; } $uname=$_POST['name']; $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); if($old['upgradeMood'] == 100 && $old['upgradeMood'] != $uwill) { die("Sorry, this house's upgrade cannot be edited."); } $db->query("UPDATE house_upgrades SET upgradeMood=$uwill, upgradeCost=$uprice, upgradeName='$uname' WHERE upgradeId={$_POST['upgrade']}"); //$db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); //$db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "<h3>House upgrade \"$uname\" was edited successfully.</h3> "; stafflog_add("Edited house upgrade $uname"); break; case "1": $q=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($q); print "<h3>Editing house Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='upgrade' value='{$_POST['upgrade']}' /> Name: <input type='text' name='name' value='{$old['upgradeName']}' /> Price: <input type='text' name='price' value='{$old['upgradeCost']}' /> Max Will: <input type='text' name='will' value='{$old['upgradeMood']}' /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing an Upgrade</h3> <form action='staff_houses.php?action=editupgrade' method='post'> <input type='hidden' name='step' value='1' /> House: ".upgrade_dropdown($c, "upgrade")." <input type='submit' value='Edit Upgrade' /></form>"; break; } } function delupgrade() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } print "<h3>House House Upgrade</h3> The upgrade will be permanently removed from the game. <form action='staff_houses.php?action=delupgradesub' method='post'> Item: ".upgrade_dropdown($c,'upgrade')." <input type='submit' value='Delete Upgrade' /></form>"; } function delupgradesub() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 2) { die("403"); } $d=$db->query("SELECT * FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); $old=$db->fetch_row($d); $db->query("DELETE FROM house_upgrades WHERE upgradeId={$_POST['upgrade']}"); print "<h3>The \"{$old['upgradeName']}\" Upgrade was removed from the game.</h3>[url='staff_houses.php?action=delupgrade']>Back[/url]"; stafflog_add("Deleted house upgrade {$old['upgradeName']}"); } $h->endpage(); ?>
-
Re: Help needed will pay! open up your old config.php file change the cron name from there and let it match the ones on your new server JOB done and that didnt cost a penny lol
-
Re: New Houses Mod [Mccodes V2] the hSELLPRICE was for a mod i made so admins could set a sell price to houses on the market if you used my mod you may want to check the file called staff_houses.php and estate.php for any mention of hSELLPRICE
-
Re: New Houses Mod [Mccodes V2] Post me your script thats has the error to my mailbox and the SQLS your using for houses and i'll take a look
-
Re: Street Images Its the small things that make a big difference to a script and how it looks :) if you wanted to create a button then you could always goto www.grsites.com for your buttons and banners you can create your own styles has some nice effects aswell
-
Re: Street Images Nicely done Chika :)
-
Re: New Houses Mod [Mccodes V2] QUERY ERROR: Column count doesn't match value count at row 1 Query was INSERT INTO houses VALUES(NULL, 'Test', '10000', '1000') Again this usually measn that the SQLS on your PHPMYADMIN are not the same as those you are trying to INSERT from a script.. Check the number of tables in your PHPMYADMIN for the dbase houses.. Then check the INSERT on your script you may have one more or less than one another...
-
Re: New Houses Mod [Mccodes V2] check the global too make sure it has a $db, aswell as the $ir Fatal error: Call to undefined function usually means theres a missing $db on a global example global $ir; would become global $db, $ir;
-
mccode-v2 100% Working Copy Enhanced Schooling
Uridium replied to Uridium's topic in Free Modifications
Re: [MCCODES V2] 100% Working Copy Enhanced Schooling You dont have to add them to the cron_hour if your just testing just create a new cron say for 5 mins and add the cron scripts to that if your just testing just call the cron schooling_cron.php