Top navigation discord button?

Questions and suggestions welcome!
Schmobius
Master
Master
Posts: 805
Joined: Sun Aug 16, 2015 7:44 am
CMDR: Schmobius
CMDR_Platform: PC-MAC
Contact:

Re: Top navigation discord button?

Postby Schmobius » Mon Aug 08, 2016 4:48 pm

I have to admit I'm not completely following what's going on in that API link. Seems like that would have to be a very from-scratch implementation.
Image

User avatar
AJH
Competent
Competent
Posts: 126
Joined: Wed Jun 08, 2016 8:01 pm
CMDR: AJH
CMDR_Platform: PC-MAC
Contact:

Re: Top navigation discord button?

Postby AJH » Mon Aug 08, 2016 5:15 pm

Yes, it would require some plugin or extension development depending on the specific phpBB version in use. It isn't particularly hard development, but still probably an hour or two to test it and such. Alternately, it can be done as a simple php page that hooks the forum for membership data. That's about a 10 minute hack to do once you have the Discord API itself setup. I have sample code that I use for TS integrations using both approaches (Discord would be extremely similar) if someone wants to try tackling it, or if there is interest, I can write it myself at some point in the future, I'm just not sure when I'll have time.

Something like this in a php file will give the page access to PHPBB's user management and verify a group membership in 3.0 versions. 3.1 changed it a little bit if we have updated to 3.1 yet.

Code: Select all

define('IN_PHPBB', true);
$phpbb_root_path = '../../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . '/includes/functions_user.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if (group_memberships(array(11),$user->data['user_id'],true))

Schmobius
Master
Master
Posts: 805
Joined: Sun Aug 16, 2015 7:44 am
CMDR: Schmobius
CMDR_Platform: PC-MAC
Contact:

Re: Top navigation discord button?

Postby Schmobius » Mon Aug 08, 2016 7:08 pm

Ok, and then you just have to make it retrieve the invite link via the API stuff in the link above when that code passes, else maybe display a message telling you to sign up? That makes sense.
Image

User avatar
AJH
Competent
Competent
Posts: 126
Joined: Wed Jun 08, 2016 8:01 pm
CMDR: AJH
CMDR_Platform: PC-MAC
Contact:

Re: Top navigation discord button?

Postby AJH » Mon Aug 08, 2016 7:18 pm

Yeah, a slightly more ideal integration is to do more behind the scenes in terms of linking a permanent token to a user and allowing them to reuse it, but that involves modifications to the phpBB user table itself and requires a full blown addon or extension to do "right". The hack just dumbly makes short lived invite codes whenever the script is run and provides a link that will consume the code. You may make a bunch that do nothing, but since you initialize them with short TTLs, they just fall off after a little bit.

The hackier version doesn't support actual true interlink (you don't know which users in discord are which users in the forum, so you can't do forum based removal), but it gets something basic up and running with minimal effort.

Schmobius
Master
Master
Posts: 805
Joined: Sun Aug 16, 2015 7:44 am
CMDR: Schmobius
CMDR_Platform: PC-MAC
Contact:

Re: Top navigation discord button?

Postby Schmobius » Mon Aug 08, 2016 8:59 pm

I think having someway to tie forum users to discord users would be great, but may not be worth the effort. Just wondering if that would end up storing the discord username in the forum user table, or the forum username in the discord user list, or both? I'm sure Wolf would agree with me that sounds neat, but may be something more for the long-term list, if at all. (Please correct me if I'm wrong.)

The quick version is hardly foolproof, but it would slow down trolls, possibly enough for them to lose interest, even if it wouldn't totally stop them. That would probably be good enough. I'm not opposed to a link going up without any such check at all, but that might be worth it if it's easy enough to put in on the forum end of things.
Image


Return to “Forum Support and Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests

i