
Dillion & Amanda 4 Lif
Members-
Posts
124 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Dillion & Amanda 4 Lif
-
[REQUEST] Rating Modification
Dillion & Amanda 4 Lif replied to Dillion & Amanda 4 Lif's topic in Free Modifications
Works fine on my part. :) -
JFGI
-
Damn -.- Lol. Windows
-
Ok so here it is. I believe i saw a rating modification on MWG before, and it lacked a few things. So here, from scratch, is my rating mod requested by Maniak. SQL [mysql] ALTER TABLE `users` ADD `ratings` INT( 11 ) NOT NULL -- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 04, 2010 at 02:56 PM -- Server version: 5.1.41 -- PHP Version: 5.3.1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `v2` -- -- -------------------------------------------------------- -- -- Table structure for table `ratings` -- CREATE TABLE IF NOT EXISTS `ratings` ( `ratedID` int(11) NOT NULL, `raterID` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `ratings` -- INSERT INTO `ratings` (`ratedID`, `raterID`) VALUES (1, 1); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; [/mysql] Cron //Add to bottom of cron_day.php $db->query("TRUNCATE `ratings`"); rate.php <?php /* Modification By Solid Snake for McCodes. Free-to-use and distribute as long as you keep this tag on :). Q&C: [email][email protected][/email] */ require_once('globals.php'); $_GET['cmd'] = isset($_GET['cmd']) && is_string($_GET['cmd']) ? strtolower(trim($_GET['cmd'])) : FALSE; echo '<h3>Ratings</h3> '; switch($_GET['cmd']){ case 'good': rate_good(); break; case 'bad': rate_bad(); break; } if(!in_array($_GET['cmd'], array('good','bad'))){ echo 'Invalid Command'; $h->endpage(); exit; } function rate_good(){ global $db,$h,$c; $_GET['ID']+=0; if(!$_GET['ID']){ echo 'Invalid User!'; $h->endpage(); exit; } $q = $db->query('SELECT `userid` FROM `users` WHERE `userid`='.$_GET['ID']); if(!$db->num_rows($q)){ echo 'Invalid User!'; $h->endpage(); exit; } if($_GET['ID'] == $_SESSION['userid']){ echo 'You can\'t rate yourself :/'; $h->endpage(); exit; } $check = $db->query('SELECT `ratedID`,`raterID` '. 'FROM `ratings` '. 'WHERE (`raterID`='.$_SESSION['userid'].') AND (`ratedID`='.$_GET['ID'].')'); if($db->num_rows($check)){ echo 'You\'ve already rated this user today. Come back Tommorow.'; $h->endpage(); exit; } $db->query('INSERT INTO `ratings` VALUES('.$_GET['ID'].','.$_SESSION['userid'].')'); $db->query('UPDATE `users` SET `ratings`=`ratings`+1 WHERE `userid`='.$_GET['ID']); echo 'You have given this user a good rating!'; } function rate_bad(){ global $db,$h,$c; $_GET['ID']+=0; if(!$_GET['ID']){ echo 'Invalid User!'; $h->endpage(); exit; } $q = $db->query('SELECT `userid` FROM `users` WHERE `userid`='.$_GET['ID']); if(!$db->num_rows($q)){ echo 'Invalid User!'; $h->endpage(); exit; } if($_GET['ID'] == $_SESSION['userid']){ echo 'You can\'t rate yourself :/'; $h->endpage(); exit; } $check = $db->query('SELECT `ratedID`,`raterID` '. 'FROM `ratings` '. 'WHERE (`raterID`='.$_SESSION['userid'].') AND (`ratedID`='.$_GET['ID'].')'); if($db->num_rows($check)){ echo 'You\'ve already rated this user today. Come back Tommorow.'; $h->endpage(); exit; } $db->query('INSERT INTO `ratings` VALUES('.$_GET['ID'].','.$_SESSION['userid'].')'); $db->query('UPDATE `users` SET `ratings`=`ratings`-1 WHERE `userid`='.$_GET['ID']); echo 'You have given this user a bad rating!'; } echo ' Extension by [url="http://makewebgames.io/user/15858/solidsnake/"]Solid Snake[/url]'; ?> And i'm sure you know how to add links to the viewuser. If not i can help you. Thanks, Solid Snake. ;)
-
Alternative to strip_slashes()
Dillion & Amanda 4 Lif replied to Dillion & Amanda 4 Lif's topic in General Discussion
Ahh ok. -
JFGI ("Just F***** Google It") Should be used more lol.
-
Alternative to strip_slashes()
Dillion & Amanda 4 Lif replied to Dillion & Amanda 4 Lif's topic in General Discussion
An example use of stripslashes() is when the PHP directive magic_quotes_gpc is on (it's on by default), and you aren't inserting this data into a place (such as a database) that requires escaping. For example, if you're simply outputting data straight from an HTML form. ? -
Well, since i know alot of people use the strip_slashes() function, i want to help out. As anyone knows magic quotes are better to not be used in scripts. However, strip_slashes() relies on them. Heres an alternative, ridiculously easy function you can use. I recommend putting it in a file that you include on every page. <?php function stripslashes($text){ return str_replace(array("\\","/"), array("",""), $text); } ?> The main reason i use this is because i escape data on input, and i dont like slashes because of quotes in my names of things, so this way its safe inside the db, and you dont have a bunch of slashes ruining your stuff :)
-
The original crimes for McCodes can make alot of people lose interest due to having to calculate every success equation with the formula. I wish they would come out with a percentage type thing
-
I think you guys should add an introduction area where new members can introduce themselves and such. :)
-
It looks cool from screens. However the color scheme isn't good at all, and make sure the game is secure before you open it. Other than that, Good Job.
-
Lol.
-
If they are going to sell it the right way, they might as well put an asterisk with: Not secure under the package. lol
-
Yeah.. I've heard that from alot of people in my life lol. 75% of the time it isnt taken care of.
-
Greatly improved Staff user editing system!
Dillion & Amanda 4 Lif replied to Dave's topic in Free Modifications
Great! +10000000 no points lol but anyway.. as long as the people using it have a secure game. if they dont, its another story, but thats not your fault, its theirs, so great mod -
Well that fact that most of your sentences have misspelled/errors doesn't make it appealing. Sorry but if your going to give modifications out, you should learn proper grammar. Whats this mess? /\ /\ /\ /\ /\ /\ /\ /\ /\ //\\//\\//\\//\\//\\//\\//\\//\\//\\ // //\\//\\//\\//\\//\\//\\//\\//\\ \\ // // \/ \/ \/ \/ \/ \/ \/ \/ // // // // \/
-
Which OS are you?
-
-
They would have to learn anyway to make secure mods, because DBS and CB even if they did secure it, they're not going secure every single persons mod.
-
Has anyone offered to secure it for CB and DBS? Because they seem to not really care much about thier clients if they can't give them what they should be able to have. A fully secure script so that noobs aren't getting hacked left and right and bothering everyone posting "I GOT HACKED!" topics on here.
-
Which Pages to Secure your game---A must read---
Dillion & Amanda 4 Lif replied to Joshua's topic in Game Support
I was just offering the most obvious solution. I use a bit more complex version of the staff system, with user groups, each staff ( when i do have any ) that are in the important ranks will be given their own htpassword, etc. etc. Much better solution. -
[align=justify]Metal Gear Solid? (?????????, Metaru Gia Soriddo?) (commonly abbreviated as MGS) is a stealth action video game directed and written by Hideo Kojima.[5] The game was developed by Konami Computer Entertainment Japan and first published by Konami in 1998 for the PlayStation video game console. It is the sequel to Kojima's early MSX2 computer games Metal Gear and Metal Gear 2: Solid Snake. The game featured cinematic cut scenes rendered using the in-game engine and graphics, as well as voice acting in numerous codec sequences.[6] Metal Gear Solid follows Solid Snake, a retired soldier who infiltrates a nuclear weapons disposal facility to neutralize the terrorist threat from FOXHOUND, a renegade special forces unit.[7] Snake must liberate two hostages, the head of DARPA and the president of a major arms manufacturer, confront the terrorists, and stop them from launching a nuclear strike.[8] Metal Gear Solid was very well-received, shipping more than six million copies,[9] and scoring an average of 94 out of 100 on the aggregate website Metacritic.[10] It is recognized by many critics as one of the best and most important games of all time,[11][12] heralded as the game which made the stealth genre popular. The commercial success of the title prompted the release of an expanded version for the PlayStation and PC, titled Metal Gear Solid: Integral;[13] and a remake, Metal Gear Solid: The Twin Snakes was later released for the Nintendo GameCube.[14][15] The game has also spawned numerous sequels, prequels and spin-offs, including several games, a radio drama, comics, and novels. [/align] <http://en.wikipedia.org/wiki/Metal_Gear_Solid>
-
Which Pages to Secure your game---A must read---
Dillion & Amanda 4 Lif replied to Joshua's topic in Game Support
If you dont want anyone to be staff, put the staff files in a directory, pword protect it with .htaccess, and absolutely let noone know the password but you. -
I use a "User Group" type thing. Its like a system where you can add groups and give them staff perms., edit groups, delete em, and so on.