Seite 1 von 1

stop_bumping_1_1_1 MOD

Verfasst: 05.01.2006 21:38
von Zlocko
Ich versuche jetzt seit einer Stunde diesn Mod einzubauen aber habe bei der includes/functions_post.php ein Problem.

Ich kann einfacj nicht die Zeile finden die in der Anleitung steht. Seht selbst:

Code: Alles auswählen

#--------------[ OPEN ]-------------
#
includes/functions_post.php

#
#--------------[ FIND ]-------------
# // after "function submit_post("

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

#
#--------------[ BEFORE, ADD ]-------------
#
	$forum_bumping = 0;
	if ($board_config['stop_bumping'] == 2 && $mode != 'newtopic')
	{
		$sql = "SELECT f.stop_bumping FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
			WHERE f.forum_id = t.forum_id
				AND t.topic_id = $topic_id";
		if (!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Could not fetch bumping status for this forum', '', __LINE__, __FILE__, $sql);
		}
		while ($row = $db->sql_fetchrow($result))
		{
			$forum_bumping = $row['stop_bumping'];
		}
		$db->sql_freeresult($result);
	}

	if (($board_config['stop_bumping'] == 1 || $forum_bumping == 1) && $userdata['user_level'] == USER && ($mode == 'reply' || $mode == 'quote')) 
	{
		$sql = "SELECT p.poster_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
			WHERE t.topic_id = " . $topic_id . "
				AND t.topic_last_post_id = p.post_id";
		if (!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not check last poster id', '', __LINE__, __FILE__, $sql);
		}

		$row = $db->sql_fetchrow($result);
		$checked_user = $row['poster_id'];

		if ($checked_user == $userdata['user_id'])
		{
			message_die(GENERAL_ERROR, $lang['Rules_bump_cannot']);
		}

		$db->sql_freeresult($result);
	}
	// END Stop Bumping Mod

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
Irgenwie stimmt die Beschreibung nicht. :oops:

Kan mir jemand helfen. DANKE

Re: stop_bumping_1_1_1 MOD

Verfasst: 05.01.2006 21:58
von easygo
Zlocko hat geschrieben:Irgenwie stimmt die Beschreibung nicht. :oops:
Eigentlich schon. Also die Zeile -->

Code: Alles auswählen

	include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
findest du genau 2 x in der functions_post.php (Standard)
- das erste Mal innerhalb der function submit_post

[ BEFORE, ADD ] heißt, über der Zeile einfügen mit copy/paste

Verfasst: 05.01.2006 22:05
von Zlocko
Ja aber da steht es nicht so wie in der Anleitung beschrieben. So schaut es bei mir aus

Code: Alles auswählen

//
// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;

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

	$current_time = time();
und in der Anleitung steht die Zeile über die ich es kopieren sollte

Code: Alles auswählen

#--------------[ FIND ]-------------
# // after "function submit_post("
Ich sehe aber nirgendwo dieses after"function submit_post("

Das ist mein Problem. :-?

P.S. Danke dir für deine schnelle hilfe.

Verfasst: 05.01.2006 22:12
von easygo
Wie gesagt, entscheidend ist nur diese Zeile -->

Code: Alles auswählen

	include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
innerhalb dieser Funktion ( function submit_post )

Nach after " brauchst du nicht suchen. :wink:

Code: Alles auswählen

# // after "function submit_post("
Soll wohl darauf hinweisen, dass es nachfolgenden Code mehrmals gibt
und damits da keine Verwechslung gibt beim Installieren, ... easy

Verfasst: 05.01.2006 22:19
von Zlocko
O.K. du meinst also ich soll das ganze über der Zeile function submit_post kopieren und nicht über diese Zeile include($phpbb_root_path . 'includes/functions_search.'.$phpEx); ???

Oder? :roll:
Sorry, bin ein bisschen durcheinander, aber wenn man ehrlich ist ist es in der oberen Anleitung wirklich dumm geschrieben. Hätte man wirklich besser schreiben können. Nun ja, ist ja egal.

Verfasst: 05.01.2006 22:30
von easygo
Zlocko hat geschrieben:O.K. du meinst also ich soll das ganze über der Zeile function submit_post kopieren und nicht über diese Zeile include($phpbb_root_path . 'includes/functions_search.'.$phpEx); ???
Hö? wie kommst du jetzt auf das schmale Brett? :-?

Befolge doch einfach die Anweisung, und erkenne als solches
gekennzeichnete Hinweise durch den Autor, oder mach dich erstmal
schlau, bevor du vielleicht noch dein Forum vermodifizierst.

Wär doch ein Jammer... na ja, falls es dir was hilft -->

Code: Alles auswählen

#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;

#
#-----[ AFTER, ADD ]----------------------------------
#
   $forum_bumping = 0; 
   if ($board_config['stop_bumping'] == 2 && $mode != 'newtopic') 
   { 
      $sql = "SELECT f.stop_bumping FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t 
         WHERE f.forum_id = t.forum_id 
            AND t.topic_id = $topic_id"; 
      if (!$result = $db->sql_query($sql)) 
      { 
         message_die(GENERAL_ERROR, 'Could not fetch bumping status for this forum', '', __LINE__, __FILE__, $sql); 
      } 
      while ($row = $db->sql_fetchrow($result)) 
      { 
         $forum_bumping = $row['stop_bumping']; 
      } 
      $db->sql_freeresult($result); 
   } 

   if (($board_config['stop_bumping'] == 1 || $forum_bumping == 1) && $userdata['user_level'] == USER && ($mode == 'reply' || $mode == 'quote')) 
   { 
      $sql = "SELECT p.poster_id FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t 
         WHERE t.topic_id = " . $topic_id . " 
            AND t.topic_last_post_id = p.post_id"; 
      if (!($result = $db->sql_query($sql))) 
      { 
         message_die(GENERAL_ERROR, 'Could not check last poster id', '', __LINE__, __FILE__, $sql); 
      } 

      $row = $db->sql_fetchrow($result); 
      $checked_user = $row['poster_id']; 

      if ($checked_user == $userdata['user_id']) 
      { 
         message_die(GENERAL_ERROR, $lang['Rules_bump_cannot']); 
      } 

      $db->sql_freeresult($result); 
   } 
   // END Stop Bumping Mod
So rum gehts auch. easy

Verfasst: 05.01.2006 22:51
von Zlocko
Danke easy hat sich schon erledigt. Hab es auch schon eingebaut und es funktioniert. Danke dir.

MfG Zlocko :wink: