trophy Posted February 28, 2009 Share Posted February 28, 2009 I need some help as I have spent hours trying to get this contribution to work, I keep getting errors. I am confused as to the instructions in the first line, there is no counter in catalog/includes to copy. I don't have a catalog only an admin, is that the same as a catalog and all below it. I can't help feeling the below is missing some words or it has the wrong wording. All help greatly appreciated Gill A These are the instructions that come with the contribution. - Copy the counter.php in the catalog/includes directory. Or change it manually, see file below. - Edit catalog/includes/application_top.php Search for the who's online function call, and remove/remark it: // include the who's online functions // require(DIR_WS_FUNCTIONS . 'whos_online.php'); // tep_update_whos_online(); (Be smart, copy these lines in your clipboard....) - Edit catalog/includes/footer.php Paste the lines (without the remarks :-) just below require(DIR_WS_INCLUDES . 'counter.php'); (Important!! If you place it above this line, your counter will not work!) require(DIR_WS_INCLUDES . 'counter.php'); // include the who's online functions require(DIR_WS_FUNCTIONS . 'whos_online.php'); tep_update_whos_online(); That's all! For the manual freaks, here's the counter.php: <?php /* $Id: counter.php,v 1.5 2003/02/10 22:30:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $wo_session_id = tep_session_id(); $known_customer_query = tep_db_query("select count(*) as count from " . TABLE_WHOS_ONLINE . " where session_id = '" . $wo_session_id . "'"); $known_customer = tep_db_fetch_array($known_customer_query); $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER); if ($known_customer['count'] > 0) { // User already known, don't add 1... $counter = tep_db_fetch_array($counter_query); $counter_startdate = $counter['startdate']; $counter_now = ($counter['counter']); } else { if (!tep_db_num_rows($counter_query)) { $date_now = date('Ymd'); tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')"); $counter_startdate = $date_now; $counter_now = 1; } else { $counter = tep_db_fetch_array($counter_query); $counter_startdate = $counter['startdate']; $counter_now = ($counter['counter'] + 1); tep_db_query("update " . TABLE_COUNTER . " set counter = '" . $counter_now . "'"); } } $counter_startdate_formatted = strftime(DATE_FORMAT_LONG, mktime(0, 0, 0, substr($counter_startdate, 4, 2), substr($counter_startdate, -2), substr($counter_startdate, 0, 4))); ?> Quote Link to comment Share on other sites More sharing options...
Guest Posted February 28, 2009 Share Posted February 28, 2009 Copy the counter.php to the catalog/includes directory, in your case it may be Copy the counter.php to the includes directory, Quote Link to comment Share on other sites More sharing options...
trophy Posted February 28, 2009 Author Share Posted February 28, 2009 Coopco thank you for the reply. I am confused as you mention catalog . When I connect with my site I see a blank folder, I then expand it and I see admin, cgi-bin, download, images, includes, pub. If I expand admin I see backups, images, includes. Now as I have two includes which one do I post into? Gill A Quote Link to comment Share on other sites More sharing options...
Guest Posted February 28, 2009 Share Posted February 28, 2009 Coopco thank you for the reply.I am confused as you mention catalog . When I connect with my site I see a blank folder, I then expand it and I see admin, cgi-bin, download, images, includes, pub. If I expand admin I see backups, images, includes. Now as I have two includes which one do I post into? Gill A since the instructions do not say admin/includes it is the one you see here admin, cgi-bin, download, images, includes, pub. Quote Link to comment Share on other sites More sharing options...
trophy Posted February 28, 2009 Author Share Posted February 28, 2009 Yes I have that correct but when I look in catalog/includes/application_top.php I see I have loaded in the counter.php which I am thinking is in correct and I need to reload that page. Where can I go to get just that page to reload? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.