vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Yesterday/Today Datestamp Hack (https://vborg.vbsupport.ru/showthread.php?t=34527)

Sinecure 05-03-2002 01:48 PM

I found a small request I'd like for this hack, but I don't know if its possible. I noticed that on $bbuserinfo[lastvisitdate] the date shows up without the Today or Yesterday timestamp. Is it possible to hack the code so that the date given by this will display the today/yesterday plus the time? It already shows the date last visted and than the time, so the only thing that would need to be changed would be the actual way the date is outputed.

I'd take a screenshot and show you, but I'm using this code on my design for PJ v3 so, well, you get the piucture :)

Hopefully someone can take a look at this ;)

KeithMcL 05-03-2002 03:36 PM

Hi Matt,

People are now showing as registering as "Today" and "Yesterday" fine. I think I thought they weren't showing properly because I have my timestamp set a different time than the time on server.

Thanks anyway Matt - Great Hack!

bigmattyh 05-03-2002 08:45 PM

If you want $bbuserinfo[lastvisitdate] to follow the "Today 8:33 AM" format, here's how:

1) In index.php, around line 65, find:
PHP Code:

} else {
  
$welcometext "";
  eval(
"\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
  eval(
"\$logincode = \"".gettemplate('forumhome_logincode')."\";");


2) Just after it, add this line:

PHP Code:

eval("\$bbuserinfo[lastvisitdate] = \"".vbdate($dateformat,$bbuserinfo[lastvisit]).
" ".vbdate($timeformat,$bbuserinfo[lastvisit])."\";"); 

Note: to change this to the "Today at 8:33 AM" format, go here.

bigmattyh 05-03-2002 09:08 PM

Screenshot:

Sinecure 05-03-2002 10:14 PM

Would it be possible to make it so it says "Today at 04:47", with the AT in there for gramatical purposes? If its not to much trouble that is?

bigmattyh 05-03-2002 10:22 PM

If you would like your date to be formatted in the "Today, at 08:33 PM" format, here's how to do so:

When you install the hack, just insert ", at" into this line:
Code:

eval("\$bbuserinfo[lastvisitdate] = \"".vbdate($dateformat,$bbuserinfo[lastvisit]).
" , at ".vbdate($timeformat,$bbuserinfo[lastvisit])."\";");

That's all!

Sinecure 05-04-2002 02:28 AM

Worked Perfectly, Thanks!
BTW, great hack, totally usefull :)

inetd 05-04-2002 04:29 AM

bigmattyh, good addon :) Add this for first post :)

bigmattyh 05-04-2002 12:18 PM

Quote:

Originally posted by inetd
Add this for first post :)
Good idea. And so it shall be done.

FWC 05-04-2002 06:49 PM

That is a nice addon, bigmattyh. :cool:


All times are GMT. The time now is 06:36 AM.

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.01175 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete