Simple Announcement Mod

Started by Chupko, January 28, 2011, 06:25:35 PM

Previous topic - Next topic

Matthew K.

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.

Arantor

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.
Holder of controversial views, all of which my own.


Matthew K.

So really, whenever htmlspecialchars is NOT run, prior to parse_bbc?

Arantor

-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.
Holder of controversial views, all of which my own.


Chupko

Bump :)

Mod updated for 1.1.16 and Created for 2.0.2. :D Enjoy ;)

aşkullah

Hi enable Display Announcement On Each Page internet expolar problems.

sample image



Ventic


Chupko

#28
Attach your Index.template.php :) Error in code :) Package reuploaded :)

Ventic


Buta

Where is admin panel for this mod?
I don't see

Chupko

Admin Panel > Feature and Options :)


Chupko


djohns

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?

aşkullah

#35
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>';
}

djohns

Thank you very much.  I will try that later today.

djohns

#37
Bummer.  It didn't make a bit of difference.  A screenshot is attached. 

It looks so nice in Chrome...


djohns

Does anyone have a recommendation for a similar mod that would work in IE8?

djohns


Advertisement: