Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chupko on January 28, 2011, 06:25:35 PM

Title: Simple Announcement Mod
Post by: Chupko on January 28, 2011, 06:25:35 PM
Simple Announcement Mod


Support Topic (http://www.simplemachines.org/community/index.php?topic=419473.0)     Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2908)



Author:
Chupavac

Languages:
English

Compatibility:
1.1.12, 1.1.13, 1.1.16, 1.1.18, 2.0.2, 2.0.4

Screenshots:

In admin panel:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg690.imageshack.us%2Fimg690%2F7888%2Fadminby.jpg&hash=ca9c544c6aa3b362760adf2749aad89df73a6b29)

When Mod Installed:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg268.imageshack.us%2Fimg268%2F4890%2Fonforum.jpg&hash=93e7136822b92d037572844685ebba13465ba0c6)
Enjoy in Mod  ;)
Title: Re: Simple Announcement Mod
Post by: Masterd on January 29, 2011, 07:43:11 AM
Nice mod! :D
Title: Re: Simple Announcement Mod
Post by: Chupko on January 29, 2011, 08:02:53 AM
Ty Masterd =)
Title: Re: Simple Announcement Mod
Post by: Arctos on February 02, 2011, 09:12:20 PM
Hi,

I have a problem with using this mod in other than default theme.
I use As Theme and tryed manually instal this Mod but it not appear.
Maybe i did something wrong.

//Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
', $txt['welcome_guest'], ' ';
}
              echo '
    </div>';
      echo '
<div id="news">
   <span class="smalltext"><b>', $txt[102], '</b>: <br />', $context['random_news_line'], '</span>
</div></div><br />';
//Start
//Simple Announcement Mod by Chupko
if (!empty($modSettings['annoc_enable_each']))
{
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: center; ">
', (empty($modSettings['annoc_title'])) ? $txt['annoc_title_default'] : $modSettings['annoc_title'], '</div></div>
        <table border="0" width="100%" class="tborder">
            <td class="windowbg2" valign="middle" align="left">
         ', (empty($modSettings['annoc_content'])) ? $txt['annoc_content_default'] : $modSettings['annoc_content'], '
         </td></table>';
}
// End
}

function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;

Is this placed in good place of code or maybe code itself is invalid  or something?

Oh anyway i use v1.1.12 of SMF
Title: Re: Simple Announcement Mod
Post by: Chupko on February 03, 2011, 09:03:33 AM
can you attach the index.template.php ? :)
Title: Re: Simple Announcement Mod
Post by: Arctos on February 03, 2011, 09:59:35 AM
Ye i can  :D
Title: Re: Simple Announcement Mod
Post by: Chupko on February 13, 2011, 03:07:51 PM
Arctos, i can't find where is error ;S


@Topic

Mod update for SMF 1.1.13 :)
Title: Re: Simple Announcement Mod
Post by: Jessica. on February 22, 2011, 11:33:03 AM
is there some way that we'll be able to use BBCode in it in the future?
Title: Re: Simple Announcement Mod
Post by: Chupko on February 22, 2011, 01:31:16 PM
Maybe.. If i have a time, i will add support for bbc :)
Title: Re: Simple Announcement Mod
Post by: wdlax11 on February 22, 2011, 08:00:59 PM
hey mate... i can't get your mod to work on my forums can you help me?
Title: Re: Simple Announcement Mod
Post by: Masterd on February 23, 2011, 06:43:07 AM
Can you be more specific?
Title: Re: Simple Announcement Mod
Post by: Chupko on February 23, 2011, 07:53:25 AM
If you use custom theme, you have to install manual.. :)
Title: Re: Simple Announcement Mod
Post by: bockonocode on February 28, 2011, 11:21:11 AM
Simple and very useful.  awesome mod, thanks Chupko!  ;D
Title: Re: Simple Announcement Mod
Post by: Chupko on February 28, 2011, 12:37:54 PM
Thank You bockonocode :)
Title: Re: Simple Announcement Mod
Post by: brendank1 on March 09, 2011, 08:59:59 PM
Hi Chupko & thanks for the mod, it will come in handy. I've only just installed it on SMF 1.1.13 and I get a triple announcement. As per my example below. Any suggestions please?
Regards   

Home    Help  Search  Admin  Profile  My Messages  Calendar  Media [1]  Members  Logout   

Test Announce
This is a test announcement!
Test Announce
This is a test announcement!
Test Announce
This is a test announcement!
Title: Re: Simple Announcement Mod
Post by: Matthew K. on March 09, 2011, 09:02:00 PM
To add bbc, all you have to do is use the parse_bbc(); function.
Title: Re: My Triple Announcements at Reply 14
Post by: brendank1 on March 10, 2011, 12:11:18 AM
Well I had a play and sorted it. I think it did not uninstall properly and when I reinstalled the same mod it doubled up on what was already left behind on server. Anyway, going great guns nor so it's all good. Thanks again, I like this mod. :)
Title: Re: Simple Announcement Mod
Post by: Chupko on March 10, 2011, 05:40:06 AM
Thank You brendank1 :)

Labradoodle-360, thanks ;)
Title: Re: Simple Announcement Mod
Post by: Masterd on March 10, 2011, 07:16:22 AM
Quote from: Labradoodle-360 on March 09, 2011, 09:02:00 PM
To add bbc, all you have to do is use the parse_bbc(); function.

Yes, it's pretty simple.

$modSettings['annoc_content'] = parse_bbc($modSettings['annoc_content']);
Title: Re: Simple Announcement Mod
Post by: Arantor on March 10, 2011, 07:17:57 AM
That sort of presumes the content is pushed through preparsecode() when saving it though, otherwise unexpected bad things can happen.
Title: Re: Simple Announcement Mod
Post by: Matthew K. on March 10, 2011, 12:58:10 PM
In what cases would preparsecode NOT be run ahead of time?
Quote from: Arantor on March 10, 2011, 07:17:57 AM
That sort of presumes the content is pushed through preparsecode() when saving it though, otherwise unexpected bad things can happen.
Title: Re: Simple Announcement Mod
Post by: Arantor on March 10, 2011, 01:21:38 PM
Well, funnily enough, it isn't run here. It's run when a post is submitted, it's run when a PM is submitted. But it isn't run here, though I am not sure whether the large_text calls htmlspecialchars or not... I suspect not, and if not, it's not necessarily safe to run parse_bbc.
Title: Re: Simple Announcement Mod
Post by: Matthew K. on March 10, 2011, 01:35:09 PM
So really, whenever htmlspecialchars is NOT run, prior to parse_bbc?
Title: Re: Simple Announcement Mod
Post by: Arantor on March 10, 2011, 04:59:10 PM
-sigh- The whole point of preparsecode is to sanitise the code specifically for parsing. htmlspecialchars will sanitise basic XSS but not the more complex things. If there is any chance that content is to be BBC parsed, it should be pushed through preparsecode.
Title: Re: Simple Announcement Mod
Post by: Chupko on February 10, 2012, 08:31:51 PM
Bump :)

Mod updated for 1.1.16 and Created for 2.0.2. :D Enjoy ;)
Title: Re: Simple Announcement Mod
Post by: aşkullah on February 14, 2012, 02:22:13 PM
Hi enable Display Announcement On Each Page internet expolar problems.

sample image

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fdesmond.imageshack.us%2FHimg252%2Fscaled.php%3Fserver%3D252%26amp%3Bfilename%3Dadszic.png%26amp%3Bres%3Dmedium&hash=30d9c64005b38640ecad8e9a3762439b4c856fe2)
Title: Re: Simple Announcement Mod
Post by: aşkullah on February 14, 2012, 02:30:20 PM
Solved
Title: Re: Simple Announcement Mod
Post by: Ventic on February 20, 2012, 10:47:05 AM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.aedes.us%2Fe%2FdIgBT.png&hash=118079076bdac580696d19118be57b7c2b8c51a4)

why it looks like this
Title: Re: Simple Announcement Mod
Post by: Chupko on February 20, 2012, 04:43:54 PM
Attach your Index.template.php :) Error in code :) Package reuploaded :)
Title: Re: Simple Announcement Mod
Post by: Ventic on February 21, 2012, 07:27:48 AM
thanks
Title: Re: Simple Announcement Mod
Post by: Buta on February 25, 2012, 12:36:57 PM
Where is admin panel for this mod?
I don't see
Title: Re: Simple Announcement Mod
Post by: Chupko on February 25, 2012, 01:01:03 PM
Admin Panel > Feature and Options :)
Title: Re: Simple Announcement Mod
Post by: Buta on February 25, 2012, 01:43:26 PM
Ooooo yes, thank you
Title: Re: Simple Announcement Mod
Post by: Chupko on February 25, 2012, 02:00:10 PM
No problem. :)
Title: Re: Simple Announcement Mod
Post by: djohns on March 26, 2012, 05:38:33 PM
I'm having the same problem as Aşkullah and Ventic.  Everything fine in Google Chrome, site appearance hosed in IE8 (as in Askulla's image attachement).

Chupko, could you post what you did for Ventic?  Or, Askulla, would you please mention how you solved this?
Title: Re: Simple Announcement Mod
Post by: aşkullah on March 29, 2012, 05:12:14 AM
Hi:

your theme/index.template.php

Find


//Simple Announcement Mod by Chupko
if (!empty($modSettings['annoc_enable_each']))
{
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<div class="cat_bar">
<h3 class="catbg">', (empty($modSettings['annoc_title'])) ? $txt['annoc_title_default'] : $modSettings['annoc_title'], '</div></div></h3>
        <table border="0" width="100%" class="tborder">
            <td class="windowbg2" valign="middle" align="left">
<p class="inline">
         ', (empty($modSettings['annoc_content'])) ? $txt['annoc_content_default'] : $modSettings['annoc_content'], '
         </p></td></table></p>';
}



REPLACE

//Simple Announcement Mod by Chupko
if (!empty($modSettings['annoc_enable_each']))
{
echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' : '', '>
<div class="cat_bar">
<div class="catbg">', (empty($modSettings['annoc_title'])) ? $txt['annoc_title_default'] : $modSettings['annoc_title'], '</div></div>
        <table border="0" width="100%" class="tborder">
            <td class="windowbg2" valign="middle" align="left">
<p class="inline">
         ', (empty($modSettings['annoc_content'])) ? $txt['annoc_content_default'] : $modSettings['annoc_content'], '
         </p></td></table></p>';
}
Title: Re: Simple Announcement Mod
Post by: djohns on March 30, 2012, 01:34:55 PM
Thank you very much.  I will try that later today.
Title: Re: Simple Announcement Mod
Post by: djohns on March 30, 2012, 05:37:37 PM
Bummer.  It didn't make a bit of difference.  A screenshot is attached. 

It looks so nice in Chrome...

(//)
Title: Re: Simple Announcement Mod
Post by: djohns on April 05, 2012, 06:05:28 PM
Does anyone have a recommendation for a similar mod that would work in IE8?
Title: Re: Simple Announcement Mod
Post by: djohns on April 11, 2012, 09:53:06 PM
Suggestions?
Title: Re: Simple Announcement Mod
Post by: djohns on April 30, 2012, 03:07:26 PM
I guess support for this mod has been discontinued. 
Title: Re: Simple Announcement Mod
Post by: TheListener on April 30, 2012, 03:20:09 PM
Quote from: djohns on April 05, 2012, 06:05:28 PM
Does anyone have a recommendation for a similar mod that would work in IE8?

You couild always use a different browser.

Title: Re: Simple Announcement Mod
Post by: djohns on April 30, 2012, 03:28:50 PM
I do use a different browser myself, but dictating a particular browser(s) is not going to fly with every forum user.  I'm just the forum administrator, not the forum dictator.  What my board of directors wants is trouble-free viewing & posting for all its members.
Title: Re: Simple Announcement Mod
Post by: djohns on June 11, 2012, 04:06:38 PM
So in digging where I could, it appears that IE8 has issues when both padding and a %width is specified for a table element(s).  The default curve theme I'm using seems to be specifying padding for the background category header.  Any suggestions on overriding certain css elements in the mod vs. replacing css statements in the theme?  I don't know css all that well and just want to get this mod running in IE8 as well as it does in Chrome & Firefox. 
Title: Re: Simple Announcement Mod
Post by: djohns on July 12, 2012, 12:24:39 AM
Still stuck....
Title: Re: Simple Announcement Mod
Post by: breweruk on July 15, 2012, 02:59:14 AM
Hi,

Great mod, thanks so much for this. I have just installed it on my forum.

One question. Is there anyway to make it appear above every post so that visitors - who are not registered - and members see it when browsing topics?

People click through from the topic headings on the front page of my site...

http://www.brookmans.com/

... and get to the forum http://www.brookmans.com/forum/ and it would be great if the message (currently about cookies) shows up above every post.

Anyway, thanks for a great mod that installed perfectly.

Cheers

David
Title: Re: Simple Announcement Mod
Post by: Andrew Evenstar on September 10, 2012, 01:22:38 AM
Does anyone have the manual edits for this mod for 1.1x or 1.1.16?

Thanks!
Title: Re: Simple Announcement Mod
Post by: Chupko on December 09, 2012, 01:17:34 PM
@djhons

I will solve that tonight or tomorrow :)


