Vergleich inc/functions_forumlist.php - 1.8.0 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
/**
* Build a list of forum bits.
*

/**
* Build a list of forum bits.
*

* @param int The parent forum to fetch the child forums for (0 assumes all)
* @param int The depth to return forums with.

* @param int $pid The parent forum to fetch the child forums for (0 assumes all)
* @param int $depth The depth to return forums with.

* @return array Array of information regarding the child forums of this parent forum
*/
function build_forumbits($pid=0, $depth=1)

* @return array Array of information regarding the child forums of this parent forum
*/
function build_forumbits($pid=0, $depth=1)

Zeile 43Zeile 43
		{
$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 63
			// 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)

			{

			{

				$hidecounters = true;

// If we only see our own threads, find out if there's a new post in one of them so the lightbulb shows

				$hidecounters = true;

// If we only see our own threads, find out if there's a new post in one of them so the lightbulb shows

Zeile 80Zeile 82
				{
$private_forums = $fids = array();
foreach($fcache as $fcache_p)

				{
$private_forums = $fids = array();
foreach($fcache as $fcache_p)

					{

					{

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

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

Zeile 89Zeile 91
								{
$fids[] = $forum_p['fid'];
}

								{
$fids[] = $forum_p['fid'];
}

							}

							}

						}
}

						}
}





					if(!empty($fids))
{
$fids = implode(',', $fids);

					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"));


						$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))
{
if(!$private_forums[$thread['fid']])

						while($thread = $db->fetch_array($query))
{
if(!$private_forums[$thread['fid']])

Zeile 105Zeile 107
								$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'];

 

if(!$private_forums[$forum['fid']]['lastposteruid'] && !$private_forums[$forum['fid']]['lastposter'])
{
$private_forums[$forum['fid']]['lastposter'] = $lang->guest; // htmlspecialchars_uni'd when formatted later
}


$lastpost_data = array(
"lastpost" => $private_forums[$forum['fid']]['lastpost'],


$lastpost_data = array(
"lastpost" => $private_forums[$forum['fid']]['lastpost'],

Zeile 123Zeile 130
			}
else
{

			}
else
{

 
				if(!$forum['lastposteruid'] && !$forum['lastposter'])
{
$forum['lastposter'] = $lang->guest; // htmlspecialchars_uni'd when formatted later
}


				$lastpost_data = array(
"lastpost" => $forum['lastpost'],
"lastpostsubject" => $forum['lastpostsubject'],

				$lastpost_data = array(
"lastpost" => $forum['lastpost'],
"lastpostsubject" => $forum['lastpostsubject'],

Zeile 132Zeile 144
				);
}


				);
}


			if($forum['password'] != '' && $mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))


			// 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;

				$hideinfo = true;
$showlockicon = 1;

			}

// Fetch subforums of this forum

			}

// Fetch subforums of this forum

Zeile 155Zeile 168
				}

// 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 176Zeile 189
			}

// 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' => '',

				);
}


				);
}


			// If the current forums lastpost is greater than other child forums of the current parent, overwrite it
if(!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost'])

			// If the current forums lastpost is greater than other child forums of the current parent and forum info isn't hidden, overwrite it
if((!isset($parent_lastpost) || $lastpost_data['lastpost'] > $parent_lastpost['lastpost']) && $hideinfo != true)

			{
$parent_lastpost = $lastpost_data;
}

			{
$parent_lastpost = $lastpost_data;
}

Zeile 282Zeile 297
			if($forum['linkto'] == '')
{
// No posts have been made in this forum - show never text

			if($forum['linkto'] == '')
{
// No posts have been made in this forum - show never text

				if(($lastpost_data['lastpost'] == 0 || $lastpost_data['lastposter'] == '') && $hideinfo != true)

				if($lastpost_data['lastpost'] == 0 && $hideinfo != true)

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

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

Zeile 292Zeile 307
					$lastpost_date = my_date('relative', $lastpost_data['lastpost']);

// Set up the last poster, last post thread id, last post subject and format appropriately

					$lastpost_date = my_date('relative', $lastpost_data['lastpost']);

// Set up the last poster, last post thread id, last post subject and format appropriately

 
					$lastpost_data['lastposter'] = htmlspecialchars_uni($lastpost_data['lastposter']);

					$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");
$lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);

					$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");
$lastpost_subject = $full_lastpost_subject = $parser->parse_badwords($lastpost_data['lastpostsubject']);

Zeile 413Zeile 429

// 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 458Zeile 474
/**
* Fetch the status indicator for a forum based on its last post and the read date
*

/**
* Fetch the status indicator for a forum based on its last post and the read date
*

 * @param array Array of information about the forum
* @param array Array of information about the lastpost date
* @param int Whether or not this forum is locked or not

 * @param array $forum Array of information about the forum
* @param array $lastpost Array of information about the lastpost date
* @param int $locked Whether or not this forum is locked or not

 * @return array Array of the folder image to be shown and the alt text
*/
function get_forum_lightbulb($forum, $lastpost, $locked=0)

 * @return array Array of the folder image to be shown and the alt text
*/
function get_forum_lightbulb($forum, $lastpost, $locked=0)

Zeile 473Zeile 489
		$folder = "offlink";
$altonoff = $lang->forum_redirect;
}

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

	// This forum is closed, so override the folder icon with the "offlock" icon.

	// This forum is closed, so override the folder icon with the "offclose" icon.

	elseif($forum['open'] == 0 || $locked)
{

	elseif($forum['open'] == 0 || $locked)
{

		$folder = "offlock";
$altonoff = $lang->forum_locked;

		$folder = "offclose";
$altonoff = $lang->forum_closed;

	}
else
{

	}
else
{

Zeile 538Zeile 554
/**
* Fetch the number of unapproved posts, formatted, from a forum
*

/**
* Fetch the number of unapproved posts, formatted, from a forum
*

 * @param array Array of information about the forum

 * @param array $forum Array of information about the forum

 * @return array Array containing formatted string for posts and string for threads
*/
function get_forum_unapproved($forum)

 * @return array Array containing formatted string for posts and string for threads
*/
function get_forum_unapproved($forum)