Friendly Date und Uhrzeit

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
exchange-planet
Mitglied
Beiträge: 113
Registriert: 14.06.2005 11:19

Beitrag von exchange-planet »

INDEX.PHP:
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

// OLD
// $last_post = $last_post_time . '<br />';
//
//
if ( $board_config['time_today'] < $forum_data[$j]['post_time'])
{
$last_post = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
}
else if ( $board_config['time_yesterday'] < $forum_data[$j]['post_time'])
{
$last_post = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $forum_data[$j]['post_time'], $board_config['board_timezone'])) . '<br />';
}
else
{
$last_post = $last_post_time . '<br />';
}
Richtig??
exchange-planet
Mitglied
Beiträge: 113
Registriert: 14.06.2005 11:19

Beitrag von exchange-planet »

SEARCH.PHP:
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $searchset[$i]['post_time'])
{
$post_date = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
}
else if ( $board_config['time_yesterday'] < $searchset[$i]['post_time'])
{
$post_date = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
}
// MOD - TODAY AT - END
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $searchset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
}
else if ( $board_config['time_yesterday'] < $searchset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $searchset[$i]['post_time'], $board_config['board_timezone']));
}
// MOD - TODAY AT - END
Alles okay soweit??
exchange-planet
Mitglied
Beiträge: 113
Registriert: 14.06.2005 11:19

Beitrag von exchange-planet »

VIEWFORUM.PHP:
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $topic_rowset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
}
else if ( $board_config['time_yesterday'] < $topic_rowset[$i]['post_time'])
{
$last_post_time = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']));
}
// MOD - TODAY AT - END
Okay?
exchange-planet
Mitglied
Beiträge: 113
Registriert: 14.06.2005 11:19

Beitrag von exchange-planet »

VIEWTOPIC.PHP:
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
//
// MOD - TODAY AT - BEGIN
//
if ( $board_config['time_today'] < $postrow[$i]['post_time'])
{
$post_date = sprintf($lang['Today_at'], create_date($board_config['default_timeformat'], $postrow[$i]['post_time'], $board_config['board_timezone']));
}
else if ( $board_config['time_yesterday'] < $postrow[$i]['post_time'])
{
$post_date = sprintf($lang['Yesterday_at'], create_date($board_config['default_timeformat'], $postrow[$i]['post_time'], $board_config['board_timezone']));
}
// MOD - TODAY AT - END
Und das letzte: LANGUAGE/lang_english/lang_main.php:
// MOD - TODAY AT - BEGIN
$lang['Today_at'] = "Today at %s"; // %s is the time
$lang['Yesterday_at'] = "Yesterday at %s"; // %s is the time
// MOD - TODAY AT - END


//
// That's all, Folks
So, kann jetzt irgendjemand einen Fehler entdecken?? Hier das Forum, falls jemand gucken will: http://www.exchange-planet.de/phpBB2/index.php

BITTE, helft mir doch!!! Ach, Atari hatte mir dieses Mod: http://www.phpbb.de/viewtopic.php?t=80962&highlight= empfohlen.

Viele Grüsse

Kirsten
exchange-planet
Mitglied
Beiträge: 113
Registriert: 14.06.2005 11:19

Beitrag von exchange-planet »

Jetzt habe ich noch mal ein anderes Mod ausprobiert. Was stimmt denn nun schon wieder nicht :-(?
[quote]#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#
$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));

#
#-----[ AFTER, ADD ]-----------------------------------
#
// friendly date mod\\*******************
$L_Today = 'Today';
$L_Yesterday = 'Yesterday';
$time_format = " - h:i a";// - hour:minute am/pm

$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];

$forum_date_today = @gmdate ("d", $gmepoch);
$forum_date_month = @gmdate ("m", $gmepoch);
$forum_date_year = @gmdate ("Y", $gmepoch);

if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today

else
if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday

else
//if today is 1 and the month is not 1, then we have to check how many days in the previews month
//and then set $yesterday to the last day in the previews month
if ($today == 1 && $month != 1)
{
$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}
else
//if we are in the first day in the year
if ($today == 1 && $month == 1)
{
$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}

//end friendly date mod\\*******************************
[/quote]

Und das ist meins:

$thetime = ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * ($tz+date("I")))), $translate) : @gmdate($format, $gmepoch + (3600 * ($tz+date("I"))));

// friendly date mod\\
$L_Today = 'Heute';
$L_Yesterday = 'Gestern';
$time_format = ", H.i";// - hour:minute am/pm

$date = getdate();
$today = $date['mday'];
$month = $date['mon'];
$year = $date['year'];

$forum_date_today = @gmdate ("d", $gmepoch);
$forum_date_month = @gmdate ("m", $gmepoch);
$forum_date_year = @gmdate ("Y", $gmepoch);

if ($forum_date_today == $today && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Today . @gmdate ($time_format, $gmepoch);//today

else
if ($today != 1 && $forum_date_today == ($today-1) && $forum_date_month == $month && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday

else
//if today is 1 and the month is not 1, then we have to check how many days in the previews month
//and then set $yesterday to the last day in the previews month
if ($today == 1 && $month != 1)
{
$yesterday = date ("t", mktime(0,0,0,($month-1),1,$year));//returns how many days in the previews month
if ($forum_date_today == $yesterday && $forum_date_month == ($month-1) && $forum_date_year == $year)
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}
else
//if we are in the first day in the year
if ($today == 1 && $month == 1)
{
$yesterday = date ("t", mktime(0,0,0,12,1,($year -1)));
if ($forum_date_today == $yesterday && $forum_date_month == 12 && $forum_date_year == ($year-1))
$thetime = $L_Yesterday . @gmdate ($time_format, $gmepoch);//yesterday
}

//end friendly date mod\\

Oh, ich habe die Fehlermeldung vergessen :-(. Das Forum ist verschwunden, statt dessen kommt diese Meldung:
Parse error: parse error, unexpected $ in /var/www/web195/html/exchange/phpBB2/includes/functions.php on line 858
Was bedeutet das?

VG Kirsten

http://www.exchange-planet.de/phpBB2/index.php
Antworten

Zurück zu „phpBB 2.0: Mod Support“