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
  #202  
Old 08-27-2002, 12:10 AM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This has officially gotten annoying. How motivated do you think I am going to be to help you if you won't even read the posts I write? Do you think I have hours and hours of free time for which I have no other use than to spend helping people who won't read?

*sigh*

Read the above post. Follow the actions in NUMBER TWO. Click on the link that says "do this." Is that spelled out easy enough for you?

I will not respond to any more of your requests unless you prove that you have investigated the matter further than asking "wut am i doing wrong? thx". YOU HAVE TO PUT FORTH EFFORT HERE, BUDDY. I AM NOT YOUR PERSONAL HELP DESK.
Reply With Quote
  #203  
Old 08-27-2002, 12:35 AM
ExAvIoUr ExAvIoUr is offline
 
Join Date: Jan 2002
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i followed number 2. it failed. as i mentioned b4. then i went to the first post. i went to the link for the "extra feature". i don't have that code in my file. as i said b4. than boofo recommended what to do. i tried it and nothing happend.

so i have read the whole thing.

i have never demanded nething or asked u to help me. but u were kind enuff to do so, so i appreicate what u have done but nothing worked unless i have done something wrong.
Reply With Quote
  #204  
Old 08-31-2002, 12:52 PM
DWZ's Avatar
DWZ DWZ is offline
 
Join Date: Dec 2001
Posts: 207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey,

I have this installed on my 2.2.5 board and it was working fine. Today I downloaded 2.2.7 and I have put all my hacks back into the code.

I uploaded the new files to my test server, but whenever I access any file I get:
Code:
Parse error: parse error, unexpected '}' in /home/dwz/public_html/vbtest/admin/functions.php on line 1763

Warning: Cannot add header information - headers already sent by (output started at /home/dwz/public_html/vbtest/admin/functions.php:1763) in /home/dwz/public_html/vbtest/admin/functions.php on line 1711

Fatal error: Call to undefined function: vbdate() in /home/dwz/public_html/vbtest/admin/sessions.php on line 399
When looking at functions.php around that area, I find it's talking about this hack. I have this in functions.php around that area:
PHP Code:
# Start replaced code for "Yesterday/Today Datestamp Hack" hack
/*REPLACED CODE:
function vbdate($format,$timestamp) {
*/
function vbdatenoty($format,$timestamp) {
# End replaced code for "Yesterday/Today Datestamp Hack" hack
  
global $bbuserinfo,$timeoffset;

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

}
# Start added code for "Yesterday/Today Datestamp Hack" hack
  
global $bbuserinfo,$timeoffset$dateformat$timeformat;

  if (
$dateformat==$format) {
    
$todaystamp=mktime();
    
$todaydate=date($format,$todaystamp+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
    
$yestdate=date($format,(($todaystamp-86400)+($bbuserinfo['timezoneoffset']-$timeoffset)*3600));
    
$date date($format,$timestamp+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
    if (
$date==$todaydate) {
      
$date="Today";
    }
    if (
$date==$yestdate) {
      
$date="Yesterday";
    }
  } else {
    
$date date($format,$timestamp+($bbuserinfo['timezoneoffset']-$timeoffset)*3600);
  }
  return 
$date;

That last line there is line number 1763, what I'm having problems with. Line 1711 is:
PHP Code:
setcookie($name$value$expire$cookiepath$cookiedomain$secure); 
When looking at sessions.php, I find that it's talking about this:
PHP Code:
// get formatted date/time
if ($bbuserinfo['lastvisit']) {
  
$bbuserinfo['lastvisitdate'] = vbdate($dateformat." ".$timeformat,$bbuserinfo['lastvisit']);
} else {
  
$bbuserinfo['lastvisitdate'] = "Never";

Line 399, what i'm having problems with is the
PHP Code:
  $bbuserinfo['lastvisitdate'] = vbdate($dateformat." ".$timeformat,$bbuserinfo['lastvisit']); 
part. I know your hack doesn't change sessions.php, but I havn't touched that file with adding in my new hacks.

Any idea?

Thanks

Alan
Reply With Quote
  #205  
Old 08-31-2002, 01:33 PM
Rock Rock is offline
 
Join Date: Nov 2001
Location: uk
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks alot for this hack m8!
Reply With Quote
  #206  
Old 08-31-2002, 02:31 PM
KarateKid's Avatar
KarateKid KarateKid is offline
 
Join Date: Oct 2001
Location: Sydney
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

could someone fix the problem for 2.2.7 like DWZ showed it?
Reply With Quote
  #207  
Old 09-02-2002, 10:33 AM
DWZ's Avatar
DWZ DWZ is offline
 
Join Date: Dec 2001
Posts: 207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmmmm.... I just added in the hack again for the hell of it, and it worked?

Same code and all, well, at least I think it was, and it's working?

oh well, we will see how we go
Reply With Quote
  #208  
Old 09-02-2002, 10:40 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had the same problem when I upgraded - you need to remove the repeated vbdate function to avoid a repeat function error, and watch that each { is closed with a } to avoid the parse error.

Reply With Quote
  #209  
Old 09-05-2002, 03:04 PM
KarateKid's Avatar
KarateKid KarateKid is offline
 
Join Date: Oct 2001
Location: Sydney
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@bigmattyh:

Could you please fix the bug, cause I'm using 2.2.7 and need your hack!

Best regards
Reply With Quote
  #210  
Old 09-05-2002, 03:45 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think there's a bug per se... It sounds like mistakes were made in copying the hack code to the newer files. (Leaving out the opening { bracket would do it.)

If you could post the specific error message PHP is giving you, I can help you out.

EDIT: Just to clarify things, all you're doing with this hack is replacing the standard vbdate() function with the new hacked version. And you're adding the vbdatenoty() function. The line numbers change with every version, but the process is essentially the same.
Reply With Quote
  #211  
Old 09-05-2002, 08:14 PM
KarateKid's Avatar
KarateKid KarateKid is offline
 
Join Date: Oct 2001
Location: Sydney
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get many errors:

Quote:
Parse error: parse error in /forum/admin/functions.php on line 2294

Warning: Cannot add header information - headers already sent by (output started at /forum/admin/functions.php:2294) in /forum/admin/functions.php on line 1591

Fatal error: Call to undefined function: get_bbarraycookie() in /forum/index.php on line 284
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 02:38 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.05003 seconds
  • Memory Usage 2,337KB
  • 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
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)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
  • (1)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