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)

bigmattyh 02-26-2002 02:44 PM

Quote:

Originally posted by Lucky
Any chance of getting this hack to work for all instances, such as You last visited: 02-26-2002 12:43 AM.
Lucky:

This instance requires on additional hack. Here it is:

In index.php, around line 250, find this block of code:
PHP Code:

if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
    
$userlastvisit=$bbforumview[$forum['forumid']];
} else {
    
$userlastvisit=$bbuserinfo['lastvisit'];


After this block, just insert the following line:
PHP Code:

$bbuserinfo['lastvisitdate'] = vbdate($dateformat$bbuserinfo['lastvisit']); 

This should fix this particular instance. Thanks for the tip!

Slowly but surely, the exceptions to this hack are finding there way out of the woodwork. There shouldn't be more than one or two more after this one -- if any.

r.cakir 03-07-2002 08:21 AM

Hello bigmattyh
Maybe you can help me with this odd problem: I can't use the attached zip-file in your first post. After it's downloaded, decompressed and opened in a Editor (BBEdit) I see only unusable code. I use Mac OS X 10.1.3 and I don't have problems with all other downloads on this Board, except for this one.

It's possible for you to send me the file with Email ?

Thanks!

Kohhal 03-08-2002 10:03 AM

Quote:

Originally posted by Lucky
Any chance of getting this hack to work for all instances, such as You last visited: 02-26-2002 12:43 AM.
I want to get this working too but instead of it showing "You last visited: Today."(which the additional hack you supplied does) I want it to show the time too ie. "You last visited Today 12:43 AM."
Is this possible? How do I do it?

Cheers,

G :)

Ps. Great hack :up:

bigmattyh 03-08-2002 05:43 PM

Thanks for the thumbs up!

Here's how you do what you're looking to do. By the way, this isn't directly related to my hack, but it does get the job done.

In index.php, around line 260, you'll see this line:
PHP Code:

$bbuserinfo['lastvisitdate'] = vbdate($dateformat$bbuserinfo['lastvisit']); 

Immediately after it, insert this line:
PHP Code:

$bbuserinfo['lastvisitdate'] .= " at " vbdate($timeformat$bbuserinfo['lastvisit']); 

And you're set. I think you can probably figure out how to customize this. For example, if you want it to say, "You last visited Today, at 8:33 PM", you'd just insert a comma before the " at " in the above line.

That's it. :)

Okiewan 03-08-2002 09:15 PM

Very nice.. thank you!

sTive 03-10-2002 02:29 PM

Is there anybody who tried to use it under vb2.2.3b ?

bigmattyh 03-10-2002 06:51 PM

I haven't installed vB 2.2.3 -- mostly because I don't want to upgrade now and then have to upgrade again when vB 3 comes out (hopefully next month).

Are you having problems with the hack under 2.2.3? If so, I can try to look into it for you.

FWC 03-10-2002 10:49 PM

Quote:

Originally posted by bigmattyh
Are you having problems with the hack under 2.2.3? If so, I can try to look into it for you.
I upgraded from 2.2.2 to 2.2.4 this morning and this hack is working fine.

Recon_Boy 03-11-2002 02:12 AM

Quote:

Originally posted by FWC
I upgraded from 2.2.2 to 2.2.4 this morning and this hack is working fine.
Same here.

Kohhal 03-11-2002 08:49 AM

Quote:

Originally posted by bigmattyh
...Here's how you do what you're looking to do...
Perfect, thanks a lot. Installed perfectly :)


All times are GMT. The time now is 11:59 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.01266 seconds
  • Memory Usage 1,749KB
  • 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
  • (4)bbcode_php_printable
  • (5)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