Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Footer Time and Date


SpinerC

Recommended Posts

Hello!

 

Can someone please tell me..... :huh:

 

I installed an upgrade found here in this section for the footer, to have the full date, down to the minutes etc.... and it works nicely but!

 

It shows the Number of Visitors Since April 11 2007!!!! That date is not here yet for one lol!! And I opened my site back on November 11th 2006.

 

Can ya please point me in the code to change in the file required? :'(

 

Thank you!

 

Sincerely

Char :)

 

Can be viewed here at http://www.diamondsahara.ca

Link to comment
Share on other sites

Pleeeeeeeeeeeeeeeeease :'( does anyone know what needs to be changed to alter the date from April 11th to Novemeber 11th 2006? :huh:

 

Thank you!

 

Sincerely

Char :)

Link to comment
Share on other sites

Although the date problem is nothing to do with me, it is me who posted the clock script that works perfectly ;) So I guess I should help you out.

 

Go into phpmyadmin>

select your database>

click the "browse" icon on Table counter>

see the "startdate" and click on the "edit" icon>

change the date, make sure the drop down option is "Save" and hit the "Go" button.

 

Incidentally, you can boost the amount of "Requests" (counter) at the same time. If you really want to have that function showing on your site, you may as well make it look good. :-"

 

Alternatively, you can run a query direct on the database:

 

drop table if exists counter;
create table counter (
 startdate char(8) ,
 counter int(12) 
);
insert into counter (startdate, counter) values ('20061111', '56811');

Link to comment
Share on other sites

Although the date problem is nothing to do with me, it is me who posted the clock script that works perfectly ;) So I guess I should help you out.

 

Go into phpmyadmin>

select your database>

click the "browse" icon on Table counter>

see the "startdate" and click on the "edit" icon>

change the date, make sure the drop down option is "Save" and hit the "Go" button.

 

Incidentally, you can boost the amount of "Requests" (counter) at the same time. If you really want to have that function showing on your site, you may as well make it look good. :-"

 

Alternatively, you can run a query direct on the database:

 

drop table if exists counter;
create table counter (
 startdate char(8) ,
 counter int(12) 
);
insert into counter (startdate, counter) values ('20061111', '56811');

 

Thank you Peter!!! :D

 

One small problem, I received an error when I tried to change the counter as above.

 

I use an FTP uploader for my file changes, so I found the counter file and it looks like this:

 

+++++++++++++++++++++++++++++++++++++++++++++++++

 

<?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

*/

$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 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, -4), substr($counter_startdate, 0, 4)));

?>

 

+++++++++++++++++++++++++++++++++++

 

???? :blink: :huh:

 

Thanks again, I think it is a GREAT contribution, just would like to have the not so far ahead but, more in tune with when I started the site. :)

 

Thanks!

Sincerely

Char :)

Link to comment
Share on other sites

Thanks again, I think it is a GREAT contribution, just would like to have the not so far ahead but, more in tune with when I started the site. :)

 

You could always change your domain name to www.soothsayer.ca :D

 

You are changing the database, aren't you? You don't need to touch counter.php.

Link to comment
Share on other sites

You could always change your domain name to www.soothsayer.ca :D

 

You are changing the database, aren't you? You don't need to touch counter.php.

 

LOL you are a scream! :P

 

The database only shows me tables and to define them, no codes. *shrug* :huh:

 

What folder is the database in? All I find is database_tables.php.

 

Thanks!

 

Sincerely

Char :)

Link to comment
Share on other sites

You could always change your domain name to www.soothsayer.ca :D

 

You are changing the database, aren't you? You don't need to touch counter.php.

 

 

Peter, I honestly don't have anything like what you are describing, to make changes in or through? HELP! lol! :P

 

Thanks!

 

Sincerely

Char :)

Link to comment
Share on other sites

The database only shows me tables and to define them, no codes. *shrug* :huh:

 

What folder is the database in? All I find is database_tables.php.

 

:blink:

 

 

Ok! Well, let's not go really technical at this stage, suffice to say, every bit of info (like products) you input via your osC admin, gets stored into a database. That date is also stored there so, all we need to do is, access the database and change it.

 

Before we do that, you need to do this as a matter of course, before you make any kind of change to the database, at any time. Go to your osC admin, click on Tools>>Backup. If at the top of the screen, you have a warning telling you the Backup directory doesn't exist, you will need to create one. If that is the case, we'll go through that procedure. Assuming you have the backups directory, you need to click on the button labelled "backup" then again on the new button labelled once again "backup". Sit patiently for a couple of minutes, until the pleasant green notice appears at the top of the screen. Now you have made a backup of the database, lets jump in and mess around with it.

 

Your host will have a user friendly GUI to make it easy to access the database. Most have phpmyadmin, though not all. You should be able to find the GUI from your host control panel.

Assuming you have found your way to it, probably phpmyadmin, you will have a list of databases to select from. Your osC one should be easy to find, as I'm going to guess it is the only one there. If there is more than one, it will be the one that has (46) next to it. 46 is the number of tables in the db. Click on your database and you will see all the tables listed alphabetically, top to bottom.

Now if all is good so far, at the top of the screen, you will see a tab with "SQL" written on it, click on that tab. Now you have a text box in front of you and a "Go" button directly underneath it. There will be another "Go" button further down the page but that is for something else. Copy this query in its entirety, paste it into that text box and hit that "Go" button directly underneath.

 

drop table if exists counter;
create table counter (
 startdate char(8) ,
 counter int(12)
);
insert into counter (startdate, counter) values ('20061111', '56811');

 

All being good and with the wind blowing North - North East, you should have the date changed and added some page requests to the counter.

Link to comment
Share on other sites

'spax'

 

All being good and with the wind blowing North - North East, you should have the date changed and added some page requests to the counter.

 

Ah, there's the problem! Wind is from the South - South WEST and nadda! lol! :blink: :blink:

 

Peter, you are speaking a completely foreign tongue to me lol! I have none of the things you mentioned above. I do have the Admin Panel but, I don't use it cause I was warned it is very buggy :huh:

 

I don't have "tabs" to pick from and my host, all there is in there is OSC :)

 

Hummmmmmm is there another way to change that date? Like a file, a code, simple stuff like....

 

Brain surgery?

 

lol! ;P

 

Thanks for trying.

 

Sincerely

Char :)

Link to comment
Share on other sites

drop table if exists counter;
create table counter (
 startdate char(8) ,
 counter int(12)
);
insert into counter (startdate, counter) values ('20061111', '56811');

 

All being good and with the wind blowing North - North East, you should have the date changed and added some page requests to the counter.

 

Ah huh! I found the code in the sql thingy back up, I always have a couple of backups, one on the hard drive and one on the server :)

 

So I found this code, changed the back up to match what you have here and whala!!

 

I now have, ready for this one? :lol: :lol: :lol: :lol:

 

November..... drumroll please :-"

 

11th...... excitment building.....

 

2009

 

?????? but, I didnt' add all those numbers to the hits....

 

So what gives?

 

Could it be a code IN the footer file? Maybe I was suppose to remove something when I added the contribution?

 

=====================================

<tr>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="footer">

<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>

 

<span id="liveclock" style="position:relative;left:0;top:0;">

</span>

<script language="JavaScript">

<!--

 

/*

Upper Corner Live clock script credit: JavaScript Kit (www.javascriptkit.com)

More free scripts here!

*/

 

function show5(){

if (!document.layers&&!document.all&&!document.getElementById)

return

 

var Digital=new Date()

var hours=Digital.getHours()

var minutes=Digital.getMinutes()

var seconds=Digital.getSeconds()

 

var dn="PM"

if (hours<12)

dn="AM"

if (hours>12)

hours=hours-12

if (hours==0)

hours=12

 

if (minutes<=9)

minutes="0"+minutes

if (seconds<=9)

seconds="0"+seconds

//change font size here to your desire

myclock="<span class='clock'> "+hours+":"+minutes+":"

+seconds+" "+dn+"</span>"

if (document.layers){

document.layers.liveclock.document.write(myclock)

document.layers.liveclock.document.close()

}

else if (document.all)

liveclock.innerHTML=myclock

else if (document.getElementById)

document.getElementById("liveclock").innerHTML=myclock

setTimeout("show5()",1000)

}

 

