Seite 2 von 2

Verfasst: 04.03.2005 23:37
von EraZor
Was davor kommt:

Code: Alles auswählen

global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;
Jetzt zeile 504

Code: Alles auswählen

	if ( $mode != 'poll_delete' && in_array($forum_id, $fid) == false )
Und was danach kommt

Code: Alles auswählen

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

		$sql = "DELETE FROM " . POSTS_TABLE . " 
			WHERE post_id = $post_id";
Wäre nett wenn dieser Fehler behoben werden kann, danke auf jeden Fall schon mal im Voraus.

Verfasst: 04.03.2005 23:43
von Mario Siebert
Leuchte hat geschrieben:Hm, mal überlegen..
includes/functions_post.php - FindeCode:
$sign = ($mode == 'delete') ? '- 1' : '+ 1';
Ersetzen mitCode:
if($mode == 'delete')
{
$sign = ($topic_id != xxx) ? '- 1' : '';
}
else
{
$sign = ($topic_id != xxx) ? '+ 1' : '';
}
xxx ist die ID des Beitrags. Sollte eigentlich funktionieren
So ist es natürlich einfacher machbar, ich dachte er wollte es aufbauend auf diese Mod mit Einstellmöglichkeit im ACP etc. wie beim Post Increment Mod...

Grüße Mario

Verfasst: 04.03.2005 23:44
von Leuchte
@Mario, das wäre der nächste Schritt, wenn es sowas nicht gibt ;)

@EraZor kannst du bitte deine includes/functions_post.php hierher verlinken!?
KB:Datei

Verfasst: 04.03.2005 23:50
von EraZor
Danke dass du so bereitwillig hilfst, habe hier die Datei:

http://www.w-bros.de/phpbb-forum/functions_post.txt

Danke, ich hoffe es hilft dir :)

Verfasst: 05.03.2005 00:05
von Leuchte
insanctus hat geschrieben:Ach das is mir zuviel aufwand für die ganzen spamposts :D
Als irgendwas.php abspeichern, aufrufen und die Beitrags-ID eingeben

Code: Alles auswählen

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//


if( $userdata['user_level'] != ADMIN )
{
	message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


include($phpbb_root_path . 'includes/page_header.'.$phpEx);

if(isset($_POST['start']) && isset($_POST['topic_id']))
{
	$topic_id = $_POST['topic_id'];
	$sql = "SELECT DISTINCT poster_id 
		FROM ". POSTS_TABLE ."
		WHERE topic_id = '$topic_id'
		AND poster_id != '-1'";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not get post user', '', __LINE__, __FILE__, $sql);
	}
	$user = array();
	
	while ( $row = $db->sql_fetchrow($result) )
	{
		$user[] = $row;
	}

	for($i = 0; $i < count($user); $i++)
	{
		$sql = "SELECT COUNT(*) as post_count
			FROM ". POSTS_TABLE ." 
			WHERE poster_id = '". $user[$i]['poster_id'] ."'
			AND topic_id = '$topic_id'";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not count user postss', '', __LINE__, __FILE__, $sql);
		}
		$row = $db->sql_fetchrow($result);
		
		$sql = "UPDATE ". USERS_TABLE ."
			SET user_posts = (user_posts - '". $row['post_count'] ."')
			WHERE user_id = '". $user[$i]['poster_id'] ."'";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update user posts', '', __LINE__, __FILE__, $sql);
		}
	}

	message_die(GENERAL_MESSAGE, "<b>$i</b> User aktualisiert</font>");
}
else
{
	echo '<table width="100%" border="0" class="forumline"><tr><td width="100%" align="center" class="row1"><form method="post"><br /><span class="genmed">ID des Beitrags eingeben: <input type="text" name="topic_id" /><br /><br /><input type="submit" name="start" value=" los " class="mainoption" /></span></form><br /></td></tr></table>';
}
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
@EraZor Finde

Code: Alles auswählen

if ( $mode != 'poll_delete' && in_array($forum_id, $fid) == false )
Ersetze mit

Code: Alles auswählen

if ( $mode != 'poll_delete')
Finde

Code: Alles auswählen

	if ($mode != 'poll_delete')
	{
		$sql = "UPDATE " . USERS_TABLE . "
			SET user_posts = user_posts $sign 
			WHERE user_id = $user_id";
Ersetze mit

Code: Alles auswählen

	if ($mode != 'poll_delete' && in_array($forum_id, $fid) == false )
	{
		$sql = "UPDATE " . USERS_TABLE . "
			SET user_posts = user_posts $sign 
			WHERE user_id = $user_id";

Verfasst: 05.03.2005 09:01
von EraZor
So ich war mal kurz schlafen :)

Fehler:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in includes/functions_post.php on line 465

Warning: Cannot modify header information - headers already sent by (output started at includes/functions_post.php:465) in posting.php on line 591

Warning: Cannot modify header information - headers already sent by (output started at /includes/functions_post.php:465) in includes/page_header.php on line 474

Warning: Cannot modify header information - headers already sent by (output started at includes/functions_post.php:465) in page_header.php on line 476

Warning: Cannot modify header information - headers already sent by (output started at includes/functions_post.php:465) in includes/page_header.php on line 477
So diesmal ist es die zeile die ich soeben neu ersetzt habe. Ich habe mal die Datei function_post.php neu hochgeladen. ( http://www.w-bros.de/phpbb-forum/functions_post.txt )

Kann mir evtl jemand eine funktionierende function_post.php mit Beitrags-counter-stop hochladen? Bitte keine Umstände, aber ich glaube das wäre das einfachste, wenn das eh schon jemand mal gemacht hat. Danke nochmal :)

Verfasst: 05.03.2005 14:21
von Leuchte
Das müsste der letzte Fehler sein
Finde und lösche

Code: Alles auswählen

	$board_config['no_post_count_forum_id'] = $GLOBALS['board_config']['no_post_count_forum_id'];
	if( strstr($board_config['no_post_count_forum_id'], ',') )
	{
		$fids = explode(',', $board_config['no_post_count_forum_id']);
	
		while( list($foo, $id) = each($fids) )
		{
			$fid[] = intval( trim($id) );
		}
	}
	else
	{
		$fid[] = intval( trim($board_config['no_post_count_forum_id']) );
	}
	reset($fid);
Finde

Code: Alles auswählen

	if ($mode != 'poll_delete' && in_array($forum_id, $fid) == false )
Füge davor ein

Code: Alles auswählen

	$board_config['no_post_count_forum_id'] = $GLOBALS['board_config']['no_post_count_forum_id'];
	if( strstr($board_config['no_post_count_forum_id'], ',') )
	{
		$fids = explode(',', $board_config['no_post_count_forum_id']);
	
		while( list($foo, $id) = each($fids) )
		{
			$fid[] = intval( trim($id) );
		}
	}
	else
	{
		$fid[] = intval( trim($board_config['no_post_count_forum_id']) );
	}
	reset($fid);

Verfasst: 05.03.2005 14:29
von EraZor
Danke es funktioniert nun wirklich, super danke @leuchte, dass du dir soviel arbeit gemacht hast.

Danke an alle die geholfen haben :)

Verfasst: 10.03.2005 23:15
von Dude83
kann man auch noch einstellen das bei den gesamtbeiträgen die beiträge nicht mitgezählt werden? :-?

Also bei "Unsere Benutzer haben insgesamt .... Beiträge geschrieben"

Verfasst: 12.03.2005 12:59
von Dude83
kann mir denn keiner helfen? :-?