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:
it doesnt work.. i did everything correct twice and nothing shows up. ????
Well, keep in mind that as a couple of new versions of vB have come out, the line references are slightly off. For example, in functions.php, the replacement code for vbdate() is a few dozen lines further down.
I don't know if that's the problem you're encountering, but if you do the replacements correctly, the hack should be working correctly.
Strange - I installed this hack yesterday (2002-04-30) and had a look at my memberlist to see if it worked, but I couldn't see any one who had joined for "Today" or "Yesterday".
I then had a look at it again this morning (2002-05-01) and those that registered yesterday i'm seeing them as being registered "Today" and not seeing anyone as being registered "Yesterday" even though some people have.
I took a look at your members list, and like you, I found that vB was reporting that two people registered Today. But then the next most recent registration is on 26-04-02 (4-5 days ago).
I need some more info to see if there's a problem. Could you post the datestamps from when Lisle and chachet joined, and could you also let me know the timezone of your server?
Thanx for this great hack, Matt. Is really useful!! Would it be possible to make the word "Today" template-based? Cause we have a Spanish and an English template, and our english users keep seeing "Hoy" (spanish word for "Today") and it's a little confusing
Aaow and White (and anyone else who is interested in a template-based version of this hack):
Here is how to convert this hack so that it uses templates.
First, find this block of code:
PHP Code:
if ($date==$todaydate) {
$date="Today";
}
if ($date==$yestdate) {
$date="Yesterday";
}
... and replace it with this:
PHP Code:
if ($date==$todaydate) {
eval("\$date= \" ".gettemplate('today')."\";");
}
if ($date==$yestdate) {
eval("\$date= \" ".gettemplate('yesterday')."\";");
}
Then create 2 custom templates, called "today" and "yesterday". Within these templates, just type the word you want to appear for today and yesterday. You can do this for as many template sets as you want -- vB will pick the right one from the current style setting.