11
ghia
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/3/20 20:24

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Check the definitions of _MD_TODAY, _MD_YESTERDAY, _MD_MONTHDAY, and _MD_YEARMONTHDAY in /modules/newbb/language/yourlanguage/main.php and adapt.

12
snoozy
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/5 14:58

  • snoozy

  • Just popping in

  • Posts: 1

  • Since: 2009/3/29


Hello,

I had the same bug as you and I find a solution...

You just have to:
1. Edit the file main.php in newbb\language\english

2. Replace these lines:
define("_MD_TODAY", "\To\d\a\y G:i:s");
define("_MD_YESTERDAY", "\Ye\s\\te\\r\d\a\y G:i:s");

by these lines:
define("_MD_TODAY", "\T\o\d\a\y G:i:s");
define("_MD_YESTERDAY", "\Y\e\s\\t\e\\r\d\a\y G:i:s");

Hope it will be useful for the community. Now your problem should be solved !


Kind regards,
Snoozy
Enjoy by playing funny online games !..

13
Anonymous
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/5 16:22

  • Anonymous

  • Posts: 0

  • Since:


The definitive solutions for date/time formatting in CBB/newbb with XOOPS 2.3.x are given in this thread:
https://xoops.org/modules/newbb/viewtopic.php?viewmode=flat&type=&topic_id=66922&forum=28

HTH

14
Heromorph
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/5 17:09

  • Heromorph

  • Just popping in

  • Posts: 3

  • Since: 2008/2/20


I tried the things mentioned above and at the link but it is still broken. Could very well be the fact that the site is running XOOPS 2.0.17. Thank you

15
ghia
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/5 17:30

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
The definitive solutions for date/time formatting in CBB/newbb with XOOPS 2.3.x are given in this thread:
https://xoops.org/modules/newbb/vi ... =&topic_id=66922&forum=28

That is true for the unpatched version.
With the patch that reactivates some unreachable code, the date formats are in /modules/newbb/language/english/main.php
function newbb_formatTimestamp($time$format "c"$timeoffset "")
{
    
/*
    if(strtolower($format) == "reg" || strtolower($format) == "") {
        $format = "c";
    }
    if( (strtolower($format) == "custom" || strtolower($format) == "c") && !empty($GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"]) ) {
        $format = $GLOBALS["xoopsModuleConfig"]["formatTimestamp_custom"];
    }
    
    load_functions("locale");
    return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
    
    if(class_exists("XoopsLocal") && is_callable(array("XoopsLocal", "formatTimestamp")) && defined("_TODAY")){
        return XoopsLocal::formatTimestamp($time, $format, $timeoffset);
    }
    */
    
global $xoopsConfig$xoopsUser;
    if(
strtolower($format) == "rss" || strtolower($format) == "r"){
        
$TIME_ZONE "";
        if(!empty(
$GLOBALS['xoopsConfig']['server_TZ'])){
            
$server_TZ abs(intval($GLOBALS['xoopsConfig']['server_TZ']*3600.0));
            
$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0)?" -":" +";
            
$TIME_ZONE $prefix.date("Hi",$server_TZ);
        }
        
$date gmdate("D, d M Y H:i:s"intval($time)).$TIME_ZONE;
        return 
$date;
    }
    
    
$usertimestamp xoops_getUserTimestamp($time$timeoffset);
    switch (
strtolower($format)) {
    case 
's':
        
$datestring _SHORTDATESTRING;
        break;
    case 
'm':
        
$datestring _MEDIUMDATESTRING;
        break;
    case 
'mysql':
        
$datestring "Y-m-d H:i:s";
        break;
    case 
'rss':
        
$datestring "r";
        break;
    case 
'l':
        
$datestring _DATESTRING;
        break;
    case 
'c':
    case 
'custom':
    default:
        
newbb_load_lang_file("main""newbb");
        
$current_timestamp xoops_getUserTimestamp(time(), $timeoffset);
        if(
date("Ymd"$usertimestamp) == date("Ymd"$current_timestamp)){
            
$datestring _MD_TODAY;
        }elseif(
date("Ymd"$usertimestamp+24*60*60) == date("Ymd"$current_timestamp)){
            
$datestring _MD_YESTERDAY;
        }elseif(
date("Y"$usertimestamp) == date("Y"$current_timestamp)){
            
$datestring _MD_MONTHDAY;
        }else{
            
$datestring _MD_YEARMONTHDAY;
        }
        break;
    }

    return 
date($datestring$usertimestamp);
}

Quote:
I altered the functions php as above

Meaning only the change of the second argument or also the rest of the function as here above?

16
Heromorph
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/5 17:33

  • Heromorph

  • Just popping in

  • Posts: 3

  • Since: 2008/2/20


OK I figured it out.

It was again with newbb/include/functions.php
I edited
From this:
function newbb_formatTimestamp($time$format="c"$timeoffset="")


To this
function newbb_formatTimestamp($time$format="j M Y H:i:s a"$timeoffset="-8")


17
ghia
Re: Newbb date problems (after upgrade to xoops 2.3)
  • 2009/4/11 8:50

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Huh, very drastic!
It may work for you, but it is not a general solution!

Login

Who's Online

306 user(s) are online (162 user(s) are browsing Support Forums)


Members: 0


Guests: 306


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits