News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Insert a script before <body>

Started by Raffoz, March 21, 2018, 08:08:34 AM

Previous topic - Next topic

Raffoz

I should insert (of frontapp.com) before the body tag.

What is the file i need to modify?
I mean:
- file of the homepage? (i use simpleportal, so i think the file is of simpleportal)
- file of the forum page?
- file of other pages?
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

vbgamer45

Your themes index.template.php file under the themes folder.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Raffoz

MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Raffoz

#3
The script gives always error:
Parse error: syntax error, unexpected '<' in /Themes/default/index.template.php on line 358

This is the code:
<script>
  window.FCSP = '...';
</script>
<script src="https://chat-assets.frontapp.com/v1/chat.bundle.js"></script>


I changed the private code with ...




The code should be inserted:
Copy this code snippet and insert it into your page right before the /body tag
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Antes


Raffoz

Tks, with " it works.

Other question:
- is there a way to let the script appear only in home page (i use simpleportal) and in the root page of forum?
- is there a way to let the script appear in some of the pages? (i use simpleportal)
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

vbgamer45

For the 1st you can put in the simpleportal block that only shows on the homepage
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Raffoz

Quote from: vbgamer45 on March 21, 2018, 11:09:32 AM
For the 1st you can put in the simpleportal block that only shows on the homepage

Clever! :)
I just put it in a block which is in that page and it works in everypage where that block is :)




Is there a normal way too?
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

vbgamer45

Yup that is the easiest way to do it.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: