Jump to content
MakeWebGames

Paddy

Members
  • Posts

    211
  • Joined

  • Last visited

Everything posted by Paddy

  1. Edited: this below is what i use and doesn't leave any gaps, obviosly you can play around with some css in the style section to fit your game   $row_color = 0; while($r=$db->fetch_row($q)) { $row_color++; if ($row_color % 2 == 0) { $paddy = ' style="background-color:#484848;text-align:center;"'; } else { $paddy = ' style="background-color:#686868;text-align:center;"'; } print " <tr$paddy> and all the other <td>text here</td>
  2. have you added the business_cron.php correctly?
  3. A much easier way :P $row_color = 0; while($r=$db->fetch_row($q)) { $row_color++; if ($row_color % 2 == 0) { $paddy = ' style="background-color:#484848;text-align:center;"'; } else { $paddy = ' style="background-color:#686868;text-align:center;"'; } print " <tr$paddy> and all the other <td>text here</td>
  4. thanks for the tips but was missing a while($ = mysql_fetch_assoc($paddy)) working now :)
  5. lets say ive changed most of the things around and filename is just an example name of the file i want to show the user list so everything there is correct just missing something
  6. Hi Guys, I need to show a list of usernames on a specific page this is what ive done at the moment can anyone drive me to the right direction. i have a row in users_table which is current_page and if user is on index.php it says he`s on (index page) so i can follow where users are, but i want to convert current_page to a user_name list, so im probably missing something in the sql query any help will be appreciated   include "global_engine.php"; $paddy=$db->query("SELECT `current_page` FROM users_table WHERE user_id=$user_id LIMIT 5"); $ass=$db->fetch_row($paddy); if($ir['current_page'] >= filename) { $current_page="----"; } else { $current_page="".$bbc->bbcode_parse(user_name($ass['user_id'])).""; } echo <<<EOT <table> <tr> <td>$current_page</td> </tr> </table> EOT;
  7. Pm me the URL of your game and ll have a look
  8. Download PSD here ^^
  9. I try not to use JS unless needed and no way round it, by saying that i would go for a Full css drop down but that's my opinion, also guys start making your headers neater remove all css from there looks awful and create a style-sheet and to finish up my post $IP = ($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; Make sure you change that!!! look at my simple header and see the difference
  10. After clicking the link given in the first post you will be redirected to a website go to the bottom of the page and find "Save file to your PC: click here"
  11. Not sure i think line 180 needs a } or a {
  12. didn't find what i wanted but since i found something, its good for others that like me are interested to read this Enabling the zlib output compression can speed up the load times considerably(up to 7x and more), particularly on pages which are comprised mostly of html code without pictures, These directions apply for Apache servers with PHP, and the zlib compression module installed, which is the case with the majority of the servers. To enable the compression , you just have to add the following 2 lines to the .htaccess file which resides in the www directory of the server. If there is no such file, create it: php_flag zlib.output_compression on php_value zlib.output_compression_level 2 That's it. Providing the server supports it, you should now experience considerable diference in how fast the pages are displayed. So its good but i still need to compare though
  13. Thanks AlucarD Above error has been fixed from V2 to Lite
  14. checked zlib.output_compression Off zlib.output_compression_level-1 zlib.output_handler no value so zlib would be better? i have gzib tough!
  15. Im sure if you read trough the code you could do it you self with out converting Make sure you understand the stylesheet and class set in Header.php then see the sqls and change accordingly, any errors i will help you out
  16.   a yeah forgot about the Font.. easily done just need to add it to the css stylesheet and define it from there with a class for the IP your right but no harm is done with 2 extra lines ^^
  17. Simple Header made for those who are just getting started with a game and want to change from the mcc Default layout (Simple & Free) Header.php Stylesheet (CSS) images all need to go in an image folder W3C Validated Ive also used a sprite might wanna have a look at it you can do great things having sprites when using loads of images   Tested in Browsers Opera - IE7 - IE8 - IE9 -Firefox <?php header('X-UA-Compatible: IE=EmulateIE8'); ob_start ("ob_gzhandler"); header("Cache-Control: must-revalidate"); $count = 3; $x = -1; while($x < $count) { $security = array("ID","viewforum","viewtopic"); $x++; $_GET[$security[$x]] = abs(@intval($_GET[$security[$x]])); } class headers { function startheaders() { global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>{$set['game_name']}</title> <meta http-equiv="content-language" content="en"/> <meta name="Distribution" content="Global"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> <link rel="stylesheet" type="text/css" href="custom.css" /> </head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> <style type="text/css"> img { border: none; } </style> EOF; } function userdata($ir,$lv,$fm,$cm,$dosessh=1) { global $db,$c,$userid, $set; $IP = $_SERVER['REMOTE_ADDR']; $IP = mysql_real_escape_string($IP); $IP = $db->escape($IP); $db->query("UPDATE users SET laston=unix_timestamp(), lastip='$IP' WHERE userid=$userid"); if(!$ir['email']) { global $domain; die (" <body> Your account may be broken. Please mail support@{$domain} stating your username and player ID."); } if($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { print " You lost all your EXP for running from the fight."; $db->query("UPDATE users SET exp=0, attacking=0 WHERE userid=$userid"); $_SESSION['attacking']=0; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $wiperc=(int) ($ir['will']/$ir['maxwill']*100); $experc=(int) ( $ir['exp']/$ir['exp_needed']*100); $brperc=(int) ($ir['brave']/$ir['maxbrave']*100); $hpperc=(int) ($ir['hp']/$ir['maxhp']*100); $enopp=100-$enperc; $wiopp=100-$wiperc; $exopp=100-$experc; $bropp=100-$brperc; $hpopp=100-$hpperc; $d=""; $u=$ir['username']; if($ir['donatordays']) { $u = " <font color=red>{$ir['username']}</font> ";$d="[img=donator.gif]"; } $gn=""; global $staffpage; $bgcolor = '999999'; //Display Pic $display_pic = $ir['display_pic']; if(!$display_pic) { $display_pic="/images/noav.png"; } print <<<OUT <div id="hd"> <div class="hd_displaypic">[img=$display_pic]</div> <div class="hd_username"> [b]Name:[/b] [url="viewuser.php?u={$ir['userid']}"] $gn{$u} [{$ir['userid']}] $d[/url] </div></div> <ul id="menu"> [*][url="index.php"]Home[/url] [*][url="inventory.php"]Inventory[/url] [*][url="explore.php"]City[/url] [*][url="viewuser.php?u={$ir['userid']}"]Profile[/url] [*][url="bank.php"]Bank[/url] [*][url="gym.php"]Gym[/url] [*][url="bank.php"]Test[/url] [*][url="gym.php"]Test[/url] [*][url="logout.php"]Logout[/url] [/list] <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top" align="left" style="padding-left:10px;"> <span class='icons1' style='padding-left:24px;'></span>[b]Money:[/b] {$fm} <span class='icons2' style='padding-left:24px;'></span>[b]Level:[/b] {$ir['level']} <span class='icons3' style='padding-left:24px;'></span>[b]Crystals:[/b] {$ir['crystals']} <hr /> <div class="stat_bars"> <div>[b]Energy:[/b]</div> <a href="#" class="Tooltip"><span>Current Energy:{$enperc}%</span> <img src=images/bar.png width=$enperc height=10><img src=redbar.png width=$enopp height=10></a> </div> <div class="stat_bars"> <div>[b]Will:[/b]</div> [url="#"]<span>Current Will: {$wiperc}%</span><img src=images/bar.png width=$wiperc height=10><img src=redbar.png width=$wiopp height=10>[/url] </div> <div class="stat_bars"> <div>[b]Brave:[/b]</div> [url="#"]<span>Current Brave: {$ir['brave']}/{$ir['maxbrave']}</span><img src=images/bar.png width=$brperc height=10><img src=redbar.png width=$bropp height=10>[/url] </div> <div class="stat_bars"> <div>[b]EXP:[/b]</div> [url="#"]<span>Current EXP: {$experc}%</span><img src=images/bar.png width=$experc height=10><img src=redbar.png width=$exopp height=10>[/url] </div> <div class="stat_bars"> <div>[b]Health:[/b]</div> [url="#"]<span>Current Health: {$hpperc}%</span><img src=images/bar.png width=$hpperc height=10><img src=redbar.png width=$hpopp height=10>[/url] </div> <hr /> OUT; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die(" [b] <font color=red size=+1> You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die(" [b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = '999999'; print ' </td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td> <td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = 'FFFFFF'; print ' </td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td> <td width="80%" bgcolor="#'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; //Shows useronline & Total Users $q=$db->query(" SELECT userid FROM users WHERE laston>unix_timestamp()-100*60 ORDER BY laston DESC"); $r1=$db->num_rows($q); $q=$db->query("SELECT userid FROM users"); $r2=$db->num_rows($q); print <<<OUT </center> </td></tr></table> </td><td class="rgrad"></td> </tr><tr><td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"></td> <td class="dgrad" align="center">Total Users [url="userlist.php"]$r2[/url] | Users Online [url="usersonline.php"]$r1[/url] </td> <td class="dgradr"></td> </tr></table> </td></tr></table> </body> </html> OUT; } } ?>   body { background-color : #333333; margin-top : 0; margin-bottom : 0; font-family : calibri, helvetica, arial, geneva, sans-serif; font-size : 12px; color : black; } #hd { background : url('images/header.png') no-repeat scroll 0% 0%; height : 200px; width : 932px; } .hd_displaypic { position : absolute; top : 16px; left : 213px; } .hd_username { position : absolute; top : 160px; left : 210px; font-variant : small-caps; } a img { border : none; } a:visited { text-decoration : none; color : black; } a:active, a:link { color : black; text-decoration : none; text-indent : 20px; } a:hover { text-decoration : underline; color : red; } table, tr, td { font-family : helvetica, arial, geneva, sans-serif; font-size : 12px; } img { border : none; } textarea { font-family : helvetica, arial, geneva, sans-serif; font-size : 12px; color : black; } .lgrad { background-image : url(images/lgrad.png); background-repeat : repeat-y; width : 19px; } .linegrad { background-image : url(images/lgrad.png); background-repeat : repeat-y; width : 2px; } .rgrad { background-image : url(images/rgrad.png); background-repeat : repeat-y; width : 19px; } .dgrad { background-image : url(images/dgrad.png); background-repeat : repeat-x; height : 38px; } .dgradl { background-image : url(images/dgradl.png); background-repeat : no-repeat; height : 38px; width : 38px; } .dgradr { background-image : url(images/dgradr.png); background-repeat : no-repeat; height : 38px; width : 38px; } .center { width : 932px; background-color : #ffffff; } .table { background-color : #000000; } .table3 { background-color : #000000; } .table td { background-color : #dedede; height : 22px; } .table3 td { background-color : #cccccc; } td .alt { background-color : #eeeeee; height : 22px; } td .h { background-image : url(tablehgrad.png); background-repeat : repeat-x; font-weight : bold; background-color : #d6d6d6; } .table th { background-image : url(tablehgrad.png); background-repeat : repeat-x; font-weight : bold; background-color : #d6d6d6; } ul#menu { margin : 0; padding : 0; list-style-type : none; width : auto; position : relative; display : block; height : 36px; font-size : 12px; font-weight : bold; text-transform : lowercase; background : transparent url("images/bg.jpg") repeat-x left top; font-family : "Trebuchet MS", Helvetica, Arial, Verdana, sans-serif; border-bottom : 1px solid #000000; border-top : 1px solid #000000; font-variant : small-caps; } ul#menu li { display : block; float : left; margin : 0; } ul#menu li a { display : block; float : left; color : #999999; text-decoration : none; font-weight : bold; padding : 12px 20px 0 20px; height : 24px; } ul#menu li a:hover { color : #ffffff; background : transparent url("images/over.jpg") no-repeat right top; } .stat_bars { color : #000; margin : 0px auto; font-family : Verdana; font-size : 11px; font-weight : normal; height : 25px; border:0; border:none; } .icons1 { background : url(images/icons.png) no-repeat scroll -1px 2px; height : 16px; width : 16px; margin : 0 0 0 auto; } .icons2 { background : url(images/icons.png) no-repeat scroll -1px -14px; height : 16px; width : 16px; margin : 0 0 0 auto; } .icons3 { background : url(images/icons.png) no-repeat scroll -1px -30px; height : 16px; width : 16px; margin : 0 0 0 auto; } a.Tooltip { position : relative; z-index : 24; background-color : #555555; color : #000; text-decoration : none; } a.Tooltip:hover { z-index : 25; } a.Tooltip span { display : none; } a.Tooltip:hover span { display : block; position : absolute; top : 2em; left : 2em; width : 14em; border : 1px solid #333333; background-color : #555555; color : #000; text-align : center; }   If you need anything changed or added let me know Thanks   http://img411.imageshack.us/img411/2251/headerpe.png http://www.2shared.com/photo/CqspSUgR/new_header.html <<--- PSD
  18. Ive seen this on a game already and works great... go for it!!
  19. yeah i agree with illegal life userpic - userpic - userpic- userpic userpic - userpic - userpic- userpic that's what he meant (i hope)
  20. Not tested, please let me know how it goes and ill edit it   <?php $d2=mysql_query("SELECT COUNT(*) as cnt FROM mail WHERE mail_to={$ir['userid']} AND mail_read=0",$c) or die(mysql_error()); $r=mysql_fetch_array($d2); if($r['cnt'] != 0) { ?> <script type="text/javascript"> <!-- function confirmation() { var answer = confirm("You Have Mail") if (answer){ alert("Go Check Your Mail") window.location = "http://www.yourdomain.com/mail.php"; } else{ alert("add anything or remove") } } //--> </script> <?php } ?>
  21. Try This   PHP Source code function bb2html($text){$pattern[] = "/\[url=([^<> \n]+?)\](.+?)\[\/url\]/i";$replacement[] = '[url="\\1"]\\2[/url]';$pattern[] = "/\[url\](.+?)\[\/url\]/i";$replacement[] = '[url="\\1"]\\1[/url]';$pattern[] = "/\[email=([^<> \n]+?)\](.+?)\[\/email\]/i";$replacement[] = '[email="\\1"]\\2[/email]';$pattern[] = "/\[img[=]?(left|right)?\](([^<> \n]+?)\.(gif|jpg|jpeg|png|bmp))\[\/img\]/i";$replacement[] = '[img=\\2]';$pattern[] = "/\[[bB]\](.+?)\[\/[bB]\]/s";$replacement[] = '[b]\\1[/b]';$pattern[] = "/\[[iI]\](.+?)\[\/[iI]\]/s";$replacement[] = '[i]\\1[/i]';$pattern[] = "/\[[uU]\](.+?)\[\/[uU]\]/s";$replacement[] = '<u>\\1</u>';$pattern[] = "/\[[pP]\](.+?)\[\/[pP]\]/s";$replacement[] = ' \\1</p>';$pattern[] = "/\[[sS]\](.+?)\[\/[sS]\]/s";$replacement[] = '<s>\\1</s>';$pattern[] = "/\/s";$replacement[] = '<hr />';$pattern[] = "/\(.+?)\[\/center\]/is";$replacement[] = '<center>\\1</center>';$pattern[] = "/\[align(=left|=right|=center|=justify)?\](.+?)\[\/align\]/is";$replacement[] = '<div align\\1>\\2</div>';$pattern[] = "/\[color=(#[A-F0-9]{6})\](.+?)\[\/color\]/is";$replacement[] = '<font color="\\1">\\2</font>';$pattern[] = "/\[link=([^<> \n]+?)\](.+?)\[\/link\]/i";$replacement[] = '[url="\\1"]\\2[/url]';$pattern[] = "/\[nbsp]/s";$replacement[] = ' ';$pattern[] = "/\[div]/s";$replacement[] = '<div class="hr"> </div>';$pattern[] = "/\[bp]/s";$replacement[] = '[img=icons/bullet.png] ';$pattern[] = "/\[arrow]/s";$replacement[] = '[img=icons/arrow.png] ';$pattern[] = "/\[ab=([^<> \n].+?)\](.+?)\[\/ab\]/i";$replacement[] = '<abbr title="\\1">\\2</abbr>';$text = preg_replace($pattern, $replacement, $text);return $text;}function strip_bbcode($text){$pattern[] = "/\[url=([^<> \n]+?)\](.+?)\[\/url\]/i";$pattern[] = "/\[email=([^<> \n]+?)\](.+?)\[\/email\]/i";$pattern[] = "/\[img(=left|=right)?\](([^<> \n]+?)\.(gif|jpg|jpeg|png))\[\/img\]/i";$pattern[] = "/\[[bB]\](.+?)\[\/[bB]\]/s";$pattern[] = "/\[[iI]\](.+?)\[\/[iI]\]/s";$pattern[] = "/\[[uU]\](.+?)\[\/[uU]\]/s";$pattern[] = "/\/s";$pattern[] = "/\(.+?)\[\/center\]/is";$pattern[] = "/\[align(=left|=right|=center|=justify)?\](.+?)\[\/align\]/is";$pattern[] = "/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";$pattern[] = "/\[link=([^<> \n]+?)\](.+?)\[\/link\]/i";$pattern[] = "/\[nbsp]/s";$pattern[] = "/\[div]/s";$pattern[] = "/\[bp]/s";$text = preg_replace($pattern, $replaces, $text);return $text;}
  22. can you post 1 or 2 lines where the error is? like line 40,41,42,43 could help
  23. well post the error!
  24. [<a href = 'Rating.php?page=Plus&ID=.abs(intval($_GET['u]))."'><span style = 'color:green'>+1</span></a>] [<a href = 'Rating.php?page=Minus&ID=.abs(intval($_GET['u]))."'><span style = 'color:red'>-1</span></a>]   if the php file name is Ratings.php its wrong needs to be like the link above Rating.php or change the links to [<a href = 'Ratings.php?page=Plus&ID=.abs(intval($_GET['u]))."'><span style = 'color:green'>+1</span></a>] [<a href = 'Ratings.php?page=Minus&ID=.abs(intval($_GET['u]))."'><span style = 'color:red'>-1</span></a>]
  25. try adding this error_reporting(E_ALL); right after the <?php try it on a day cron or what ever you think is given you an error   so on top it will look like this   <?php error_reporting(E_ALL);   see what that gives you, Deleting them wont solve your issue
×
×
  • Create New...