@breweruk

I will add it to next update ;) is posible :)

@Andrew Evenstar

You have here:

http://custom.simplemachines.org/mods/index.php?action=parse;mod=2908;attach=197299;smf_version=1.1.16
Title: Re: Simple Announcement Mod
Post by: djohns on December 09, 2012, 05:01:32 PM
Chupko,

Any progress on the fix for ie8 in version 2.0?

Thank you!
Title: Re: Simple Announcement Mod
Post by: Chupko on December 09, 2012, 05:32:59 PM
I will solve that tonight or tomorrow :)

Title: Re: Simple Announcement Mod
Post by: iDevGrow on December 22, 2012, 03:00:48 AM
like it "  :-*
Title: Re: Simple Announcement Mod
Post by: djohns on January 09, 2013, 05:16:44 PM
Chupko,

Any progress on the fix for ie8 in version 2.0?  It's been a month since your last reply.  I hate to bug you but this works so well in Chrome I'd like the rest of our users to have it too.

Thank you!
Title: Re: Simple Announcement Mod
Post by: Chupko on February 17, 2013, 05:47:22 PM
BUMP! Mod is updated for 1.1.18 & 2.0.4.. :) Enjoy :)
Title: Re: Simple Announcement Mod
Post by: djohns on February 18, 2013, 11:52:22 AM
 :)

You darling!

Will load it as soon as I get home from traveling.

Like the new Avatar!

Thanks you!!!
Title: Re: Simple Announcement Mod
Post by: XHIBIT911 on May 18, 2013, 05:16:29 AM
This mod stopped working in my 2.0.4 forum out the sky blue.
Now when I upload nothing shos in the post box
Title: Re: Simple Announcement Mod
Post by: OzzyMozzy on May 28, 2013, 06:48:03 AM
After i installed this i ended up with all of this at the top of the forum when in the ADMIN section, I uninstalled the mods but it's still there. How can i get rid of it all? what file would i find it in to take it out?

$txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title
Title: Re: Simple Announcement Mod
Post by: OzzyMozzy on July 12, 2013, 03:13:22 AM
Quote from: OzzyMozzy on May 28, 2013, 06:48:03 AM
After i installed this i ended up with all of this at the top of the forum when in the ADMIN section, I uninstalled the mods but it's still there. How can i get rid of it all? what file would i find it in to take it out?

$txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title

Any help on this? Any ideas where i would find this code?
Title: Re: Simple Announcement Mod
Post by: Misterlamed on August 05, 2013, 11:45:30 AM
Hello Chupko I need some help i don't know why but it shows 3 of the boarder for my announcement i tried uninstalling and restalling and manually deleting the codes and stuff but still no luck could you help me out

Thank you very much!

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi43.tinypic.com%2F2i8c11t.png&hash=01dc159a53a828a09c8bf0bbbcf7158a4408bd64)
Title: Re: Simple Announcement Mod
Post by: Misterlamed on August 07, 2013, 09:58:35 AM
anyone here? :/
Title: Re: Simple Announcement Mod
Post by: 2greedy on March 25, 2014, 02:56:49 AM
Quote from: OzzyMozzy on May 28, 2013, 06:48:03 AM
After i installed this i ended up with all of this at the top of the forum when in the ADMIN section, I uninstalled the mods but it's still there. How can i get rid of it all? what file would i find it in to take it out?

$txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title'] = 'Enter the title for Announcement Mod'; $txt['annoc_content'] = 'Write your own text for Announcement'; $txt['annoc_enable_each'] = 'Display Announcement On Each Page'; $txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index'; $txt['annoc_title

I'm having the same problem! can we get some help ere?
Title: Re: Simple Announcement Mod
Post by: 2greedy on March 27, 2014, 03:21:45 AM
I got it sorted guy's, turns out when you uninstall the mod it doesn't remove all file edits, mainly the last 2 file edits

./Themes/default/languages/Modifications.english.php

Find (at the end of the file):
?>

Add Before:

$txt['annoc_title_default'] = 'Announcement center';
$txt['annoc_default'] = 'Please type announcement in admin panel.';




./Themes/default/languages/Admin.english.php

find
?>

Add Before: [Select]

$txt['annoc_enable_each'] = 'Display Announcement On Each Page';
$txt['annoc_enable_index'] = 'Display Announcement Just On Forum Index';
$txt['annoc_title'] = 'Enter the title for Announcement Mod';
$txt['annoc_content'] = 'Write your own text for Announcement';