
DELETE ME NOW!
Members-
Posts
346 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by DELETE ME NOW!
-
[Mccodes V2]Login Register, TOs- New
DELETE ME NOW! replied to mmomaker's topic in Free Modifications
Re: [Mccodes V2]Login Register, TOs- New Okay i got a deal lol, i bid $1.01 for the game :mrgreen: -
[V1 && V2] Simple MySQL Rank Mod!
DELETE ME NOW! replied to DELETE ME NOW!'s topic in Free Modifications
Re: [V1 && V2] Simple MySQL Rank Mod! I also forgot to say it sends userid 1 a event when a user trys to access the page without being admin... And for staff menu add Ranks lol -
[V1 && V2] Simple MySQL Rank Mod!
DELETE ME NOW! replied to DELETE ME NOW!'s topic in Free Modifications
Re: [V1 && V2] Simple MySQL Rank Mod! Why use that? The following should be good enough... $Row = mysql_fetch_array(mysql_query(sprintf("SELECT `u_rank` FROM `ranks` WHERE `u_level`='%u'", abs(@intval($r['level']))))); $Blah = (!$Row['u_level'] && !$Row['u_rank']) ? 'No Rank' : $Row['u_rank']; echo '[b]Rank:[/b] #'.$Blah Yes i know, but it works fine the way i done it . . . Some times i do it your way and mine, and also sprintf() theres no need for it!, so you cant say nothink about my work when everytime you have a query, you sprintf it, theres no need, and also slows the page down. -
[V1 && V2] Simple MySQL Rank Mod!
DELETE ME NOW! replied to DELETE ME NOW!'s topic in Free Modifications
Re: [V1 && V2] Simple MySQL Rank Mod! Also forgot to say for V2 just change the include("globals.php"); to V1 code ;) and done -
Okay here is what this mod does.... You can add rank levels, and names from staff panel. You can edit rank levels, and names from staff panel. You can delete rank levels, and names from staff panel. No screen shots so one of you would have to add it too one of your test sites or something...... Okay first things to come: MySQL....phpMyAdmin. Run in phpmyadmin. CREATE TABLE IF NOT EXISTS `ranks` ( `u_id` int(11) NOT NULL auto_increment, `u_level` int(11) NOT NULL default '0', `u_rank` varchar(255) NOT NULL, PRIMARY KEY (`u_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; INSERT INTO `ranks` (`u_id`, `u_level`, `u_rank`) VALUES (1, 1, 'Newbie'); Once you've done that. Add this to global_funcs.php Just before ?> function ranks($connection, $ddname="rank", $selected=-1) { global $db; $ret = "<select name='$ddname' type='dropdown'>"; $sql = mysql_query("SELECT `u_id`, `u_level`, `u_rank` FROM `ranks` ORDER BY `u_level` ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r = mysql_fetch_array($sql)) { $ret.="\n<option value='{$r['u_id']}'"; if ($selected == $r['u_id'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['u_level']} :: {$r['u_rank']}</option>"; } $ret.="\n</select>"; return $ret; } Once you've done that. Create a php file you can save it as anything you like becuase im using php self. <?php include("globals.php"); # if($ir['user_level'] != 2) { $id = 1; //Userid to send the event to Default is userid: 1 $name = stripslashes($ir['username']); //Username who tryed accessing this page.. $php_self = $_SERVER['PHP_SELF']; //Php self event_add($id," ". $name ." tryed to access page: ". $php_self ."", $c); echo ("Your not ment to be here"); exit(); } # switch($_GET['p']) { case "1": page_one(); break; case "2": page_two(); break; case "3": page_three(); break; //-Default default: default_page(); break; } function default_page() { global $ir, $c, $userid; echo '<h3>Rank page</h3> [b]Here you can add ranks for levels![/b] > [url="'. $_SERVER['PHP_SELF']. '?p=1"]Add a Rank[/url] > [url="'. $_SERVER['PHP_SELF']. '?p=2"]Edit a Rank[/url] > [url="'. $_SERVER['PHP_SELF']. '?p=3"]Delete a Rank[/url]'; } function page_one() { global $ir, $c, $userid; if(!$_POST['level'] && !$_POST['name']) { echo '<h3>Add a Rank</h3> <form action="'. $_SERVER['PHP_SELF'] .'?p=1" method="POST"> [b]Fill in the <u>2</u> boxes[/b] [b]Level:[/b] <input type="text" name="level"> [b]Rank Name:[/b] <input type="text" name="name"> <input type="submit" value="Add RANK!"></form>'; } else { $level = abs(@intval ($_POST['level'])); $name = mysql_real_escape_string($_POST['name']); $sql = "INSERT INTO `ranks` (`u_id`, `u_level`, `u_rank`) VALUES('NULL', '". $level ."', '". $name ."')"; mysql_query($sql) or die (mysql_error()); echo '[b]Level:[/b] '. $level .' [b]Rank Name:[/b]'. $name .' ......... Has been added!'; } } function page_two() { global $ir, $c, $userid; switch($_POST['page']) { case "2": $level = abs(@intval ($_POST['u_id'])); $name = mysql_real_escape_string($_POST['name']); mysql_query("UPDATE `ranks` SET `u_level` = '". $level ."', `u_rank` = '". $name ."' WHERE (`u_id` = '". $_POST['u_id'] ."')") or die(mysql_error()); print "Rank has been updated!"; break; case "1": $sql = mysql_query("SELECT * FROM `ranks` WHERE (`u_id` = '". $_POST['rank'] ."')") or die (mysql_error()); $row = mysql_fetch_array($sql); echo '<h3>Editing a Rank</h3><hr /> <form action="'. $_SERVER['PHP_SELF'] .'?p=2" method="post"> <input type="hidden" name="page" value="2" /> <input type="hidden" name="u_id" value="'. $_POST['rank'] .'" /> Level: <input type="text" name="level" value="'. $row['u_level'] .'" /> Rank Name: <input type="text" name="name" value="'. $row['u_rank'] .'" /> <input type="submit" value="Update Rank!" /></form>'; break; default: echo '<h3>Edit a Rank</h3> <form action="'. $_SERVER['PHP_SELF'] .'?p=2" method="POST"> <input type="hidden" name="page" value="1" /> Rank Name: '. ranks($c, "rank") .' <input type="submit" value="Edit RANK!" /></form>'; break; } } function page_three() { global $ir, $c, $userid; if($_POST['rank']) { mysql_query("DELETE FROM `ranks` WHERE (`u_id` = '". $_POST['rank'] ."')") or die (mysql_error()); print "Rank Has just been deleted!"; } else { echo '<h3>Delete a Rank</h3>'; echo 'Deleting a rank is permanent, so be sure you want to delete it, there is no undo, unless you add it back!'; echo '<form action="'. $_SERVER['PHP_SELF'] .'?p=3" method="POST">'; echo 'Rank Name: '. ranks($c, "rank") .' '; echo '<input type="submit" value="Delete RANK be Sure!" /></form>'; } } ?> Okay once you've done that Open viewuser.php Find Enemies: {$r['enemy_count']} After the add "; Now add $level = $r['level']; $query = "SELECT `u_rank` FROM `ranks` WHERE `u_level` = '". $level ."'"; $_sql_ = mysql_query($query) or die (mysql_error()); $rowww = mysql_fetch_array($_sql_); $blahl = (!$rowww['u_level'] && !$rowww['u_rank']) ? "No Rank" : $rowww['u_rank']; echo '[b]Rank:[/b] #'. $blahl; Works, fine, ive saw people using loads of code when there's not need too. If it dont work please show here thankyou :), also didnt take long.
-
Re: Secure Names? Please help. Hmm true lol
-
Re: Updating Parelem just gave him a link also everyone has to learn by there self too there are so many good tutorials out there, remember, google if your friend :P
-
Re: Ranks Mod!!!! That is still useless code hardley all of that is needed lol, here. Cleaner code! <?php include("globals.php"); if($ir['jail'] OR $ir['hospital']) { die('<font color="red">This page cannot be accessed while in jail or hospital.</font>'); } echo ' <h3><font color="white">Level Ranks</font></h3> <font color="white">Welcome To Level Ranks here you will see your ranks and what they will become as you level up, to become a different rank when you reach the certain level ask a staff member to change your rank.</font>'; echo ' <table border="1" width"90%" bordercolor="#939393"> <tr align="center"> <th>Rank</th> <th>Name</th> <th>Level</th> </tr> <tr align="center"> <td>[img=rank1.png]</td> <td>Private</td> <td>1</td></tr> <tr align="center"> <td>[img=rank2.png]</td> <td>Corporal</td> <td>100</td> </tr> <tr align="center"> <td>[img=rank3.png]</td> <td><center>Sergeant</td> <td>125</td> </tr> <tr align="center"> <td>[img=rank4.png]</td> <td>Sergeant Major</td> <td>150</td> </tr> <tr align="center"> <td>[img=rank5.png]</td> <td>Second Lieutenant</td> <td>175</td> </tr> <tr align="center"> <td>[img=rank6.png]</td> <td>First Lieutenant</td> <td>200</td> </tr> <tr align="center"> <td>[img=rank7.png]</td> <td>Captain</td> <td>225</td> </tr> <tr align="center"> <td>[img=rank8.png]</td> <td>Major</td> <td>250</td> </tr> <tr align="center"> <td>[img=rank9.png]</td> <td>Lieutenant Colonel</td> <td>275</td> </tr> <tr align="center"> <td>[img=rank10.png]</td> <td>Colonel</td> <td>300</td> </tr> <tr align="center"> <td>[img=rank11.png]</td> <td>Brigadier General</td> <td>325</td> </tr> <tr align="center"> <td>[img=rank12.png]</td> <td>Major General</td> <td>350</td> </tr> <tr align="center"> <td>[img=rank13.png]</td> <td>Lieutenant General</td> <td>375</td> </tr> <tr align="center"> <td>[img=rank14.png]</td> <td>General</td> <td>400</td> </tr> <tr align="center"> <td>[img=rank15.png]</td> <td>General of the Army</td> <td>500</td> </tr> <tr align="center"> <td>[img=rank16.png]</td> <td>General of the Armies</td> <td>750</td> </tr> <tr align="center"> <td>[img=rank17.png]</td> <td>General Of Wars</td> <td>1000</td> </tr> </table>'; $h->endpage(); ?> Cleaner code!, lol.
-
Re: Ajax Contact Form That function is not needed, why have it when you can just stripslashes() okay a function would be okay if you have more in it but you simpley just have stripslashes so there's no need.
-
Re: 859299 days, 12 hours, 58 mins Rofl i didnt see that then
-
Re: Secure Names? Please help. Yes but, how is a user going to get an userid 1.24 it wont happen lol, it will just go 1,2,3,4,5,6,7,8,9,10,11 ect lol.
-
Re: 859299 days, 12 hours, 58 mins What are you using v2 or v1?
-
Re: 859299 days, 12 hours, 58 mins If its crimes check the docrime.php file.
-
Re: Secure Names? Please help. Why abs(@intval userid, userid is all ready a number and cant be changed.
-
Re: Secure mccodes You really want to secure your pages just delete the database and your done ;)
-
Re: Powered by codes made by Dabomstew V1 && V2 aint copyrighted.
-
Re: 859299 days, 12 hours, 58 mins Like POG1 said it could be the mysql query, or in the database for crimes..
-
Re: Secure Names? Please help. Okay here are to i use: else if (ereg("[^A-Za-z0-9]", $_POST['newname'])) { print "Your name can only contain letters and numbers! [url='preferences.php?action=namechange']> Back[/url]"; } else if(strlen($_POST['newname']) >= 20) { print "You must have a name that is below 20 characters. [url='preferences.php?action=namechange']> Back[/url]"; } else { $newUsername = strip_tags($_POST['newname']); mysql_query("UPDATE `users` SET `username`='".mysql_real_escape_string($newUsername)."' WHERE (`userid` = $userid)", $c); print "Username changed!"; } That is some of the code i use, but not all.