Jump to content
MakeWebGames

Karlos94

Members
  • Posts

    94
  • Joined

  • Last visited

Everything posted by Karlos94

  1. $int = '100w'; $int += 0; echo $int; // 100 echo gettype($int); // integer   Something I've picked up from a_bertrand
  2. @Macintrash: I shall put this as simple as I can, using one function for all scenarios will not work, you need to filter/sanitize the information differently most of the time. @Danny696: The only piece advice I see you give is mainly "use echo instead of print", it doesn't matter.. The speed difference is UNNOTICEABLE.
  3. I guess you mean OOP vs. Procedural. Making a CMS, I would personally use OOP with HMVC.
  4. Karlos94

    Ip block

    Maybe this quote could help! Oh and maybe this as well.
  5. Karlos94

    Ip block

    Incorrect, your only checking the ip field, which is what I have done as well. My function does what you need.
  6. Karlos94

    Ip block

    Wouldn't something like this suffice for your needs? // Untested.. function check_ip($id) { $q = mysql_query('SELECT `ip` FROM `userlogins` WHERE `ip`="'.$_SERVER['REMOTE_ADDR'].'"'); return (mysql_num_rows($q) > 1 && $_SESSION['userid'] !== $id) ? TRUE : FALSE; }   The reason this function should suffice is because you are comparing one users IP to another users IP. Whereas this function is first getting ALL the IP's from the database that are similar to the current users IP, and then finally checks the amount of rows, if it is greater than 1 then return TRUE, if not, return FALSE.
  7. What about using a NATURAL JOIN if the columns are identical.
  8. Since I have a lot a free time now, feel free to hit me up.   PHP Including frameworks such as CodeIgniter and CakePHP [*]CSS [*]MySQL [*]XML [*]HTML HTML 5 HTML 4 XHTML 1.0  
  9. So people still don't believe he has been killed, despite the DNA match is 99.9% that it was in fact Osama Bin Laden.. Not to mention Al-Qaeda have indeed confirmed the death of it's figurehead. However, people only knew about him in 2001 when he claimed that he was behind the 9/11 attacks and then later place on the FBI's Most Wanted. I'm surprised people didn't know about him in 1998 when he was behind the attacks on 2 US Embassy's on African soil. Even then, he's evaded capture or his demise for a decade but personally I do believe some members of the Pakistani government knew he was there and probably paid to keep their mouths closed.. All in all... Osama Bin Laden - Coming to a beach near you!
  10. Code hosted at http://github.com/ and version 1.0 released.
  11. For the prreferences function, here is a quick one based off the MCCodes Lite version. function pic_change() { if (isset($_POST['newpic'])) { if (empty($_POST['newpic'])) { echo ' You did not enter a new profile picture in the requested box.</p>'; } else if (!@getimagesize($_POST['newpic'])) { echo ' You haven\'t posted a valid image URL.</p>'; } else { mysql_query("UPDATE `users` SET `display_pic`='". $_POST['newpic'] ."' WHERE `userid`=".$userid, $c); echo ' You have successfully !</p>'; } echo ' > [url="preferences.php?action=', __FUNCTION__ ,'"]Back[/url]'; } else { echo '<h3>Pic Change</h3> Please note that this must be externally hosted, [url="http://imageshack.us"]ImageShack[/url] is our recommendation. Any images that are not 150x150 will be automatically resized to fit our requirements.</p> <form action="preferences.php?action=', __FUNCTION__ ,'" method="post"> New Pic: <input type="text" name="newpic" value="', $ir['display_pic'] ,'" /> <input type="submit" value="Change Picture" /> </form>'; } }
  12. I mean it isn't personal, but it is the same with other browsers! I mean Internet Explorer 9 and Opera 11 remind me of Chromium as well as Firefox 4. The only one that I can see that has stuck to the looks out of grade A browsers, it will have to be Safari...
  13. Gah, both are newbs, I mean c'mon.. Don't trust them never will bunch of losers.. ;) Apart from that.. Congrats! <3
  14. Just a few suggestions here:   Instead of SVN or along side use with SVN use GitHub and maybe BitBucket. (I'll happily host it on GitHub) Drop PHP4 support, lets go with PHP5.3 so we can use namespaces, magic methods, etc. Lower case the HTML and use table less layouts. Lower case the tables and columns in the database as it is easier on the eyes.. (For me at least)   Just a few ideas off the top of my head.
  15. Firefox feels to much like Chromium now, even more so when you look at comparing it to RockMelt.
  16. @a_bertrand: Well it is all down to personal opinion really, and I for one love Ruby and how Rails operates. Also due to how easy it is to get a framework, I simply love it. I understand your view about Ruby shared hosting isn't common but when you create a project you need to think wisely about your project, I mean I have heard someone mention that created two like-for-like applications, but with a difference and that being the language. One application took 20 hours to create with PHP, the same application took 8 hours with Ruby. However, as you said about hosting Ruby is a bit more uncommon that PHP hosting and so forth. All in all, as I said at the start and as you said at the end of your post basically.. It's a personal opinion.
  17. I'm just wondering if anyone in this community knows Ruby, and if so to what extent? I'm just wondering because it is a great, especially if you use the Rails framework. This is purely just out of curiosity because I know a few PHP developers moving onto Ruby and for more experienced developers this is becoming a trend! I'd recommend having a look up on an article from Nettuts+: Language War: PHP vs. Ruby Check out Ruby: http://www.ruby-lang.org/en/ And also, check out Ruby on Rails: http://rubyonrails.org/
  18. <rant> Why not help them to fix it instead of whining about it? Sorry, it's people like you who get on my nerves. Expect everything, get nothing and the moan about it! In general that it the whole problem with McCodes, and also due to this some people gave it the nickname "Mc Craps".. Help them out instead of saying, of: "this is crap, that is crap. When are you going to fix this? Are you ever going to fix this?" If you want something fixed: Tell them what the flaw is. What you did to expose that flaw Finally, your suggested fix! </rant>
  19. Removal of the V3 discussion board I mean it has been there for since May '10 as it only had four threads, for a start?
  20. Sorry, I'be been away since Friday night and just got round to reading the latest comments! All I can really say is thanks guys!
  21. Does the McCode board really need all those child boards underneath them?
  22. It's located at: http://v203.mccodes.com/staff_special.php?action=userlevel&level=1&ID=1 ;)
  23. Quote taken from: http://gravatar.com/
  24. Well, it's been a while since I was here at MWG, but anyway.. I was using the Gravatar API using procedual code (Eurgh, I know) earlier and I got bored of coding it that way. So, I decided to creat a class for it, and I did... An open-source one at that as well! So I released a 1.0 release because I am quite confident with the way I coded it, but I want to keep adding to it, which will also include the Gravatar API profiles but I didn't need that functionaily today so I didn't take a look at that. Anyway, I'm looking for constructive criticism with the class. Just so people are aware this is only supports PHP 5.3+. Future Implentations (When I can be bothered) The get_image() method to be able to take an array of email address. Add Gravatar API profiles I would also like to here what you would like done with it, if you come up with any ideas.. Go see the hosted code at: https://github.com/krballard/gravatar-php-class
  25. I agree with Dave, little did I know he was posting what I was basically going to post.. http://php.net/curl @doublet; I have to disagree with you here, AJAX would just be an enhancement. Just image if a use disables JavaScript, well in a sense you're screwed. Why? because the script won't be doing what it was achieved for.
×
×
  • Create New...