Seite 1 von 2

Users Can Rate Topics Problem (mysql4.php)(page_header.php)

Verfasst: 09.04.2003 06:14
von mixmax
## Mod Title: Users Can Rate Topics
## Mod Version: 1.2.3
auf 2.0.4

Hab mal den Top 10 der bewerteten Themen Mod eingebaut.
Beim Bewerten bekomme ich eine kurze Fehlermeldung

Code: Alles auswählen

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/db/mysql4.php on line 318

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/db/mysql4.php:318) in /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/includes/page_header.php on line 496

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/db/mysql4.php:318) in /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/includes/page_header.php on line 498

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/db/mysql4.php:318) in /home/virtual/site20/fst/var/www/html/phpbb2.0.4a/includes/page_header.php on line 499

mysql4.php line 318

Code: Alles auswählen

			mysql_free_result($query_id);
page_header.php line 496 bis 499

Code: Alles auswählen

	header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
Wer kann mir sagen was ich machen muß.
www.das-info-board.de.vu

Verfasst: 09.04.2003 19:03
von saerdnaer
die codes die du gepostet hast nutzen garnichts... du müssetst die entsprechende zeile posten in der die funktion $db->sql_freeresult(); ausgeführt wird...

ah

Verfasst: 09.04.2003 23:18
von mixmax
edit: das wahr die standart mysql4.php die kann sich jeder bei seinem phpbb anschauen...
mfg saerdnaer

Verfasst: 12.04.2003 14:47
von mixmax
help !

Verfasst: 13.04.2003 14:31
von saerdnaer
du musst die zeile finden in der $db->sql_freeresult(); aufgerufen wird...

ah

Verfasst: 13.04.2003 15:51
von mixmax
:o jo aber wo muß ich suchen ?

Hab das hier in der modcp.php gefunden

Code: Alles auswählen

// Do major work ...
//
switch( $mode )
{
	case 'delete':
		if (!$is_auth['auth_delete'])
		{
			message_die(MESSAGE, sprintf($lang['Sorry_auth_delete'], $is_auth['auth_delete_type']));
		}

		$page_title = $lang['Mod_CP'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);

		if ( $confirm )
		{
			include($phpbb_root_path . 'includes/functions_search.'.$phpEx);

			$topics = ( isset($HTTP_POST_VARS['topic_id_list']) ) ?  $HTTP_POST_VARS['topic_id_list'] : array($topic_id);

			$topic_id_sql = '';
			for($i = 0; $i < count($topics); $i++)
			{
				$topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . $topics[$i];
			}

			$sql = "SELECT poster_id, COUNT(post_id) AS posts 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id IN ($topic_id_sql) 
				GROUP BY poster_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql);
			}

			$count_sql = array();
			while ( $row = $db->sql_fetchrow($result) )
			{
				$count_sql[] = "UPDATE " . USERS_TABLE . " 
					SET user_posts = user_posts - " . $row['posts'] . " 
					WHERE user_id = " . $row['poster_id'];
			}
			$db->sql_freeresult($result);

			if ( sizeof($count_sql) )
			{
				for($i = 0; $i < sizeof($count_sql); $i++)
				{
					if ( !$db->sql_query($count_sql[$i]) )
					{
						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
					}
				}
			}
			
			$sql = "SELECT post_id 
				FROM " . POSTS_TABLE . " 
				WHERE topic_id IN ($topic_id_sql)";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql);
			}

			$post_id_sql = '';
			while ( $row = $db->sql_fetchrow($result) )
			{
				$post_id_sql .= ( ( $post_id_sql != '' ) ? ', ' : '' ) . $row['post_id'];
			}
			$db->sql_freeresult($result);

			$sql = "SELECT vote_id 
				FROM " . VOTE_DESC_TABLE . " 
				WHERE topic_id IN ($topic_id_sql)";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get vote id information', '', __LINE__, __FILE__, $sql);
			}

			$vote_id_sql = '';
			while ( $row = $db->sql_fetchrow($result) )
			{
				$vote_id_sql .= ( ( $vote_id_sql != '' ) ? ', ' : '' ) . $row['vote_id'];
			}
			$db->sql_freeresult($result);

Verfasst: 13.04.2003 15:57
von saerdnaer
ja welche seite rufst du denn auf wenn der fehler kommt?

ah

Verfasst: 13.04.2003 16:21
von mixmax
der fehler wird beim bewerten kurz eingeblendet

Thema bewerten:1-5 -->Speichern. (wird nur ganz kurz eingeblendet) !

Verfasst: 13.04.2003 16:28
von saerdnaer
welche seite wird da aufgerufen?

url zu deiner seite?

ah

Verfasst: 13.04.2003 16:54
von mixmax
www.das-info-board.de.vu

Im Test Forum aktiv !