Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Banner History


tryagain

Recommended Posts

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.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...