1 (edited by Reines 2005-06-22 13:16)

Topic: Announcements Mod 1.0

This mod removes the existing announcement system and replaces it with a system which will read threads out of a certain board as announcements.

##        Mod title:  Announcements
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.5
##     Release date:  2005-05-02
##           Author:  Jamie (reines@gmail.com)
##
##      Description:  This mod removed the existing announcement system and
##                    replaces it with a system which will read posts out of
##                    a board as announcements.
##
##   Affected files:  include/common.php
##                    header.php
##                    admin_options.php
##                    viewtopic.php
##                    delete.php
##                    edit.php
##                    help.php
##                    moderate.php
##                    post.php
##                    profile.php
##                    style/imports/base.css
##
##       Affects DB:  Yes
##
##            Notes:  This mod involves removing all calls to the parser and
##                    adding it into common.php, this is maybe not as efficient
##                    as it could be, though it saves alot of work.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.

Download

Edit: Added in what Connorhd suggested to delete the cache.

Re: Announcements Mod 1.0

you can add this to the install_mod.php

    //delete everything in the cache since we messed with some stuff
    $d = dir(PUN_ROOT.'cache');
    while (($entry = $d->read()) !== false)
    {
        if (substr($entry, strlen($entry)-4) == '.php')
            @unlink(PUN_ROOT.'cache/'.$entry);
    }
    $d->close();

that will delete the cache files

Re: Announcements Mod 1.0

Thanks.

Re: Announcements Mod 1.0

hi2u reines lol, ima use this mod on my site.

Re: Announcements Mod 1.0

Very nice Mod, definatly a must-have for displaying announcement.
One question, will it accept html? I didn't try it yet, couldn't know smile

6 (edited by Frank H 2005-05-03 14:39)

Re: Announcements Mod 1.0

Connorhd wrote:

you can add this to the install_mod.php
<snip>
that will delete the cache files

I use this in the attachment mod installer (as Rickard used it in his scripts wink) (dunno if it also creates a new one?)

    require_once PUN_ROOT.'include/cache.php';
    generate_config_cache();

Re: Announcements Mod 1.0

yeh they will probably both work, i stole mine from install.php i think tongue

Re: Announcements Mod 1.0

Very smart indeed. Up and running at http://randomhawk.com/brain/talk/forum.php

One small quible about the styling though: For my taste there is too much space above and below the message content. Currently it has a <br / > above and below the content <p>. How can I remove these line-breaks?

9 (edited by Reines 2005-05-03 15:41)

Re: Announcements Mod 1.0

snoogly wrote:

Currently it has a <br / > above and below the content <p>. How can I remove these line-breaks?

In step 9 find

echo '<div class="center"><b>'.pun_htmlspecialchars($announcement['subject']).'</b> - Posted By '.$announcement['poster'].' ('.format_time($announcement['posted']).') '.$announcement['closed'].'</div><br/>'."\n".$announcement['message'].'<br/>'."\n";

and replace it with

echo '<div class="center"><b>'.pun_htmlspecialchars($announcement['subject']).'</b> - Posted By '.$announcement['poster'].' ('.format_time($announcement['posted']).') '.$announcement['closed'].'</div>'."\n".$announcement['message']."\n";

PS. nice skin on your site smile

10 (edited by snoogly 2005-05-03 15:50)

Re: Announcements Mod 1.0

Thanks Reines, it's much more compact now.

Until I actually recruit users for my forum I will content myslef with making it look nice!

Re: Announcements Mod 1.0

Sorry for bumping up an old topic. But does anyone still have this mod lol. Reines said he deleted it..

12

Re: Announcements Mod 1.0

anyone know how to do this??

13

Re: Announcements Mod 1.0

tryed asking reinets but i get no reply from him :'(

14

Re: Announcements Mod 1.0

Sorry i lost the file lol, feel free to delete this post, unless anyone else can find it lying around.

15

Re: Announcements Mod 1.0

can you not find a the text you need of your php files for your site?

Re: Announcements Mod 1.0

hey. Does anyone have this kicking around? or is there anyone willing to remake it. This would be very useful to me, and other no doubt (for a unique overview/description at the top of each forum section). Please, please, please...