Pagina 1 van 1

Report knopje alleen in eerste post

Geplaatst: 16 mei 2005, 14:16
door RobinTown
Ik heb de Report post hack van Saerdnaer geinstalleerd, maar ik wil dat het plaatje alleen in de eerste post van de topic komt.

Gedeelte dat waarschijnlijk aangepast moet worden:

Code: Selecteer alles

	if ( $i == 0 && !isset($rp) )
	{
		include($phpbb_root_path . 'includes/reportpost.'.$phpEx);
	}
	if ( empty($postrow[$i]['reporter_id']) && ( !$userdata['session_logged_in'] || $postrow[$i]['poster_id'] != $userdata['user_id'] ) && !$rp->report_disabled2($postrow[$i]['poster_id']) && $rp->report_auth($userdata['user_id']) )
	{
		$temp_url = append_sid("report.$phpEx?mode=report&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
		$report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_report'] . '" alt="' . $lang['Report_post'] . '" title="' . $lang['Report_post'] . '" border="0" /></a>';
		$report = '<a href="' . $temp_url . '">' . $lang['Report_post'] . '</a>';
	}
	else if ( !empty($postrow[$i]['reporter_id']) && ( ( $userdata['session_logged_in'] && $postrow[$i]['reporter_id'] == $userdata['user_id'] ) || ( $is_auth['auth_mod'] && $rp->check_access() ) ) )
	{
		$temp_url = append_sid("report.$phpEx?mode=del_report&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
		$report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_del_report'] . '" alt="' . $lang['Report_del'] . '" title="' . $lang['Report_del'] . '" border="0" /></a>';
		$report = '<a href="' . $temp_url . '">' . $lang['Report_del'] . '</a>';
	}
	else
	{
		$report_img = '';
		$report = '';
	}
In posting.php heb ik wel wat gevonden met first_post, maar ik weet niet of dat hier gebruikt kan worden

Geplaatst: 16 mei 2005, 14:20
door Luuk
Probeer eens

Code: Selecteer alles

   if ( $i == 0 && !isset($rp) )
   {
      include($phpbb_root_path . 'includes/reportpost.'.$phpEx);
   }
   if ( $forum_topic_data['topic_first_post_id'] == $postrow[$i]['post_id'] && empty($postrow[$i]['reporter_id']) && ( !$userdata['session_logged_in'] || $postrow[$i]['poster_id'] != $userdata['user_id'] ) && !$rp->report_disabled2($postrow[$i]['poster_id']) && $rp->report_auth($userdata['user_id']) )
   {
      $temp_url = append_sid("report.$phpEx?mode=report&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
      $report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_report'] . '" alt="' . $lang['Report_post'] . '" title="' . $lang['Report_post'] . '" border="0" /></a>';
      $report = '<a href="' . $temp_url . '">' . $lang['Report_post'] . '</a>';
   }
   else if ( $forum_topic_data['topic_first_post_id'] == $postrow[$i]['post_id'] &&  !empty($postrow[$i]['reporter_id']) && ( ( $userdata['session_logged_in'] && $postrow[$i]['reporter_id'] == $userdata['user_id'] ) || ( $is_auth['auth_mod'] && $rp->check_access() ) ) )
   {
      $temp_url = append_sid("report.$phpEx?mode=del_report&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
      $report_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_del_report'] . '" alt="' . $lang['Report_del'] . '" title="' . $lang['Report_del'] . '" border="0" /></a>';
      $report = '<a href="' . $temp_url . '">' . $lang['Report_del'] . '</a>';
   }
   else
   {
      $report_img = '';
      $report = '';
   }

Je moet dan alleen in viewtopic.php

Code: Selecteer alles

$sql = "SELECT t.topic_id, t.topic_title
opzoeken en erachter zetten, in dezelfde regel (alles staat dus in 1 regel, je voegt er alleen iets tussen)

Code: Selecteer alles

, t.topic_first_post_id