[Tool] phpBB 2.0.19 to phpBB 2.0.20 Changes

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
12
36%
Very Good
2
6%
Good
5
15%
Fair
2
6%
Poor
12
36%
 
Total votes: 33

Martyn_
Registered User
Posts: 12
Joined: Tue Jan 16, 2007 5:44 pm

Post by Martyn_ »

Yeah, I did a search for that and it's not there.
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Post by D¡cky »

Are you sure it is not there? When moving or deleting a post or topic in the moderator control panel, you have to confirm that you want to perfom the action. Look for the variable $confirm and tell me how many you find.
Have you hugged someone today?
Martyn_
Registered User
Posts: 12
Joined: Tue Jan 16, 2007 5:44 pm

Post by Martyn_ »

Okay, searching for "if ( $confirm )" doesn't find anything, but $confirm finds four instances, but they're all before the bit of code that I posted. However, this is the code from

Code: Select all

		$page_title = $lang['Mod_CP'];
		include( $phpbb_root_path .'includes/page_header.'.$phpEx);
Onwards, right to the end.

Code: Select all

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

		$u_topic_type = array('sticky', 'announce', 'poll', 'shadow', 'locked', 'unlocked', 'unread', 'unanswered');
		$l_topic_type = array($lang['Display_sticky'], $lang['Display_announce'], $lang['Display_poll'], $lang['Display_shadow'], $lang['Display_locked'], $lang['Display_unlocked'], $lang['Display_unread'], $lang['Display_unanswered']);
		for($tt = 0; $tt < count($u_topic_type); $tt++)
		{
			$topic_types .= ( $type == $u_topic_type[$tt] ) ? $l_topic_type[$tt] .'&nbsp;|&nbsp;' : '<a href="modcp.'.$phpEx.'?'. POST_FORUM_URL .'='. $forum_id .'&type='. $u_topic_type[$tt] .'&sid='. $userdata['session_id'] .'" class="genmed">'. $l_topic_type[$tt] .'</a>&nbsp;|&nbsp;';
		}
		$topic_types .= ( empty($type) ) ? $lang['Display_all'] : '<a href="modcp.'.$phpEx.'?'. POST_FORUM_URL .'='. $forum_id .'&sid='. $userdata['session_id'] .'" class="genmed">'. $lang['Display_all'] .'</a>';

		if( $forum_topics == '0' )
		{
			$template->assign_block_vars("switch_no_topics", array() );
		}

		$template->assign_vars(array(
			'TOPIC_TYPES' => $topic_types,
			'TOPIC_COUNT' => ( $forum_topics == '1' ) ? sprintf($lang['Mod_CP_topic_count'], $forum_topics) : sprintf($lang['Mod_CP_topics_count'], $forum_topics),
			'FORUM_NAME' => find_names($forum_id),
			'L_NO_TOPICS' => $lang['Mod_CP_no_topics'],
			'L_MOD_CP' => $lang['Mod_CP'],
			'L_ENHANCED' => $lang['Mod_CP_enhanced'],
			'L_DELETE' => $lang['Delete'],
			'L_POLL_DELETE' => $lang['Delete_poll'],
			'L_MOVE' => $lang['Move'],
			'L_LOCK' => $lang['Lock'],
			'L_UNLOCK' => $lang['Unlock'],
			'L_STICKY' => $lang['Mod_CP_sticky'],
			'L_ANNOUNCE' => $lang['Mod_CP_announce'],
			'L_GLOBAL_ANNOUNCE' => $lang['Mod_CP_global'],
			'L_NORMALIZE' => $lang['Mod_CP_normal'],
			'L_TOPICS' => $lang['Topics'], 
			'L_REPLIES' => $lang['Replies'], 
			'L_VIEWS' => $lang['Views'], 
			'L_FIRSTPOST' => $lang['Mod_CP_first_post'], 
			'L_LASTPOST' => $lang['Last_Post'], 
			'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?". POST_FORUM_URL ."=$forum_id"),
			'S_HIDDEN_FIELDS' => '<input type="hidden" name="sid" value="'. $userdata['session_id'] .'" /><input type="hidden" name="'. POST_FORUM_URL .'" value="'. $forum_id .'" />',
			'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
		));

		if( $is_auth['auth_delete'] )
		{
			$template->assign_block_vars('switch_auth_delete', array());
		}
		if( $is_auth['auth_pollcreate'] && ($type == 'poll' || $type == 'sticky' || $type == 'announce' || $type == 'global_announce') )
		{
			$template->assign_block_vars('switch_auth_poll_delete', array());
		}
		if( $is_auth['auth_sticky'] && $type != 'sticky' && $type != 'shadow' )
		{
			$template->assign_block_vars('switch_auth_sticky', array());
		}
		if( $is_auth['auth_announce'] && $type != 'announce' && $type != 'shadow' )
		{
			$template->assign_block_vars('switch_auth_announce', array());
		}
		if( $is_auth['auth_globalannounce'] && $type != 'global_announce' && $type != 'shadow' )
		{
			$template->assign_block_vars('switch_auth_global_announce', array());
		}
		if( $type == 'sticky' || $type == 'announce' || $type == 'global_announce' )
		{
			$template->assign_block_vars('switch_auth_normalize', array());
		}
		if( $type != 'shadow' )
		{
			$template->assign_block_vars('switch_auth_move', array());
		}
		if( $type != 'locked' && $type != 'shadow' )
		{
			$template->assign_block_vars('switch_auth_lock', array());
		}
		if( $type != 'unlocked' && ($type == 'locked' || $type == 'poll' || $type == 'sticky' || $type == 'announce') )
		{
			$template->assign_block_vars('switch_auth_unlock', array());
		}

		$template->set_filenames(array('body' => 'modcp_body.tpl'));
		make_jumpbox('modcp.'.$phpEx);

		$orig_word = array();
		$replacement_word = array();
		obtain_word_list($orig_word, $replacement_word);

		$sql = "SELECT t.*, u.username, u.user_id, p.post_time, p.post_id, p.post_username, u2.username AS topic_starter, u2.user_id AS topic_starter_id, p2.post_id, p2.post_username AS topic_starter_guest
			FROM ". TOPICS_TABLE ." t, ". USERS_TABLE ." u, ". POSTS_TABLE ." p, ". USERS_TABLE ." u2, ". POSTS_TABLE ." p2
			WHERE t.forum_id = $forum_id AND p.poster_id = u.user_id AND t.topic_poster = u2.user_id AND p.post_id = t.topic_last_post_id
				AND p2.post_id = t.topic_first_post_id $where_type
			ORDER BY t.topic_type DESC, p.post_time DESC LIMIT $start, ". $board_config['topics_per_page'];
		if( !($result = $db->sql_query($sql)) )
		{
	   		message_die(GENERAL_ERROR, 'could not obtain topic information.', '', __LINE__, __FILE__, $sql);
		}
		while( $row = $db->sql_fetchrow($result) )
		{
			if ( $row['topic_status'] == TOPIC_LOCKED )
			{
				$folder_img = $images['folder_locked'];
				$folder_alt = $lang['Topic_locked'];
			}
			else
			{
				if( $row['topic_type'] == POST_GLOBAL_ANNOUNCE )
				{
					$folder_img = $images['folder_global_announce'];
					$folder_alt = $lang['Global_announcement'];
				}
				else if( $row['topic_type'] == POST_ANNOUNCE )
				{
					$folder_img = $images['folder_announce'];
					$folder_alt = $lang['Topic_Announcement'];
				}
				else if( $row['topic_type'] == POST_STICKY )
				{
					$folder_img = $images['folder_sticky'];
					$folder_alt = $lang['Topic_Sticky'];
				}
				else 
				{
					$folder_img = $images['folder'];
					$folder_alt = $lang['No_new_posts'];
				}
			}

			if( $row['topic_type'] == POST_GLOBAL_ANNOUNCE )
			{
				$topic_type = $lang['Topic_global_announcement'] .' ';
			}
			else if( $row['topic_type'] == POST_ANNOUNCE )
			{
				$topic_type = $lang['Topic_Announcement'] .' ';
			}
			else if( $row['topic_type'] == POST_STICKY )
			{
				$topic_type = $lang['Topic_Sticky'] .' ';
			}
			else if( $row['topic_status'] == TOPIC_MOVED )
			{
				$topic_type = $lang['Topic_Moved'] .' ';
			}
			else
			{
				$topic_type = '';
			}

			if( $row['topic_vote'] )
			{
				$topic_type .= $lang['Topic_Poll'] .' ';
			}

			$topic_title = $row['topic_title'];
			if( count($orig_word) )
			{
				$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
			}

			$first_post_time = create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']);
			$first_post_author = ( $row['topic_starter_id'] == ANONYMOUS ) ? ( ($row['topic_starter_guest'] != '' ) ? $row['topic_starter_guest'] .' ' : $lang['Guest'] .' ' ) : '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $row['topic_starter_id']) .'">'. $row['topic_starter'] .'</a> ';
			$first_post_url = ( $type == 'shadow' ) ? '' : '<a href="'. append_sid("viewtopic.$phpEx?". POST_TOPIC_URL .'='. $row['topic_id']) .'"><img src="'. $images['icon_latest_reply'] .'" border="0" alt="'. $lang['View_latest_post'] .'" title="'. $lang['View_latest_post'] .'" /></a>';

			$last_post_time = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
			$last_post_author = ( $row['user_id'] == ANONYMOUS ) ? ( ($row['post_username'] != '' ) ? $row['post_username'] .' ' : $lang['Guest'] .' ' ) : '<a href="'. append_sid("profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $row['user_id']) .'">'. $row['username'] .'</a> ';
			$last_post_url = '<a href="'. append_sid("viewtopic.$phpEx?". POST_POST_URL .'='. $row['topic_last_post_id']) .'#'. $row['topic_last_post_id'] .'"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="'. $lang['View_latest_post'] .'" title="'. $lang['View_latest_post'] .'" /></a>';

			$u_view_topic = ( $type == 'shadow' ) ? '' : "modcp.$phpEx?mode=split&". POST_TOPIC_URL ."=". $row['topic_id'] ."&sid=". $userdata['session_id'];

			$template->assign_block_vars('topicrow', array(
				'ROW_CLASS' => ( !($i++ % 2) ) ? $theme['td_class1'] : $theme['td_class2'],
				'U_VIEW_TOPIC' => $u_view_topic,
				'TOPIC_FOLDER_IMG' => $folder_img, 
				'TOPIC_TYPE' => $topic_type, 
				'TOPIC_TITLE' => $topic_title,
				'TOPIC_ID' => $row['topic_id'],
				'REPLIES' => $row['topic_replies'],
				'VIEWS' => $row['topic_views'],
				'FIRST_POST_URL' => $first_post_url,
				'FIRST_POST_TIME' => $first_post_time,
				'FIRST_POST_AUTHOR' => $first_post_author,
				'LAST_POST_TIME' => $last_post_time,
				'LAST_POST_AUTHOR' => $last_post_author,
				'LAST_POST_URL' => $last_post_url,
				'L_TOPIC_FOLDER_ALT' => $folder_alt,
			));
		}

		$template->assign_vars(array(
			'PAGINATION' => ( $forum_topics == '0' ) ? '' : generate_pagination("modcp2.$phpEx?". POST_FORUM_URL ."=$forum_id&type=$type&sid=". $userdata['session_id'], $forum_topics, $board_config['topics_per_page'], $start),
			'PAGE_NUMBER' => ( $forum_topics == '0' ) ? '' : sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )),
		));
		$template->pparse('body');
		break;
}

