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 08-27-2002 12:10 AM

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.

ExAvIoUr 08-27-2002 12:35 AM

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.

DWZ 08-31-2002 12:52 PM

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

Rock 08-31-2002 01:33 PM

Thanks alot for this hack m8! :D

KarateKid 08-31-2002 02:31 PM

could someone fix the problem for 2.2.7 like DWZ showed it?

DWZ 09-02-2002 10:33 AM

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

Erwin 09-02-2002 10:40 AM

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.

:)

KarateKid 09-05-2002 03:04 PM

@bigmattyh:

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

Best regards

bigmattyh 09-05-2002 03:45 PM

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.

KarateKid 09-05-2002 08:14 PM

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


All times are GMT. The time now is 02:28 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.01360 seconds
  • Memory Usage 1,763KB
  • 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
  • (4)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