[XenMods] Announcements [Deleted]

Oh I just tested it, it does a completely announce, even in the homepage, is there a way to set it up to be sticky inside the forums & sub-forums only?

I just want to add a global form rules and have it inside every forum. just not the homepage forum :)
 
Oh I just tested it, it does a completely announce, even in the homepage, is there a way to set it up to be sticky inside the forums & sub-forums only?

I just want to add a global form rules and have it inside every forum. just not the homepage forum :)

Good idea, I'll add this setting for the next release.

Oh and when I have sub-forums, the announcement goes under the sub-forums, should be above

Good catch, I'll also fix this for the next release. In the mean time if you want you can edit what hook it uses in the file: /library/PHCannouncements/Listener/Hook.php
 
<?php
class PHCannouncements_Listener_Hook
{
public static function listen($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
if ($hookName == 'forum_list_nodes' || $hookName == 'forum_view_pagenav_before')
{
$globalModel = XenForo_Model::create('PHCannouncements_Model_Threads');
$threads = $globalModel->Announcements();

$hookParams['announcements'] = $threads;

$contents = $template->create('PHCannouncements', $hookParams) . $contents;
}
}
}
?>

In order to remove it from the forum homepage, I should remove
if ($hookName == 'forum_list_nodes' || $hookName == 'forum_view_pagenav_before')
right?
 
To remove from the homepage change

PHP:
if ($hookName == 'forum_list_nodes' || $hookName == 'forum_view_pagenav_before')

to

PHP:
if ($hookName == 'forum_view_pagenav_before')
 
To remove from the homepage change

PHP:
if ($hookName == 'forum_list_nodes' || $hookName == 'forum_view_pagenav_before')

to

PHP:
if ($hookName == 'forum_view_pagenav_before')
Woops! indeed, it works amazingly! you're like a magician :)

There is the other issue (inside sub-forum, above the inner sub-forums) I guess it is some what related to PageContent, but can't find it @ Hook
 
I just looked, unfortunately there is not another hook higher up on the template list. If you're using 1.2 you can set a TMS rule to put it somewhere higher. The template you're looking in is forum_view
 
Where the heck do I configure this lol I don't see it anywhere in AdminCP.
 
Thanks man


I'm going to be doing any update soon. Are there any changes anyone would like to see?
 
Thanks man


I'm going to be doing any update soon. Are there any changes anyone would like to see?
Only thing I can think of at the moment is the phrase that says 'Announcement Title' I wish it just said 'Announcement: Please Read' or let us configure the phrase through admincp.
 
try: announcement_title

This was when I was just getting used to the structure of xF and I didn't really maintain consistency in how I named things (still don't do it perfect)
 
  • Like
Reactions: DRE
Not sure if this is something you can fix or not but I need the announcement blocks at the top of the forum list above other blocks. What hook or how are you posting this above the forum list? I ask because when using XenPorta, any block above the forum node lists actually goes above the announcement. See my site for example.
 
Back
Top Bottom