- October 14, 2013 at 15:34 #1140
dear Support, what code to add to display total ads in the entire classified on frontend.php please advice, Thanks………….October 14, 2013 at 21:32 #1141
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.October 18, 2013 at 18:02 #1170
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?October 20, 2013 at 02:43 #1175
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.February 11, 2014 at 19:17 #1534
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.