Jump to content
MakeWebGames

BradBoy08

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

BradBoy08's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Re: V2 index.php Ok i have put this in to my game and the rounded edges you have got from useing td .h in the css don't show up so maybe you could post yours.
  2. Re: V2 index.php But wouldn't we need that part of css to be able to view the index.php the way it should be?
  3. Re: V2 index.php <td class="h" you have this in a few places, What is "Class h"??
  4. Re: [v2]User Competitions[v2] I just fixed his errors =/
  5. Someone was complaining about the current ones that "webster" made wern't working so i went off and fixed most of the errors please let me know if youn find any because haven't had time to test :) Contains: 4 PHP Pages 2 SQL tables + 1 Alter 1 Cron Adjustment Make a file Called "compentry.php" <?php include "globals.php"; $_GET['u'] = abs((int) $_GET['u']); $q=$db->query("SELECT * FROM competitions WHERE id={$_GET['u']}"); if($db->num_rows($q) == 0) { print "Invalid Competition"; } else { $r=$db->fetch_row($q); if($ir['money']>{$r['fee']) { print " You have entered the competition [b]{$r['name']}[/b] Entering costed you \${$r['fee']} {$r['entrys']} people have entered this competition."; $db->query("UPDATE users SET money=money-fee WHERE userid=$userid"); } $db->query("UPDATE competitions SET profit=profit+{$r['fee']} WHERE id={'$_GET['u']}"); $db->query("INSERT INTO compentrys VALUES('',$userid)"); else { print "You do not have enough money to join this competition."; } ?>   Save it Create a fle called "comps.php"   <?php include "globals.php"; $_GET['u'] = abs((int) $_GET['u']); $q=$db->query("SELECT * FROM competitions WHERE id={$_GET['u']}"); if($db->num_rows($q) == 0) { print "Invalid Competition"; } else { $r=$db->fetch_row($q); if($ir['money']>{$r['fee']) { print " You have entered the competition [b]{$r['name']}[/b] Entering costed you \${$r['fee']} {$r['entrys']} people have entered this competition."; $db->query("UPDATE users SET money=money-fee WHERE userid=$userid"); } $db->query("UPDATE competitions SET profit=profit+{$r['fee']} WHERE id={'$_GET['u']}"); $db->query("INSERT INTO compentrys VALUES('',$userid)"); else { print "You do not have enough money to join this competition."; } ?>   Save that Then create "createcomp"   <?php include "globals.php"; $q=$db->query("SELECT * FROM competitions WHERE id={$_GET['u']}"); $r=$db->fetch_row($q); $f=$ir['level']*10000; if($ir['money'] < $f) { die("You don't have enough money. You need \$ $f to create a competion."); } if($ir['compown']) { die ("You are already running a competition!"); } if($_POST['submit']) { $name=htmlspecialchars($_POST['name']); $desc=htmlspecialchars($_POST['desc']); $db->query("INSERT INTO competitiona VALUES('','$name','$desc','{$ir['username']}','$cash','$crys','$item','$fee','$time','')"); $i=$db->insert_id(); $cost=$cash+$f $db->query("UPDATE users SET compown=$i,money=money-$cost,crystals=crystals-$crys where userid=$userid"); print "Competition created!"; } else { print "<h3> Create A Competition </h3> <form action='createcomp.php' method='post'><input type='hidden' name='submit' value='1' /> Name:<input type='text' name='name' /> Description: <textarea name='desc' cols='40' rows='7'></textarea> Entry Fee:<input type='text' name='fee' /> Cash Reward:<input type='text' name='cash' /> Crystals Reward:<input type='text' name='crys' /> Hours:<input type='text' name='time' /> Item: ".item_dropdown($c,'item')." <input type='submit' value='Create Competition' /></form>"; } $h->endpage(); ?>   Save that Create "viewcomp.php"   <?php include "globals.php"; $_GET['u'] = abs((int) $_GET['u']); if(!$_GET['u']) { print "Invalid use of file"; } else { $q=$db->query("SELECT * FROM competitions WHERE id={$_GET['u']}"); if($db->num_rows($q) == 0) { print "This competition no longer exists."; } else { $r=$db->fetch_row($q); print " <table width=100% cellspacing=1 class='table'> <tr style='background:gray'> <th width='50%'>General Info</th><th width='50%'>Rewards</th> ></tr> <tr> <td> Creator: {$r['creator']} Time left (Hours): {$r['time']} </td> <td> Money: \${$r['rewardcash']} Crystals: {$r['rewardcrys']}</tr> <tr> <th colspan='2'>Users Joined</th></tr>"; $b=$db->row_count($q); print " <tr><td>$b</td></tr> <tr><td>[url='compentry.php']Enter this competition[/url]</td></tr> </table> "; } $h->endpage(); ?>   Save That Run this SQL in PHPMyAdmin   CREATE TABLE `competitions` ( `id` int(11) NOT NULL auto_increment, `compname` text NOT NULL, `compdesc` text NOT NULL, `creator` text NOT NULL, `rewardcash` int(11) NOT NULL default '0', `rewardcrys` int(11) NOT NULL default '0', `rewarditem` int(11) NOT NULL default '0', `fee` int(11) NOT NULL default '1000', `entrys` int(11) NOT NULL default '0', `profit` int(11) NOT NULL default '0', `time` int(11) NOT NULL default '24', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE `compentrys` ( `id` int(11) NOT NULL auto_increment, `userid` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; ALTER TABLE `users` ADD `compown` int(11) NOT NULL;   Find this in "cron_hour.php" <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } 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;   After add $db->query("UPDATE competitions set time=time-1"); if ($b['time'] == 0) { $conn=$db->query("SELECT * FROM competitions"); while($b=$db->fetch_row($conn)) $entry=$db->query("SELECT * FROM compentrys WHERE id={$b['id']}"); while($e=$db->fetch_row($entry)) $winner=rand(1,'{$b['entrys']}'); $prize=$db->("SELECT * FROM compentrys WHERE id=$winner"); $db->("UPDATE users SET money=money+{$b['rewardcash']} crystals=crystals+{$b['rewardcrys']} WHERE id={$prize['userid']}"); $db->("UPDATE users SET money=money+ WHERE id={$b['creator']}"); $db->("DELETE FROM competitions WHERE id={$b['id']}"); $db->("DELETE FROM compentrys WHERE id={$b['id']}");   Then place this anywhere you want.   [url='comps.php']Competitions[/url]
  6. Re: [MCCODE V2] User Competitions   Cash Reward:<input type='text' name='cash' /> Crystals Reward:<input type='text' name='cash' /> Should be Cash Reward:<input type='text' name='cash' /> Crystals Reward:<input type='text' name='crys' />
  7. Re: Staff Password without sql's. (ANY VERSION)   Here with the userids =] Stafflogin.php: [code]<?php include("globals.php"); if($ir['user_level'] == 1) { echo 'You must be a total newb if your trying to login to the admin panel XD'; $h->endpage(); exit; } echo 'You were redirected here because you are not logged into the staff panel. '; if($ir['userid'] == 1) { $pass = "password"; } else if($ir['userid'] == 2) { $pass = "password"; } else if($ir['userid'] == 3) { $pass = "password"; }//add more or less else if statments depends on what you want $_POST['pass'] = htmlspecialchars(mysql_real_escape_string($_POST['pass'])); if($_POST['pass'] == $pass) { $_SESSION['stafflogin'] = 1; header('location: staff.php'); } else if($_POST['pass'] != $pass) { echo 'Wrong password. Go back and try again.'; $h->endpage(); exit; } echo '<form action="stafflogin.php" method="post"> Password: <input type="password" name="pass"> <input type="submit" value="Submit"></form>'; $h->endpage(); ?>   smenu.php: if($_SESSION['stafflogin'] == 0) { header('location: stafflogin.php'); }[/code]
  8. Re: Little forum mod Thanks ammo=]
  9. Re: Emerngency Surgery for V2 1. Ain't isn't a word it was Arn't 2 i had trouble was trying to turn the script in to a revive so that another player can revive other people for a certain amount of energy
  10. Re: Little forum mod iseeyou it is exactly the same as normal forums accept admins only can see the start new topic button
  11. Re: Emerngency Surgery for V2 i have a good idea for this will post in a bit
  12. Re: Little forum mod Thanks, Trying to get some SQL to run perfectly if anyone can help me hit me up on msn: [email protected]
  13. ok basically i made this little mod thing myself and you can make it so that in a certain forum only staff/admins can start topics and everyone else can reply to them until locked/deleted... In forums.php Replace The Whole Fuction - function newtopicform() With function newtopicform() { global $ir, $c, $userid, $h, $bbc, $db; $q=$db->query("SELECT * FROM forum_forums WHERE ff_id={$_GET['forum']}"); $r=$db->fetch_row($q); $a=$db->query("SELECT * FROM forum_forums WHERE ff_id=1");/*Change the number to the forum ID you want.*/ if(($r['ff_auth']=='gang' AND $ir['gang'] != $r['ff_owner']) OR ($r['ff_auth'] == 'staff' AND $ir['user_level'] < 2)) { print "You have no permission to view this forum. > [url='forums.php']Back[/url]"; $h->endpage(); exit; } if ($ir['user_level'] == 2 AND $a == true) { print <<<EOF <big>[url='forums.php']Forums Home[/url] >> [url='forums.php?viewforum={$_GET[']{$r['ff_name']}[/url] >> New Topic Form</big> <form action='forums.php?act=newtopic&forum={$_GET['forum']}' method='post'> <table cellspacing='1' class='table' width='80%' border='0'> <tr> <td align=right>Topic Name:</td> <td align=left><input type='text' name='ft_name' value='' /></td> </tr> <tr> <td align=right>Topic Description:</td> <td align=left><input type='text' name='ft_desc' value='' /></td> </tr> <tr> <td align=right>Topic Text:</td> <td align=left><textarea rows='8' cols='45' name='fp_text'></textarea></td> </tr> <tr> <th colspan=2><input type='submit' value='Post Topic' /></th> </tr> </table> EOF; } elseif ($ir['user_level'] > 1 AND $a == false) { print <<<EOF <big>[url='forums.php']Forums Home[/url] >> [url='forums.php?viewforum={$_GET[']{$r['ff_name']}[/url] >> New Topic Form</big> <form action='forums.php?act=newtopic&forum={$_GET['forum']}' method='post'> <table cellspacing='1' class='table' width='80%' border='0'> <tr> <td align=right>Topic Name:</td> <td align=left><input type='text' name='ft_name' value='' /></td> </tr> <tr> <td align=right>Topic Description:</td> <td align=left><input type='text' name='ft_desc' value='' /></td> </tr> <tr> <td align=right>Topic Text:</td> <td align=left><textarea rows='8' cols='45' name='fp_text'></textarea></td> </tr> <tr> <th colspan=2><input type='submit' value='Post Topic' /></th> </tr> </table> EOF; } }
  14. Ok 2nd mod on here and let me know what you think of this... Replace the whole of stafflist.php with... <?php include "globals.php"; $staff=array(); $q=$db->query("SELECT * FROM users WHERE user_level IN(2,3,5) ORDER BY userid ASC"); while($r=$db->fetch_row($q)) { $staff[$r['userid']]=$r; } print " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'><th>User</th> <th>Status</th> <th>Duties</th> <th>Last Seen</th> <th>Online</th> </tr>"; foreach($staff as $r) { if($r['user_level']==2) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><font color=blue>Admin</font></td> <td>{$r['duties']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'><th>User</th> <th>Status</th> <th>Duties</th> <th>Last Seen</th> <th>Status</th> </tr>"; foreach($staff as $r) { if($r['user_level']==3) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><font color=yellow>Secretary</font></td> <td>{$r['duties']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'><th>User</th> <th>Status</th> <th>Duties</th> <th>Last Seen</th> <th>Status</th> </tr>"; foreach($staff as $r) { if($r['user_level']==4) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><font color=green>Assistant</font></td> <td>{$r['duties']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'><th>User</th> <th>Status</th> <th>Duties</th> <th>Last Seen</th> <th>Status</th> </tr>"; foreach($staff as $r) { if($r['user_level']==5) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><font color=purple>Modorator</font></td> <td>{$r['duties']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print " <table width=75% cellspacing=1 class='table'> <tr style='background:gray'><th>User</th> <th>Status</th> <th>Duties</th> <th>Last Seen</th> <th>Status</th> </tr>"; foreach($staff as $r) { if($r['user_level']==6) { if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td><font color=cyan>Helper</font></td> <td>{$r['duties']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; $h->endpage(); ?>
  15. Re: userlist.php with a few mods to it V2 give us a few mins and i'll get screen shot
×
×
  • Create New...