PHP Help - Bumping of Ads

Discussion in 'Coding Help' started by offloadit, May 26, 2010.

  1. offloadit

    offloadit New Member

    Anyone know how to set it up so that adverts on a classifieds site can be bumped up to the top?

    My classifieds website uses PHP for the placement of new ads but I want to allow users to bump their ads to the top (for a small fee).
  2. php.allstar

    php.allstar New Member

    I'd say your script displays ads in reverse chronological order (i.e. - newest ads first) this is the norm.

    If so, its just a matter of writing a custom "bump" script where the user provides the username and password and possibly the id of the ad they want to bump. If the credentials are correct the user is prompted for payment details. Upon payment success, the payment processor triggers your script to update the ad in the database with the current timestamp.

    You'd possibly want to modify your database for this. It's always a good idea to keep the original timestamp of when the ad was erm, added, just add a timestamp field for "bump" which by default gets set with the current timestamp when the user initially adds their ad. Then just modify your php script to sort listings by this "bump" field.

    Hope I haven't confused you too much!
  3. danielovincenzo

    danielovincenzo New Member

    Could you give me some basic tips on php coding. thanks
  4. php.allstar

    php.allstar New Member

  5. danielovincenzo

    danielovincenzo New Member

    Thanks for this info. I'll save this one for my starting reference.

Share This Page