SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple pause listing logic

    Hi gurus,

    See, I have a simple logic to understand here. Currently I have a system that allows users to post a classified ad listing. This listing expiry date varies, depending how many days the user chooses. 1,3,5,7,10 days. It works just closely similar to eBay.

    Ok, once a listing is posted, there will be an expiry date recorded in the database. For example 2006-11-02 04:27:26. This is the date time that the listing will expired. For now, I want to allow them to pause their own listing. How to I enable this feature? Do i have to create another field in the table and record when the user pause their listing? And how do i calculate that to offset the duration?

  2. #2
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bump?

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i suppose you could record a pause start and pause end time. from that you can calculate the time paused, and use that to extend the expiry time.

    you probably want to make a seperate table to hold these pause start and end times, to make it easy to allow for multiple pauses if needed.

  4. #4
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply clamcrusher,

    do I need to track the pause end time? because everytime a user unpause a listing, the expiry time will be calculated (to the extend) immediately and the pause time will be deleted. Am i right to say that?

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats one way to do it.

    you could also keep the pause times if you need to keep records of them, as well as keep the origional expiry time if you need that info, and just calculate the expiry or have an 'adjusted expiry' field.

  6. #6
    SitePoint Addict say's Avatar
    Join Date
    Sep 2003
    Location
    At work
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very much thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •