Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: delta5 on January 16, 2019, 08:30:28 PM

Title: How To Add A Widget
Post by: delta5 on January 16, 2019, 08:30:28 PM
Hi guys,
I'm trying to start a Discord server for my forum. Discord now has a website widget. You create a server, then click a tab and it generates a code snippet that you paste where you want it. I would like to put it where the smfpacks shout box is, but I have no idea where to paste that code. Any help would be appreciated.
Thanks
Title: Re: How To Add A Widget
Post by: Looking on January 16, 2019, 08:35:23 PM
Normally you would edit your template, but this might be of help: Discord Web Hooks (https://custom.simplemachines.org/mods/index.php?mod=4190).
Title: Re: How To Add A Widget
Post by: delta5 on January 16, 2019, 08:40:24 PM
Thanks! I will check that out. Any idea what that mod does?
Title: Re: How To Add A Widget
Post by: Looking on January 16, 2019, 09:06:11 PM
Check the description to see if it will do what your widget does.
Title: Re: How To Add A Widget
Post by: delta5 on January 16, 2019, 09:27:06 PM
That's what I was wondering. Not much about it there. I'm wondering if it sends texting from discord like an RSS feed. This widget is brand new, so maybe I wont need that mod?
Title: Re: How To Add A Widget
Post by: Looking on January 16, 2019, 09:58:51 PM
The mod was just an option I shared because its already integrated with SMF/Discord and you do not know how to install the one you have.

You will need to learn how to edit your templates to insert your code. That is not something I can show you how to do here.
Title: Re: How To Add A Widget
Post by: delta5 on January 19, 2019, 08:16:39 PM
Ok, i think im ready to add this code. Can anyone tell me which template to edit? I want to put the widget on the front page, where the shoutbox would normally sit.
Title: Re: How To Add A Widget
Post by: Gwenwyfar on January 20, 2019, 04:44:34 AM
By front page you mean the board index?
Title: Re: How To Add A Widget
Post by: delta5 on January 20, 2019, 07:35:41 AM
Yes, just the index.
Title: Re: How To Add A Widget
Post by: Gwenwyfar on January 20, 2019, 07:58:38 AM
The template for that is in Themes/BoardIndex.template.php
Title: Re: How To Add A Widget
Post by: delta5 on January 20, 2019, 12:35:29 PM
Thanks! The widget will show on all themes then?
Title: Re: How To Add A Widget
Post by: Gwenwyfar on January 20, 2019, 01:30:56 PM
If they do not have their own copy of BoardIndex.template.php, they should. It will use the default file in that case. If they have their own file, you have to edit that too.
Title: Re: How To Add A Widget
Post by: delta5 on January 21, 2019, 08:33:01 PM
Interesting, i get a syntax error. I guess I will just pay someone to do it for my since my html skills are below zero lol

Thanks for the help.