
Floydian
Members-
Posts
900 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Floydian
-
Re: Db Query Help I'm not sure what the problem is here. Is there an error with that query?
-
Re: Error. Please help! Any time you use >>> $db->fetch_row You need to make sure the "resource" you pass into it is a valid resource (since the db class does not do that check for you) You used that Database method twice in the part of the script you posted. One of them is being passed an invalid resource. Most likely the value being passed is "false".
-
Re: Race. Help! When you put arrays into strings, they need curly brackets around them. $online="update km_users set online='$time', lastseen='Racing(Testing Trial)' where playername='$userstats3[playername]'"; That should be like this: $online="update km_users set online='$time', lastseen='Racing(Testing Trial)' where playername='{$userstats3[playername]}'"; Does that help?
-
Re: Installation.php lol and yet, the files in question were posted three times each! :O
-
Re: Logic twister You missed the point, but you never miss an opportunity to be condescending. Well, you did something. :S So, the point here, and it's not a big deal, and it's not a Californian gold rush, is interesting nonetheless. To test if only one of two variables is set, you can test if one is set, and the other isn't using the xor operator instead of testing if both exist or if both don't exist. It's something I'm willing to bet a lot of people never thought about even if they did RTFM. ;) So, please keep the condescension to yourselves folks if you have nothing better to contribute to the community, EVEN IF YOU'RE AN ADMIN. :O
-
Re: can someone convert this to v2 mccodes guide? You need a php guide, an html guide, a mysql guide, and maybe a javascript guide. HTML is most important, since your users will see nothing without html. PHP is the next one because it connects mysql to the html. javascript is the last one because you could do without it completely.
-
Re: Help with Session Good deal ;)
-
Re: Help with Session Did you try it out?
-
I ran across an interesting bit of code that I think some folks might appreciate. <?php $blah = 1; $foo = 1; if (!isset($blah) xor isset($foo)) { echo 'only one variable may be set...'; } else { echo 'yay, only one variable is set'; } If you test that out, try commenting out one of the two variables at the beginning. Then uncomment it and comment the other. Lastly, comment them both, and see the results. To bring home what the logic is that we have going on here, this next bit of code is another way to write that conditional statement. <?php $blah = 1; $foo = 1; if ( (isset($foo) and isset($blah) or (!isset($foo) and !isset($blah)) { echo 'only one variable may be set...'; } else { echo 'yay, only one variable is set'; } So as you can see, the first one twists up the "isset() and !isset()" using the "xor" logical operator and is a bit shorter.
-
Re: can someone convert this to v2 generally, most things on version 1 work on version 2 so long as the includes at the beginning of the script are changed. (going from v2 to v1 is a different story) It should work as is since this is just a part of a script.
-
Re: The Standards of CE Mod! lol Why so much space for the "lol", because I think it's that important! :D Do you want to raise the standards? Buyers should only accept good quality work. Of course this means they will have to pay more than $5 to $10 for a mod. People that contract me to do work for them normally pay a minimum of $50 for a mod. And they get top quality work. Have you seen a bunch of mods from me? Nope, because I don't need to list a bunch of mods in order to sell them. People know who I am and they come to me when they need me. The same goes for the other programmers here that produce quality work. There's nothing wrong with a sub forum filled with mostly crap, some good mods, a few outstanding mods, and whatever fits in between that. The folks I know that are willing to spend a little bit of money for the good stuff will seek out the people they know and trust for it. There's some very high quality work coming out of CE, but most folks want a free or very cheap alternative. That's a dichotomy that will always exist. I see nothing wrong with that. In the end, the old saying: "You get what you pay for.", still holds true.
-
Re: main page/login I personally don't start any project without first deciding on what doc type I'm using. HTML 4.0 Strict is probably the one most folks should use (If the folks at Yahoo are to be believed) Then, I apply a css reset (since different browsers have different default styling for elements). Then, I apply a basic set of css styles to tags like: th -- centered, bold, strong -- bold, h1 and h2 and h3 -- font size and centered and so on. Then I apply Yahoo Grids. Once I have all that, I have an environment that will be standardized across the most popular browsers since all css is specifically set to mine/yahoo's standards. Grids then allows me to break up a page into columns very easily. You can optionally use the Yahoo Fonts package which helps to standardize fonts across different browsers as well. (this is an area where no matter what you do, you're going to see very apparent differences across browser, but Yahoo Fonts gets you closer to a "standard".) Altogether, the start of an html document might look like: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Basic HTML/CSS page layout</title> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.6.0/build/reset-fonts-grids/reset-fonts-grids.css"> <link rel="stylesheet" type="text/css" href="my_custom.css"> <!-- Again, this css file is created to apply basic styles to elements since all element styles have been canceled by the reset. --> </head> Once you have that, you're good to go! Link to Yahoo Reset: http://developer.yahoo.com/yui/reset/ Link to Yahoo Font: http://developer.yahoo.com/yui/fonts/ Link to Yahoo Grids: http://developer.yahoo.com/yui/grids/
-
Re: CSS [V2] MAYBE [V1] The css pseudo-class "hover" is only recognized on the "A" element in IE. Of course other browsers recognize it on other elements. So, take note that that css deal does not work in IE. For IE, you'd need to use the mouseenter and mouseleave events to do this sort of thing (javascript of course) (IE only). You could use mouseover and mouseout which is supported by most browsers (IE, firefox, opera among others) but there are difficulties with this. http://www.quirksmode.org/dom/events/index.html There's your DOM events browser compatibility list and explanations of the four mouse events I listed as well.
-
Re: i dont get it The error is before all that. An error sometimes doesn't get detected early on because php thinks it's okay, but that error causes something more serious down the line somewhere. You're probably missing a semi colon or a quote somewhere.
-
Re: Big Prob Help Please There's no way to know. What php version, webserver and version are you using? What script is this/where did you get it? Need more details to know for sure. ;)
-
Re: install.php That is essentially your answer. I couldn't show you any code from mc version 2 since I don't own a copy and licensing makes it impossible to get/distribute the code legally without paying for it ;) I can however show you how my engine, Horizons Game Engine, accomplishes the same thing: $command = 'mysql -u ' . DB_USER . ' -p' . escapeshellarg(DB_PASS) . ' '. DB_SCHEMA . ' < ' . BASE_URI . 'horizon.sql'; $output = shell_exec($command); What does that do? First I define a string that will be executed in a shell (command prompt, i.e., DOS prompt). mysql -u username -puserpass databasename < path/to/file/horizons.sql The second line there executes that command. And that's all there is to it.
-
Re: BBCode Resize it might be browser specific. firefox only shows the scroll bar that would be usable. other browsers, I couldn't tell ya nice tip on the overflow-y/-x lol, never seen that one before
-
Re: BBCode Resize browsers always make the image in the img tag fill the available space. adding width to that will cause the image to resize. if you wrap the img tag in a div, and apply the width and overflow to the div, then the image in the img tag will be contrained like you're talking about. ;) of course the portion of the image that doesn't fit the space is simply hidden from view. "overflow: auto" would add scroll bars
-
Re: BBCode Resize You'd have to hack into the bbcode engine, and after the part where the bbcode engine isolates the contents of tags, you would feed that data into the script I linked to. It would require some modification of both the bbcode engine and the script I linked to, but that script has a good solid foundation to build on.
-
Re: BBCode Resize http://criminalexistence.com/ceforums/i ... ic=23871.0 That post demonstrates how to scale down an image to a predefined max size. You would get a x/y list of numbers that you can plug into the img tag as width="y" height="x". If you just toss in width and height attributes that are the same on all images, then all images will be that size. This code above only scales down images larger than that max size, keeps proportions, and doesn't increase the size of smaller images.
-
Re: please can someone change from html to php The general rule for javascript and html concerning " and ' is that you use " as the outer quotes and ' as the inner quotes. <span class="syntaxdefault"></span><span class="syntaxkeyword"><</span><span class="syntaxdefault">a href</span><span class="syntaxkeyword">=</span><span class="syntaxstring">"javascript:self.do_something('option_one', 'option_two')"</span><span class="syntaxkeyword">></span><span class="syntaxdefault">Click me</span><span class="syntaxkeyword">!</</span><span class="syntaxdefault">a</span><span class="syntaxkeyword">> </span><span class="syntaxdefault"></span> It's generally accepted that " be used around tag attribute values, if you use quotes at all. As for making javascript work by simply changing " to ' is misguided to say the least. Javascript doesn't make any distinction, as far as I know, to either of those two quote types. Javascript does not allow variables inside quotes, so that's not in play. I don't know specifically if \n works inside '\n' as I haven't specifically tested it, but I suspect it does. So, which quote you use really doesn't matter unless you're concerned with following standard conventions.
-
Re: Adobe CS3 Why not send a letter to the FBI? aye caramba... You might want to delete that post my friend, Poldar.
-
mccode-v2 8 Lines to secure your site from known sql injections.
Floydian replied to Haunted Dawg's topic in Free Modifications
Re: 8 Lines to secure your site from known sql injections. Perhaps you didn't read my entire post then. I did give reasons why it's not a good idea. I could give more. Mccodes requires magic quotes which is inserting slashes into the get and post already. Add more slashes to it with your method and you get double slashes. Perhaps you've taken out the code on mccodes version two that makes it require magic quotes, and also turned magic quotes off. The other reasons I gave are still valid. -
mccode-v2 8 Lines to secure your site from known sql injections.
Floydian replied to Haunted Dawg's topic in Free Modifications
Re: 8 Lines to secure your site from known sql injections. Catch alls that filter through the entire get and post are just ridiculous... I have an even better idea, don't allow users to submit user input. Don't ever update or insert, or delete anything in the database. That should secure just about any site. Don't believe me? lol Even better, take out this line: mysql_connect($host, $user, $pass); I guarantee you will never suffer a mysql injection again! -------------------------------------------------------------------- Obviously I jest, but a point is illustrated here. Whilst those things will work, you give up certain functionality. Cycling through the entire get and post arrays and escaping all text is just way to overreaching. What if you want to have an email script? You'd be sending out email with slashes all over it... That's really smart! What if you buy a mod from someone that actually took the time to secure their script the RIGHT WAY?? If you escape all get and post strings, their script will escape them again (unescaping them basically) and you're screwed. You'd be in luck with my scripts because I almost exclusively use the REQUEST array which I never see being escaped in these catch alls... Those aren't the only reasons that those catch all's shouldn't be done, but maybe the biggest one is it shows two things. One of them is okay, and to be expected. The other, I think, people would want to avoid. It shows: inexperience. Nothing wrong with that. We've all been inexperienced programmers. It also shows: LAZINESS!! More specifically, being too lazy to do things properly. That's IMHO. Feel free to be lazy and stuck on noob, I won't complain. ;) -
Re: Phpmyadmin lol yup, or you can drop the database and recreate it. The drop database syntax could't be much easier.