Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 8 Hours, 18 Minutes, 39 Seconds ago Cant embed HTML in announcemts
#1
Solved: 8 Hours, 18 Minutes, 39 Seconds ago Question 
Ive been trying to embed a covid19 stats announcement on my forum with this code:

<script src="https://apps.elfsight.com/p/platform.js" defer></script>

<div class="elfsight-app-68c9a77a-0d8b-4356-ab58-494c8849f1db"></div>

Why is it not working for me? It keeps defaulting to "No" for Allow HTML also.

[Image: UdKV2GX.jpg]
Reply
#2
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
exactly which version of MyBB you are using ?

have you turned on html for announcements in the settings of Posting
(at configuration section)

perhaps it would be better to use a announcements plugin for it !
Announcement | OUGC Announcement Bars | BAM Announcements Manager

or
use the code directly in one of the templates
may be in header template or showthread template ...
Reply
#3
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
In your screenshot... "allow html no" ???
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#4
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
(03-26-2020, 03:11 AM).m. Wrote: exactly which version of MyBB you are using ?

have you turned on html for announcements in the settings of Posting
(at configuration section)

perhaps it would be better to use a announcements plugin for it !
Announcement | OUGC Announcement Bars | BAM Announcements Manager

or
use the code directly in one of the templates
may be in header template or showthread template ...
Im on 1.8.22
I would like a way to embed the stats in the top of forum page itself if possible but dont know if its possible, but ive seen other forums where its been done but they are not running on mybb.
Ive checked the settings and HTML is turned on for announcements.

I will look at those plugins to see if they help

(03-26-2020, 06:50 AM)Crazycat Wrote: In your screenshot... "allow html no" ???
As I mentioned, it keeps turning back to no on its own
Reply
#5
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
another method to try :
you can try using the code at rules section of the specific forum
[available at forum settings of the forum - through forum management]
Reply
#6
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
(03-26-2020, 09:23 AM)nzoomed Wrote:
(03-26-2020, 06:50 AM)Crazycat Wrote: In your screenshot... "allow html no" ???
As I mentioned, it keeps turning back to no on its own

Sorry, I read too fast Smile
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM
Reply
#7
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
The "preview" seems not working with HTML at AdminCP. But if you just save and post it, it should be displayed correctly at your forum's announcement page.

Wait a minute. Looks like the <script> part will not be parsed as HTML.

And yes, the button for Allow HTML does revert to "No" every time you edit it. But if you tick "Yes" for it, the content for the announcement will be parsed as HTML, except that <base>, <meta>, <script> and <style> HTML entities will be output in their RAW format, they're unsafe as User-inputted content at MyBB's perspective (scope: the parser).

(03-26-2020, 09:23 AM)nzoomed Wrote: (...)
I would like a way to embed the stats in the top of forum page itself if possible but dont know if its possible, but ive seen other forums where its been done but they are not running on mybb.
(...)

Maybe you could try with a plugin that could output a template-based page and get those raw HTML contents in a template.
Worth a try.
Reply
#8
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
Quote:<script> part will not be parsed as HTML.
hmm., in that case, script code has to be used in header / footer part of a template.
Reply
#9
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
(03-26-2020, 12:30 PM).m. Wrote:
Quote:<script> part will not be parsed as HTML.
hmm., in that case, script code has to be used in header / footer part of a template.

Any template would be OK to work with those above-mentioned HTML tags, I guess.

Besides, MyBB has some mechanism to check script's security, though maybe not fully working at some time, which will lead to a security warning/error when editing a template at AdminCP.
Worth a try.
Reply
#10
Solved: 8 Hours, 18 Minutes, 39 Seconds ago
(03-26-2020, 12:30 PM).m. Wrote:
Quote:<script> part will not be parsed as HTML.
hmm., in that case, script code has to be used in header / footer part of a template.
Is it possible to change the template on any particular forum?
Im trying to work out how i change its template and insert the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)