Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by bigmattyh bigmattyh is offline
Developer Last Online: Mar 2014 Show Printable Version Email this Page

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.

Demo: Installed on vBulletin.org.

The following are add-ons that may be helpful depending on your specific needs.

Extra features: 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:Comments and criticism are always welcome.
Please click the install button to show your support.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #212  
Old 09-06-2002, 07:58 PM
Illuvatar's Avatar
Illuvatar Illuvatar is offline
 
Join Date: Apr 2002
Location: So. Cal
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey bigmattyh!!!

[high]* Illuvatar moves site to new server, installs 2.2.7, and reapplys this most excellent hack with NO PROBLEMS!!
[/high]

lol

And get this...

I even modified the code a little cause I liked the "Today, at" in the last visited piece, and I wanted it on my individual forum display as well!

All I did was this:
PHP Code:
    if ($date==$todaydate) {
      
$date="Today, at";
    }
    if (
$date==$yestdate) {
      
$date="Yesterday, at"
and worked like a champ!

Many thanks again!

Illu
Reply With Quote
  #213  
Old 09-06-2002, 08:37 PM
Baptizer Baptizer is offline
 
Join Date: Nov 2001
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wonder why he didnt add the ", at" that way in the first place...seems easier. I dont know much about code, but is there a reason why he chose to add it the other way? loads faster? god i stupid!
Reply With Quote
  #214  
Old 09-08-2002, 08:35 AM
Greystang302's Avatar
Greystang302 Greystang302 is offline
 
Join Date: May 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, I am running vB 2.2.7 and I just installed this hack tonight. Everything seems to be working as advertised except for the display in Trilobyte's Welcome Panel hack. I have attached an image to show what the problem looks like.

I followed your instructions in this post and it made no difference irregardless of which line I posted it above ($getnewthread or $getnewpost). Any ideas about what could have gone wrong? I followed the instructions to the letter...
Reply With Quote
  #215  
Old 09-09-2002, 11:04 AM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by KarateKid
I get many errors...
Open up your functions.php file and post the offending section of it here -- from about line 2292 to 2296. That way I can see what's up.

Quote:
Wonder why he didnt add the ", at" that way in the first place
I seem to remember that there are some problems with doing it this way. Like on your memberlist page, you might get "Today, at" ... and no time. It's been a while, so I could be wrong.

Greystang302:
I don't have the welcome panel installed on my forums, so I can't troubleshoot this one. It looks like the value for $bbuserinfo[lastvisit] is being replaced elsewhere in the welcome panel code... Can you find a line in that hack that assigns a value to $bbuserinfo[lastvisit]? If so, comment it out (by typing // before any text on that line.
Reply With Quote
  #216  
Old 09-09-2002, 12:57 PM
Greystang302's Avatar
Greystang302 Greystang302 is offline
 
Join Date: May 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will check on that after work tonight Matty, I was also looking at the code while eating breakfast this morning and it looks like for some reason some of the edits that I made to the file didn't get uploaded? Not sure what could have happened though...

I will verify this tonight and post the findings. Thanks for the help!
Reply With Quote
  #217  
Old 09-10-2002, 02:39 AM
Greystang302's Avatar
Greystang302 Greystang302 is offline
 
Join Date: May 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I got the hack working again except for the Welcome Panel. I got home from work late so I didn't have time to do anything else otherwise. There is a code difference in the 2.2.7 release, but it's not major. I will post all of this tomorrow, I am beat! Gotta get to sleep for now...
Reply With Quote
  #218  
Old 09-11-2002, 06:01 AM
ExAvIoUr ExAvIoUr is offline
 
Join Date: Jan 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice hack indeed ... simple and works.

Wanted to do as many others mentioned and have it display up top also like You last visited: 09-11-2002 01:58 AM

... but I don't have any code matching what you specified in an earlier post in my index.php:

Code:
if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
    $userlastvisit=$bbforumview[$forum['forumid']];
} else {
    $userlastvisit=$bbuserinfo['lastvisit'];
}
or anything close to it .... I have instead:

Code:
if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) {
						$userlastvisit=$fview;
					} else {
						$userlastvisit=$bbuserinfo['lastvisit'];
thanx for any assistance anyone can offer.
Reply With Quote
  #219  
Old 09-11-2002, 08:49 PM
Greystang302's Avatar
Greystang302 Greystang302 is offline
 
Join Date: May 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That code was one of the differences with 2.2.7 that I mentioned before... it was part of a change to the original code to fix an AOL cookie-dumping problem. I just haven't had a chance to post about it yet.
Reply With Quote
  #220  
Old 09-12-2002, 06:01 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay... I haven't upgraded to 2.2.7 (and I'm not planning to yet!), so I can't say for sure if this will work, but give it a try:

Replace this:
Code:
if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) {
						$userlastvisit=$fview;
					} else {
						$userlastvisit=$bbuserinfo['lastvisit'];
With this:
Code:
if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) {
						$userlastvisit=$fview;
					} else {
						$userlastvisit=vbdate($bbuserinfo['lastvisit']);
And then insert $userlastvisit into your template where you want the date to appear.
Reply With Quote
  #221  
Old 09-13-2002, 12:24 AM
ExAvIoUr ExAvIoUr is offline
 
Join Date: Jan 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you ^#^&@^&! you fecked my board!

hehe just kidding m8, thanx for the suggestion. tried it out and got:

Code:
Warning: Missing argument 2 for vbdate() in /home/choicein/public_html/forums/admin/functions.php3 on line 1609
sounds simple enugh to do, but beyond me at this point. hehe
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05024 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete