PDA

View Full Version : Collapseable Announcements Below Navbar


evenmonkeys
22 Jun 2006, 19:44
I know there are a lot of announcement hacks, but I made this one especially for my forums. I want my announcements to be accessable at all times. However, I don't want to force users to have to read them more than once. I'd rather give them the option of having it open at all times, or closed.

Description
This will allow you to create announcements under your navbar that users may collapse after viewing it. If they want to read it again, they may uncollapse it. Otherwise, it collapses to a 25 pixel high box, much like the statistics at the bottom of the forumhome.

Templates to edit: 1 (navbar)
Files to Upload: 0

Instructions
1. In your AdminCP, go to Styles & Templates -> Style Manager -> Edit Templates -> navbar.

2. Find:<!-- / nav buttons bar -->
Add Below:<!-- Announcements -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td align="center" class="tcat" colspan="2">Announcements</td>
</tr>
</thead>
<!-- Example -->
<tbody>
<tr>
<td colspan="2" class="thead"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_ann1')"><img id="collapseimg_forumhome_ann1" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_ann1].gif" border="0" /></a>Title of Announcement</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_ann1" style="$vbcollapse[collapseobj_forumhome_ann1]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" border="0" /></td>
<td class="alt1" width="100%"><div class="smallfont">Put whatever you want in here.</div></td>
</tr>
</tbody>
<!-- // Example -->
<!-- Example 2 -->
<tbody>
<tr>
<td colspan="2" class="thead"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_ann2')"><img id="collapseimg_forumhome_ann2" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_ann2].gif" border="0" /></a>Title of Announcement</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_ann2" style="$vbcollapse[collapseobj_forumhome_ann2]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/whos_online.gif" border="0" /></td>
<td class="alt1" width="100%"><div class="smallfont">Put whatever you want in here.</div></td>
</tr>
</tbody>
<!-- // Example 2 -->
</table>
<!-- // Announcements -->

Notes
If you want more than one accouncement, Just copy the section between the <!-- Example --> part. Then you'll need to change all five of the forumhome_ann1 to fit each announcement. Example: forumhome_ann2, forumhome_ann3. There are five in each announcement. They must all match. Remember that each announcement has a title and a body.

More Notes
Unfortunately, this hack is not cooperating with additional hacks. If you are using the ibProArcade, they will not stay collapsed. However, they will stay collapsed on v3Arcade. If you're using the PhotoPlog, they will not stay collapsed. I have no idea how to fix this. If anyone can help, let me know. Also, if you are using the columns on either side of your forum within FireFox on a 100% wide board, this may also cause issues such as expanding passed the 100% mark. I have been unable to fix this at this point.

I know it's kind of choppy, but all of my users like it. I like it too.

The Free Bird
22 Jun 2006, 20:11
thinks

Snake
23 Jun 2006, 12:42
Awesome! Been waiting for this... :)

abosaleh
11 Aug 2006, 16:59
thanks

midirtrider
30 Aug 2006, 21:17
installed.. but to difficult to change announcment.

If you could hack in a way to link this to an announcment of announcments that were stickied.. or recently applied to the forums.. that would be AWSOME!!

evenmonkeys
30 Aug 2006, 21:27
I would have no idea how to do that. I'll toy with it a little bit though. I'll see if I can come up with something.

Mr.Dosa
10 Jan 2007, 22:16
hi abosaleh
thanks

Breathex
19 Jan 2007, 05:58
I would prefer to enter announcements in a page in admin cp, it would be great. Btw great hack, thanks for this. I'll install it soon but i'll be waiting for the upgrade that i talk about.

evenmonkeys
20 Jan 2007, 04:59
Maybe I can throw something together this weekend. I'm more of a template kind of guy. Coding's not really my field... but we'll see what we can come up with.

Breathex
25 Jan 2007, 04:25
Maybe I can throw something together this weekend. I'm more of a template kind of guy. Coding's not really my field... but we'll see what we can come up with.
i'll be waiting for this, good luck ;)

sr972
13 Aug 2007, 13:35
Really nice hack.
You still work on it? Cause using the "normal" Announcements would be great.
If i am interested to do more actions on it (e.g. using normal announcements) would you give your ok?

Wheezy
31 Aug 2007, 02:48
I agree its a tad impractical editing announcements from the navbar template, but it works nonetheless. Thanks for sharing :)