Vergleich announcements.php - 1.6.0 - 1.6.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

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

 * $Id: announcements.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id: announcements.php 5565 2011-09-08 09:07:55Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 65Zeile 65
$time = TIME_NOW;

$query = $db->query("

$time = TIME_NOW;

$query = $db->query("

	SELECT u.*, u.username AS userusername, a.*, f.*, g.title AS grouptitle, g.usertitle AS groupusertitle, g.stars AS groupstars, g.starimage AS groupstarimage, g.image AS groupimage, g.namestyle, g.usereputationsystem

	SELECT u.*, u.username AS userusername, a.*, f.*

	FROM ".TABLE_PREFIX."announcements a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

	FROM ".TABLE_PREFIX."announcements a
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)

	LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)

 
	WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND a.aid='$aid'
");

	WHERE a.startdate<='$time' AND (a.enddate>='$time' OR a.enddate='0') AND a.aid='$aid'
");

$announcementarray = $db->fetch_array($query);



$announcementarray = $db->fetch_array($query);


if(!$announcementarray)
{
error($lang->error_invalidannouncement);


if(!$announcementarray)
{
error($lang->error_invalidannouncement);

}



















}

// Gather usergroup data from the cache
// Field => Array Key
$data_key = array(
'title' => 'grouptitle',
'usertitle' => 'groupusertitle',
'stars' => 'groupstars',
'starimage' => 'groupstarimage',
'image' => 'groupimage',
'namestyle' => 'namestyle',
'usereputationsystem' => 'usereputationsystem'
);

foreach($data_key as $field => $key)
{
$announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field];
}


$announcementarray['dateline'] = $announcementarray['startdate'];
$announcementarray['userusername'] = $announcementarray['username'];
$announcement = build_postbit($announcementarray, 3);
$lang->forum_announcement = $lang->sprintf($lang->forum_announcement, htmlspecialchars_uni($announcementarray['subject']));

$announcementarray['dateline'] = $announcementarray['startdate'];
$announcementarray['userusername'] = $announcementarray['username'];
$announcement = build_postbit($announcementarray, 3);
$lang->forum_announcement = $lang->sprintf($lang->forum_announcement, htmlspecialchars_uni($announcementarray['subject']));

 

if($announcementarray['startdate'] > $mybb->user['lastvisit'])
{
$setcookie = true;
if($mybb->cookies['mybb']['announcements'])
{
$cookie = unserialize(stripslashes($mybb->cookies['mybb']['announcements']));

if(isset($cookie[$announcementarray['aid']]))
{
$setcookie = false;
}
}

if($setcookie)
{
my_set_array_cookie('announcements', $announcementarray['aid'], $announcementarray['startdate'], -1);
}
}


$plugins->run_hooks("announcements_end");



$plugins->run_hooks("announcements_end");