phpBB

Code Changes

File: includes/functions_content.php

  Unmodified   Added   Modified   Removed
Line 150Line 150
*/
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
{

*/
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false, $force_display = false)
{

	global $config, $auth, $template, $user, $db, $phpbb_path_helper;

	global $config, $auth, $template, $user, $db, $phpbb_path_helper, $phpbb_dispatcher;


// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
if (!$config['load_jumpbox'] && $force_display === false)


// We only return if the jumpbox is not forced to be displayed (in case it is needed for functionality)
if (!$config['load_jumpbox'] && $force_display === false)

Line 162Line 162
		FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);

		FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);

 

$rowset = array();
while ($row = $db->sql_fetchrow($result))
{
$rowset[(int) $row['forum_id']] = $row;
}
$db->sql_freeresult($result);


$right = $padding = 0;
$padding_store = array('0' => 0);
$display_jumpbox = false;
$iteration = 0;


$right = $padding = 0;
$padding_store = array('0' => 0);
$display_jumpbox = false;
$iteration = 0;

 

/**
* Modify the jumpbox forum list data
*
* @event core.make_jumpbox_modify_forum_list
* @var array rowset Array with the forums list data
* @since 3.1.10-RC1
*/
$vars = array('rowset');
extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_forum_list', compact($vars)));


// Sometimes it could happen that forums will be displayed here not be displayed within the index page
// This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions.
// If this happens, the padding could be "broken"



// Sometimes it could happen that forums will be displayed here not be displayed within the index page
// This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions.
// If this happens, the padding could be "broken"


	while ($row = $db->sql_fetchrow($result))

	foreach ($rowset as $row)

	{
if ($row['left_id'] < $right)
{

	{
if ($row['left_id'] < $right)
{

Line 205Line 222
			continue;
}


			continue;
}


 
		$tpl_ary = array();

		if (!$display_jumpbox)
{

		if (!$display_jumpbox)
{

			$template->assign_block_vars('jumpbox_forums', array(

			$tpl_ary[] = array(

				'FORUM_ID'		=> ($select_all) ? 0 : -1,
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
'S_FORUM_COUNT' => $iteration,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),

				'FORUM_ID'		=> ($select_all) ? 0 : -1,
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
'S_FORUM_COUNT' => $iteration,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),

			));

			);


$iteration++;
$display_jumpbox = true;
}



$iteration++;
$display_jumpbox = true;
}


		$template->assign_block_vars('jumpbox_forums', array(

		$tpl_ary[] = array(

			'FORUM_ID'		=> $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',

			'FORUM_ID'		=> $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
'SELECTED' => ($row['forum_id'] == $forum_id) ? ' selected="selected"' : '',

Line 227Line 245
			'S_IS_LINK'		=> ($row['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),

			'S_IS_LINK'		=> ($row['forum_type'] == FORUM_LINK) ? true : false,
'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),

		));



















		);

/**
* Modify the jumpbox before it is assigned to the template
*
* @event core.make_jumpbox_modify_tpl_ary
* @var array row The data of the forum
* @var array tpl_ary Template data of the forum
* @since 3.1.10-RC1
*/
$vars = array(
'row',
'tpl_ary',
);
extract($phpbb_dispatcher->trigger_event('core.make_jumpbox_modify_tpl_ary', compact($vars)));

$template->assign_block_vars_array('jumpbox_forums', $tpl_ary);

unset($tpl_ary);


for ($i = 0; $i < $padding; $i++)
{


for ($i = 0; $i < $padding; $i++)
{

Line 235Line 271
		}
$iteration++;
}

		}
$iteration++;
}

	$db->sql_freeresult($result);
unset($padding_store);

	unset($padding_store, $rowset);



$url_parts = $phpbb_path_helper->get_url_parts($action);



$url_parts = $phpbb_path_helper->get_url_parts($action);