Vergleich inc/functions_forumlist.php - 1.8.24 - 1.8.37

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 41Zeile 41
	{
foreach($parent as $forum)
{

	{
foreach($parent as $forum)
{

 
			$forum['viewers'] = 0;

			$subforums = $sub_forums = '';
$lastpost_data = array(

			$subforums = $sub_forums = '';
$lastpost_data = array(

				'lastpost' => 0


				'lastpost' => 0,
'lastposter' => '',

			);
$forum_viewers_text = '';
$forum_viewers_text_plain = '';

			);
$forum_viewers_text = '';
$forum_viewers_text_plain = '';

Zeile 62Zeile 64
			// Build the link to this forum
$forum_url = get_forum_link($forum['fid']);


			// Build the link to this forum
$forum_url = get_forum_link($forum['fid']);


			// This forum has a password, and the user isn't authenticated with it - hide post information

 
			$hideinfo = $hidecounters = false;
$hidelastpostinfo = false;
$showlockicon = 0;

			$hideinfo = $hidecounters = false;
$hidelastpostinfo = false;
$showlockicon = 0;

			if(isset($permissions['canviewthreads']) && $permissions['canviewthreads'] != 1)
{
$hideinfo = true;




// Hide post info if user cannot view forum or cannot view threads
if($permissions['canview'] != 1 || (isset($permissions['canviewthreads']) && $permissions['canviewthreads'] != 1))
{
$hideinfo = true;

			}

if(isset($permissions['canonlyviewownthreads']) && $permissions['canonlyviewownthreads'] == 1)

			}

if(isset($permissions['canonlyviewownthreads']) && $permissions['canonlyviewownthreads'] == 1)

Zeile 82Zeile 85
					foreach($fcache as $fcache_p)
{
foreach($fcache_p as $parent_p)

					foreach($fcache as $fcache_p)
{
foreach($fcache_p as $parent_p)

						{

						{

							foreach($parent_p as $forum_p)
{
if($forumpermissions[$forum_p['fid']]['canonlyviewownthreads'])
{
$fids[] = $forum_p['fid'];
}

							foreach($parent_p as $forum_p)
{
if($forumpermissions[$forum_p['fid']]['canonlyviewownthreads'])
{
$fids[] = $forum_p['fid'];
}

							}
}
}


							}
}
}


					if(!empty($fids))
{
$fids = implode(',', $fids);
$query = $db->simple_select("threads", "tid, fid, subject, lastpost, lastposter, lastposteruid", "uid = '{$mybb->user['uid']}' AND fid IN ({$fids}) AND visible != '-2'", array("order_by" => "lastpost", "order_dir" => "desc"));

					if(!empty($fids))
{
$fids = implode(',', $fids);
$query = $db->simple_select("threads", "tid, fid, subject, lastpost, lastposter, lastposteruid", "uid = '{$mybb->user['uid']}' AND fid IN ({$fids}) AND visible != '-2'", array("order_by" => "lastpost", "order_dir" => "desc"));





						while($thread = $db->fetch_array($query))
{

						while($thread = $db->fetch_array($query))
{

							if(!$private_forums[$thread['fid']])

							if(!isset($private_forums[$thread['fid']]))

							{
$private_forums[$thread['fid']] = $thread;

							{
$private_forums[$thread['fid']] = $thread;

							}
}
}
}

if($private_forums[$forum['fid']]['lastpost'])

							}
}
}
}

if(!empty($private_forums[$forum['fid']]['lastpost']))

				{
$forum['lastpost'] = $private_forums[$forum['fid']]['lastpost'];


				{
$forum['lastpost'] = $private_forums[$forum['fid']]['lastpost'];


Zeile 124Zeile 127
						"lastposttid" => $private_forums[$forum['fid']]['tid'],
"lastposteruid" => $private_forums[$forum['fid']]['lastposteruid']
);

						"lastposttid" => $private_forums[$forum['fid']]['tid'],
"lastposteruid" => $private_forums[$forum['fid']]['lastposteruid']
);

				}

				}

			}
else
{

			}
else
{

Zeile 140Zeile 143
					"lastposttid" => $forum['lastposttid'],
"lastposteruid" => $forum['lastposteruid']
);

					"lastposttid" => $forum['lastposttid'],
"lastposteruid" => $forum['lastposteruid']
);

			}

			}





 
			// This forum has a password, and the user isn't authenticated with it - hide post information

			if(!forum_password_validated($forum, true))
{
$hideinfo = true;
$showlockicon = 1;

			if(!forum_password_validated($forum, true))
{
$hideinfo = true;
$showlockicon = 1;

 
			}

if(is_array($forum_viewers) && isset($forum_viewers[$forum['fid']]) && $forum_viewers[$forum['fid']] > 0)
{
$forum['viewers'] = $forum_viewers[$forum['fid']];

			}

// Fetch subforums of this forum
if(isset($fcache[$forum['fid']]))

			}

// Fetch subforums of this forum
if(isset($fcache[$forum['fid']]))

			{

			{

				$forum_info = build_forumbits($forum['fid'], $depth+1);

// Increment forum counters with counters from child forums

				$forum_info = build_forumbits($forum['fid'], $depth+1);

// Increment forum counters with counters from child forums

Zeile 159Zeile 168
				$forum['unapprovedthreads'] += $forum_info['counters']['unapprovedthreads'];
$forum['unapprovedposts'] += $forum_info['counters']['unapprovedposts'];


				$forum['unapprovedthreads'] += $forum_info['counters']['unapprovedthreads'];
$forum['unapprovedposts'] += $forum_info['counters']['unapprovedposts'];


				if(!empty($forum_info['counters']['viewing']))

				if(!empty($forum_info['counters']['viewers']))

				{

				{

					$forum['viewers'] += $forum_info['counters']['viewing'];

					$forum['viewers'] += $forum_info['counters']['viewers'];

				}

// If the child forums' lastpost is greater than the one for this forum, set it as the child forums greatest.

				}

// If the child forums' lastpost is greater than the one for this forum, set it as the child forums greatest.

				if($forum_info['lastpost']['lastpost'] > $lastpost_data['lastpost'])

				if(isset($forum_info['lastpost']['lastpost']) && $forum_info['lastpost']['lastpost'] > $lastpost_data['lastpost'])

				{
$lastpost_data = $forum_info['lastpost'];


				{
$lastpost_data = $forum_info['lastpost'];


Zeile 186Zeile 195
			}

// If we are hiding information (lastpost) because we aren't authenticated against the password for this forum, remove them

			}

// If we are hiding information (lastpost) because we aren't authenticated against the password for this forum, remove them

			if($hidelastpostinfo == true)

			if($hideinfo == true || $hidelastpostinfo == true)

			{

			{

 
				// Used later for get_forum_lightbulb function call - Setting to 0 prevents the bulb from being lit up
// If hiding info or hiding lastpost info no "unread" posts indication should be shown to the user.

				$lastpost_data = array(
'lastpost' => 0,

				$lastpost_data = array(
'lastpost' => 0,

					'lastposter' => ''

					'lastposter' => '',

				);
}


				);
}


Zeile 198Zeile 209
			if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) && $hideinfo != true)
{
$parent_lastpost = $lastpost_data;

			if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) && $hideinfo != true)
{
$parent_lastpost = $lastpost_data;

			}

if(is_array($forum_viewers) && isset($forum_viewers[$forum['fid']]) && $forum_viewers[$forum['fid']] > 0)
{
$forum['viewers'] = $forum_viewers[$forum['fid']];

 
			}

// Increment the counters for the parent forum (returned later)

			}

// Increment the counters for the parent forum (returned later)

Zeile 217Zeile 223
				{
$parent_counters['viewers'] += $forum['viewers'];
}

				{
$parent_counters['viewers'] += $forum['viewers'];
}

			}


			}


			// Done with our math, lets talk about displaying - only display forums which are under a certain depth
if($depth > $showdepth)
{
continue;

			// Done with our math, lets talk about displaying - only display forums which are under a certain depth
if($depth > $showdepth)
{
continue;

			}

			}


