Jump to content
MakeWebGames

BludClart

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Everything posted by BludClart

  1. I guess i could just put the ajax straight into the file that they are on when playing the game, This is the html buttons :)   $options = "<td align = 'center' width = '25%'><form method = 'post' name = 'check_btn'> <input type = 'button' name = 'check_btn' value = 'Check' onClick=\"postFormAjax('ptable.php?XID=".$_GET['XID']."', 'check_btn');\"></form></td> <td align = 'center' width = '25%'><form method = 'post' name = 'fold_btn'> <input type = 'button' name = 'fold_btn' value = 'Fold' onClick=\"postFormAjax('ptable.php?XID=".$_GET['XID']."', 'fold_btn');\"></form></td> <td align = 'center' width = '50%'><form method = 'post' name = 'bet_btn'><input type = 'text' name = 'bet_amt' value = '' onkeypress=\"typingOn();\"> <input type = 'button' name = 'bet_btn' value = 'Bet' onClick=\"postFormAjax('ptable.php?XID=".$_GET['XID']."', 'Bet_btn');\"></form></td>";
  2. <?php echo "<meta http-equiv = \"Pragma\" content = \"no-cache\"> <meta http-equiv = \"Cache-Control\" content = \"must-revalidate\"> <center> <script type=\"text/javascript\"> var f = false; var waittime = 5000; var pauserefresh = false; function typingOn() { pauserefresh=true; } if(pauserefresh != true) { function autoRefresh() { clearTimeout(); if(pauserefresh != true) { setTimeout('refreshPoker(\"#\")',5000); } } function postFormAjax(url, formname) { var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\"); } if (!f && xmlhttp) { var fields = new Array(); if(formname) { var ajax = formname; } //loop through form elements and retrieve field NAMEs and Values for (var x = 0; x < eval(\"document.\"+ajax+\".elements.length\"); x++) { // join them into a string. eval(\"fields.push(document.\"+ajax+ \".elements[x].name+'='+document.\" +ajax+\".elements[x].value)\"); } elem = 'errors'; var sendf = fields.join('&'); xmlhttp.open(\"POST\", url, true); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { results = xmlhttp.responseText; var para = document.getElementById('errors'); para.innerHTML = results; f = false; // re activate the AJAX function } } } xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlhttp.send(sendf); f = true; if(pauserefresh != true) { refreshPoker(\"#\"); } } } function refreshPoker(url) { var xmlhttp; if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else { xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4) { document.getElementById(\"pokermain\").innerHTML = ''; document.getElementById(\"pokermain\").innerHTML = xmlhttp.responseText; } } xmlhttp.open(\"GET\", url, true); xmlhttp.send(null); if(pauserefresh != true) { autoRefresh(); } } } </script>"; ?>   This is what im including as the ajax, Whats wrong is i have to refresh the page everytime i want to be able to push a button =\
  3. Haha i think i did :S Must of been cuz my internet was all messed up :P
  4. You cany just secure everything through includes, Go round your whole site and just secure EVERY little thing, There is always ways of getting round these includes! Better still just dont use mccodes lol, Rebuild your own engine, I have and believe me i feel like i cant of done anything better, I secured it as i weant along and now i know that its pretty much fully secure to my ability!
  5. Well its the same way for everyone pretty much, But i think it might be my revalidate control =\ I mean it must be able to be done because when i refresh the page the buttons work again but then of course that makes the ajax pointless ROFL XD
  6. I have no idea how my post ended up here :S haha
  7. Hey guys, Been a while since i logged on lol, I am having some problems with my buttons, I have made the body start a refresh function every 5 seconds using my ajax script, Also made it so they can post forms using the ajax script, It kind of loops through as the game goes, Problem i have is this: When a user clicks the button in the main div(The game platform) it will work no problem...BUT if they click any other buttons after that they dont react in any way...When they refresh the page they can click another button and so on, I dont know what i am doing wrong but any help would be appreciated!! Thanks :)
  8. No offence but i wouldnt use die(''); it is better to use echo "Page closed blah blah"; $h->endpage(); exit(); just means that if they have a custom header half the images after where you add die(''); wouldnt show =\ so i would use exit();
  9. Lol sorry family problem atm guys,sister been rushed into hospital,best thing to say is it will be up as soon as i can get it up....sorry about the wait guys :|
  10. I have it progressive like TC if that helps? =\ and they lose exp for failing wich can help ;) half what the gain would have been gets taken away :) and it goes by crimexp
  11. Just a quick update,You will have to download the main file from my ftp,i will give a link to a text file.it is over 700 maybe 800 lines long,and i aint sitting here adding it like that :P 85% done,aim to get the last part done within the hour ;) And if anyone is good at securing scripts,it wouldnt go a miss for someone to secure it :P
  12. Hey users of MWG! Just popped on to tell you all that i am currently making a dog mod,This is basically a dog racing mod,where you can own the dogs,race head to head,or race them in an arena,train your pet,feed it,walk it,treat it,name it,give it a personal picture,gain rewards,show it off on your profile to other users,buy it items such as toys and leads,hrnesses ect.take it to the vets if it gets ill,dog can be punded due to neglect,you can only own one dog at one time,you can rehome it,or it might run away due to neglect(its a random for running away or pounded) I hope this mod will appear to you guys! Will be adding this tonight latest!
  13. tbh mate,You could make this,but it has already been made by immortal.And was very popular,So i dont know how that will work out :S
  14. I could only get it to work like this mate,Any reason why? :)   <?php include_once (DIRNAME(__FILE__) . '/globals.php'); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'index'; switch($_GET['action']) { case 'banned': fedded(); break; case 'forum': forum_banned(); break; case 'mails': mail_banned(); break; default: index(); break; } if (!in_array($_GET['action'], array('banned','forum','mails','index'))) { echo "[b]Invalid Action.[/b]"; $h->endpage(); exit; } if(!function_exists('format')) { function format($str) { return is_numeric($str) ? number_format($str) : nl2br(stripslashes($str)); } } function index() { print "<h3>Jail Management</h3> "; global $db; $feddedusers = $db->fetch_single($db->query("SELECT COUNT(`userid`) FROM users WHERE (fedjail = 1)")); $mailbanned = $db->fetch_single($db->query("SELECT COUNT(`userid`) FROM users WHERE (mailban > 0)")); $forumbanned = $db->fetch_single($db->query("SELECT COUNT(`userid`) FROM users WHERE (forumban > 0)")); echo "<table class='table' width='50%'>"; echo "<tr>"; echo "<th>[url='?action=banned']Federal Jail[/url]</th>"; echo "<td style='text-align:center;'>".$feddedusers."</a></td>"; echo "</tr>"; echo "<tr>"; echo "<th>[url='?action=mails']Mail Banned[/url]</th>"; echo "<td style='text-align:center;'>".$mailbanned."</td>"; echo "</tr>"; echo "<tr>"; echo "<th>[url='?action=forum']Forum Banned[/url]</th>"; echo "<td style='text-align:center;'>".$forumbanned."</td>"; echo "</tr>"; echo "</table>"; } function fedded() { global $db,$r,$h; echo ' <h3 style="text-align: left; text-decoration: underline;">Ferderal Jail</h3> <table border="1" width="80%" class="table" cellspacing="0" cellpadding="2"> <tr style="text-align:center;"> <th>Who</th> <th>Time Left</th> <th>Reason</th> <th>Jailer</th> </tr> '; $Find = $db->query("SELECT f.*, u.* FROM fedjail f LEFT JOIN users u ON f.fed_userid=u.userid ORDER BY f.fed_days ASC"); while($r = $db->fetch_row($Find)) { $jailed=$db->query("SELECT * FROM users WHERE userid={$r['fed_jailedby']}"); $j=$db->fetch_row($jailed); echo ' <tr style="text-align:center;"> <td>[url="viewuser.php?u='.$r['fed_userid'].'"]'.$r['username'].'[/url]</td> <td>'.$r['fed_days'].' Days</td> <td>'.$r['fed_reason'].'</td> <td>[url="viewuser.php?u='.$r['fed_jailer_id'].'"][b]'.$r['fed_jailer'].'[/b][/url] ['.$j['username'].']</td> </tr> '; } echo '</table>'; } function mail_banned() { global $db,$r,$h; print '<h3 style="text-align: left; text-decoration: underline;">MailBanned Users</h3> <table border="1" width="80%" class="table" cellspacing="0" cellpadding="2"> <tr style="text-align:center;"> <th>Who</th> <th>Time Left</th> <th>Reason</th> </tr> '; $q=$db->query("SELECT `userid`,`username`,`mailban`,`mb_reason` FROM `users` WHERE `mailban` > 0 ORDER BY `mailban` DESC"); while($r=$db->fetch_row($q)) { print " <tr> <td>[url='viewuser.php?u=".$r[']".$r['username']."[/url]</td> <td>".$r['mailban']."</td> <td>".$r['mb_reason']."</td> </tr>"; } echo "</table>"; } function forum_banned() { global $db,$r,$h; print '<h3 style="text-align: left; text-decoration: underline;">Forumbanned Users</h3> <table border="1" width="80%" class="table" cellspacing="0" cellpadding="2"> <tr style="text-align:center;"> <th>Who</th> <th>Time Left</th> <th>Reason</th> </tr> '; $q=$db->query("SELECT `userid`,`username`,`forumban`,`fb_reason` FROM users WHERE `forumban` > 0 ORDER BY `forumban` DESC"); while($r=$db->fetch_row($q)) { print "<tr> <td>[url='viewuser.php?u=".$r[']".$r['username']."[/url]</td> <td>".$r['forumban']."</td> <td>".$r['fb_reason']."</td></tr>"; } echo "</table>"; } $h->endpage(); ?>
  15. Check your junbk mail ;) a little tip,if you keep getting it appear in junk,try using your domain as who its from ;)
  16. yhyh kinda like a newsletter haha,Erm not sure about the sglobals but i just changed mine to include it :P Still works as far as i can see :) Thanks for that jordan :)
  17. Ever had a problem like having to move domain or just need to send an email to your whole userlist? This will do just that. Enjoy. Add this to staff menu [url='massemailer.php']Mass email users[/url]   Upload this to your server and call it massemailer.php Dont forget to change ***YOUR EMAIL!!!*** to your actual email address lol.   <?php include "globals.php"; $_GET['act'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? trim($_GET['action']) : 'default'; switch($_GET['action']) { case 'sendmail': send_mail(); break; default: mail_index(); break; } function mail_index() { global $ir,$h; if($ir['user_level'] < 2) { print "Nice try."; $h->endpage(); exit; } print "<h3>Mass emailer V_1.0 Created by BludClart</h3>"; print "<table class='table' width='75%' cellspacing='0' cellpadding='3'><tr><th colspan='2'>Select a subject</th></tr> <form action='massemailer.php?action=sendmail' method='post'> <tr><td>Subject: </td><td><input type='text' name='subject' value='Subject here' /></td></tr> <tr><td>Email: </td><td><textarea rows=10 cols=50 name='email'></textarea></td></tr> <tr><td colspan='2'><center><input type='submit' value='Send mass mail' /></form></center></td></tr></table>"; $h->endpage(); } function send_mail() { global $db,$h; if($_POST['email'] == '') { print "You didnt enter a message to be sent lol"; $h->endpage(); exit; } if($_POST['subject'] == '') { print "You didnt enter a subject for your email"; $h->endpage(); exit; } $getem=$db->query("SELECT * FROM users"); while($em=$db->fetch_row($getem)) { mail($em['email'], "{$_POST['subject']}", "Hi {$em['username']},{$_POST['email']}", "From: ***YOUR EMAIL!!!!!***"); print "message sent to all users!"; $h->endpage(); } } ?>   Done,any problems let me know :thumbup:
  18. hey mate,i have been looking for something like this for ages! But i have a problem =\ I want it to show stock performance over a duration of 2 hours,but cant get it working. What i want it to do is show the time(its in unix_timestamp) And how much it weant up/down at that time. This is what my stocks show already. Latest performance of this stock!         11 minutes ago: £0.043 ?</big> £4.0092       26 minutes ago: £0.058 ?</big> £4.0522       41 minutes ago: £0.051 ?</big> £4.1105       56 minutes ago: £0.035 ?</big> £4.1617       1 hours ago: £0.040 ?</big> £4.1971       1 hours ago: £0.055 ?</big> £4.2367       1 hours ago: £0.058 ?</big> £4.2915       1 hours ago: £0.037 ?</big> £4.3498       2 hours ago: £0.084 ?</big> £4.3756       2 hours ago: £0.103 ?</big> £4.4704     And this is what i have edited so far if it helps =\   <?php /* -- stockchart.php */ /* ///////Build Chart from DB stocks !! if used comment above include "mysql.php"; $q=mysql_query("SELECT * FROM stock_ticks ORDER BY tickID ASC LIMIT 6",$c); $strData = '$data=array('; While ($r=mysql_fetch_array($q)) { $strData .= "\"" . $r['tickTIME'] . "\"" . ' => ' . $r['stockTPRICE'] . ','; } $strData .= ');'; eval($strData); */ ////End Stock Data // create image $width = 900; $height = 250; $image = imagecreate($width, $height); // colors $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $navy = imagecolorallocate($image, 0x00, 0x00, 0x80); $black = imagecolorallocate($image, 0x00, 0x00, 0x00); $gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); // layout $maxval = max($data); $nval = sizeof($data); $vmargin = 20; // top (bottom) vertical margin for title (x-labels) $hmargin = 38; // left horizontal margin for y-labels $base = floor(($width - $hmargin) / $nval); // distance between columns $ysize = $height - 2 * $vmargin; // y-size of plot $xsize = $nval * $base; // x-size of plot // title $titlefont = 3; $title = "Last 24 hour stock behavour"; $txtsz = imagefontwidth($titlefont) * strlen($title); // pixel-width of title $xpos = (int)($hmargin + ($xsize - $txtsz)/2); // center the title $xpos = max(1, $xpos); // force positive coordinates $ypos = 3; // distance from top imagestring($image, $titlefont, $xpos, $ypos, $title , $black); // y labels and grid lines $labelfont = 2; $ngrid = 4; // number of grid lines $dydat = $maxval / $ngrid; // data units between grid lines $dypix = $ysize / ($ngrid + 1); // pixels between grid lines for ($i = 0; $i <= ($ngrid + 1); $i++) { // iterate over y ticks // height of grid line in units of data $ydat = (int)($i * $dydat); // height of grid line in pixels $ypos = $vmargin + $ysize - (int)($i*$dypix); $txtsz = imagefontwidth($labelfont) * strlen($ydat); // pixel-width of label $txtht = imagefontheight($labelfont); // pixel-height of label $xpos = (int)(($hmargin - $txtsz) / 2); $xpos = max(1, $xpos); imagestring($image, $labelfont, $xpos, $ypos - (int)($txtht/2), $ydat, $black); if (!($i == 0) && !($i > $ngrid)) { imageline($image, $hmargin - 3, $ypos, $hmargin + $xsize, $ypos, $gray); // don't draw at Y=0 and top } } // columns and x labels $padding = 3; // half of spacing between columns $yscale = $ysize / (($ngrid+1) * $dydat); // pixels per data unit for ($i = 0; list($xval, $yval) = each($data); $i++) { // vertical columns $ymax = $vmargin + $ysize; $ymin = $ymax - (int)($yval*$yscale); $xmax = $hmargin + ($i+1)*$base - $padding; $xmin = $hmargin + $i*$base + $padding; imagefilledrectangle($image, $xmin, $ymin, $xmax, $ymax, $navy); // x labels $txtsz = imagefontwidth($labelfont) * strlen($xval); $xpos = $xmin + (int)(($base - $txtsz) / 2); $xpos = max($xmin, $xpos); $ypos = $ymax + 3; // distance from x axis imagestring($image, $labelfont, $xpos, $ypos, $xval, $black); } // plot frame imagerectangle($image, $hmargin, $vmargin, $hmargin + $xsize, $vmargin + $ysize, $black); // flush image header("Content-type: image/gif"); // or "Content-type: image/png" imagegif($image); // or imagepng($image) imagedestroy($image); ?>
  19. Basically if you want something coding in v2,tell me what name your price and i will message you back. i have experience in coding enough to make most things.
  20. you c ant talk your tring to rip TC yup this works great ;) you just buy one and your up and ready.
  21. HaHa i want a green peters badge :rolleyes:
  22. Yu There is no `gangID` column in users. Also, this wont delete gang wars. I use this:   $gangs=mysql_query("SELECT * FROM gangs WHERE gangRESPECT<=0", $c); $gang=mysql_fetch_array($gangs); $delete=$gang['gangID']; mysql_query("DELETE FROM gangwars WHERE warDECLARER=$delete OR warDECLARED=$delete",$c); mysql_query("DELETE FROM gangs WHERE gangRESPECT<=0",$c); mysql_query("UPDATE users SET gang='0' WHERE gang=$delete", $c);   Tested and works fine, Mines in daily cron though, This way it wont have to check the DB as much. This one will also clear gang wars. p this should work ;) BUT this one...made by iseeyou94056 wont work because its calling for a resource XD $gang=mysql_query("SELECT gangID FROM gangs WHERE gangRESPECT<0"); = ANY of the ids for the gangs with 0 respect mysql_query("UPDATE users SET gang=0 WHERE gangID=$gang",$c); = ERROR :P mysql_query("UPDATE users SET gang=0 WHERE gang=$gang",$c); = UPDATE nothing XD     $norespect=mysql_query("SELECT gangID FROM gangs WHERE gangRESPECT<0"); = ANY of the ids for the gangs with 0 respect while($gang=mysql_fetch_row($norespect)) { mysql_query("UPDATE users SET gang=0 WHERE gang=$gang",$c); } but still you need to delete the gang wars aswell :P infact anything to do with the gang XD
  23. Ditto :P What exactelly do you mean Tcmaker? =\ cuz by the sound of things you try to copy TC :S
  24. just so everyone knows how this works.....it means they HAVE to click the buttons in the game rather than refreshing the page.....they cant refresh the page because every time a page loads pid=EXPIREEEEED :P
  25. Want to stop people putting things in the url? SIMPLE! i have worked out a way that takes a LONG time to install but very worth it ;) First ALTER TABLE user ADD PID INT(11) NOT NULL DEFAULT '0'; Second you need to add this into header.php .... $randpid=mt_rand(11111111111,99999999999); $db->query(UPDATE users SET PID={$randpid} WHERE userid=$userid"); if($_GET['pid'] != $ir['PID']) { die("Page expired!"); } HUGE downside to this is that you have to go through EVERY file and add $_GET['pid'] = abs(@intval($_GET['pid'])); AND to EVERY url you add this after for example index.php ?pid={$pid['PID']} so it should look like this..... index.php?pid={$pid['PID']} OR if it has something already after .php like this example.php?ID={$_GET['ID']} you make it look like this example.php?ID={$_GET['ID']}&pid={$pid['PID']} Now for the worst part but worth it if you dont want anything inserted into your url ;) in EVERY FILE (As far as i know) $pi=$db->query("SELECT PID FROM users WHERE userid=$userid"); $pid=$db->fetch_row($pi); This i think you would be able to get in header =\ or you COULD add it to a .php file and just require "pid.php"; in pid.php add $pi=$db->query("SELECT PID FROM users WHERE userid=$userid"); $pid=$db->fetch_row($pi); PLEASE tell me if there is anything else that could make this work better and just so you know this is just an example of what you can do with this method,i am adding mine a little different that this but hope it helps stop url inserting ;)
×
×
  • Create New...