Tobbetobs Posted March 11, 2010 Posted March 11, 2010 Hello! I tried to change the counter date in counter.php and changed: $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER) to: $counter_query = tep_db_query("select date2010, counter from " . TABLE_COUNTER) and then the footer disipeard and then the webshop whent to be only a blank page! I then changed it back to how it was before but its still behaving in the same way!! What to do?! Help!! :( Sorry for bad english! <?php /* $Id: counter.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER) 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))); ?>
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 This row, $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER) needs to end with a semi-colon. $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER); Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 This row, $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER) needs to end with a semi-colon. $counter_query = tep_db_query("select startdate, counter from " . TABLE_COUNTER); That was the bugger, Thank you!!! is it possible to reset or change the startdate in admin?
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 That was the bugger, Thank you!!! is it possible to reset or change the startdate in admin? There are a couple of add-on that may do that. My add on (http://addons.oscommerce.com/info/7270) automatically resets monthly (or as often as you like). Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 There are a couple of add-on that may do that. My add on (http://addons.oscommerce.com/info/7270) automatically resets monthly (or as often as you like). ok, i have uploaded the single file rotate_counter.php to my admin folder how do i create a cron job to execute the file? I want to reset the counter only once and have the date change once aswell only! I dont have my own server but using a webhost
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 ok, i have uploaded the single file rotate_counter.php to my admin folder how do i create a cron job to execute the file? I want to reset the counter only once and have the date change once aswell only! I dont have my own server but using a webhost A cron job is created on your cPanel at your host. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 A cron job is created on your cPanel at your host. ok thank you for yout support! Since being a neeby it seems complicated, isnt there any easier way to change the startdate?
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 ok thank you for yout support! Since being a neeby it seems complicated, isnt there any easier way to change the startdate? As I said, there are a couple of add-ons that you can search for in the add-on sections. If you are comfortable using phpMyAdmin you can change it by hand. Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 As I said, there are a couple of add-ons that you can search for in the add-on sections. If you are comfortable using phpMyAdmin you can change it by hand. ok, not realy but i can try. how do i doo?
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 ok, not realy but i can try. how do i doo? In phpMyAdmin on the left is a list of the databases you have access to. Select your shops database. When the page refreshes, click on counter in the left side. When the page refreshes, on the right side click the Browse tab (in recent versions it may already be selected) You will likely see one row in the table. Click the edit icon (looks like a pencil) Put in whatever value you want and the data you want and click OK. (Be VERY certain you keep the data format correct) Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 In phpMyAdmin on the left is a list of the databases you have access to. Select your shops database. When the page refreshes, click on counter in the left side. When the page refreshes, on the right side click the Browse tab (in recent versions it may already be selected) You will likely see one row in the table. Click the edit icon (looks like a pencil) Put in whatever value you want and the data you want and click OK. (Be VERY certain you keep the data format correct) ok it looks like this: and i changed it to: and saved but nothing changes!
Tobbetobs Posted March 12, 2010 Author Posted March 12, 2010 changed it in counter worked great! thx!!
♥mdtaylorlrim Posted March 12, 2010 Posted March 12, 2010 changed it in counter worked great! thx!! Yeah, you were in the counter_history table. While you are there however, if you could figure out the cron job, the counter_history table is updated at each rotation of the counter.... Community Bootstrap Edition, Edge Avoid the most asked question. See How to Secure My Site and How do I...?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.