window.onload=show5

//-->

</script><noscript><?php echo date("h:i:s A"); ?></noscript>

 

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td align="center" class="smallText"><?php echo FOOTER_TEXT_BODY; ?></td>

</tr>

</table>

==================================

 

Just showing the important stuff from the footer file.

 

LOL!! Here I thought all was good and it worked.... till I saw the 2009 then I had to laugh :lol:

 

Thanks Peter!

 

I think it was the wind shifting ever so slightly lol!

 

Sincerely

Char :)

Link to comment
Share on other sites

Hey Peter! lol!

 

Gooooooooooooooooooooooooooooood Morning! :lol:

 

Well, still 2009 or 10 I believe....

 

I don't have one of those fancy phpmyadmin panels like I have seen sooooooooooooo, I have to do everything from "scratch" so to say, so I need a file or folder or php, someplace where I can go and change this or that code.

 

Any idea :huh:

 

Please let me know, otherwise I will have to take something out of the code and see if I can just keep a stat counter there instead of the date too. Which I really don't want to do :'(

 

Thanks!

 

Sincerely

Char :)

Link to comment
Share on other sites

Hey Char aka Dr Who,

 

Give me the lottery numbers from your year will ya?

 

This is a strange problem indeed, oh great Soothsayer. Changing the backup then restoring it is ok to do, although I would backup the backup first. So, you could keep deducting from the year, until you are back with us mortals.

I did notice a little tinkering with that counter.php code >_< This line:

 

 tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values values ('" . $date_now . "', '1')");

 

Should only have "values" once, thus:

 

 tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')");

 

Have you tinkered with any other code? You little tinkerer you! :shifty:

Link to comment
Share on other sites

Hey Char aka Dr Who,

 

Give me the lottery numbers from your year will ya?

 

This is a strange problem indeed, oh great Soothsayer. Changing the backup then restoring it is ok to do, although I would backup the backup first. So, you could keep deducting from the year, until you are back with us mortals.

I did notice a little tinkering with that counter.php code >_< This line:

 

 tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values values ('" . $date_now . "', '1')");

 

Should only have "values" once, thus:

 

 tep_db_query("insert into " . TABLE_COUNTER . " (startdate, counter) values ('" . $date_now . "', '1')");

 

Have you tinkered with any other code? You little tinkerer you! :shifty:

 

Me tinker!!! :blush:

 

Well I have been known to tinker here and there but, inspite of what you heard, I tell ya the truth, its only when I go BASS FISHING!! in the summer, now that be tinkering!!!! :lol:

 

Guess what?

 

Nope, wrong, try again!

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

I GOT IT!

 

I only had to set the time back to.... 2003, it was a pretty good year, not that I want to repeat it and all and whooops!!! so sorry.....

 

During my time travel, I completely forgot to run by a lottery stand to getcha those numbers but, tell ya what....

 

If you click your little red shoes together, saying, there's no place like home....

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

>

YOU'LL WAKE UP AS A GIRL >_< ON A FARM WITH A RAT FOR A DOG!!!!!

 

Gotcha! :lol:

 

Thanks for all your help Peter, I still like the contribution :)

 

And you're ok, regardless of what they been saying in PM's :rolleyes: ooops! did I say that outloud!? I gotta get that fixed!

 

Sincerely, in humor

Char :)

Link to comment
Share on other sites

Damn those PMs :angry: I didn't think anyone knew about the little red shoe fetish. :blush:

 

Good luck ;)

 

Thanks and all the best to you too!

 

Sorry but, it was one of the first things I was told in a PM..... the red shoe thingy... it was all good though after that, well, that is if you don't think..... ah never mind, we'll keep that one in PM's (pms lol!) :lol:

 

Sincerely

Char :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...