Results 1 to 1 of 1

Thread: Help needed with an add-on

  1. #1
    Join Date
    Oct 2012
    Thanked 1 Time in 1 Post

    Default Help needed with an add-on

    One programmer wrote this add-on for me, but it has an issue. The programmer is currently busy with a lot of work, so I was wondering if someone can help me with it.

    The add-on should allow people to post a set amount of free ads and once that limit is reached they are required to post featured (paid) ads.

    This is what goes to the config file:

    // Max amount of free ads user can post. If set at 0 it only allows featured listings. Default is 10
    $free_ad_limit = 10;
    // Enable the timer so that if a certain amount of time is passed, poster can post ads again.  Enabled: 1
    $enable_max_ad_timer = 1;
    // If $enable_max_ad_timer is enabled above, specify how much time poster has until their free ad limit expires.  Default: 86400 (24 hours)
    $max_free_ad_expire = 86400;

    And this is what goes to the post file:

     if ($enable_max_ad_timer == 1)
                $ask_query = "SELECT ip FROM $t_ads
                                         WHERE ip = '$_SERVER[REMOTE_ADDR]'
                                        AND (UNIX_TIMESTAMP(createdon) > '1379843684'
                                         AND UNIX_TIMESTAMP(createdon) <= '".(time()+$max_free_ad_expire)."')";
                $ask_result = mysql_query($ask_query);
                $ask_count = mysql_num_rows($ask_result);
                if ($_POST['promote']['featured'] == 0 && $ask_count >= $free_ad_limit)
                    $err .= "&bull; $lang[ERROR_ASK_FEATURED]<br>";
    What happens is it stops people from posting free ads just fine, but then when the $max_free_ad_expire expires it continues to stop free ads from being posted. It's supposed to let them be posted again after 24 hours (or whatever time frame I want to use).

    Does anyone know what the issue might be?

    Last edited by; 10-31-2013 at 10:08 PM.

Similar Threads

  1. Nav Bar Help needed PLEASE
    By ddurante in forum JavaScript
    Replies: 0
    Last Post: 02-27-2011, 09:52 AM
  2. PHP Help needed.
    By tgallagher26 in forum PHP
    Replies: 0
    Last Post: 04-27-2009, 08:26 PM
  3. how much RAM is needed for my PC
    By joycie in forum Computer hardware and software
    Replies: 4
    Last Post: 07-25-2008, 03:52 PM
  4. help needed...
    By Josh_R in forum JavaScript
    Replies: 6
    Last Post: 12-18-2005, 04:30 PM
  5. Some help needed.
    By shachi in forum JavaScript
    Replies: 1
    Last Post: 08-03-2005, 03:53 PM


Posting Permissions

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