Jump to content
MakeWebGames

POG1

Members
  • Posts

    1,419
  • Joined

  • Last visited

Everything posted by POG1

  1. Re: [V2] View Donators mixing xhtml??
  2. Re: day cron error This could do with tome optimization.
  3. Re: need help wtih this function like spudinski said you are missing a semi colon. The line before the print "$ph=(mysql_fetch_row($cph))" needs a semi colon, so... $ph = mysql_fetch_row($cph);
  4. Re: [GRPG] need help with ,new mods grpg is so insecure man
  5. Re: moving "boxes"? nothing in life will be given to you. Search for "3 column layout" and you will find what your looking for
  6. Re: [mccodes V1-V2]Selling MYOP - Players can make their Own Donor Packs ($75) There should be only 1 donating method...
  7. Re: Limiting Characters in username -register,game   Very well said, the explanations and demonstrations on the links i showed are very useful.
  8. Re: Making it harder to level up? to get less exp from crimes you will have to edit the payout (the standard crime system will work the exp from the payout) or the algorithm that determines the exp, but attacking would then have to be changed.
  9. Re: Limiting Characters in username -register,game strlen() or mb_strlen().. http://uk3.php.net/manual/en/function.strlen.php http://uk3.php.net/manual/en/function.mb-strlen.php
  10. POG1

    My Engine

    Re: My Engine I have another simple query. I added a table into the database and the pages that are disabled depending on status; hospital, jail, staff and admin. I was wondering what would be the best way, all i can think of is keep setting the same variable with a number of if functions. Here is what i got, i don't want the script to be very slow and there probably would be a better and faster way to do what i need, can someone give some pointers or help? please :)   $validPage = (preg_match('/^[a-z]+$/',$_GET['page']) AND isset($_GET['page']) AND file_exists($dir.'/'.$_GET['page'].'.php')) ? $_GET['page'] : index ; $pageArray = explode(",",$serverCheck['disabledpages']); $validPage = (in_array($validPage,$pageArray) AND $user_class->staff != 1) ? errorpage : $validPage ;
  11. Re: Hospital & Jail Timestamp. a cron will update the database, this will check if the time is correct. say if the time stamp was 100000 and you added 300 onto it (which is 5 mins) when it goes to check it will check against the current time stamp. With the $howlong you would have a way to set how long, so like a field in the crime table.
  12. Re: Hospital & Jail Timestamp. You could use strtotime() to add to the timestamp, here is a link to the php manual for it.. http://uk2.php.net/manual/en/function.strtotime.php
  13. Re: Hospital & Jail Timestamp. You will need a feild in the db and when they go to jail or hospital it puts the timestamp in. First you need to work out the timestamp.. $howlong = 300; // can be any number $timestamp = time() + $howlong; // this will be a timestamp 5 mins from now You will want it in the header and also in the viewuser, jailbust, attack ect. if(time() > $timestamp) { echo 'NOT IN HOSP OR JAIL'; $h->endpage(); die(); } That example is very basic but it is something like that.
  14. POG1

    My Engine

    Re: My Engine Thanks for that, the add works a treat! does this look ok to you? if(isset($_GET['block']) AND $user_class->staff == 1){ $block = preg_replace("/[^a-zA-Z0-9]/","",strip_tags(trim($_POST['block']))) $r = mysql_fetch_array(mysql_query("SELECT disabledpages FROM serverconfig")); $pageArray = explode(",",$r['disabledpages']); if(in_array($block,$pageArray)) { // unblock page $result = mysql_query(sprintf("UPDATE serverconfig SET disabledpages = REMOVE_FROM_SET('%s',disabledpages)",$block)); } else { // block page $result = mysql_query(sprintf("UPDATE serverconfig SET disabledpages = ADD_TO_SET('%s',disabledpages)",$block)); } } Also when i try to add the remove function i get an error
  15. POG1

    My Engine

    Re: My Engine hmm how can i add them, would i run them as a sql? i had tried a foreach loop but your sql functions seem better.
  16. POG1

    My Engine

    Re: My Engine I have another dilemma. I am working on a system that looks in the database and if the page is there it won't display it. The database feild will contain values like.. forum-mailbox-town-events I have used explode to seperate them into an array and i can add to the pages, but i can not take them away. Can someone please help me or tell me what i need? i was thinking of a function to delete a selected array then to put it back together with implode
  17. Re: [mccode v2] Staff Icon my menu is in the footer :-P
  18. Re: Need Help With My Staff List   <?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 "[b]Admins[/b] <table width=75% cellspacing=1 class='table'> <tr style='background:silver'><th>User</th> <th>Level</th> <th>Money</th> <th>Crystals</th> <th>Donator Days</th> <th>Last Seen</th> <th>Status</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>{$r['level']}</td> <td>\${$r['money']}</td> <td>{$r['crystals']}</td> <td>{$r['donatordays']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print "[b]Secretaries[/b] <table width=75% cellspacing=1 class='table'> <tr style='background:silver'><th>User</th> <th>Level</th> <th>Money</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>{$r['level']}</td> <td>\${$r['money']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; print "[b]Assistants[/b] <table width=75% cellspacing=1 class='table'> <tr style='background:silver'><th>User</th> <th>Level</th> <th>Money</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>{$r['level']}</td> <td>\${$r['money']}</td> <td>".date('F j, Y, g:i:s a',$r['laston'])."</td> <td>$on</td> </tr>"; } } print "</table>"; $h->endpage(); ?>
  19. Re: Please review My Game   why should it say that?
  20. POG1

    My Engine

    I am working on a game and i have decided to have everything work from the index file and use the switch function. I was wondering if there is a better way of how i done it..   <? $allowed = array(town,inventory,mailbox,bank); if(preg_match('/^[a-zA-Z0-9_]/',$page)( { echo '<h2>Page Error</h2>'; endPage(); die(0); } if (in_array($page, $allowed)) { switch($page) { case 'town': include("town.php"); break; case 'inventory': include("inventory.php"); break; case 'mailbox': include("mailbox.php"); break; case 'bank': include(bank.php"); break; // more here } } ?>   Would it be safe to just use. include($page.'.php');
  21. Re: Crons VS. Time Stamp I have been working on a timestamp cron implementation...   <? $timesinceupdate = time() - $update; if ($timesinceupdate>=300) { $num_updates = floor($timesinceupdate / 300); $result = mysql_query("SELECT id FROM `users`"); while($line = mysql_fetch_assoc($result)) { $updates_user = // get user details $newenergy = $updates_user->energy + (($updates_user->maxenergy * .21) * $num_updates); $newenergy = ($newenergy > $updates_user->maxenergy) ? $updates_user->maxenergy : $newenergy; $newnerve = $updates_user->nerve + (($updates_user->maxnerve * .21) * $num_updates); $newnerve = ($newnerve > $updates_user->maxnerve) ? $updates_user->maxnerve : $newnerve; } $leftovertime = $timesinceupdate - (floor($timesinceupdate / 300) * 300); if ($leftovertime>0) { $newupdate = time() - $leftovertime; // update DB } ?>
  22. Re: [V2] Inventory Item (x2) item_add() & item_remove() They are both functions that are in the mccodes v2 engine, why not use them?
  23. Re: Dodgy header problem dreamweaver is good if you know how to use it
  24. Re: [ANY] Random Comment   its only simple how can you know? a faster way would be to use $msg = 'Admin [1] Says: '; switch(mt_rand(1,3)) { case 1: $msg .= 'Enjoy the game and please donate'; break; case 2: $msg .= 'Enjoy playing & Remember to vote!'; break; case 3: $msg .= 'Thanks For Signing Up!'; beak; } echo $msg;
  25. POG1

    Time Stamp

    Re: Time Stamp ajax maybe?
×
×
  • Create New...