Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Member eif media's Avatar
    Join Date
    Apr 2011
    Location
    Glossop, UK
    Posts
    73
    Member #
    27461
    Liked
    4 times
    Good afternoon all,

    I am hoping to design an online store whose products change every 24 hours at midnight.

    I am open to suggestions on how this might best be achieved, although I believe it would be possible utilising a frame for the static elements (i.e. header and footer) with the content page being exchanged using javascript at 00:00.

    If this is indeed the best method, or if you can guide me towards another method, help with the code would be greatly appreciated as my Javascript knowledge is limited.

    Thank you,
    Dan

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    With a MySQL database, you can have a whole table full of contents and specific dates
    of when they should switch. Not sure if you switch by random, or you cycle through each day.
    How many switch, etc. You'll have to tell us more about the products, the specifications on
    which ones switch, or how they are supposed to switch.

    The actual web page part is easy. The PHP script knows your exact time (in your timezone) and
    queries the database for particular items based on the time. So the picking of the items is
    merely a query.

    Now if your products are not your own (you're getting them from some other site or resource),
    that will make this harder to do. We'll have to see what your specifications are.

    And does the user's browser have to dynamically change at 00:00, or with the next page refresh they do?


  4. #3
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    The real trick is going to be...

    Midnight your location ? Or midnight server location ? Or midnight visitors location...

    The first 2 are doable... Last would be a real pain...

    Your DB table with products would only need 1 other column needed and a 1-7 number added... Based on day of week... Display these items ( suspect just the front page )... Otherwise... 1-30 ... But personally think that is a little overkill... 1-7 gives you 7 days to tweak and make changes to what you may want to show the following week...

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    If your visitors need to log-in, you could have them specify their timezone ....
    but be careful with that ... example, I could view your products with my timezone US Central DST
    and then change my timezone to Sydney Australia and view the products for tomorrow. They are
    15 hours ahead of me. The internet is like a time-warp. This is a common problem with
    businesses that offer time sensitive coupons and special offers.


  6. #5
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    I've seen those before... Most "time zone" user settings are being replaced with a small piece of Ajax that gets the clients computer time and sends it back to the server...

    Short of doing a ping and measuring hops and response times ( and even hat can be manipulated )... Not really much more you can do...

    I'd pick the center of your target market... Use that for your time zone change... Now of you're running multilingual... Another big mess... And another can of worms to wrestle with...

    Fun with PC clocks...

  7. #6
    Member eif media's Avatar
    Join Date
    Apr 2011
    Location
    Glossop, UK
    Posts
    73
    Member #
    27461
    Liked
    4 times
    Thank you both for your help so far.

    The products are shoes and there are to be 30 per page/day and I think they are to be predefined (not random). Server times are fine for defining the page refresh - no need for a user login and a change on refresh will suffice.

    The products will be external as far as I understand, as the client is asking for a build based on search engine software (price tapestry) presumably for affiliate marketing - I thought this would present a difficulty.

    This has lead me to consider another option though (which perhaps would be best commented on by folk at price tapestry) the inclusion of the column of time related info within a .CSV file and a query set to perform a search of the file at 00:00 using date information collected from the server - is that possible as I think it would probably be my best route?

    Dan

  8. #7
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    If they can offer an XML file (like and RSS feed), that would be best.
    The .CSV file can be read, but they would have to make sure the latest is uploaded.

    If you can get a PHP script to access the items (photos, description, prices) from any
    type of file (XML or CSV) ... as long as the data is current.

    To build your own search engine nd scrape websites ... that will be a difficult job.
    Try to find XML files if you can.


  9. #8
    CPD
    CPD is offline
    Member
    Join Date
    May 2012
    Location
    South London, England
    Posts
    36
    Member #
    31775
    Liked
    5 times
    Why not use GeoIP to get the country code and then determine the time zone. There's a fair bit of overhead and I can't say how reliable the GeoIP will be.

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,717
    Member #
    5580
    Liked
    718 times
    I think it pops up a box that asks the user if they wish to allow the script to find their location.
    And when I've done that, it puts me in the correct place about 80% of the time. Otherwise, my
    marker ends-up about 300 miles away. Not very reliable.


  11. #10
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    The accurate GEOIP database is not cheap, and is constantly being updated ( has to )...

    There are some free versions based on old data... But accuracy is not guaranteed...

    Don't think it's warranted or needed in this case...

    Set a cron job on the server to call the DB at midnight ( server time ), run a script that updates the list of items to show on the front page... If the external source is updating their CSV file nightly... You can setup a batch to go get the file and dump it on the server every night...

    If you're running php... You might be able to setup a script to call their file and copy it over at a set time... Then you could setup a cron job to call that script....

    That's if you can make use of their CSV file.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:39 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com