// Get the lightbulb status indicator for this forum based on the lastpost
$lightbulb = get_forum_lightbulb($forum, $lastpost_data, $showlockicon);

// Fetch the number of unapproved threads and posts for this forum


// Get the lightbulb status indicator for this forum based on the lastpost
$lightbulb = get_forum_lightbulb($forum, $lastpost_data, $showlockicon);

// Fetch the number of unapproved threads and posts for this forum

			$unapproved = get_forum_unapproved($forum);


 
			if($hideinfo == true)
{

			if($hideinfo == true)
{

				unset($unapproved);








				$unapproved = array(
"unapproved_posts" => '',
"unapproved_threads" => '',
);
}
else
{
$unapproved = get_forum_unapproved($forum);

			}

// Sanitize name and description of forum.

			}

// Sanitize name and description of forum.

Zeile 241Zeile 252
			$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); // Fix & but allow unicode
$forum['name'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['name']);
$forum['description'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['description']);

			$forum['description'] = preg_replace("#&(?!\#[0-9]+;)#si", "&", $forum['description']); // Fix & but allow unicode
$forum['name'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['name']);
$forum['description'] = preg_replace("#&([^\#])(?![a-z1-4]{1,10};)#i", "&$1", $forum['description']);





			// If this is a forum and we've got subforums of it, load the subforums list template
if($depth == 2 && $sub_forums)
{

			// If this is a forum and we've got subforums of it, load the subforums list template
if($depth == 2 && $sub_forums)
{

Zeile 325Zeile 336
					if($forum['viewers'] == 1)
{
$forum_viewers_text = $lang->viewing_one;

					if($forum['viewers'] == 1)
{
$forum_viewers_text = $lang->viewing_one;

					}

					}

					else
{
$forum_viewers_text = $lang->sprintf($lang->viewing_multiple, $forum['viewers']);

					else
{
$forum_viewers_text = $lang->sprintf($lang->viewing_multiple, $forum['viewers']);

Zeile 353Zeile 364
				eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_hidden")."\";");
}


				eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost_hidden")."\";");
}


			// Moderator column is not off


			// Moderator column
$modlist = '';

			if($mybb->settings['modlist'] != 0)
{
$done_moderators = array(

			if($mybb->settings['modlist'] != 0)
{
$done_moderators = array(

Zeile 409Zeile 421
				if($moderators)
{
eval("\$modlist = \"".$templates->get("forumbit_moderators")."\";");

				if($moderators)
{
eval("\$modlist = \"".$templates->get("forumbit_moderators")."\";");

				}
else
{
$modlist = '';

 
				}
}


				}
}


Zeile 424Zeile 432

// Check if this category is either expanded or collapsed and hide it as necessary.
$expdisplay = '';


// Check if this category is either expanded or collapsed and hide it as necessary.
$expdisplay = '';

			$collapsed_name = "cat_{$forum['fid']}_c";
if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;")

			$collapsed_name = "cat_{$forum['fid']}_e";
if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: none;")

			{
$expcolimage = "collapse_collapsed.png";
$expdisplay = "display: none;";
$expthead = " thead_collapsed";

			{
$expcolimage = "collapse_collapsed.png";
$expdisplay = "display: none;";
$expthead = " thead_collapsed";

				$expaltext = "[+]";

				$expaltext = $lang->expcol_expand;

			}
else
{
$expcolimage = "collapse.png";
$expthead = "";

			}
else
{
$expcolimage = "collapse.png";
$expthead = "";

				$expaltext = "[-]";

				$expaltext = $lang->expcol_collapse;

			}

// Swap over the alternate backgrounds

			}

// Swap over the alternate backgrounds

Zeile 479Zeile 487
	global $mybb, $lang, $db, $unread_forums;

// This forum is a redirect, so override the folder icon with the "offlink" icon.

	global $mybb, $lang, $db, $unread_forums;

// This forum is a redirect, so override the folder icon with the "offlink" icon.

	if($forum['linkto'] != '')

	if(!empty($forum['linkto']))

	{
$folder = "offlink";
$altonoff = $lang->forum_redirect;

	{
$folder = "offlink";
$altonoff = $lang->forum_redirect;