Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by JasonLewis

  1. Hey guys, looks great. Well done to those that did the change over. Not very active anymore but it's great to see the community continue to grow.
  2. Very interesting. Not that I frequent here anymore (I'm sorry!) I'll be interested to see how it all goes. I'll check in from time to time. After all.. this is probably my longest standing account on the internet. Good luck to you!
  3. I've come to the conclusion that Twitter most likely uses JavaScript to update their dates. You can check this by changing your computers date/time and refreshing the page. As an educated guess I'd say Twitter keeps the timezone setting as a server-side fall back in case something goes wrong client-side. Fair enough. I've gone the same way. I'm using PHPDate for jQuery to make formatting my dates easier and also using this conversion script found on StackOverflow. This has turned into a client-side thing now. Ah well, hopefully this can help someone.
  4. Developing apps is great until I have to start dealing with blasted timezones. For some reason this aspect of it always does my head in. At the moment I'm storing all dates in the DB as GMT with the format Y-m-d H:i:s. I figure it's good to be consistent and store dates in GMT then convert to the users desired timezone. So I allow users to choose there timezone, based off the defined PHP timezones that can be used with the DateTimeZone class. My problem, however, arises with the whole syncing of times. Let's say I post something right now. The date gets stored in in the database as: 2012-04-14 02:35:49 Now I'm in GMT +10 (possibly the greatest of timezones ), so I've set my timezone in my settings as Australia/Melbourne and when displaying date/times locally I do something like this: public static function local($user, $date, $format = 'F j, Y, h:ia') { $date = new DateTime($date); return $date->setTimezone(new DateTimeZone($user->timezone))->format($format); } So running the stored date above through my method gives me a date like this: April 14, 2012, 12:35pm Awesome. My question is: I noticed that on say, Twitter, when you change your timezone your tweet dates don't change. They remain as the date/time of my actual timezone, regardless of what I set it too. With my implementation however, if I change my timezone to GMT +12 (Fiji) my post is now posted at: April 14, 2012, 02:35pm So is what I'm doing right? My head has about had it. Thanks.
  5. Just an update for people. I'm approaching this like I've posted above. I'll be making use of Node/Socket.io/Redis (pub/sub feature) to handle real-time updates for notifications and other related components. Once I get it working properly I'll post how I did it all for future reference.
  6. Thanks for your reply kicken! What I'm getting at is this. Say I post a new update or something, when that update is inserting into the database should I push the notification through to socket.io which then broadcasts that notification to the connected clients? Does that sound feasible? What I want to try to avoid is polling the database every couple of seconds to check for new notifications. I'm using MySQL and I've read that other database's handle that sort of thing a tad better. Edit: This is a quote from another forum: I can make sense of that... I'll just need to implement Redis since I don't have it at the moment.
  7. I'm looking for advice at the moment on achieving real-time notifications using a mix of PHP, NodeJS and socket.io. At the moment I have done next to nothing with Node and socket.io so I'm at a loss with the best way to achieve this. I've done some basically listening and what not but nothing extreme. For now my questions are: 1. How will socket.io know of new notifications, should PHP be responsible for sending the data (say a post was created) to socket.io and from there broadcasting to connected clients? 2. How does socket.io know which clients want the notifications? I'm really not sure what else. This is all a bit much for me at the moment. I just can't get my head around how the notifications will be distributed. Any advice would be greatly appreciated. I don't expect a detailed walk through, just a push in the right direction or some knowledge on how it all meshes. Cheers.
  8. How do you propose to gain a foothold on Facebook if you're making a clone? No one wants another Facebook. I'd stop making this clone if I were you and make something better than Facebook. Unless you're just screwing around, in which case go nuts.
  9. Using sessions to allow data to be available on subsequent pageviews is fine. In fact most people use sessions for that purpose.
  10. Are you being serious about charging per line? That just sounds ri-god-damn-diculous. If you are going to charge them (although I really think you shouldn't as you said yourself this is your first PHP project) do it per hour or as a lump sum you can work out with client. See how much they are willing to pay.
  11. We all have that magical power... YOU JUST GOT TO BELIEVE MAN!
  12. They indeed do, but jQuery would be a humongous overkill here. Of course. Unless there will be more JS usage across the website.
  13. Like thorpe said, you can bind events just with jQuery. You can determine when the DOM is ready with something like: $(document).ready(function(){ // Bind the event in here. });
  14. You're correct, it requires a combination of JavaScript and CSS. These days people tend to lean towards using a JavaScript library, such as jQuery. This allows for easy animating of elements and more.
  15. People are just under the assumption that a title of "HELP!!!!!!!!!!!!!!!!!!!!!!" stands out more and people will be more inclined to click into it. Sadly that's not the case, unless I'm keen for a laugh at the contents of the topic contained within.
  16. You are binding the click event handler twice: inline with the onclick attribute and in the onclicks function close_box. That's a no no. It's doubling up and getting confused. You can have one or the other. You can pass this from the onclick attribute, or just define an ID attribute with the ID to delete then grab it with the jQuery event.
  17. http://www.youtube.com/watch?v=W1kwW4WuBzo For those of you who don't know, Hamish and Andy are an Australian radio hosting duo. They're really funny guys. Currently they are on a GAP year in New York, that clip is from an episode of their currently airing TV show. Funny stuff. This is safe for work too.
  18. Tested in IE9 and it works. I no longer have IE Tester installed so I can't test earlier versions, sorry.
  19. Looks okay... except points 5 and 6. You're always going to get horrible spellers and badly titled topics. Mainly due to (like you sort of mentioned) a proportion of PHPF being international as well as an age range from somewhere between 12 and 60+. The younger generation are always going to write 'u' or 'r'. Or they'll throw a huge wall of text at you because they've never heard of paragraphs. I'd also put in something to do with thinking hard about where this problem belongs. Is it really related to the topic of the board or should it go elsewhere. But again, people sometimes just don't give a rats ass.
  20. This relates to Ajax as well but more-so JavaScript. Let me use an example. I have a tagging system that's using Ajax to auto-suggest tags. The user can then select a tag from the suggested tags or add the tag they want. If they select a tag, is the best way to go about it adding that tag ID to a hidden field as a comma separated list. Or... keep the selected tags in an array and attach an event to the submit handler of the form, then once submitted insert X amount of hidden inputs (where X is the number of tags) so that I'll have an array of selected tags when they submit. In the past when I've done things like this I've just updated a hidden input each time a tag is added/edited, however I'm just wondering if the second approach is possible and if it's better. The only possibility I can think of is that it won't work due to the form already being submitted and thus the inputs aren't actually added to the post data. I am yet to test this. Cheers.
  21. md5 and sha1 are not encryption methods, they are simply calculating the hash values of strings supplied. See the sticky at the top of this board: http://www.phpfreaks.com/forums/index.php/topic,254277.0.html
  22. No, I doubt the examples you listed would provide username/access code information publicly. Okay, so then this depends on the circumstances that surround it. I tested a few sites: Westpac (my bank), Forrst, GitHub, Flingbits, Facebook and this website. The websites that said my password was incorrect were: Flingbits, Facebook and PHP Freaks. All the others said that my login combination was incorrect or something to that effect.
  23. Of course, a login spam filter should be consider for all logins. But still, usernames are publicly available? So they shouldn't be getting it wrong anyway, unless it's a bot script that is simply trying to brute force it's way through. But again the lockout will be applied if they try too many times.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.