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)

Illuvatar 09-06-2002 07:58 PM

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

Baptizer 09-06-2002 08:37 PM

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!

Greystang302 09-08-2002 08:35 AM

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...

bigmattyh 09-09-2002 11:04 AM

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.

Greystang302 09-09-2002 12:57 PM

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!

Greystang302 09-10-2002 02:39 AM

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...

ExAvIoUr 09-11-2002 06:01 AM

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. :)

Greystang302 09-11-2002 08:49 PM

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. :)

bigmattyh 09-12-2002 06:01 PM

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.

ExAvIoUr 09-13-2002 12:24 AM

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


All times are GMT. The time now is 07:43 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.01228 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)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