-
Posts
3,368 -
Joined
-
Last visited
-
Days Won
126
Content Type
Profiles
Forums
Events
Everything posted by Dave
-
Could be a nice idea >_< I may improve this mod soon and add in stats and logging :)
-
Wouldn't really help tbh ;) It's a short enough code to read it anyway.
-
What you mean bud ? He means to replace the line which says $db->query("UPDATE 'users' SET rates=1"); to.. $db->query("UPDATE `users` SET rates=1"); Notice the difference between using ' and `.
-
mccode-v2 Advanced Attack and Inventory Mod--One Click.
Dave replied to Joshua's topic in Free Modifications
Somehow I see browsers dropping it very soon in favour of using inline css. Please use tabbing correctly as well.. Makes reading a code alot easier when done proberlyish. -
I second what CrimGame says.. If I see any of my mods.. Your host will be contacted. Mccodes should set-up a global licensing system for all mods and the main script to protect coders and most importantly the source code.
-
Hello, When I was trying to edit one of the users on my game I noticed that the edit user form lacked some basics.. Like allowing you to edit anything about the user. This new mod allow's you to edit anything within the user table. This means if you need to edit something which is normally not within the Edit User page you can with this! Things to do: [expander] Ability to change user's stats. Ability to edit literally everything to do with a user's account. [/expander] Screenshots: [expander] [/expander] Currently the mod blocks the ability to edit and view users passwords, just for security reasons. You can save the php file as anything you wish. It supports any file name, then just link it in your smenu.php. <?php //----------------------------------- // Mod created by Dave Macaulay ([email protected]) // For free use only with Mccodes V2 // For use of mod this must remain intack! //------------------------------------ require_once('sglobals.php'); $_GET['ID'] = abs((int) $_GET['ID']); if($_POST) { foreach($_POST as $k => $v){ $db->query("UPDATE `users` SET ".$k."='".$v."' WHERE userid=".$_POST['userid']); } echo '[b]<u>User edits saved!</u>[/b] The edits have now been saved. Please click [url="'.basename($_SERVER['SCRIPT_FILENAME']).'"]here[/url] if you would like to edit another user.'; $h->endpage(); exit; } if(!$_GET['ID'] AND !$_POST['userid']) { echo ' [b]<u>Editing a user</u>[/b] Please select the user you wish to edit below, Some of the edit fields have been disabled and hidden to protect certain details about the user. <table width="70%" class="table" cellpadding="5" cellspacing="1"> <tr> <th width="50%">Userid</th> <th width="50%">Username</th> </tr> <tr> <td style="text-align: center;"> <form action="'.basename($_SERVER['SCRIPT_FILENAME']).'" method="get"> <input type="text" name="ID" /> <input type="submit" value="Edit" /> </form> </td> <td style="text-align: center;"> <form action="'.basename($_SERVER['SCRIPT_FILENAME']).'" method="get"> '.user_dropdown($c, 'ID').' <input type="submit" value="Edit" /> </form> </td> </tr> </table> '; $h->endpage(); exit; } function showTable($variable) { if ($variable === true) { return 'true'; } else if ($variable === false) { return 'false'; } else if ($variable === null) { return 'null'; } else if (is_array($variable)) { $html = ' <table width="80%" class="table" cellpadding="5" cellspacing="1" style="text-align: left;"> <tr><th colspan="2">Currently editing user '.$variable['username'].' ['.$_GET['ID'].'] <div style="float: right;">[url="'.basename($_SERVER['SCRIPT_FILENAME']).'"]Back[/url]</div></th></tr> <tr><th width="20%" style="text-align: left;">Field</th><th style="text-align: left;">Value</th></tr>'; foreach ($variable as $key => $value) { $value = showTable($value); $hide = array('userpass'); if(!in_array($key, $hide)) { $html .= '<tr><td style="text-align: left;">'.ucfirst($key).'</td> <td style="text-align: left;"> <input type="text" name="'.$key.'" value="'.$value.'" size="70"> </td></tr>'; } } return $html; } else { return strval($variable); } } $ro = mysql_query("SELECT * FROM users WHERE userid=".$_GET['ID']); if(!mysql_num_rows($ro)) { echo 'No user found! [url="'.basename($_SERVER['SCRIPT_FILENAME']).'"]Back[/url]'; $h->endpage(); exit; } $r = mysql_fetch_assoc($ro); echo '<form action="'.basename($_SERVER['SCRIPT_FILENAME']).'" method="post">'; echo showTable($r); echo '<tr><td colspan="2"><input type="submit" value="Save new settings" /></td></tr></form> </table> '; $h->endpage(); ?>
-
Thanks :) Got bored and decided to make something for the community! Yeah.. Kinda an example of how to make an Ajax Login for mccode. Could potentially help people new to jQuery.
-
Wanna link me? I wanna see :)
-
This version has some basic styling. But ultimately you should integrate it with your current login layout. It would be pretty easy :) .
-
Hey, Got a bit bored so decided to make something using Ajax and jQuery for the community. I made this simple login which instead of reloading the page to discover if the user has entered correct details it simply check's via an ajax request. Then if the users account is real it will then log them in. [paypal][email protected][/paypal] [align=center]Your donations will motivate me to write bigger and better mods for the community![/align] <?php //----------------------------------- // Mod created by Dave Macaulay ([email protected]) // For free use only with Mccodes V2 // For use of mod this must remain intack! //------------------------------------ session_start(); require_once('config.php'); global $_CONFIG; define("MONO_ON", 1); require_once('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; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } if($_POST) { if($_POST['username'] && $_POST['username'] != 'Username' && $_POST['password'] && $_POST['password'] != 'Password') { $user = mysql_real_escape_string($_POST['username']); $pass = mysql_real_escape_string($_POST['password']); $select = $db->query("SELECT userid FROM `users` WHERE `username` = '".$user."' AND `userpass` = '".md5($pass)."'") or die(mysql_error()); if(mysql_num_rows($select)) { $user = $db->fetch_row($select); $db->query("UPDATE `users` SET `lastip_login` = '".$_SERVER['REMOTE_ADDR']."', `last_login` = ".time()." WHERE `userid` = ".$user['userid']); if($set['validate_period'] == "login" && $set['validate_on']) { $db->query("UPDATE `users` SET `verified` = 0 WHERE `userid` = ".$user['userid']); } $_SESSION['loggedin'] = 1; $_SESSION['userid'] = $user['userid']; echo '1'; exit; } else { echo 'That account dosen\'t exist.'; exit; } } else { echo 'You must enter both username and password.'; exit; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?=($set['game_name'] ? $set['game_name'] : 'Game Name')?></title> <style type="text/css"> body { background: #eeeeee; font-family: Tahoma; font-size: 12px; } #login { background: #dfdfdf; border: 1px #d3d3d3 solid; width: 450px; padding: 10px; text-align: center; } .text_field { width: 200px; text-align: center; font-family: Tahoma; font-size: 12px; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> function submitForm() { var username = $('[name=username]'); var password = $('[name=password]'); if(username.val() == 'Username' || username.val() == '' || password.val() == 'Password' || password.val() == '') { alert("You must fill in both input fields!"); } else { $.ajax({ url: "ajax_login.php", cache: false, type: "POST", data: { "username": username.val(), "password": password.val() }, success: function(data) { if(data != 1){ $('#error_area').html('<span style="color: red;">' + data + '</span> '); } else { window.location = 'index.php'; } } }); } } function ucfirst(str) { str += ''; var f = str.charAt(0).toUpperCase(); return f + str.substr(1); } $(document).ready(function(){ $(".text_field").focus(function(){ if($(this).val() == ucfirst($(this).attr('name'))) { $(this).val(''); } }); $(".text_field").blur(function(){ if($(this).val() == '') { $(this).val(ucfirst($(this).attr('name'))); } }); }); </script> </head> <body> <center> <div id="login"> [img=logo.png]" /> </div> <form action="ajax_login.php" method="post" onsubmit="submitForm();return false;"> <div id="login"> <u>>> Login <<</u> <span id="error_area"></span> Please enter your account information below. <input type="text" name="username" class="text_field" autocomplete="off" value="Username" /> <input type="password" name="password" class="text_field" autocomplete="off" value="Password" /> <input type="submit" name="submit" value="Submit" /> </div> </form> </center> </body> </html>
-
Thanks, Worked a treat. I did have to do current_th+=+ blah
-
Hey, I've been trying to use jQuery each to count the total height of all elements with the same class. The code below does not work and the alert that I put in for debugging always returns as 0. Any help would be appreciated. var current_th = 0; $('.noteWindow').each( function(index, domEle) { var current_th = + $(this).height(); }); alert(current_th);
-
PBBG-Engine - Free PHP RPG engine with a plugin system!
Dave replied to JakeB's topic in Game Projects
So you can afford vBulletin? but cannot afford a domain? -
Most these sites do pay out actually.. I haven't ever checked out CPALead but I know ALOT of sites are using it... and why would ALOT of sites be using a company which doesn't pay out?
-
http://unforgivenwar.com/ - Is reasonably successful and is also mccodes? The script doesn't mean you cant make money.. You just need very good skills at running a game considering it's not at all unique (Unless you decide to make it unique).
-
People on here charge around $300 for completely securing the oh so secure Mccodes script. For the Cron Jobs even though the question gets asked like all the time I'm sure someone can help you on here, firstly check these things those. Your host supports crons in the first place? Can you run them manually? (Type in http://game/cron_minute.php?code=???) Have you inputed them correctly? should have the timings then the url of the cron and the cron should start with curl.
-
A working patch was released... I sent it to everyone who had purchased it if you haven't received it please contact me on MSN.
-
I preferred this forum when it ran on SMF. This new forum system just causes more issues then it solves.
-
Hey, I've written a voting script before and was recently thinking about upgrading it to use some fancy JavaScript effects and such. If you would like to talk more about what you would want from the voting mod and pricing you can contact me on MSN at [email protected].
-
Would be nice if you could see the actual login clearly.. Make the opacity of your watermark around 10%.
-
One of my designers created the mascots for our site, you are able to purchase mascots of me if you wish there is a post on this forum somewhere about it.
-
Can I see some of your mascot designs please.
-
I love Pokemon >_< I'd love to sign up and possibly become a moderator :]
-
Will this forum provide skinning? Because that rather strange blue colour scheme will definitely not fit on any game with a half decent theme. Thus why personally I would of used the CSS within Mccode V2 already (table and so on) to make it so that it would somewhat fit into any game without to much hassle.
-
A few grammar mistakes on your site once again, Not a big problem but they may drive away customers thinking your some 12 year old with a reseller. (I am aware my grammar is probably worse but I am just pointing out) and you cannot "make" domain names you purchase them, saying make sounds rather strange to me. Good luck though it's hard to get big in hosting.