Seite 4 von 5

Verfasst: 26.07.2004 19:05
von Titan_Flippi
Also ich nutze noch die Version 2.0.8,
die 2.0.10 weicht da schon etwas ab...

aber für mich sieht es so aus als würde zumindest in dieser Zeile
bei dir nur der <br /> Tag fehlen,
vielleicht funktioniert der Mod ja trotzdem!
Evtl. weiß ja jemand hier etwas genaues, der es ausprobiert hat?

*vorher die Datei sichern* :wink:

Verfasst: 26.07.2004 19:24
von Berndte
bei 2.0.8 funktioniert der Mod bei mir einwandfrei (auch mit dem Last-Visit)

hier nochmal der Code: (ich habe noch die Änderungen der deutschen Spachdatei eingebaut)

Code: Alles auswählen

############################################################## 
## MOD Title: Today At/Yesterday At
## MOD Author: netclectic < adrian@netclectic.com > (Adrian Cockburn) http://www.netclectic.com 
## MOD Description: Will show Today At if the post was posted today 
##                  Will show Yesterday At if the post was posted yesterday
##
## MOD Version: 1.3.1
## 
## Installation Level: easy
## Installation Time: 10 Minutes 
## Files To Edit: (6) page_header.php, index.php, search.php, viewforum.php, viewtopic.php, lang_main.php
## Included Files: n/a
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## Author Notes: 
##
##  Original Author: blulegend
##  Update by netclectic to work on 2.0.4 & 2.0.6
## 
############################################################## 
## MOD History:
##
##  2003-12-15 - v1.3.1
##      - no change: confirmed as 2.0.6 compatible
##  2003-06-10 - v1.3.0
##      - updated for 2.0.4
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

#
#-----[ OPEN ]------------------------------
# 
includes/page_header.php 

# 
#-----[ FIND ]------------------------------------------ 
#  
//
// Parse and show the overall header.
//

#
#-----[ BEFORE, ADD ]-----------------------------------
# 
//
// MOD - TODAY AT - BEGIN
// PARSE DATEFORMAT TO GET TIME FORMAT 
//
$time_reg = '([gh][[:punct:][:space:]]{1,2}[i][[:punct:][:space:]]{0,2}[a]?[[:punct:][:space:]]{0,2}[S]?)';
eregi($time_reg, $board_config['default_dateformat'], $regs);
$board_config['default_timeformat'] = $regs[1];
unset($time_reg);
unset($regs);

//
// GET THE TIME TODAY AND YESTERDAY
//
$today_ary = explode('|', create_date('m|d|Y', time(),$board_config['board_timezone']));
$board_config['time_today'] = gmmktime(0 - $board_config['board_timezone'] - $board_config['dstime'],0,0,$today_ary[0],$today_ary[1],$today_ary[2]);
$board_config['time_yesterday'] = $board_config['time_today'] - 86400;
unset($today_ary);
// MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
# 
index.php 

#
#-----[ FIND ]-----------------------------------
# 
$last_post = $last_post_time . '<br />';

#
#-----[ REPLACE WITH ]-----------------------------------
# 

								// OLD
								// $last_post = $last_post_time . '<br />';
								//
                                // MOD - TODAY AT - BEGIN
								//
								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 />'; 
								} 
                                // MOD - TODAY AT - END

#
#-----[ OPEN ]------------------------------
# 
search.php

#
#-----[ FIND ]-----------------------------------
# 
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
# 

			//
            // 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

#
#-----[ FIND ]-----------------------------------
# 
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
# 

				//
                // 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

#
#-----[ OPEN ]------------------------------
# 
viewforum.php 

#
#-----[ FIND ]-----------------------------------
# 
$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
# 

		//
        // 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

#
#-----[ OPEN ]------------------------------
# 
viewtopic.php 

#
#-----[ FIND ]-----------------------------------
# 
$post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);

#
#-----[ AFTER, ADD ]-----------------------------------
# 

	//
    // 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

#
#-----[ OPEN ]------------------------------
# 
language/lang_english/lang_main.php 

#
#-----[ FIND ]-----------------------------------
# 
?>

#
#-----[ BEFORE, ADD ]-----------------------------------
# 

// 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

#
#-----[ OPEN ]------------------------------
# 
language/lang_german/lang_main.php 

#
#-----[ FIND ]-----------------------------------
# 
?>

#
#-----[ BEFORE, ADD ]-----------------------------------
# 

// MOD - TODAY AT - BEGIN
$lang['Today_at'] = "Heute um %s"; // %s is the time
$lang['Yesterday_at'] = "Gestern um %s"; // %s is the time
// MOD - TODAY AT - END

# 
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
# EoM
Wer Fettdruck haben will kann es damit versuchen:

Code: Alles auswählen

$lang['Today_at'] = "<b>Heute um %s</b>"; // %s is the time
$lang['Yesterday_at'] = "<b>Gestern um %s</b>"; // %s is the time

Verfasst: 26.07.2004 19:49
von Titan_Flippi
Das es mit 2.0.8 geht wissen wir :D

Die frage war ob es mit der 2.0.10 auch funktioniert...
da gibt es nämlich im Code Abweichungen :wink:

Verfasst: 26.07.2004 20:47
von danysahne333
die code abweichungen habe ich nur da gefunden wo der code duch mods verändert wurde.

kann mir vielleicht jemand beid er lösung dieses problems helfen???

ich will die beiden mods zusammen nutzen doch er today/yeszerday mod ersetzt code des anderen mod, so das diser nicht mehr funktioniert :(

kann mir wer helfen???

dany

Verfasst: 27.07.2004 22:57
von Titan_Flippi
Hi nochmal,

Wo ersetzt den der Yesterday... Mod den Code des anderen Mods (Last-Visit-Mod?)?

Ich will versuchen dir zu helfen so gut ich kann.

Verfasst: 28.07.2004 03:51
von danysahne333
auszug aud lasttopicindex (letztes thema im index)

Code: Alles auswählen

#
#-----[ ACTION Find ]------------------[phpBB 2.0.5]-----------------------
#
							if ( $forum_data[$j]['forum_last_post_id'] )
							{
								$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

								$last_post = $last_post_time . '<br />';

								$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
								
								$last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
							}
#
#-----[ ACTION Replace With ]---------------------------------
#
	if ( $forum_data[$j]['forum_last_post_id'] )
	{
		$topic_title = $forum_data[$j]['topic_title'];
		$topic_title2 = $forum_data[$j]['topic_title'];
		
		//
		// Censor topic title
		//
		if ( count($orig_word) )
		{
			$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
			$topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
		}
										
		if (strlen($topic_title)>27) {
			$topic_title = substr($topic_title,0,24) . '...';
		}

		$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
		$last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
		$last_post .= $last_post_time . '&nbsp;<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . '&nbsp;';
		$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
	}

#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------
#
das habe ich auch so geändert da, ich diesen mod ja verbaut habe.

doch nun soll ich laut "today yesterday mod" folgendes machen:

Code: Alles auswählen

#-----[ FIND ]----------------------------------- 
# 
$last_post = $last_post_time . '<br />'; 

# 
#-----[ REPLACE WITH ]----------------------------------- 
# 

                        // OLD 
                        // $last_post = $last_post_time . '<br />'; 
                        // 
                                // MOD - TODAY AT - BEGIN 
                        // 
                        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 />'; 
                        } 
                                // MOD - TODAY AT - END 

#
doch da durch den lasttopicindex-mod etwas ersetzt wird finde ich die zeile

Code: Alles auswählen

$last_post = $last_post_time . '<br />';
nicht mehr.

man muss doch aber die gewollte änderung des tody-yesterday mods in den geänderten code einbauen können oder???

das geht doch bei sonsogen mods auch.

Verfasst: 28.07.2004 10:08
von Titan_Flippi
Also so wie ich das sehe steht die Zeile die du suchst hier dazwischen gequetscht:

Code: Alles auswählen

$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']); 
      $last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
 >>hier>> $last_post .= $last_post_time . '&nbsp; <<hier<< <a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . '&nbsp;'; 
      $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> '; 
   }
Nur das <br> mit ner Leerzeile ersetzt wurde...
Versuch jetzt mal die Zeilen da dazwischen einzubauen, vielleicht funktioniert diese mod verschachtelung?!

Verfasst: 28.07.2004 15:16
von danysahne333
habs versucht, bekomm aber nur ne fehlermeldung.

könnte mri das bitte mal jemand einbauen?

das soll ich tun:

Code: Alles auswählen

#-----[ FIND ]----------------------------------- 
# 
$last_post = $last_post_time . '<br />'; 

# 
#-----[ REPLACE WITH ]----------------------------------- 
# 

                        // OLD 
                        // $last_post = $last_post_time . '<br />'; 
                        // 
                                // MOD - TODAY AT - BEGIN 
                        // 
                        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 />'; 
                        } 
                                // MOD - TODAY AT - END 

und das sol hierrein

Code: Alles auswählen

   if ( $forum_data[$j]['forum_last_post_id'] ) 
   { 
      $topic_title = $forum_data[$j]['topic_title']; 
      $topic_title2 = $forum_data[$j]['topic_title']; 
       
      // 
      // Censor topic title 
      // 
      if ( count($orig_word) ) 
      { 
         $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); 
         $topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2); 
      } 
                               
      if (strlen($topic_title)>27) { 
         $topic_title = substr($topic_title,0,24) . '...'; 
      } 

      $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']); 
      $last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>'; 
      $last_post .= $last_post_time . '&nbsp;<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . '&nbsp;'; 
      $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> '; 
   } 
ich bekomms alleine echt nicht hin.

oder schreibt wenigstens jemand das dies nicht möglich ist :roll:

dany

Verfasst: 31.07.2004 11:48
von Titan_Flippi
Hi sorry das ich erst so spät antworte :(

Also ich denke das diese alten Mods einfach nicht kompatibel sind.
Schau mal hier nach neuen Versionen http://mods.db9.dk/index.php, da gibts auch schon den Last Visit Mod für 2.0.10 dann dürfte da auch irgendwo vielleicht schon ein neuer Today/Yesterday Mod rumschwirren.
Oder schau einfach mal da noch wu du den Mod her hast :)

Verfasst: 23.08.2004 23:18
von Nike
bei mir gehen die beiden mods nebeneinander - also der

## Mod Title: Last Visit Mod 1.2.8

und der

## MOD Title: Today At/Yesterday At
## MOD Version: 1.3.1

und das ganze in nem phpbb 2.0.10