Jump to content

JasonLewis

Members
  • Posts

    3,347
  • Joined

  • Last visited

About JasonLewis

  • Birthday 01/31/1991

Contact Methods

  • MSN
    jason.lewis1991@gmail.com
  • Website URL
    http://jasonlewis.me

Profile Information

  • Gender
    Male
  • Location
    Victoria, Australia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JasonLewis's Achievements

Member

Member (2/5)

0

Reputation

  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. });
×
×
  • 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.