How to add counter to display total ads in classified at frontend.php?

ClassiBase classifieds script Forums General help How to add counter to display total ads in classified at frontend.php?

This topic contains 4 replies, has 2 voices, and was last updated by  ClassiBase 2 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1140 Reply

    Elite Tan
    Participant

    dear Support, what code to add to display total ads in the entire classified on frontend.php please advice, Thanks………….

    #1141 Reply

    ClassiBase
    Keymaster

    To display total number of live ads use following code.

    <?php echo Ad::countByClass('Ad', 'listed=?', array(1));?>

    Result are cached when using this method for 1 hour so do not worry about overloading database.

    #1170 Reply

    Elite Tan
    Participant

    thanks Support,

    1. by the way want to ask when public post new ad, we notice the ad count is not increase until i manually clear the cache in the admin page, will the ad count be automatically updated how often it is 1-2 hour later after user post new ad or we’ve to manually clear cache so that the ad count will be updated? please advice…………..

    2. and for the total ad count, will it be automatically updated in real time also when user post new ad or we’ve to manually clear cache so that it’ll be updated?

    #1175 Reply

    ClassiBase
    Keymaster

    It is programmed to clear ad count cache immediately after any ad added or deleted.

    If cache is not deleted by program or manually by admin regular cache period is set to 1 hour.

    #1534 Reply

    ClassiBase
    Keymaster

    We wrote detailed tutorial about displaying total number of ads, number of ads posted last month and number of ads posted last day. Please read How to display total number of ads in Classifieds website? tutorial.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: How to add counter to display total ads in classified at frontend.php?
Your information: