<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook('pre_output_page','aclearnewsbar');
function aclearnewsbar_info()
{
return array
(
"name"=>"هاك شرط اخر الاخبار المعدل",
"description"=>"يقوم باضافة شريط اخر المواضيع متحرك.",
"website"=>"http://www.ajdija.com",
"author"=>"Mateusz Grzesiukiewicz",
"authorsite"=> "http://www.ajdija.com",
"version"=>"1.0",
"guid"=>"7dc27e3041bfe6e412f1a9b2f7634db2",
"compatibility"=>"18*"
);
}
function aclearnewsbar($page)
{
global $mybb,$theme, $db;
$announcements = '';
$query = $db->query("
SELECT t.*, t.username AS threadusername, u.username AS USER0
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.dateline DESC
LIMIT 0,10 "
);
$news = '';
while($announcement = $db->fetch_array($query))
{
$announcement['threadlink'] = get_thread_link($announcement['tid']);
$announcement['subject'] = htmlspecialchars_uni($announcement['subject']);
$announcement['threadusername'] = htmlspecialchars_uni($announcement['threadusername']);
$news = $news.' <strong><a href="'.htmlspecialchars_uni($announcement['threadlink']).'">'.htmlspecialchars_uni($announcement['subject']).'</a> </strong>['.htmlspecialchars_uni($announcement['threadusername']).'] <i class="fa fa-quote-left" aria-hidden="true"></i>
';
}
$page=preg_replace('#<div class="navigation">(.*)</div>#Usi','<div class="navigation">$1</div><br />
<table border="0" cellspacing="'.$theme["borderwidth"].'" cellpadding="'.$theme["tablespace"].'" class="tborder">
<thead>
<tr>
<td class="thead" width="100" align="center" style="color: aquamarine; border-radius: 0 6px 0 0"><strong>آخر '.
/* Use below code and set ^^(width) higher if you want board name to be said:
$mybb->settings['bbname']
*/
'المواضيع : </strong></td><td class="thead" style="color: aqua;border-radius: 6px 0 0 0"><marquee direction="right" scrollamount="6" onmouseover="this.stop();" onmouseout="this.start();">'.$news.'</marquee></td>
</tr>
</thead>
</table>',$page);
return $page;
}
?>