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)

Bugz 07-04-2002 12:58 AM

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 ?

Bugz 07-04-2002 03:19 AM

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=

Gary King 07-05-2002 02:41 PM

Nice hack! Gonna install it now :)

bigmattyh 07-05-2002 02:41 PM

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.

PeterNRG 07-06-2002 09:09 AM

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

Bugz 07-07-2002 07:19 PM

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.

Bugz 07-07-2002 11:44 PM

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

bigmattyh 07-08-2002 03:33 PM

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.

Bugz 07-08-2002 03:45 PM

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.

......

bigmattyh 07-09-2002 09:56 PM

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.


All times are GMT. The time now is 11:13 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.01382 seconds
  • Memory Usage 1,747KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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