Vergleich inc/functions_indicators.php - 1.6.0 - 1.6.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.6

<?php
/**
* MyBB 1.6

 * Copyright � 2010 MyBB Group, All Rights Reserved

 * Copyright 2010 MyBB Group, All Rights Reserved

 *
* Website: http://mybb.com
* License: http://mybb.com/about/license
*

 *
* Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: functions_indicators.php 4941 2010-05-15 18:17:38Z RyanGordon $

 * $Id: functions_indicators.php 5321 2011-01-13 14:20:31Z Tomm $

 */

/**

 */

/**

Zeile 75Zeile 75
				$comma = ',';
}
}

				$comma = ',';
}
}

		



		if(!empty($tids))
{
$count = 0;

		if(!empty($tids))
{
$count = 0;

			
// We set a limit to 100 otherwise it'll become too processor intensive, especially if we have many threads.
$query = $db->query("
SELECT lastpost, tid, fid
FROM ".TABLE_PREFIX."threads
WHERE visible=1 AND closed NOT LIKE 'moved|%' AND fid IN ($fid) AND tid IN ($tids) AND lastpost > '{$cutoff}'
LIMIT 100
");


// We've read at least some threads, are they here?
$query = $db->simple_select("threads", "lastpost, tid, fid", "visible=1 AND closed NOT LIKE 'moved|%' AND fid IN ($fid) AND lastpost > '{$cutoff}'", array("limit" => 100));






			while($thread = $db->fetch_array($query))
{
if($thread['lastpost'] > intval($threadsread[$thread['tid']]) && $thread['lastpost'] > intval($forumsread[$thread['fid']]))

			while($thread = $db->fetch_array($query))
{
if($thread['lastpost'] > intval($threadsread[$thread['tid']]) && $thread['lastpost'] > intval($forumsread[$thread['fid']]))

Zeile 94Zeile 90
					++$count;
}
}

					++$count;
}
}

 


			return $count;

			return $count;

		}
}
else
{
switch($db->type)
{
case "pgsql":
$query = $db->query("
SELECT COUNT(t.tid) AS unread_count
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."threadsread tr ON (tr.tid=t.tid AND tr.uid='{$mybb->user['uid']}')
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=t.fid AND fr.uid='{$mybb->user['uid']}')




		}

// Not read any threads?
return false;
}
else
{
switch($db->type)
{
case "pgsql":
$query = $db->query("
SELECT COUNT(t.tid) AS unread_count
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."threadsread tr ON (tr.tid=t.tid AND tr.uid='{$mybb->user['uid']}')
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=t.fid AND fr.uid='{$mybb->user['uid']}')

					WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' AND t.fid IN ($fid) AND t.lastpost > COALESCE(tr.dateline,$cutoff) AND t.lastpost > COALESCE(fr.dateline,$cutoff) AND t.lastpost>$cutoff

					WHERE t.visible=1 AND t.closed NOT LIKE 'moved|%' AND t.fid IN ($fid) AND t.lastpost > COALESCE(tr.dateline,$cutoff) AND t.lastpost > COALESCE(fr.dateline,$cutoff) AND t.lastpost>$cutoff

				");

				");

				break;
default:
$query = $db->query("

				break;
default:
$query = $db->query("

Zeile 120Zeile 120
				");
}
return $db->fetch_field($query, "unread_count");

				");
}
return $db->fetch_field($query, "unread_count");

	}
}

/**

	}
}

/**

 * Mark a particular forum as read.
*
* @param int The forum ID

 * Mark a particular forum as read.
*
* @param int The forum ID

Zeile 246Zeile 246
	}
else
{

	}
else
{

 
		my_setcookie("mybb[readallforums]", 1);

		my_setcookie("mybb[lastvisit]", TIME_NOW);

		my_setcookie("mybb[lastvisit]", TIME_NOW);

 


		my_unsetcookie("mybb[threadread]");
my_unsetcookie("mybb[forumread]");
}

		my_unsetcookie("mybb[threadread]");
my_unsetcookie("mybb[forumread]");
}