Seite 1 von 5

Fatal error:Cannot redeclare make_forum_select() [ERLEDIGT]

Verfasst: 29.05.2005 18:21
von Shadowproject
hab da n prob auf meinem forum. . .
ich hab im thema spamming (beiträge zählen nicht) einen beitrag: zahlenkette. wenn ich auf das thema klicke geht alles normal aber wenn ich zu seite 2 gehen will oder weiter drücke kommt das:
Fatal error: Cannot redeclare make_forum_select() (previously declared in /home/www/web88/html/david/forum/includes/functions_admin.php:27) in /home/www/web88/html/david/forum/includes/functions_admin.php on line 27
hier meine functions_admin.php:

Code: Alles auswählen

<?php
/***************************************************************************
 *                            functions_admin.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: functions_admin.php,v 1.5.2.3 2002/07/19 17:03:47 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/

//
// Simple version of jumpbox, just lists authed forums
//
function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
{
	global $db, $userdata;

	$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);

	$sql = "SELECT forum_id, forum_name
		FROM " . FORUMS_TABLE . " 
		ORDER BY cat_id, forum_order";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
	}

	$forum_list = '';
	while( $row = $db->sql_fetchrow($result) )
	{
		if ( $is_auth_ary[$row['forum_id']]['auth_read'] && $ignore_forum != $row['forum_id'] )
		{
			$selected = ( $select_forum == $row['forum_id'] ) ? ' selected="selected"' : '';
			$forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected .'>' . $row['forum_name'] . '</option>';
		}
	}

	$forum_list = ( $forum_list == '' ) ? '<option value="-1">-- ! No Forums ! --</option>' : '<select name="' . $box_name . '">' . $forum_list . '</select>';

	return $forum_list;
}

//
// Synchronise functions for forums/topics
//
function sync($type, $id = false)
{
	global $db;

	switch($type)
	{
		case 'all forums':
			$sql = "SELECT forum_id
				FROM " . FORUMS_TABLE;
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get forum IDs', '', __LINE__, __FILE__, $sql);
			}

			while( $row = $db->sql_fetchrow($result) )
			{
				sync('forum', $row['forum_id']);
			}
		   	break;

		case 'all topics':
			$sql = "SELECT topic_id
				FROM " . TOPICS_TABLE;
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql);
			}

			while( $row = $db->sql_fetchrow($result) )
			{
				sync('topic', $row['topic_id']);
			}
			break;

	  	case 'forum':
			$sql = "SELECT MAX(post_id) AS last_post, COUNT(post_id) AS total 
				FROM " . POSTS_TABLE . "  
				WHERE forum_id = $id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
			}

			if ( $row = $db->sql_fetchrow($result) )
			{
				$last_post = ( $row['last_post'] ) ? $row['last_post'] : 0;
				$total_posts = ($row['total']) ? $row['total'] : 0;
			}
			else
			{
				$last_post = 0;
				$total_posts = 0;
			}

			$sql = "SELECT COUNT(topic_id) AS total
				FROM " . TOPICS_TABLE . "
				WHERE forum_id = $id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get topic count', '', __LINE__, __FILE__, $sql);
			}

			$total_topics = ( $row = $db->sql_fetchrow($result) ) ? ( ( $row['total'] ) ? $row['total'] : 0 ) : 0;

			$sql = "UPDATE " . FORUMS_TABLE . "
				SET forum_last_post_id = $last_post, forum_posts = $total_posts, forum_topics = $total_topics
				WHERE forum_id = $id";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not update forum', '', __LINE__, __FILE__, $sql);
			}
			break;

		case 'topic':
			$sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
				FROM " . POSTS_TABLE . "
				WHERE topic_id = $id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
			}

			if ( $row = $db->sql_fetchrow($result) )
			{
				$sql = ( $row['total_posts'] ) ? "UPDATE " . TOPICS_TABLE . " SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . " WHERE topic_id = $id" : "DELETE FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
				if ( !$db->sql_query($sql) )
				{
					message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
				}
			}
			break;
	}
	
	return true;
}

?>
was ist der fehler?

edit: es ist nur bei diesem thema so. . .

edit: alle beiträge in spamming außer regeln laden langsamer. . . warum??

Verfasst: 30.05.2005 15:13
von Shadowproject
*schieb*
weiß echt keiner was der fehler ist?

Verfasst: 30.05.2005 15:18
von pandorra
gib doch mal die url dazu, versteh nicht ganz, wie du das meinst...

Verfasst: 30.05.2005 16:05
von Shadowproject
www.shadowproject-forum.de.vu
musst dich aba registrieren. . .
damit du das siehst. . .
ich kann dich au danach wieder löschen
edit: jetzt läd das ganze bei dem post sekt o. selters nur noch ganz lahm. . .

Verfasst: 31.05.2005 16:37
von Shadowproject
*wieder schieb*
weiß echt keiner was ich machen kann?
spamming spielt echt verrückt. . .
es hatte sich mit dem thema sekt o. selters wieder gelöst. . .
aba jetzt hat jmd gepostet und jetzt funzts wieda nemme
selber fehler wie ganz oben. .

Verfasst: 01.06.2005 09:41
von fclforum
Ich habe das selbe Problem. Die meisten Threads werden ganz normal angezeigt, nur in einigen wenigen Threads taucht das Problem auf; eine Gesetzmässigkeit konnte ich leider nicht herausfinden...

Beispiel eines Threads, bei dem der Fehler auftaucht:
http://www.fclforum.ch/viewtopic.php?t=2106

Ich habe soeben die neuste Version der includes/functions_admin.php runtergeladen und diese auf den Webserver geladen - das Problem besteht leider weiterhin.

Any ideas?

EDIT
Konnte das Problem jetzt lösen... aus irgendeinem mir unerfindlichen Grund wurde in der viewtopic.php die Datei includes/functions_admin.php mehrfach (3x) eingebunden (das 1. Mal fast zuoberst, das 2. und 3. Mal in bedingten Anweisungen)... die Zeile 2x auskommentiert - und schon gehts :)

Verfasst: 01.06.2005 15:45
von Shadowproject
wasmmuss ich n da jetzt löschen in der functions_admin?
s.o.

Verfasst: 01.06.2005 15:54
von fclforum
In der functions_admin.php nichts, aber in der viewtopic.php folgendes. Wie gesagt, die Zeile

Code: Alles auswählen

include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
stand bei mir (in einer aktuellen viewtopic.php, phpBB 2.0.15) 3 mal in der Datei. Ich habe das Problem so gel�st, dass ich die Zeile beim 2. und 3. Vorkommen (bei mir auf Zeile 500 und Zeile 526) auskommentiert habe:

Code: Alles auswählen

// include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
Danach gings wieder...

HTH

Verfasst: 01.06.2005 16:43
von Shadowproject
@fclforum: bei mir ist das leider nicht der fall :(
also, der fehler tritt auf, wenn der Startbeitrag des gewünschten Forums eine mehr als 1stellige ID hat. . .
also bis 9 geht es aber ab 10 das prob.
vll. könnt ihr damit was anfangen. . .
http://david.tchoulakian.de/forum/viewt ... 5&start=15 ist der beitrag "sekt oder selters" 2. seite
die funzen:
http://david.tchoulakian.de/forum/viewt ... 95&start=1
http://david.tchoulakian.de/forum/viewt ... 95&start=2
http://david.tchoulakian.de/forum/viewt ... 95&start=3
http://david.tchoulakian.de/forum/viewt ... 95&start=4
http://david.tchoulakian.de/forum/viewt ... 95&start=5
http://david.tchoulakian.de/forum/viewt ... 95&start=6
http://david.tchoulakian.de/forum/viewt ... 95&start=7
http://david.tchoulakian.de/forum/viewt ... 95&start=8
http://david.tchoulakian.de/forum/viewt ... 95&start=9
aber ab 10 nix mehr:
http://david.tchoulakian.de/forum/viewt ... 5&start=10

WARUM?????

EDIT: riesen prob: ich hab n thema namens "the corner" sowas wie n gefängnis. . .
n gesperrtes thema wo die beiträge nicht zählen und user hinverbannt werden wenn sie böse sind. . .
da hab ich den 2 seiten test au ma gemacht:
ES IST NOCH KEINE 2 SEITEN und schon der fehler :'(
was is in diese functions_admin.php falsch? :(

EDIT: so was verrücktes hab ich ja noch nie gesehen: ich hab n bissle rumprobiert was der fehler sein könntes, aber da sind nur noch mehr fehler aufgetreten. dann hab ich wieder die vor den änderungen gesicherte datei geuppt und es funzte wieder. . . was ist das?????????????
bei "zahlenkette und "sekt oder selters" funzt es aba noch nicht. . .
büüüüüüüüüdddeeee helft mir :(

Verfasst: 02.06.2005 19:15
von Shadowproject
*schieb*