Version: 1.00, by bigmattyh
Developer Last Online: Mar 2014
Version: 2.2.x
Rating:
Released: 01-26-2002
Last Update: Never
Installs: 326
No support by the author.
YESTERDAY/TODAY DATESTAMP HACK - Updated 5/25/02
Tested and working on vB 2.2.1 -> 2.2.6
Description: This hack replaces the standard "05-25-02, 02:45 PM" date with "Today" or "Yesterday" anywhere you have a date posted, if the date matches today's or yesterday's date.
The following are add-ons that may be helpful depending on your specific needs.
Extra features:
Template-based version : Allows you to specify different values for "Today" and "Yesterday" -- useful if you have multiple language style sets on your board. (i.e., you can set the value for today to "Today" in your English style set, and "Aujourd'hui" for your Francais style set.)
Helpful template hacks: Due to the way the standard vB template set handles date columns in forumhome.php and forumdisplay.php, some template changes may be of use:
Well, I wanted to put the welcome/last visit/new posts into a sensible paragraph, the way it is here, so that it looks like this:
Mae Govannen!, Illuvatar
The time now is 02:59 PM.
You last visited: 06-08-2002 02:53 PM.
There have been 1 new posts and 1 updated threads since then.
View New Posts
In order to do this I modified my welcometext template to include the time is and last visited stuff lines that are normally in the forumhome template.
My welcometext now looks like this:
PHP Code:
<smallfont>Mae Govannen!, <b>$username</b><br></smallfont>
The time now is $timenow.<br>
You last visited: $bbuserinfo[lastvisitdate].
<br>There have been <b>$getnewpost[posts]</b> new posts and <b>$getnewthread[threads]</b> updated threads since
then.
Could that be the problem? I moved mine out of forumhome to the other template too. Wouldn't that cause it to stop working right? I akready did everything in the link you posted. It has to do with the welcome panel final hack, I think.
Quote:
Originally posted by bigmattyh Thanks for the kind words about the hack!
but that IS the puzzler now isn't it Boofo? :bunny:
Just like you all I did was template changes, to make the today thing work in the welcome piece only requires a change to the index.php file, and I didn't mess with that.
In fact here is what that piece of the index.php looks like:
PHP Code:
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = "".gettemplate('forumhome_welcometext')."";");
eval("\$logincode = "".gettemplate('forumhome_logoutcode')."";");
eval("\$newposts = "".gettemplate('forumhome_newposts')."";");
I'm thinking that maybe it has to do with the fact that I am now "calling" $welcometext from my forumhome template, but I'm not sure as to why that would affect it. :ermm:
Like yours, mine worked before I added the welcome panel final box to the top of my home page. After I moved the code in there, it stopped working in that spot. Everywhere else it seems to be working fine though. I have seen alot of times calling code meant for one place to another place does not always work. I guess that's why you have to edit more than one file most of the time to get some things to work in different places. Hopefully, someone will be able to come up with a fix for this somehow.
By the way: My code looks exactly like yours here, so that should tell us something, huh?
Quote:
Originally posted by Illuvatar but that IS the puzzler now isn't it Boofo? :bunny:
Just like you all I did was template changes, to make the today thing work in the welcome piece only requires a change to the index.php file, and I didn't mess with that.
In fact here is what that piece of the index.php looks like:
PHP Code:
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = "".gettemplate('forumhome_welcometext')."";");
eval("\$logincode = "".gettemplate('forumhome_logoutcode')."";");
eval("\$newposts = "".gettemplate('forumhome_newposts')."";");
I'm thinking that maybe it has to do with the fact that I am now "calling" $welcometext from my forumhome template, but I'm not sure as to why that would affect it. :ermm: