Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: forumdisplay.php 5480 2011-07-04 21:29:44Z huji $
| * $Id: forumdisplay.php 5655 2011-11-27 00:10:00Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 629 | Zeile 629 |
---|
// Get Announcements $forum_stats = $cache->read("forumsdisplay");
|
// Get Announcements $forum_stats = $cache->read("forumsdisplay");
|
if($forum_stats[-1]['announcements'] || $forum_stats[$fid]['announcements'])
| if(!is_array($forum_stats)) { $forum_stats = $cache->read("forumdisplay", true); }
$parentlist_exp = explode(',', $parentlist); if(is_array($forum_stats) && ($forum_stats[-1]['announcements'] || array_intersect_key(array_flip($parentlist_exp), $forum_stats)))
|
{ $limit = ''; $announcements = '';
| { $limit = ''; $announcements = '';
|
Zeile 647 | Zeile 654 |
---|
WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1') ORDER BY a.startdate DESC $limit ");
|
WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND ($sql OR fid='-1') ORDER BY a.startdate DESC $limit ");
|
| // See if this announcement has been read in our announcement array $cookie = array(); if(isset($mybb->cookies['mybb']['announcements'])) { $cookie = unserialize(stripslashes($mybb->cookies['mybb']['announcements'])); }
|
$bgcolor = alt_trow(true); // Reset the trow colors while($announcement = $db->fetch_array($query)) {
|
$bgcolor = alt_trow(true); // Reset the trow colors while($announcement = $db->fetch_array($query)) {
|
if($announcement['startdate'] > $mybb->user['lastvisit'])
| if($announcement['startdate'] > $mybb->user['lastvisit'] && !$cookie[$announcement['aid']])
|
{ $new_class = ' class="subject_new"'; $folder = "newfolder";
|
{ $new_class = ' class="subject_new"'; $folder = "newfolder";
|
} else {
| } else {
|
$new_class = ' class="subject_old"'; $folder = "folder";
|
$new_class = ' class="subject_old"'; $folder = "folder";
|
| }
// Mmm, eat those announcement cookies if they're older than our last visit if($cookie[$announcement['aid']] < $mybb->user['lastvisit']) { unset($cookie[$announcement['aid']]);
|
}
$announcement['announcementlink'] = get_announcement_link($announcement['aid']);
| }
$announcement['announcementlink'] = get_announcement_link($announcement['aid']);
|
Zeile 668 | Zeile 688 |
---|
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']); $posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']); $announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);
|
$postdate = my_date($mybb->settings['dateformat'], $announcement['startdate']); $posttime = my_date($mybb->settings['timeformat'], $announcement['startdate']); $announcement['profilelink'] = build_profile_link($announcement['username'], $announcement['uid']);
|
|
|
if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
| if($foruminfo['allowtratings'] != 0 && $fpermissions['canviewthreads'] != 0) { eval("\$rating = \"".$templates->get("forumdisplay_announcement_rating")."\";");
|
Zeile 679 | Zeile 699 |
---|
$rating = ''; $lpbackground = "trow1"; }
|
$rating = ''; $lpbackground = "trow1"; }
|
|
|
if($ismod)
|
if($ismod)
|
{
| {
|
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
eval("\$modann = \"".$templates->get("forumdisplay_announcements_announcement_modbit")."\";");
|
}
| }
|
else { $modann = ''; }
|
else { $modann = ''; }
|
|
|
$plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
| $plugins->run_hooks("forumdisplay_announcement"); eval("\$announcements .= \"".$templates->get("forumdisplay_announcements_announcement")."\";"); $bgcolor = alt_trow();
|
Zeile 698 | Zeile 718 |
---|
{ eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true;
|
{ eval("\$announcementlist = \"".$templates->get("forumdisplay_announcements")."\";"); $shownormalsep = true;
|
| }
if(empty($cookie)) { // Clean up cookie crumbs my_setcookie('mybb[announcements]', 0, (TIME_NOW - (60*60*24*365))); } else if(!empty($cookie)) { my_setcookie("mybb[announcements]", addslashes(serialize($cookie)), -1);
|
} }
| } }
|