Seite 4 von 4

Verfasst: 21.12.2004 22:53
von Mentalana
Hülfeeee.... ich wollt mir grad den Mod einbauen, habe aber folgendes Prob:

Code: Alles auswählen

#
#-----[ ACTION Find ]---------------[phpBB 2.0.5]--------------------------
#

		default:
			$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
Bei mir sieht der Code aber so aus...

Code: Alles auswählen

$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;
	}
	$db->sql_freeresult($result);

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

	//
	// Obtain a list of topic ids which contain
Sprich die Zeile

Code: Alles auswählen

$db->sql_freeresult($result);
steht in dem zu Suchendem gar nicht...

Hab schon meine eingebauten Mods durchgestöbert, ob das von dem anderen Mod geändert ist.... kann da aber rein gar nichts finden...

Hat jemand ne Ahnung zu was das gehören könnte und ob ich das einfach mit überschreiben kann/soll?!?

Hab folgende Mods eingebaut:
- Staff ver. 2.0.3 (also die Mitarbeiter-Liste)
- Junior Admin ver. 2.0.5
- Topic Shadows ver. 2.2.0
- Single Namechange 1.0.1
- Color Groups ver. 1.2.0
- Admin User List ver. 1.1.0
- Edit/Delete only last post vers. 1.00

Hab das PhpBB 2.0.11 und hier ist die Index


Oder paßt der Mod (ursprünglich ja für´s 2.0.5 gedacht) einfach nicht mehr zum 2.0.11???

Liebe Grüße
Menta

Verfasst: 01.01.2005 16:16
von Mentalana
hmmm, so langsam könnte ich das ja persönlich nehmen...

immer wenn ich dann mal eine Frage hab, dann endet das Thread mit meinem Post *g*

Aber watt soll´s... wenn ich wirklich Hilfe brauche, dann sollte ich mir vielleicht doch mal das VBB kaufen ;)

Frohes Neues Jahr an ALLE!!!!

LG
Menta

Verfasst: 01.01.2005 16:41
von Nico Haase
ich denke mal, die zeile

Code: Alles auswählen

#-----[ ACTION Find ]---------------[phpBB 2.0.5]-------------------------- 
will dir sagen, dass du diesen code in der phpBB-version 2.0.5 findest ;) für ein update müsstest du den autor fragen, was man nun machen soll

Verfasst: 01.01.2005 17:28
von Mentalana
Oder paßt der Mod (ursprünglich ja für´s 2.0.5 gedacht) einfach nicht mehr zum 2.0.11???
Naja, DAS hatte ich ja schon festgestellt. Bin zwar blond, aber nicht blind ;)

War ja auch meine Frage, ob´s dann einfach nicht mehr zum 2.0.11 passt....

LG
Menta

Verfasst: 07.01.2005 15:35
von cyber3000
versuche mal den Code


Code: Alles auswählen

##############################################################
## Mod Title:   Last post topic on index
## Original Mod Title: shows topic of last made post on index
## Mod Version: 1.0.0
## Author:		MandersOnline <mods@mandersonline.nl>
##			http://www.mandersonline.nl/mods
## Author Original:	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:
##         1.0 Release for phpBB 2.0.10
############################################################## 
## 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;
	}
	$db->sql_freeresult($result);

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