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
  #162  
Old 07-04-2002, 12:58 AM
Bugz Bugz is offline
 
Join Date: Feb 2002
Location: Cleveland
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
UPGRADING FROM VERSION 1:

1.	Open functions.php, in your /forum/admin/ directory.
2.	Scroll down to around line 1500, where you should find the altered version of the function vbdate (which you modified in version 1 of this hack). This function ends with the following lines:

   } else {
  $date = date($format,$timestamp+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
  }
  return $date;
}

3.	After this block of code, add the following block:

function vbdatenoty($format,$timestamp) {
  global $bbuserinfo,$timeoffset;

  return date($format,$timestamp+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
}
when i do this i get this error

Code:
Fatal error: Cannot redeclare vbdatenoty() (previously declared in /home/bugz/public_html/vb/admin/functions.php:1633) in /home/bugz/public_html/vb/admin/functions.php on line 1660
i am runnign 2.2.6 php version 4.2.1 . any ideas ?
Reply With Quote
  #163  
Old 07-04-2002, 03:19 AM
Bugz Bugz is offline
 
Join Date: Feb 2002
Location: Cleveland
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you sould really change the install file that ptoblem i had before.

its already in the code. and because it was in there twice i was getting that error


also my member list sais i reged "Today, at " and thats it any way to fix this ?

http://vb.bugz.m-c-web.com/memberlist.php?s=
Reply With Quote
  #164  
Old 07-05-2002, 02:41 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack! Gonna install it now
Reply With Quote
  #165  
Old 07-05-2002, 02:41 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Bugz
Fatal error: Cannot redeclare vbdatenoty() (previously declared in /home/bugz/public_html/vb/admin/functions.php:1633) in /home/bugz/public_html/vb/admin/functions.php on line 1660
Hi Bugz,

The function vbdatenoty() isn't a standard vb function, so I'm guessing you probably pasted it twice without knowing it... or something. I made that function up, and named it, so if you didn't paste it twice, some other hack you installed decided to use that same name (although I wouldn't know why).

As for your second post, I can't see what you're talking about. I visited your forums, and the Last Visited date (the only recent date I can get) is working fine.
Reply With Quote
  #166  
Old 07-06-2002, 09:09 AM
PeterNRG PeterNRG is offline
 
Join Date: Mar 2002
Location: Belgium
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As cool as this hack is, I think you can take it a bit further.

I believe that people don't really have an idea how old a post is by looking at a date or timestamp. I think it would be much cooler to give them this kind of information:

1 minute old
5 minutes old
35 minutes old
1 hour old
5 hours old
2 days old
2 weeks old
etc....

Or maybe with the correct date between brackets, like this:
5 minutes old (07-07-2002 15:15).

Another feature of this "TIME POSTED AGO" hack could be that the admin can specify a period of when the normal date should be displayed again. For example, if a post is older than 1 month, then it will not display the '1 month old' message, but simple the date.

I've seen this feature on other boards, take a look for example at http://www.dpreview.com/forums/forum.asp?forum=1002 (it's not a vb board though), it seems like it works very well there, and you get an immediate idea of how old posts are.

What do you think? Am I making any sence ?
Reply With Quote
  #167  
Old 07-07-2002, 07:19 PM
Bugz Bugz is offline
 
Join Date: Feb 2002
Location: Cleveland
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is my members list looks like when somone regesters on like today.

i made a test user today.

sorry for the image quality im not on my comp and was forced to use MSpaint.
Reply With Quote
  #168  
Old 07-07-2002, 11:44 PM
Bugz Bugz is offline
 
Join Date: Feb 2002
Location: Cleveland
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by PeterNRG
As cool as this hack is, I think you can take it a bit further.

I believe that people don't really have an idea how old a post is by looking at a date or timestamp. I think it would be much cooler to give them this kind of information:

1 minute old
5 minutes old
35 minutes old
1 hour old
5 hours old
2 days old
2 weeks old
etc....

Or maybe with the correct date between brackets, like this:
5 minutes old (07-07-2002 15:15).

Another feature of this "TIME POSTED AGO" hack could be that the admin can specify a period of when the normal date should be displayed again. For example, if a post is older than 1 month, then it will not display the '1 month old' message, but simple the date.

I've seen this feature on other boards, take a look for example at http://www.dpreview.com/forums/forum.asp?forum=1002 (it's not a vb board though), it seems like it works very well there, and you get an immediate idea of how old posts are.

What do you think? Am I making any sence ?
i dont know php nor asp but i do know that there totally diffrent type of programming. so i assume it would be maby difficult to do this in a vb (php) prgramming
Reply With Quote
  #169  
Old 07-08-2002, 03:33 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It could be done. I'll look at it today, and if it isn't too time-consuming, I'll write a separate hack for it.
Reply With Quote
  #170  
Old 07-08-2002, 03:45 PM
Bugz Bugz is offline
 
Join Date: Feb 2002
Location: Cleveland
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Bugz
this is my members list looks like when somone regesters on like today.

i made a test user today.

sorry for the image quality im not on my comp and was forced to use MSpaint.
......
Reply With Quote
  #171  
Old 07-09-2002, 09:56 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Bugz

......
Yes, I figured that one out. You're only seeing "Today, at ______" because you must have applied the "at" variation to this hack (found here) somewhere other than the "Last visited" date.

You can't use the "at" modification within vbdate() itself -- not the way vB is written. You should only use the "at" modification in specific places where you want to see "at". It isn't appropriate in many places because vB only passes a date -- and not a time -- to many displayed dates throughout the system.

Hope that helps.
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 05:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05270 seconds
  • Memory Usage 2,320KB
  • 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
  • (2)bbcode_code
  • (4)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
  • (2)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