-
Posts
277 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by Richard
-
Re: Gym with Current Stats (v1) I just added the stats from the home page, its simple but it saves you from switching pages every time you train
-
I know its very easy for most people to do, but here it is: <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.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']); $ts=$ir['strength']+$ir['agility']+$ir['guard']+$ir['labour']+$ir['IQ']; $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); $tsrank=get_rank($ts,'strength+agility+guard+labour+IQ'); $ir['strength']=number_format($ir['strength']); $ir['agility']=number_format($ir['agility']); $ir['guard']=number_format($ir['guard']); $ir['labour']=number_format($ir['labour']); $ir['IQ']=number_format($ir['IQ']); $ts=number_format($ts); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $out=""; $_GET['times']= abs((int) $_GET['times']); if(isset($_GET['train'])) { if($_GET['train'] != "strength" && $_GET['train'] != "agility" && $_GET['train'] != "guard" && $_GET['train'] != "labour") { $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); die("Abusers aren't allowed."); } $tgain=0; for($i=1;$i<=$_GET['times'] && $ir['energy'] > 0;$i++) { if ($ir['energy'] > 0) { $gain=rand(1,3)/rand(800,1000)*rand(800,1000)*(($ir['will']+20)/150); $tgain+=$gain; if ($_GET['train']=="IQ") { $gain/=100; } $ir[$_GET['train']]+=$gain; $egain=$gain/10; $ts=$ir[$_GET['train']]; $st=$_GET['train']; mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,energy=energy-1,exp=exp+$egain WHERE userid=$userid ".mysql_error()); $wu=(int) (rand(1,3)); if ($ir['will'] >= $wu) { $ir['will']-=$wu; mysql_query("UPDATE users SET energy=energy-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c); } else { $ir['will']=0; mysql_query("UPDATE users SET energy=energy-1,exp=exp+$egain,will=0 WHERE userid=$userid",$c); } $ir['energy']-=1; $ir['exp']+=$egain; } else { $out="You do not have enough energy to train."; } } $stat=$ir[$st]; $i--; $out="<center><h3>Gym</h3><hr width=50%><div> <center>You begin training your $st. <font color=green>You have gained [b]$tgain $st[/b] by training it $i times.</font> You now have [b]$stat $st[/b] and [b]{$ir['energy']}[/b] energy left. "; } else { $out="<center><h3>Gym</h3><hr width=50%><div> "; } $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); print $out; print "<center>Enter the times you wish to train the stat you select You can train {$ir['energy']} times with the energy you have <form method='get' action=gym.php> <table border=0><tr> <td align=center>Times</td> <td align=center>Stat</td> </tr><tr> <td align=center><input type='text' size='5' name='times' value='{$ir['energy']}' maxlength='2'></td> <td align=center><select type='dropdown' name='train'> <option value='strength'>Strength</option> <option value='agility'>Agility</option> <option value='labour'>Labour</option> <option value='guard'>Guard</option> </select></td> </tr><tr> <td colspan=2 align=center><input type=submit value='Train'></form></td> </tr></table><hr width=50%><center>[b]<center>Your Current Stats:[/b]<hr width=50%> <table width=50%><tr><td>[b]<center>Strength:[/b]<font color=#000066> {$ir['strength']} [Ranked: <font color=#000066>{$ir['strank']}]</td><td>[b]<center>Agility:[/b] <font color=#000066>{$ir['agility']} [Ranked: <font color=#000066>{$ir['agirank']}]</td></tr> <tr><td>[b]<center>Guard:[/b] <font color=#000066>{$ir['guard']} [Ranked: <font color=#000066>{$ir['guarank']}]</td><td>[b]<center>Labour:[/b]<font color=#000066> {$ir['labour']} [Ranked: <font color=#000066>{$ir['labrank']}]</td></tr> <tr><td>[b]<center>IQ: [/b] <font color=#000066>{$ir['IQ']} [Ranked: <font color=#000066>{$ir['IQrank']}]</td><td>[b]<center>Total stats:[/b] <font color=#000066>{$ts} [Ranked: <font color=#000066>$tsrank]</td></tr></table> <hr width=50%>[url='index.php']Back to Home[/url]<hr width=50%>"; $h->endpage(); ?>
-
[mccode v2] Contact Form (Fresh & NEW!)
Richard replied to Haunted Dawg's topic in Free Modifications
Re: Contact Form (Fresh & NEW!) Here it is for v1 staff_contact.php <?php /*----------------------------------------------------- -- Mono Country v1.0 BETA -- A product of DBS-entertainment -- Copyright held 2005 by Dabomstew -- INDEX.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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($_GET['action'] == 'reply') { if($_POST['message']) { $XID = abs(@intval( $_GET['XID'])); $af = mysql_query("SELECT * FROM messages WHERE ID='{$XID}'") or die(mysql_error()); $at = mysql_fetch_assoc($af); $to = $at['useremail']; $subject = "Reply From Your Game Name"; $body = $_POST['message']; $from = "[email protected]"; $headers = 'From: Your Game Name | Reply Of ' .$at['subject']. ' <' .$from. '>'; mail($to, $subject, $body, $headers); mysql_query("DELETE FROM messages WHERE ID='{$at['ID']}'") or die(mysql_error()); echo 'Deleted row id ' .$at['ID']. ' TO: ' .$to. ' Header: ' .$headers. ' Subject: ' .$subject. ' Body: ' .$body. ' '; echo 'Replied To and Deleted.'; $h->endpage(); exit; } $XID = abs(@intval( $_GET['XID'])); $ay = mysql_query("SELECT * FROM messages WHERE ID='{$XID}'") or die(mysql_error()); echo '<form action="staff_contact.php?action=reply&XID=' .$XID. '" method="post">'; echo 'Type in your message bellow: <textarea name="message" cols="50" rows="10"></textarea> <input type="submit" value="Continue"></form>'; $h->endpage(); exit; } echo ' <table border=1 width=100% class=table> <tr> <th>User Name</th> <th>User Email</th> <th>Time Submited</th> <th>Message</th> <th>Actions</th> </tr>'; $m = mysql_query("SELECT * FROM messages"); $t = mysql_num_rows($m); echo '<center><h3>Staff Messages</h3><hr width=100%>[url="staff_contact.php"]Contact Messages (' .$t. ' Unreplied)[/url]<hr width=100%>'; $s = mysql_query("SELECT * FROM messages") or die(mysql_error()); if (mysql_num_rows($s) == 0) { echo '<td colspan=6>No new messages.</td>'; } while($t = mysql_fetch_assoc($s)) { $time = date ('F j, Y')." ".date('g:i:s a'); echo '<td>' .$t['username']. '</td> <td>' .$t['useremail']. '</td> <td>' .$time. '</td> <td>' .$t['message']. '</td> <td>[url="staff_contact.php?action=reply&XID=' .$t['ID']. '"]Reply[/url]</td><tr>'; } echo '</tr></table>'; $h->endpage(); ?> contact.php <?php session_start(); print "<html> <head> <title>Contact Staff</title> <style> body { font-family:Arial;font-size:9pt;color: black; background-color:#CCCCCC; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-size:9pt; } img { border:none; } </style> </head> <body><center>[img=logo.bmp] "; $ip = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(file_exists('ipbans/'.$ip)) { die("[b]<font color=red size=+1>Your IP has been banned, there is no way around this.</font>[/b]</body></html>"); } require "mysql.php"; global $c; if($_POST['myname']) { $mn = htmlspecialchars(mysql_real_escape_string($_POST['myname'])); $m = htmlspecialchars(mysql_real_escape_string($_POST['message'])); $s = htmlspecialchars(mysql_real_escape_string($_POST['subject'])); $em = htmlspecialchars(mysql_real_escape_string($_POST['email'])); mysql_query("INSERT INTO messages VALUES(NULL, '{$mn}','{$m}','{$s}','{$em}', unix_timestamp())") or die(mysql_error()); echo 'Done, Thanks for your support ticket we will respond to the email you supplied.'; exit; } echo ' <form action="contact.php" method="post"> <center><h3>Contact Staff</h3><hr width=50%><table border=0 width=50% class=table> <tr> <td>Your Name:</td><td><input type="text" name="myname"></td><tr> <td>Your Email:</td><td><input type="text" name="email"></td><tr> <td>Subject:</td><td> <select name="subject"> <option value="Account Enquiry">Account Enquiry</option> <option value="Website Problems">Website Problems</option> <option selected>Select a Option</option> </select> </td><tr> <td colspan=2>Your Message:</td><tr> <td colspan=2><textarea name="message" rows="10" cols="50"></textarea></td><tr> <td colspan=2><input type="submit" value="Submit"></td> </table><hr width=50%><a href=login.php> Back to Login</a><hr width=50%> </form>'; ?> Enjoy! :) -
Re: Advanced Dating (v1) If you have any Problems with this mod Please mail me and I'll try to fix, at the moment it is working perfectly on my game...
-
Re: Advanced Dating (v1) This Should all work perfectly now... Enjoy!
-
Re: Advanced Dating (v1) Thnx, this took me around 2 hours to code
-
Firstly Run this SQL Data alter table users add happiness int (11) not null default 50 alter table users add date int (11) not null default 0 alter table users add datehours int (11) not null default 0 Next Create this Table -- -------------------------------------------------------- -- -- Table structure for table `dates` -- CREATE TABLE `dates` ( `dateID` int(11) NOT NULL default '0', `dateNAME` varchar(255) NOT NULL default '0', `dateDESC` varchar(255) NOT NULL default '0', PRIMARY KEY (`dateID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `dates` -- INSERT INTO `dates` VALUES (1, 'To The Park', 'Spend a quiet evening in the Park'); INSERT INTO `dates` VALUES (2, 'Out to Dinner', 'Take your Partner out to a Restaurant'); Next Find in partner.php case "sendcyber": sendcyber(); break; case "sendcybersub": sendcybersub(); break; Add below case "date": date_partner(); break; In the Same file find function sendmoneysub() { global $ir, $mr, $c, $userid, $h, $fm; $tm=money_formatter($mr['money']); $with=abs((int) $_POST['money']); if($with > $ir['money']) { die("You don't have enough to send your partner that amount. > [url='partner.php']Back[/url]"); } $k=money_formatter($with); mysql_query("UPDATE users SET money=money+$with WHERE userid={$mr['userid']}", $c); mysql_query("UPDATE users SET money=money-$with WHERE userid={$ir['userid']}", $c); event_add($mr['userid'],"Your partner {$ir['username']} gave you $k using Marriage Tools.", $c); print "Money has been given to partner. > [url='partner.php']Back[/url]"; } Below add function date_partner() { global $ir,$c,$userid; $_POST['date'] = abs((int) $_POST['date']); if($_POST['date']) { if($ir['date'] != 0) { print "Your are already planning a Date!"; } else { mysql_query("UPDATE users SET date={$_POST['date']},datehours=8 WHERE userid={$ir['userid']}",$c); print "You have started to plan this Date. It will start in 8 hours."; } } else { print "<h3>Dating</h3> <form action='partner.php?action=date' method='post'>Choose a Date to take your Partner on. Date: ".date_dropdown($c,'date')." "; $cnt=mysql_query("SELECT username FROM users WHERE userid={$ir['userid']}",$c); { print "<option value='{$r['dateID']}'>{$r['dateNAME']}</option>"; } print "</select> <input type='submit' value='Start Date' /></form>"; } } Next Find (In Partner.php) <tr> <td>[b]Your Bank:[/b] $mb</td> <td>[b]Their Bank:[/b] $tb</td> </tr> Add Below <tr> <td>[b]Your Happiness:[/b] {$ir['happiness']}</td> <td>[b]Their Happiness:[/b] $hap</td> </tr> In the Same file find $tm=money_formatter($mr['money']); Add Below $hap=($mr['happiness']); In the Same file find <tr> <td>> [url='partner.php?action=sendlove']Send Your Love[/url]</td> <td>> [url='partner.php?action=divorce']Divorce Partner[/url]</td> </tr> Add Below <tr> <td>> [url='partner.php?action=date']Date your Partner[/url]</td> <td>Time Until Next Date: [b]{$ir['datehours']}[/b] Hours [[url='dateresult.php']Date Result[/url]]</td> </tr> Create a file called dateresult.php <?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']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); if($ir['date'] == 0) die("<center><h3>Date Result</h3><hr width=75%>You are not on a Date...<hr width=75%>> <a href=partner.php>Back to Partner Management</a><hr width=75%>"); print "<center><h3>Date Result</h3><hr width=75%>"; if ($ir[datehours]>1.) { print "<center>Your Date Hasn't Finished Yet...<hr width=75%>> <a href=partner.php>Back to Partner Management</a><hr width=75%>"; }else{ $chance = rand(1,2); mysql_query("update users set date=0 where userid=$userid",$c); if ($chance == 1) { $gain = rand(8,10); print "<font color=green>Congratulations! Your Date Was a Success.</font>"; mysql_query("update users set happiness=happiness+$gain where userid=$userid",$c); mysql_query("update users set date=0 where userid=$userid",$c); mysql_query("UPDATE users SET happiness=happiness+$gain WHERE userid={$r['married']}",$c); mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, Your Date was a Success!')",$c); } if ($chance == 2) { $gain = rand(8,10); print "<font color=red>Your Date Was a Failure...</font>"; mysql_query("update users set happiness=happiness-$gain where userid=$userid",$c); mysql_query("update users set date=0 where userid=$userid",$c); mysql_query("UPDATE users SET happiness=happiness-5 WHERE userid={$r['married']}",$c); mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Your Date was a Total Failure!')",$c); } $date = ($ir['date']=0); print " <hr width=75%>> <a href=partner.php>Back to Partner Management</a><hr width=75%>"; } $h->endpage; ?> In global_func.php find function item_dropdown($connection,$ddname="item",$selected=-1) { $ret="<select name='$ddname' type='dropdown'>"; $q=mysql_query("SELECT * FROM items ORDER BY itmname ASC",$connection); if($selected == -1) { $first=0; } else { $first=1; } while($r=mysql_fetch_array($q)) { $ret.="\n<option value='{$r['itmid']}'"; if ($selected == $r['itmid'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['itmname']}</option>"; } $ret.="\n</select>"; return $ret; } Below add function date_dropdown($connection,$ddname="date",$selected=-1) { $ret="<select name='$ddname' type='dropdown'>"; $q=mysql_query("SELECT * FROM dates ORDER BY dateNAME ASC",$connection); if($selected == -1) { $first=0; } else { $first=1; } while($r=mysql_fetch_array($q)) { $ret.="\n<option value='{$r['dateID']}'"; if ($selected == $r['dateID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['dateNAME']}</option>"; } $ret.="\n</select>"; return $ret; } Add into your daysold cron mysql_query("UPDATE users SET happiness=happiness-5 WHERE married > 0",$c); That should be all I also wanted to add something like this into partner.php, but It comes up with an error if ($mr['happiness'] == 0) { mysql_query("UPDATE users SET married=0 WHERE userid={$ir['userid']}",$c); mysql_query("UPDATE users SET happiness=happiness-50 WHERE userid={$ir['userid']}",$c); { mysql_query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Your Partner Left You!')",$c); } To add Dates in Admin Panel: In admin.php find case 'newitem': new_item_form(); break; case 'newitemsub': new_item_submit(); break; Add Below case 'newdate': new_date_form(); break; case 'newdatesub': new_date_submit(); break; Also in admin.php find function massmailer() { global $ir,$c,$userid; if($_POST['text']) { $_POST['text']=nl2br(strip_tags($_POST['text'])); $subj="This is a mass mail from the administration"; if($_POST['cat']==1) $q=mysql_query("SELECT * FROM users ",$c); else if($_POST['cat']==2) $q=mysql_query("SELECT * FROM users WHERE user_level > 1",$c); else if($_POST['cat']==3) $q=mysql_query("SELECT * FROM users WHERE user_level=2",$c); else $q=mysql_query("SELECT * FROM users WHERE user_level={$_POST['level']}",$c); while($r=mysql_fetch_array($q)) { mysql_query("INSERT INTO mail VALUES('', 0, 0, {$r['userid']}, unix_timestamp(),'$subj','{$_POST['text']}')",$c); print "Mass mail sent to {$r['username']}. "; } print "Mass mail sending complete! [url='admin.php']> Back[/url]"; } else { print "[b]Mass Mailer[/b] <form action='admin.php?action=massmailer' method='post'> Text: <textarea name='text' rows='7' cols='40'></textarea> <input type='radio' name='cat' value='1' /> Send to all members <input type='radio' name='cat' value='2' /> Send to staff only <input type='radio' name='cat' value='3' /> Send to admins only OR Send to user level: <input type='radio' name='level' value='1' /> Member <input type='radio' name='level' value='2' /> Admin <input type='radio' name='level' value='3' /> Secretary <input type='radio' name='level' value='4' /> IRC Op <input type='radio' name='level' value='5' /> Assistant <input type='submit' value='Send' /></form>"; } } Add Below function new_date_form() { global $ir,$c,$h; print "<h3>Adding a New Date</h3> <form action='admin.php?action=newdatesub' method='post'> Date Name: <input type='text' name='daten' value='' /> Date Desc: <input type='text' name='dated' value='' /> <input type='submit' value='Create Date' /></form>"; } function new_date_submit() { global $ir,$c,$h; if(!isset($_POST['daten']) || !isset($_POST['dated'])) { print "You missed a field, go back and try again. [url='admin.php?action=newdate']> Back[/url]"; } else { $daten=mysql_escape($_POST['daten']); $dated=mysql_escape($_POST['dated']); mysql_query("INSERT INTO dates VALUES('','$daten','$dated')",$c); print "The Date was successfully added to the game."; } } Again in admin.php find [[url='admin.php?action=editnews']Edit Newspaper[/url]] Add Below [[url='admin.php?action=newdate']Create a new Date[/url]] If you have any problems please let me know :)
-
Re: Improved Delete User for V1!!! ty :-D
-
Re: Improved Delete User for V1!!! If u hav any errors let me know ill try and fix em, but it shud all be fine :-)
-
Hi, this picks the user from a dropdown list and deletes them. In admin.php Find: case 'massmailer': massmailer(); break; Add After: case 'deluserform': del_user_form(); break; case 'delusersub': del_user_submit(); break; Find: $h->endpage(); ?> Before it add: function del_user_form() { global $ir,$c,$h,$userid; print "<h3>Deleting User</h3> The user will be deleted. <form action='admin.php?action=delusersub' method='post'> User: ".user_dropdown($c,'user',$_GET['XID'])." <input type='submit' value='Delete User' /></form>"; } function del_user_submit() { global $ir,$c,$h,$userid; mysql_query("DELETE FROM users WHERE userid={$_POST['user']}",$c); print "User deleted."; } Find: [[url='admin.php?action=edituser']Edit User[/url]] Add After: [[url='admin.php?action=deluserform']Delete User[/url]] Ty JDubz for reminding me to add the link. :-D
-
Re: Need Help Good Point, I'll go to another section
-
Re: Need Help I can easily get it to say the amount of jail time for each crime, but I wanted for each crime with 0 jail time, for it to say 'None' instead of 0 Mins
-
Re: Need Help Yeah, The crimeFAIL is the amount of jail time for each crime...
-
Ive tried to add a column to my Crimes Page called Jail Time, I tried this: if ( $r2['crimeFAIL'] < 1 ) { $jailtime="<font color=green>None</font>"; } else { $jailtime="<font color=red>{$r2['crimeFAIL']} Mins</font> "; } It just says None for all crimes, can anyone help?
-
Re: [V1] FREE! ID refiller/counter Thanks Oxi, Great Mod. I had a major Prob with ID's on my Game, It jumped from 6 to 1113