Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Banner History


tryagain

Recommended Posts

Posted

Is there an easy way to delete the previous years of banner history?

 

I have been deleting it line by line in the database but there has to be an easier way.

 

Thanks

Posted

open your catalog\includes\functions\banner.php

 

locate this code:

////
// Update the banner click statistics
 function tep_update_banner_click_count($banner_id) {
tep_db_query("update " . TABLE_BANNERS_HISTORY . " set banners_clicked = banners_clicked + 1 where banners_id = '" . (int)$banner_id . "' and date_format(banners_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')");

 

right below it add this code:

	tep_db_query("delete from " . TABLE_BANNERS_HISTORY . " where (curdate()+0) > ((date_format(banners_history_date, '%Y%m%d')+0)+10000)");

 

Then when someone clicks a banner the code will delete the banner history that's over a year's old.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...