MyBB Community Forums

Full Version: bam announcements pls help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i enabled my bam announcement html option to put html in my announcement and it looks good in the admin panel:
[Image: VL13ocg.png]

But, looks like this on index.php

[Image: kXVluvG.png]

What should i do?
Hi,

I'm working on a 2.1 release (I've been sort of quiet about it, but it's coming soon). I will say that my own website had used the banner for discord widgets for a bit, and we did something a little different.

This is because BAM is purposefully designed to clean javascript out of announcements. This was something that had to be done for it to meet security standards (although someone with access to the ACP could already access your templates, and therefore blocking javascript in announcements is a mute point unless someone is using admin permissions to specifically grant access to BAM while denying everything else).

Try this instead. This will work (we did this on our own site for a while):
  • Go to global templates
  • Add a new template called "bam_discord" and paste your HTML widget in there.
  • Add a new BAM_announcement, and put [@template:bam_discord] anywhere in your announcement's content/text. Doesn't matter where (BAM will search for it and find it.)

This is a special tag that is deliberately set to change the way BAM loads internally. It's sort of an unofficial feature specifically designed for cases like this where raw HTML needs to be loaded from a template instead of the normal, default template.

That being said, I'd like to follow up with you and look into why it cleaned out the HTML characters the way it did. You have stated you set HTML to be enabled from BAM's settings. I'll do some testing and see if there is a bug deeper down in the code. Thank you for reporting. Smile
hey i am putting the same html code in the template and it looks like this


[Image: 8jvfiYL.png]


I want it to look like this:

[Image: xY7Sphz.png]

^ The way i am getting this is by a random letter in Announcement: and then I just replace the random letter with my html with ctrl+shift+i  So I don't know what is the problem here.
What does your new template look like? Is it displaying differently in the ACP than it does on your forum index?

What is in the announcement's text currently?
[Image: SkCbpqG.png]

This is my announcement currently

Then i use ctrl+shift+i to put my html there.

[Image: JynR6EZ.png]
It looks like it's still loading the normal BAM_announcement template. The text displaying below the announcement is a known issue that is fixed in the upcoming branch for 2.1, but I'll show you how to fix this in the meantime.

Make a new template in global templates called bam_discord:

[Image: KxbHV.png]

(Of course, I've removed some of the sensitive links and so forth that are specific to our widget, but just copy/paste your widget here)

Then create a new announcement. Put nothing inside the text except this tag: [@template:bam_discord]

[Image: ca9FP.png]

We've tested this on the 2.0 branch that's released and were using it on our forum for a little while. This should work as expected. Smile



Edit: I see that you might be just adding a link instead of the entire widget. If you aren't copy/pasting an entire widget, go to global_templates and replace bam_announcement with:

<div class="{$bam_unsticky} {$class}" id="announcement-{$bcprefix}{$announcement_id}">{$announcement}<span class="bam_date">{$date}</span>
<span class='close_bam_announcement {$display_close}'>x</span></div>

This is the new version of the template that will be in BAM 2.1. It replaces the <p> tags with <div> tags to fix the issue with certain HTML popping out under the announcement. This is a known issue that is already fixed on the GitHub version of BAM that will be released in the next week or two. Smile
[Image: DNML4UB.png]


I HAVE DONE IT!


THANKS FOR THE HELP!

am so happy. the plugin is awesome!
Glad it is working well for you! Let me know if you have any other questions. A new version is going to be coming out soon, but it's just a maintenance release with some fixes and polishing around the edges. Let me know if you have any suggestions.
(2021-01-30, 08:47 PM)Darth Apple Wrote: [ -> ]Glad it is working well for you! Let me know if you have any other questions. A new version is going to be coming out soon, but it's just a maintenance release with some fixes and polishing around the edges. Let me know if you have any suggestions.

Hi Darth,

I just installed and activated Bam. I followed your instructions above. Made the bam_discord template in global templates. But nothing is showing. What am I doing wrong? Attached are  images of AdminCP configs. Is there something else I need to do?

I am a complete newbie.

I'd be really grateful for your help. Thanks
[attachment=44920]  
[attachment=44921]  
[attachment=44922]