include($phpbb_root_path .'includes/page_tail.'.$phpEx);
?>
User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Post by D¡cky »

Martyn_ wrote: Okay, searching for "if ( $confirm )" doesn't find anything, but $confirm finds four instances, but they're all before the bit of code that I posted. However, this is the code from

Code: Select all

		$page_title = $lang['Mod_CP'];
		include( $phpbb_root_path .'includes/page_header.'.$phpEx);
Onwards, right to the end.

Code: Select all

<snip>

It seems as though you have some sort of "enhanced" moderator control panel. I would check with the MOD author to see if there are any updates or what he/she recommends.
Have you hugged someone today?
~Sentinel~
Registered User
Posts: 262
Joined: Tue Jun 03, 2003 3:19 pm

Post by ~Sentinel~ »

I have a search.php problem. I tried to update using this mod and easymod and I get the following error from easymod before it even starts trying anything...

Code: Select all

Critical Error

FIND FAILED: In file [search.php] could not find:

if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}
$search_author = str_replace('*', '%', trim($search_author));

MOD script line #2204 :: FAQ :: Report
Does anyone know the answer to this one? I did see in the past 15 pages that some people had similar problems with their search.php.
tbartold
Registered User
Posts: 138
Joined: Sat Mar 15, 2003 3:51 am
Contact:

Post by tbartold »

I also had a problem with search.php and thus never updated.

Code: Select all

Critical Error

FIND FAILED: In file [search.php] could not find:

if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}
$search_author = str_replace('*', '%', trim($search_author));

MOD script line #2209 :: FAQ :: Report
The earlier "solution" I saw was:
gansert wrote: Download the original search.php and replace it.


This leaves me totally stuck. I do not see where I can download either the "original" 2.0.19 or 2.0.20 version of search.php. My "original" search.php would be 2.0.10 which may have been modded since then.

I removed the failing changes to search.php from the mod, and am hoping that I can eventually replace search.php with the currently available 2.0.22 version. At least i can get the mod to complete on other files this way.

P.S. Apparently the "keep unread flag" MOD made many changes to the search.php file, and is the cause of this failure in my case.
Post Reply

Return to “[2.0.x] MOD Database Releases”