Seite 1 von 2

Suche Mod um bei "letzter Beitrag" dessen Titel an

Verfasst: 17.03.2006 22:00
von caesargrau
Hätte gern bei der Spalte "letzter Beitrag" noch den Titel des letzten Beitrags angezeigt. Wie geht das ? Hilfe bin Anfänger ! Wer liefert mir noch ne Bedienungsanleitung mit wie ich so nen Mod einbaue ?

Verfasst: 17.03.2006 22:32
von Fabrizio
Hi caesargrau,

schaue mal hier. Einfach herunterladen und den Installationsanweisungen folgen. ;-)

Gruß,
Fabrizio

Verfasst: 18.03.2006 07:06
von caesargrau
Hallo Fabrizio,

erst Mal vielen Dank für Deine schnelle Hilfe. Das mit dem Herunterladen hat geklappt, aber ich finde die Installionsanleitung nicht. Wahrscheinlich stell ich mich nur zu doof an ... Kannst Du mir bitte noch Mal unter die Arme greifen ? Hab jetzt einfach nur 2 Dateien und weis nicht was ich damit machen soll !

Verfasst: 18.03.2006 07:25
von MagMo
Hi,
caesargrau hat geschrieben:..., aber ich finde die Installionsanleitung nicht. Wahrscheinlich stell ich mich nur zu doof an ...
Die Installationsanleitung ist die Datei LastPostTopicIndex14.txt.

Falls du Probleme mit der Anleitung hast, dann hilft dir dieser Artikel ('MODs - FAQ') weiter.

Grüße
MagMo

Verfasst: 18.03.2006 07:25
von Lenox82
Hier ist sie ;)

Code: Alles auswählen

##############################################################
## Mod Title:   shows topic of last made post on index
## Mod Version: 1.4.0
## Author:      e-sven <sven@e-sven.net> http://www.e-sven.net
## Description: -adds lasts post topic to each forum on
##               the index page (based on read-access)
##		-word censorship is used
##		-topic title with more then 27 chars are cut off
##		-mouseover info displays the full title
##
## Installation Level:  easy
## Installation Time:   2-5 Minutes
## Files To Edit:       index.php
## Included Files:      index.php (pre-modded)
##############################################################
## History:
##         0.9 not released beta
##         1.0 first working release
##         1.1 optimized db access
##	   1.2 made implementation easier 
##	       (only two replaces have to be made)
##         1.2a just a minor bug (thanks to Acid)
##         1.3 empty forums where not displayed correctly
##         1.4 optimized db-query
############################################################## 
## Before Adding This MOD To Your Forum, 
## You Should Back Up All Files Related To This MOD
##############################################################

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

#
#-----[ ACTION Find ]-----------------------------------------
#
			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";
			break;
	}
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	while( $row = $db->sql_fetchrow($result) )
	{
		$forum_data[] = $row;
	}

	if ( !($total_forums = count($forum_data)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_forums']);
	}

	//
	// Obtain a list of topic ids which contain


#
#-----[ REPLACE WITH ]----------------------------------------
#
 		$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_last_post_id " .
			" FROM ((( " . FORUMS_TABLE . " f " .
			" LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
			" LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
			" LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
			" ORDER BY f.cat_id, f.forum_order";
		break;
	}
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_data = array();
	$topic_last_ary = array();
	$i=0;
	while( $row = $db->sql_fetchrow($result) )
	{
		if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
			$topic_last_ary[i]=$row['topic_last_post_id'];
			$i++;
			$forum_data[] = $row;
		}
	}
	unset($topic_last_ary);
	if ( !($total_forums = count($forum_data)) )
	{
		message_die(GENERAL_MESSAGE, $lang['No_forums']);
	}
	
	//
	// Filter topic_title not allowed to read
	// 
	if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
		$auth_read_all = array();
		$auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
		$auth_data = '';
		for($i=0; $i<count($forum_data); $i++)
		{
			if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
				$forum_data[$i]['topic_title']='';
			}
		}
	}

	//
	// Define censored word matches
	//
	$orig_word = array();
	$replacement_word = array();
	obtain_word_list($orig_word, $replacement_word);

	//
	// Obtain a list of topic ids which contain


#
#-----[ ACTION Find ]-----------------------------------------
#
	if ( $forum_data[$j]['forum_last_post_id'] )
	{
	...
	}


#
#-----[ 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 ]----------------------------------
#

Verfasst: 18.03.2006 20:36
von Fabrizio
caesargrau hat geschrieben:Hallo Fabrizio,

erst Mal vielen Dank für Deine schnelle Hilfe. Das mit dem Herunterladen hat geklappt, aber ich finde die Installionsanleitung nicht. Wahrscheinlich stell ich mich nur zu doof an ... Kannst Du mir bitte noch Mal unter die Arme greifen ? Hab jetzt einfach nur 2 Dateien und weis nicht was ich damit machen soll !
Hi,

kein Problem. Die Anleitung befindet sich in der Datei mit dem Namen LastPostTopicIndex14.txt, wie meine Vorredner schon erwähnten. Anleitungen haben meist die Endung txt oder mod. Falls es sich um die Endung mod handelt, benennst du die Datei einfach in eine Textdatei (txt) um, und schon kannst du sie in einem beliebigen Editor öffnen. Die von MagMo erwähnte MODs-FAQ sollte dir auf jeden Fall weiter helfen, was den Einbau anbelangt, falls nicht, stelle deine Fragen hier und wenn alle Stricke reißen, kannst du mich anschreiben und ich helfe dir gerne.

Gruß,
Fabrizio

Verfasst: 18.03.2006 21:02
von caesargrau
ja, noch eine Frage hätte ich ... hört sich zwar sicher doof an, aber wie öffne ich die index.php ?

Entschuldigt bitte, aber ich bin halt noch blutiger Anfägner !

Verfasst: 18.03.2006 21:08
von Fabrizio
caesargrau hat geschrieben:ja, noch eine Frage hätte ich ... hört sich zwar sicher doof an, aber wie öffne ich die index.php ?

Entschuldigt bitte, aber ich bin halt noch blutiger Anfägner !
Keine Frage ist doof, doof ist man nur, wenn man sie nicht stellt. ;-)

Welches Programm zum FTP-Upload benutzt du? Meist lassen sich die Dateien mittels Doppelklick auf die entsprechende Datei öffnen. Wenn du das in aller Ruhe machen willst, empfehle ich dir den Download des HTML-Editors Proton. Dieser verfügt über eine einfache Bedienung und öffnet jede beliebige Datei fürs Forum.

Verfasst: 18.03.2006 21:24
von caesargrau
Den Proton hab ich, aber ein Programm zum FTP-Upload hab ich nicht. Wo krieg ich so was her ?

Verfasst: 18.03.2006 21:31
von Fabrizio
caesargrau hat geschrieben:Den Proton hab ich, aber ein Programm zum FTP-Upload hab ich nicht. Wo krieg ich so was her ?
Das FTP-Programm ist Geschmackssache. Ich selbst benutze den FTP-Uploader und hatte früher den Smart-FTP. Andere Programme bekommst du bei google. Schaue dich einfach mal um, welches Programm am besten zu dir passt bzw. mit welchem du am besten zurecht kommst...