Jump to content
MakeWebGames

Karlos

Members
  • Posts

    951
  • Joined

  • Last visited

    Never

Everything posted by Karlos

  1. Re: forum posts   <?php include_once(DIRNAME(__FILE__) . '/globals.php'); echo 'Showing the last 10 forum posts! <table border="1" width="85%" class="table" cellspacing="0" cellpadding="2"> <tr style="text-align:center;"> <th>Topic</th> <th>Posts</th> <th>Started</th> <th>Last Post</th> </tr>'; $Select = $db->query("SELECT `ft_id`, `ft_name`, `ft_desc`, `ft_posts`, `ft_owner_id`, `ft_owner_name`, `ft_start_time`, `ft_last_id`, `ft_last_name`, `ft_last_time` FROM `forum_topics` ORDER BY `ft_last_time` DESC LIMIT 10"); while ($r = $db->fetch_row($Select)) { echo ' <tr style="text-align:center;"> <td> [url="forums.php?viewtopic='.intval($r['ft_id']).'&lastpost=1"]'.stripslashes($r['ft_name']).'[/url] [size="1"]'.stripslashes($r['ft_desc']).'[/size] </td> <td> '.number_format($r['ft_posts']).' </td> <td> '.date('F j Y, g:i:s a', $r['ft_start_time']).' By: [url="viewuser.php?u='.intval($r['ft_owner_id']).'"]'.stripslashes($r['ft_owner_name']).'[/url] </td> <td> '.date('F j Y, g:i:s a', $r['ft_last_time']).' By: [url="viewuser.php?u='.intval($r['ft_last_id']).'"]'.stripslashes($r['ft_last_name']).'[/url] </td> </tr>'; } echo ' </table>'; $h->endpage(); ?>   I think... :wink:
  2. Re: [V2] Current Status - What's going on? Working fine for me, just tested.
  3. Re: [V2] Current Status - What's going on? Nothing much, i got bored. Spaced out. Using number_format(). Shortened your code.
  4. Re: [V2] Current Status - What's going on?   <?php // Pwetty colours xD echo ' <table class="status"> <tr style="text-align:center;"> <td> [b]Your current status[/b]: </td> </tr> <tr style="text-align:center;"> <td>'; if($ir['hospital']) echo 'You are currently in hospital for '.number_format($ir['hospital']).' minutes.'; else if($ir['jail']) echo 'You are currently in jail for '.number_format($ir['jail']).' minutes.'; else if ($ir['new_mail'] > '0') echo 'You have new mail! Check your [url="mailbox.php"]mailbox[/url] to read it.'; else if ($ir['new_events'] > '0') echo 'You have new events! Check your [url="events.php"]events[/url] to check whats going on.'; else echo 'All is fine for you at the moment!'; echo ' </td> </tr> </table>';
  5. Re: [V2] Will Refill!   else if($_GET['spend'] == 'wrefill') { if (isset($_POST['points')) { $_POST['crystals'] = abs(intval($_POST['points'])); if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { echo 'Error, you either do not have enough points or did not fill out the form. [url="'.$_SERVER['PHP_SELF'].'?spend=wrefill"]Back[/url]'; } else { $Gain = ($ir['maxwill'] / '100') * $_POST['crystals']; $db->query(sprintf("UPDATE `users` SET `crystals`=`crystals`-'%u' WHERE `userid`='%u'", $_POST['crystals'], $userid)); $db->query(sprintf("UPDATE `users` SET `will`=`will`+'%u' WHERE userid='%u'", $Gain, $userid)); echo 'You traded '.$_POST['crystals'].' points for '.$Gain.' Will.'; if ($ir['will'] > $ir['maxwill']) { $db->query(sprintf("UPDATE `users` SET `will`=`maxwill` WHERE `userid`='%u'", $userid)); } } } else { echo ' How many points to refill will? You have [b]'.number_format($ir['crystals']).'[/b] points. One point = 1% Will. <form action="'.$_SERVER['PHP_SELF'].'?spend=wrefill" method="post"> <input type="text" name="points" /> <input type="submit" value="Trade" /> </form>'; }   Untested! Knowing My Luck There Might Be An Error.
  6. Re: 3 Word Game he licked goat
  7. Re: Can someone help me? Answer the questions.   E-Books, Teaching you're self GFX, become good at it. Make (X)HTML and CSS templates to practice and make it look nice! Urrr... How else are you ment to do it? Of course :wink: Of course. Idk. Never looked. Various tutorials over the net i'll think you'll find.
  8. Re: 3 Word Game career as a
  9. Re: forum posts Could use... set_error_handler() :wink:
  10. Re: forum posts Should use include_once() :wink:
  11. Re: Battle ladder [Mccodes V2] I've Done It! :wink: Only options are Create And Delete...   <?php /* Staff Interface For Richards Battle Ladder Modification. Made By Karlos. Richards Mod: [url="http://criminalexistence.com/ceforums/http://makewebgames.io/phpBB3/viewtopic.php?p=129051#p129051"]http://criminalexistence.com/ceforums/h ... 51#p129051[/url] Karlos's Add-On(Staff Interface): [url="http://criminalexistence.com/ceforums/http://makewebgames.io/phpBB3/viewtopic.php?p=129753#p129753"]http://criminalexistence.com/ceforums/h ... 53#p129753[/url] */ include_once (DIRNAME(__FILE__) . '/sglobals.php'); if($ir['user_level'] != '2') { echo '<font color="#FF0000>403 - Unauthorized Access</font>'; $h->endpage(); exit; } $_GET['act'] = isset($_GET['act']) && is_string($_GET['act']) ? trim($_GET['act']) : ""; switch($_GET['act']) { case 'CreateLadder': CreateLadder(); break; case 'DeleteLadder': DeleteLadder(); break; default: echo '<font color="#FF0000>What Are You Doing?!?</font>'; break; } function CreateLadder() { global $db, $c, $h; if(isset($_POST['NAME']) AND isset($_POST['LEVEL'])) { if(strlen($_POST['NAME']) < '5') { echo 'Sorry, The Battle Lader Name Is Too Short. [url="'.$_SERVER['PHP_SELF'].'"]Back[/url]'; $h->endpage(); exit; } $Get = $db->query(sprintf("SELECT `ladderName` FROM `battle_ladders` WHERE `ladderName`='%s'", addslashes($_POST['NAME']))); if($db->num_rows($Get)) { echo 'Sorry, You Can\'t Have Two Battle Ladders With The Same Name.'; $h->endpage(); exit; } $db->query(sprintf("INSERT INTO `battle_ladders` (`ladderName`, `ladderLevel`) VALUES ('%s', '%u')", addslashes($_POST['NAME']), abs(@intval($_POST['LEVEL'])))); echo 'Battle Ladder ('.addslashes($_POST['NAME']).') Added! > [url="'.$_SERVER['PHP_SELF'].'?act=CreateLadder"]Create Another![/url] > [url="staff.php"]Back To Staff Index[/url]'; stafflog_add('Created A Battle Ladder ('.addslashes($_POST['NAME']).')'); $h->endpage(); exit; } else { echo 'Adding A Battle Ladder... <form action="'.$_SERVER['PHP_SELF'].'?act=CreateLadder" method="post"> <table> <tr> <th>Ladder Name:</th> <td><input type="text" name="NAME"></td> </tr> <tr> <th>Ladder Level:</th> <td><input type="text" name="LEVEL"></td> </tr> <tr> <th colspan="2"><input type="submit" value="Add Battle Ladder!" /></th> </tr> </table> </form>'; } } function DeleteLadder() { global $db, $c, $h; if (isset($_POST['Ladder'])) { $Ladder = $db->fetch_row($db->query(sprintf("SELECT `ladderId`, `ladderName` FROM `battle_ladders` WHERE `ladderId` = '%u'", @intval($_POST['Ladder'])))); $db->query(sprintf("DELETE FROM `battle_members` WHERE `bmemberLadder`='%u'", $Ladder['ladderId'])); $db->query(sprintf("DELETE FROM `battle_ladders` WHERE `ladderId`='%u'", $Ladder['ladderId'])); echo 'Ladder Deleted! > [url="'.$_SERVER['PHP_SELF'].'?act=DeleteLadder"]Delete Another![/url] > [url="staff.php"]Back To Staff Index[/url]'; stafflog_add('Deleted Battle Ladder ('.$Ladder['ladderName'].')'); $h->endpage(); exit; } else { echo ' <h3>Delete A Battle Ladder</h3> Deleting A Ladder Is Permanent! Any Users On This Battle Ladder Will Be Taken Off. <form action="'.$_SERVER['PHP_SELF'].'?act=DeleteLadder" method="post"> <table> <tr> <td>Ladder:</td> <td>'.ladder_dropdown('Ladder').'</td> </tr> <tr> <th colspan="2"><input type="submit" value="Delete Ladder!" /></th> </tr> </table> </form>'; } } $h->endpage(); ?>   function ladder_dropdown($DropBox='Ladder', $Selected='-1') { global $db, $c; $Ret = '<select name="'.$DropBox.'" type="dropdown">'; $Q = $db->query("SELECT `ladderId`, `ladderName` FROM `battle_ladders` ORDER BY `ladderId` DESC"); if($Selected == '-1') { $First = '0'; } else { $First = '1'; } while($r=$db->fetch_row($Q)) { $Ret .= '\n<option value='.$r['ladderId'].'" '; if ($Selected == $r['ladderId'] || $First == '0') { $Ret .= 'selected="selected"'; $First = '1'; } $Ret .= '>'.stripslashes($r['ladderName']).'</option>'; } $Ret .= '\n</select>'; return $Ret; }   > [url="staff_battle.php?act=CreateLadder"]Create Ladder[/url] > [url="staff_battle.php?act=DeleteLadder"]Delete Ladder[/url]   Tested! No Error's Have Occoured During The Tests!
  12. Re: Nice Day Logout Ahh, well they say you learn something new everyday... I just have :-P
  13. Re: Battle ladder [Mccodes V2] xD I'll probably make an admin feature sometime tomorrow hopefully before cadets.. :wink:
  14. Re: Nice Day Logout I'm not great with arrays but i've tested a little array to cut down your code. $Day = array( 'Mon' => 'Monday', 'Tue' => 'Tuesday', 'Wed' => 'Wednesday', 'Thu' => 'Thursday', 'Fri' => 'Friday', 'Sat' => 'Saturday', 'Sun' => 'Sunday' ); $Day = $Day[date('D')]; echo ' <center> Have A Nice '.$Day.' </center> <meta http-equiv="refresh" content="4; url=login.php"> ';   Edit: Has Been Tested..
  15. Re: Some help with jobs.php error I sometimes use myql_errno
  16. Re: [any version] Removal of 1 minute crons Ahh very nice, would this also benifit for doing it half hour, hour and day? Timestamps aren't my best area but i need to learn :wink:
  17. Re: [any version] Removal of 1 minute crons So basically converting this to the 5min cron would be the better idea?
  18. Re: [v2] Car Mods Or modify the script and make them into a new table..
  19. Re: [any version] Removal of 1 minute crons Well i have been browsing the web and i found a link that maybe useful. http://buildingbrowsergames.com/2008/07 ... d-of-cron/
  20. Re: Daily Donators Reward [Mccode v2] as for the rand() in there try mt_rand()
  21. Re: Daily Donators Reward [Mccode v2]   I know what he can and can't do. This looks like his code.
  22. Re: User Levels [v2] I think he means making the user_level's for members 10 or something.
  23. Re: New Houses Mod [Mccodes V2] Well I always expect good mods for you so two words... WELL DONE! :lol:
  24. Re: Battle Tent error (Order of assending) DESC `cb_money` :wink:
  25. Re: Food Shop [Mccode V2] Here's a base for you.. functions "bur" and "pizza" have not been touched... Hopefully it shows you a better use of sprintf() and neater code.   <?php include_once (DIRNAME(__FILE__) . '/globals.php'); echo <<<Style <style type="text/css"> .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#999999; height:22px; } .table3 td { background-color:#000000; } td .alt { background-color:#0066FF; height:22px; } .table th { font-weight: bold; background-color: #A0A0A0; } </style> Style; $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? trim(strtolower($_GET['action'])) : ""; switch ($_GET['action']) { case 'buy': buy(); break; case 'bur': bur(); break; case 'pizza': pizza(); break; default: index(); break; } function index() { global $db, $ir, $userid; echo '<h4>Food Shop</h4> [i]Welcome To Our Food shop[/i] <table cellspacing="1" width="80%" class="table" cellspacing="1"> <tr> <th>Food Name</th> <th>Food Price</th> <th>Buy</th> </tr> <tr> <td>Chips</td> <td>$2</td> <td>[url="'.$_SERVER['PHP_SELF'].'?action=buy"]Buy Chips[/url]</td> </tr> <tr> <td>Burger</td> <td>$1</td> <td>[url="'.$_SERVER['PHP_SELF'].'?action=bur"]Buy Burger[/url]</td> </tr> <tr> <td>Pizza</td> <td>$7</td> <td>[url="'.$_SERVER['PHP_SELF'].'?action=pizza"]Buy Pizza[/url]</td> </tr> </table> [i]Made By Mafia-Club[/i]'; } function buy() { global $db, $ir, $h, $userid; if($ir['energy'] == $ir['maxenergy']) { echo 'Energy Is Already Full Come Back When you Have Less Energy'; $h->endpage(); exit; } if ($ir['money'] < '1') { echo 'Error: You Need Atleast $2 To Buy Chips'; $h->endpage(); exit; } if($ir['money'] > '2') { echo 'You Bought A Potion Of Chips Enjoy'; $db->query(sprintf("UPDATE `users` SET `money`=`money`-'5' WHERE `userid`='%u'", $userid)); $db->query(sprintf("UPDATE `users` SET `energy`=`energy`+'12' WHERE `energy` < `maxenergy` AND `userid`='%u'", $userid)); } } function bur() { global $db,$ir,$userid; if($ir['brave'] == $ir['maxbrave']) { echo "Brave Is Already Full Come Back Later When you Have Less Brave"; exit; } if($ir['money'] < 1) { echo "You Need Atleast $1 To Buy A burger"; } elseif($ir['money'] > 1 ) { echo "You Bought A Burger And Gained Brave"; $db->query("UPDATE users SET brave=brave+1 WHERE brave<maxbrave AND userid=$userid"); } } function pizza() { global $db,$ir,$userid; if($ir['hp'] == $ir['maxhp']) { global $db,$ir,$userid; echo "Your Health Is Already Full Come Back Later When You Have Less Health"; exit; } if($ir['money'] < 5 ) { echo "Error: You Need Atleast $7 To Buy A Pizza"; } elseif($ir['money'] > 7 ) { echo ":) You Just Bought A Pizza And will gain some health"; $db->query("UPDATE users SET money=money-7 WHERE userid=$userid"); $db->query("UPDATE users SET hp=hp+5 WHERE hp<maxhp AND userid=$userid"); } } $h->endpage(); ?>
×
×
  • Create New...