Advertisement:

Author Topic: Posting Announcement  (Read 70555 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 73,189
Re: Posting Announcement
« Reply #160 on: May 19, 2010, 08:30:15 AM »
Comma separated is relatively easy...

ModSettings.php
Code: [Select]
// The Posting Announcement mod
                        array('check', 'enable_announcement'),
array('large_text', 'text_announcement', '2'),
                        array('text', 'board_announcement'),

Modifications.english.php
Code: [Select]
// Start Posting Announcement mod by Nas
$txt['enable_announcement']='Show an announcement on the top of the post page';
$txt['text_announcement']='Announcement to display <div class="smalltext">HTML and BBC may be used.</div>';
// End Posting Announcement mod by Nas
$txt['board_announcement']='Board ID(s) to display the announcement';

Post.template.php
Code: [Select]
// Posting Announcement
$board_announce_this_board = false;
if (!empty($modSettings['board_announcement']))
{
$modSettings['board_announcement'] = preg_replace('~[^0-9,]~', '', $modSettings['board_announcement']);
$boards_announce = explode(',', $modSettings['board_announcement']);
$board_announce_this_board = in_array((string) $context['current_board'], $boards_announce);
}
if (!empty($modSettings['enable_announcement']) && $board_announce_this_board)
echo '
<tr>
<td></td>
<td align="left">
<img src="', $settings['images_url'], '/icons/assist.gif" /> <b>',parse_bbc($modSettings['text_announcement']),'</b> <br /><br />
</td>
</tr>';

In case anyone's curious WTF that's going, first it checks to make sure there's actually something in the modSettings[] item, if there is, strip out anything that isn't a number or a comma (like spaces), split it up into an array (which, btw, are going to be strings), then do a comparison of the current board, converted to a string so it's the right type, against the array.

Not tested though.
No good deed goes unpunished
All helpful urges should be circumvented

Offline KidCactus

  • Semi-Newbie
  • *
  • Posts: 74
Re: Posting Announcement
« Reply #161 on: May 19, 2010, 08:42:06 AM »
Not tested though.
I just tried your edit and I can confirm that it works like a charm. :)

Offline aw06

  • SMF Hero
  • ******
  • Posts: 2,763
  • Gender: Male
  • Make The Link
    • shopinja.classifieds on Facebook
    • @shopinja on Twitter
    • ShopinJA.com
Re: Posting Announcement
« Reply #162 on: May 20, 2010, 08:47:11 AM »
I also have this working flawlessly on 1.1.11
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Offline gisfreak

  • Senior Translator
  • Jr. Member
  • *
  • Posts: 340
  • Gender: Male
  • NO TRESPASSING
    • GIS Community
Re: Posting Announcement
« Reply #163 on: November 10, 2010, 04:08:39 AM »
hem, how to upgrade it to latest version ?

should i uninstall it first?, coz it said failed in some file  :(
Me fail English? That’s unpossible.

Offline Vincent Volmer

  • Jr. Member
  • **
  • Posts: 218
  • Gender: Male
  • SMF2.0.18
    • digiscrapdigitaalscrappen on Facebook
    • @Digiscrap_NL on Twitter
    • Digiscrap Digitaal scrappen
Re: Posting Announcement
« Reply #164 on: March 10, 2011, 05:31:18 AM »
Hello,

Is this mod updated for SMF2.0 RC5?

Thanks,

Vincent

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,443
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Posting Announcement
« Reply #165 on: March 10, 2011, 07:19:11 AM »
Hello,

Is this mod updated for SMF2.0 RC5?

Thanks,

Vincent
It installs on any RC 2.0. ;)

Offline Vincent Volmer

  • Jr. Member
  • **
  • Posts: 218
  • Gender: Male
  • SMF2.0.18
    • digiscrapdigitaalscrappen on Facebook
    • @Digiscrap_NL on Twitter
    • Digiscrap Digitaal scrappen
Re: Posting Announcement
« Reply #166 on: March 10, 2011, 07:25:17 AM »
It installs on any RC 2.0. ;)

Okay!! Thanks for the great mod!


Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,443
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Posting Announcement
« Reply #167 on: March 10, 2011, 08:14:01 AM »
It installs on any RC 2.0. ;)

Okay!! Thanks for the great mod!


Thanx. Any issues post here. ;)

Offline Adonix

  • Newbie
  • *
  • Posts: 6
Re: Posting Announcement
« Reply #168 on: September 29, 2015, 12:05:58 AM »
Could we get any updated version for this mod :\ ?
This mod is nice but will it work with 2.0.11 SMF version Mick ?

Offline br360

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,398
    • GenXcommunity
Re: Posting Announcement
« Reply #169 on: September 29, 2015, 12:14:15 AM »
This mod does work fine with 2.0.11.

Offline Grammy

  • Full Member
  • ***
  • Posts: 503
  • Gender: Female
  • Tire Kicker
Re: Posting Announcement
« Reply #170 on: January 24, 2021, 09:30:26 PM »
Okay, this is VERY nice!   :)

Offline Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,443
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: Posting Announcement
« Reply #171 on: January 24, 2021, 09:31:29 PM »
Okay, this is VERY nice!   :)
Not bad eh? Easy as pie lol