Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

xxx requests since July 19, 2003 on footer


Guest

Recommended Posts

I've searched thru a gazillion posts for this, so....I see lots of requests on how to change the language, the format, etc. But, I can't find anything that can help me change that xxx number of requests since July 19, 2003 on the bottom of my store's home-page :blink: .

 

My website does show the current date on the left hand side of the footer, but I can't stand seeing that 'July 19, 2003' on the far right.

 

I saw something about logging in as www.mywebsite.com/phpadmin.......but I don't have phpadmin capability.

 

So....what file(s) do I need to edit to change that date? I don't care about changing the actual number of hits......just the date. I want it to read November 29, 2004. Thank You for your help!

Link to comment
Share on other sites

Hi,

 

The table used is called "counter" as follows:

 

DROP TABLE IF EXISTS counter;

CREATE TABLE counter (

startdate char(8),

counter int(12)

);

 

From memory, the osC code looks for the row, if not there (first time) adds the row at todays date.

 

You can modify it via PhpMyAdmin.

 

Peter

Link to comment
Share on other sites

Hi,

 

_Completely_ untested, but I see no reason why it won't work (famous last words).

 

Save this as counter_fix.php

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 

 $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 {   //this will be true, you already have the row present
   $date_now = date('Ymd');
   tep_db_query("update " . TABLE_COUNTER . " set startdate = '" . date_now . "'");
 }

?>

 

upload to your site, and run it.

 

Peter

Link to comment
Share on other sites

Good Lord, you work too hard, Peter! LOL!

 

Alright.....this is where my I-have-no-clue-how-to-do-that speech comes in.

 

I go to my cpanel and then.....what? What folder or directory do I put it in?

 

Baby steps, please. Sorry for the trouble, I swear!

 

Andrea

Link to comment
Share on other sites

Hi Andrea,

 

I'm assuming you have the script above, saved in a file called counter_fix.php

 

If you don't, then please don't use the CPanel 'File Manager', or even the osCommerce 'file manager', use a good freebie like "Crimson Editor" (http://www.crimsoneditor.com/)

 

Now you have the file saved.

 

1. Let's say your website is called htp://example.com

 

2. Upload the file counter_fix.php (via FTP) to your 'web root' path, which if you are using CPanel, would be:

 

/home/someusername/public_html

 

3. Now run the script like this.

 

htp://example.com/counter_fix.php

 

Peter

Link to comment
Share on other sites

Hi,

 

That's what I get for not testing it. LOL

 

This line ...............

 

tep_db_query("update " . TABLE_COUNTER . " set startdate = '" . date_now . "'");

 

should be ........

 

tep_db_query("update " . TABLE_COUNTER . " set startdate = '" . $date_now . "'");

 

Peter

Link to comment
Share on other sites

Hi Andrea,

 

Good that it worked. :)

 

If you have CPanel, then usually PhpMyAdmin will not be 'visible', so to speak. There _should_ be an option like "MySQL databases" or similar from memory, select that, then right down the bottom of the form, there is a link to phpmyadmin.

 

Peter

Link to comment
Share on other sites

Hi Andrea,

 

Good that it worked.  :)

 

If you have CPanel, then usually PhpMyAdmin will not be 'visible', so to speak. There _should_ be an option like "MySQL databases" or similar from memory, select that, then right down the bottom of the form, there is a link to phpmyadmin.

 

Peter

 

 

Thanks for the advice; I need all of the help I can get.

 

Just curious: is it fair to say that if I run that program again on different days in the future.....it will update the date on the screen? Wicked thought but, just curious. Have a good night!

 

Andrea

Link to comment
Share on other sites

  • 1 month later...

I have read the whole page.

 

1. half-suggeston - to go to the contol Panel, My Admin and to counter table. THan What?

 

2. Half-ready fix and than fix to it, but not simply corrected and re-posted.

 

It is some kind of game that I do not unserstand?

Link to comment
Share on other sites

Hi,

 

I have read the whole page.

 

1. half-suggeston - to go to the contol Panel, My Admin and to counter table. THan What?

 

2. Half-ready fix and than fix to it, but not simply corrected and re-posted.

 

It is some kind of game that I do not unserstand?

 

Some answers I hope.

 

1. Then click the EDIT icon, and update the value (usually with the GO button)

 

2. Huh ??

 

Peter

Link to comment
Share on other sites

thank you for the priceless contribution.

 

>>1. Then click the EDIT icon, and update the value (usually with the GO button)

 

in Table: counter

 

opend for editing I can see 3 Go buttons. Shell I press all 3 semountenously?

Link to comment
Share on other sites

thank you for the priceless contribution.

 

>>1. Then click the EDIT icon, and update the value (usually with the GO button)

 

in Table: counter

 

opend for editing I can see 3 Go buttons. Shell I press all 3 semountenously?

 

yes, those buttons are very sensitive, so all at the same time but carefully.

Treasurer MFC

Link to comment
Share on other sites

Hi,

 

thank you for the priceless contribution.

 

You are welcome, and as you say, it was priceless, it didn't cost anything. :lol:

 

>>1. Then click the EDIT icon, and update the value (usually with the GO button)

 

in Table: counter

 

opend for editing I can see 3 Go buttons. Shell I press all 3 semountenously?

 

If you knew how many different flavours/versions of phpMyAdmin there were, and that the GO button may not even be in the same place from one version to another, or in some cases, not there at all, there may be then some understanding in the matter.

 

We cannot 'see' what you can see in phpMyAdmin, therefore please construct the question in a more descriptive manner, and I'm sure more help will come your way.

 

Peter

Link to comment
Share on other sites

Yes, according to Peter, I did just that!

 

;-)

 

Try the SQL tab, then ..............

 

to set te counter to zero

 

UPDATE counter SET counter=0;

 

to increase it by 100

 

UPDATE counter SET counter=counter+100;

 

to set it to 23,543

 

UPDATE counter SET counter=23543;

 

But, please, don't ask what button to press. :lol:

 

Peter

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...