This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
|
| 3 |
<extension engine="1.0"> |
| 4 |
<id>pm_announcements</id> |
| 5 |
<title>Private Message Announcements</title> |
| 6 |
<version>0.1</version> |
| 7 |
<description>Display an announcement if there are unread private messages.</description> |
| 8 |
<author>Ivan Fomichev</author> |
| 9 |
<minversion>1.3</minversion> |
| 10 |
<maxtestedon>1.3.4</maxtestedon> |
| 11 |
<dependencies> |
| 12 |
<dependency>pun_pm</dependency> |
| 13 |
</dependencies> |
| 14 |
|
| 15 |
<hooks> |
| 16 |
<hook id="co_common"><![CDATA[ |
| 17 |
// Include a language file |
| 18 |
if (file_exists($ext_info['path'] . '/lang/' . $forum_user['language'] . '.php')) |
| 19 |
include_once($ext_info['path'] . '/lang/' . $forum_user['language'] . '.php'); |
| 20 |
else |
| 21 |
include_once($ext_info['path'] . '/lang/English.php'); |
| 22 |
]]></hook> |
| 23 |
|
| 24 |
<hook id="hd_gen_elements"><![CDATA[ |
| 25 |
require_once(FORUM_ROOT.'extensions/pun_pm/functions.php'); |
| 26 |
|
| 27 |
pun_pm_unread_messages(); // update cache |
| 28 |
list($new_messages) = pun_pm_read_cache(); |
| 29 |
|
| 30 |
if ($new_messages) { |
| 31 |
$announcement_heading = $lang_pm_announcements['New messages']; |
| 32 |
$announcement_message = sprintf($lang_pm_announcements['You have unread messages'], forum_link($forum_url['pun_pm_inbox']), $new_messages); |
| 33 |
$gen_elements['<!-- forum_announcement -->'] .= '<div id="brd-announcement" class="gen-content">'."\n\t".'<h1 class="hn"><span>'.$announcement_heading.'</span></h1>'."\n\t".'<div class="content">'.$announcement_message.'</div>'."\n".'</div>'."\n"; |
| 34 |
} |
| 35 |
]]></hook> |
| 36 |
</hooks> |
| 37 |
</extension> |