Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: vbgamer45 on February 18, 2021, 01:19:30 PM

Title: Discord Who's Online
Post by: vbgamer45 on February 18, 2021, 01:19:30 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4281)

Discord Who's Online
By: vbgamer45

For: SMF 2.1.x, SMF 2.0.x

Adds who is online for a discord channel below who's online a forum.
Requires the Server Widget to be enabled under the Widget section for the channel settings.
Also requires cURL to be installed with PHP


Based on the idea from Arantor/StoryBB.


https://www.smfhacks.com
Title: Re: Discord Who's Online
Post by: Aleksi "Lex" Kilpinen on February 20, 2021, 02:28:58 AM
Cool. Seems to me though that the "Show discord avatars.." setting does nothing. Either way it's set, the avatars are shown.
Title: Re: Discord Who's Online
Post by: vbgamer45 on February 20, 2021, 02:22:30 PM
Fixed

1.1
!Fixed setting for showing avatars not working.
!Clear cache when saving setings
Title: Re: Discord Who's Online
Post by: Aleksi "Lex" Kilpinen on February 20, 2021, 02:26:19 PM
Seems to work now, thanks! :)
Title: Re: Discord Who's Online
Post by: vbgamer45 on February 20, 2021, 02:31:13 PM
Glad to help
Title: Re: Discord Who's Online
Post by: Jelle Mees on March 18, 2021, 04:06:00 PM
Can you make it so that the usernames are aligned in the center of the avatar and not at the bottem. Like this:



It's an easy fix. Simply add vertical-align:middle to the img style.

I also added padding-right:5px . Looks much nicer. Try it ;)
Title: Re: Discord Who's Online
Post by: vbgamer45 on March 18, 2021, 04:32:42 PM
Change made the vertical-align middle thanks.
Title: Re: Discord Who's Online
Post by: efk on March 18, 2021, 07:56:43 PM
Can it be displayed inside block on portal and without avatar, as a list of 10 names for example and with scroll button to see who else is active?
Title: Re: Discord Who's Online
Post by: vbgamer45 on March 18, 2021, 08:08:02 PM
Could be possible include discordonline.php
THen call
discordonline_boardlayout();
You can then customize your own
template_ic_block_discord_whos_online() for the layout
Title: Re: Discord Who's Online
Post by: efk on March 18, 2021, 11:50:04 PM
Quote from: vbgamer45 on March 18, 2021, 08:08:02 PM
Could be possible include discordonline.php
THen call
discordonline_boardlayout();
You can then customize your own
template_ic_block_discord_whos_online() for the layout
Thanks this can be useful for everyone.
Title: Re: Discord Who's Online
Post by: StarredSkies on July 06, 2021, 06:27:59 PM
This is a really cool addition! Might have to try it out.
Title: Re: Discord Who's Online
Post by: revgreed on May 22, 2022, 12:19:58 AM
Hi,

I just installed this mod on the following:

SMF 2.1.2
Default theme

Under the "Info Center" where the "Discord Who's Online" and the "Visit Discord Server" wording is displayed - it's being displayed as such:

Discord Who's Online Visit Discord Server

And I was wondering if I could change it to where there shows an obvious separation between the two.  Such as a hyphen to become:

Discord Who's Online - Visit Discord Server

Where would I go to make that change?

I attached an image of what I'm referring to:



https://ibb.co/m6zcgW3
Title: Re: Discord Who's Online
Post by: revgreed on May 22, 2022, 07:06:50 PM
Quote from: revgreed on May 22, 2022, 12:19:58 AMHi,

I just installed this mod on the following:

SMF 2.1.2
Default theme

Under the "Info Center" where the "Discord Who's Online" and the "Visit Discord Server" wording is displayed - it's being displayed as such:

Discord Who's Online Visit Discord Server

And I was wondering if I could change it to where there shows an obvious separation between the two.  Such as a hyphen to become:

Discord Who's Online - Visit Discord Server

Where would I go to make that change?

I attached an image of what I'm referring to:



https://ibb.co/m6zcgW3

I believe I figured it out.  Here's what I did.

I went to "..Themes/default/languages/discordonline.english.php"

And find:

$txt['discord_online_title'] = 'Discord Who\'s Online';
Change to:

$txt['discord_online_title'] = 'Discord Who\'s Online - ';
Although it worked perfectly - I'm just not sure it's the correct way.
Title: Re: Discord Who's Online
Post by: vbgamer45 on May 22, 2022, 11:03:29 PM
That is the correct way good job!
Title: Re: Discord Who's Online
Post by: aegersz on July 08, 2023, 03:21:15 PM
Discord Who's Online shows 0 users

I think everything is OK (I am running on CentOS 6.10) and have checked the php curl module is active and phpinfo.php looks good as far as cURL is concerned.

I added the Server ID into the config but left Discord Server Link empty. Is that OK ?

Does my Discord user name have to be the same as my SMF user name ?
Title: Re: Discord Who's Online
Post by: vbgamer45 on July 08, 2023, 03:24:53 PM
The server link is not required.
Title: Re: Discord Who's Online
Post by: aegersz on July 08, 2023, 03:28:59 PM
Thanks. Why am I seeing 0 users ? Is it because of these errors ?:

https://forum.drugs-and-users.org/index.php?action=forum
8: Undefined index: discord_whos_online
File: /var/www/html/Sources/discordonline.php
Line: 152

https://forum.drugs-and-users.org/index.php?action=forum
Discord Widget not configured

EDIT: I fixed it - the widget wasn't enabled
Title: Re: Discord Who's Online
Post by: vbgamer45 on July 08, 2023, 03:32:33 PM
Check that you followed the steps and allow widgets on discord

If you can visit
https://discord.com/api/guilds/YOURSERVERIDGOESHERE!!!!!!!/widget.json
Title: Re: Discord Who's Online
Post by: aegersz on July 15, 2023, 01:54:35 PM
 I fixed it - the widget wasn't enabled
Title: Re: Discord Who's Online
Post by: vbgamer45 on July 15, 2023, 03:19:56 PM
Glad you figured
Title: Re: Discord Who's Online
Post by: Senkusha on August 31, 2023, 02:23:57 PM
Is there a way I can filter out any Bots from my member list.  Also, is there a way that maybe members can link their Discord member name to their forum member name?
Title: Re: Discord Who's Online
Post by: vbgamer45 on August 31, 2023, 02:38:14 PM
No option for either currently
Title: Re: Discord Who's Online
Post by: jovanddd on September 01, 2023, 04:58:39 PM
Nice, thanks