Discord Module
Select messages from # through # Forum FAQ
[/[Print]\]

HeadShot Extreme -> Nuke Blocks / Modules Support

#1: No icon Discord Module Author: scooterdud PostPosted: Mon Sep 25, 2023 12:32 am
    —
I use the the latest version of Extreme: 2.0.9f , downloaded the Discord module, can not make it work......

#2: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 25, 2023 9:23 am
    —
— scooterdud wrote
I use the the latest version of Extreme: 2.0.9f , downloaded the Discord module, can not make it work......


Can you give me a bit more context to go with this?
Were you able to get it to install the module?
Did you enter in your Discord Json URL?
Any errors showing up?

I just installed this module on a friends site a few weeks ago with no issues.

Ignore the "Admins to Display", that is going to be removed since Discord removed that ability from the API, unless I change it to usernames. I will have to look at the API again to see if anything has been added.

#3: No icon Re: Discord Module Author: scooterdud PostPosted: Mon Sep 25, 2023 10:08 am
    —
Is this theright one.....
Please login to see this link
Get registered or Log in


And here is a screenshot of the Block:
Please login to see this link
Get registered or Log in

#4: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 25, 2023 10:43 am
    —
Yes, that JSON api URL is correct. When I first looked at it, it was giving an error as it was not open for use, but, now I see content so is the block working?

#5: No icon Re: Discord Module Author: scooterdud PostPosted: Mon Sep 25, 2023 10:52 am
    —
Take a look at this screenshot now..... I think i get it to work ????
Please login to see this link
Get registered or Log in

#6: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 25, 2023 11:16 am
    —
Yeup, that looks correct. When you add more channels and people are in the channels, (voice channels that is), then you will see their name in there. Just note, there can be a delay from when someone is in a channel and when you see it. Same with creating new channels do to the system caching and only updating every 30 seconds or so, plus, discords api has a min delay.

#7: No icon Re: Discord Module Author: scooterdud PostPosted: Mon Sep 25, 2023 11:35 am
    —
Ok, i get it.....Is there only voice channel to use or can you use Text channels

#8: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 25, 2023 12:39 pm
    —
It will only display voice channels since that is the only type of channels you can go into.

#9: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 25, 2023 5:32 pm
    —
I just pushed an update for the module where the admin section, if someone wants to use it, can by using the username. I also did some other small updates to it.
To update, just re-download the files and upload overwriting what you have there and that is it.
Please login to see this link
Get registered or Log in

#10: No icon Re: Discord Module Author: scooterdud PostPosted: Mon Sep 25, 2023 9:12 pm
    —
Thank you so much, downloaded and updated.....

#11: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Tue Sep 26, 2023 10:03 pm
    —
n/p

#12: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Wed Sep 27, 2023 6:28 pm
    —
Greetings, I have the same problem as original post with block looking like :
Please login to see this link
Get registered or Log in
also. What ports other than 80 and 443 needs to be open?


+ edited, never mind. Lonestar told me that it uses a curl call.

#13: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 29, 2023 12:37 pm
    —
yeup, that it does use a curl, so no ports would need to be opened.

#14: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Fri Sep 29, 2023 10:58 pm
    —
Lonestar's discord module did work, but I am hoping to use your version because I personally like the layout of yours better. (no offense to Lonestar!) And I would really like to figure out why the latest version is not displaying for me. On my live site (evo-E) I am using your original release, and it is fine. I am cloning my site using evo F at a test site and trying your latest version. I do have java and curl installed and am using php7.4 on Ubuntu 20.04. Any thoughts on what I might be missing or can learn to aid in figuring out what I am doing wrong?   Thanks for your time and efforts coRpSE and sorry to bother you with this post.

$php -version
PHP 7.4.3-4ubuntu2.19 (cli) (built: Jun 27 2023 15:49:59) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
   with Zend OPcache v7.4.3-4ubuntu2.19, Copyright (c), by Zend

$java -version
openjdk version "11.0.20.1" 2023-08-24
OpenJDK Runtime Environment (build 11.0.20.1+1-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.20.1+1-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

$curl -V
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
Last edited by daveran27703 on Sat Sep 30, 2023 2:53 pm; edited 1 time in total

#15: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 30, 2023 8:39 am
    —
daveran27703 Do any other cURL's work on your site?

I see that you have the cURL extensions installed, but have you done a phpinfo(); to verify that it is enabled?

PHP:  [ Select all ]

<?php
phpinfo
();
?>


You can run a test script. I put one together that worked fine for me trying to make sure it worked on my local:

PHP:  [ Select all ]

<?php

// URL to test (something like your Discords widget .json URL)
$url 'PUT YOUR URL HERE';

// Initialize cURL session
$ch curl_init($url);

// Set cURL options
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
curl_setopt($chCURLOPT_SSL_VERIFYPEERtrue); // Verify SSL certificate
curl_setopt($chCURLOPT_SSL_VERIFYHOST2);    // Verify host name in certificate

// Execute cURL request
$response curl_exec($ch);

// Let's check for cURL errors
if (curl_errno($ch)) {
 
   echo "cURL Error: " curl_error($ch);
} else {
 
   // Let's check for SSL certificate errors
 
   $sslInfo curl_getinfo($chCURLINFO_SSL_VERIFYRESULT);
 
   if ($sslInfo === 0) {
 
       echo "SSL Certificate OK <br />";
 
   } else {
 
       echo "SSL Certificate Error (Code: " $sslInfo ") <br />";
 
   }

 
   // Let's check HTTP status code (200 OK)
 
   $httpCode curl_getinfo($chCURLINFO_HTTP_CODE);
 
   if ($httpCode === 200) {
 
       echo "HTTP Status Code: 200 OK <br />";
 
   } else {
 
       echo "HTTP Status Code: " $httpCode "<br />";
 
   }
}

// Close cURL session
curl_close($ch);

echo 
'<br /><br />' $response//Show the contents
?>

 
Just put that code into a blank PHP file, put in your Discord's widget URL, then place that file into the root of your site and then point your browser towards it.
If you see:

SSL Certificate OK
HTTP Status Code: 200 OK

At the top of the page with a bunch of info under it, then that would eliminate the SSL verify as an issue. That is an issue I had with my local WAMP server not being able to read SSL certs.

Here is the post I made about it:
Please login to see this link
Get registered or Log in


You can also attempt to try that line of code I put in that post to see if that works. Thought that was for steam, it will be the same for the Discord module except that my Discord module uses the cURL for Evo, and that is found in the file public_html/includes/functions_evo_custom.php.

Just do a search for cache_json_data and in that function, you should see what I mentioned in that post.

I am just trying to do a process of elimination to hopefully solve this.

#16: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Sat Sep 30, 2023 10:32 am
    —
I PM'ed you with link to your test script. I believe it returned the expected response.  I am not on a localhost, but on a VPS from Ionos. I don't think I have any SSL or DNS faults. (Pm to you in my outbox got edited for more info depending on when / if viewed). I am scared it will be something my fault, which statistical odds suggest is a high probability  augen rollen

#17: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 30, 2023 11:32 am
    —
Yup, I replied to your PM with another suggestion, basically, making sure that permissions are right. The way my system works is, it will first check to see if the cached file exist and is newer than X time. If the file doesn't exist, or is older X time, then it will make the cURL call and put the info into a cached file.

Once it puts the info into the cached file, the system then reads off of that cached file. By doing it this way, it save on it making a cURL on every page reload, which will in turn save your site and Discord's from getting too many API calls.

Now, we have determined that your site is allowing the API calls and is able to display the information, so that leads me to think that it is not either allowing the creation of the cache file, which would be the folder permission that I put in that PM, or, the file permissions, which would block the ability to write the info from the curl into that file.

#18: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Sat Sep 30, 2023 12:52 pm
    —
yes, it is a permissions issue! I temp made the discord/cache a 777 -r and it works.

#19: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 30, 2023 1:42 pm
    —
Yeah, just set it to 755 instead of 777. For security reasons, you shouldn't have that with that permission.
But glad to hear that we were able to get this solved and its working.

#20: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Sat Sep 30, 2023 2:23 pm
    —
thanks coRpSE  actually I had it at 745, but I will make it 755 like you said. Your explanation of how it works was very helpful along with your direct suggestions of course.  Hopefully others will benefit from todays efforts also.

#21: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 30, 2023 3:13 pm
    —
n/p. I find looking at the order of what something does usually can turn up what the issue is, or at least get you in the general ballpark. This was a new one for me and I learned something from it, which will benefit others in the future if they have an issue similar to this one.

#22: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Sun Oct 22, 2023 4:00 pm
    —
coRpSE  Hey coRpSE, hope all is well. All is working fine on the site we were focused on running evo-f and to jog your memory, the last detail you focused on was regarding sizing/ centering of the discord content in the block (that might not be the best choice of words, but hopefully you remember what I am talking about). The (mysite).info is perfect, as you left it, with v1.1. I thought I would upgrade my live site (mysite.org) with the v1.1 over v1 and it looks a little different. My live site is still at evo-e and on that site, I have a horizontal scroll bar below the discord block content and I was wondering if you had a suggestion on how to make it look like what is on my evo-f clone site. I don't know why the 2 sites would display it differently (probably my fault). Suggestions would be greatly appreciated. The data in both admin sections are the same with the exception of admins listed in the 2nd field on the live site. Thanks in advance whenever you have a chance to read this. Nothing urgent. It seems the block is working fine, just too wide and with horz. scroll bar at far left, the discord server image crops in the [join Server] button.

+edited+  If this was not intended for evo -e, I can simply put v1 back

#23: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Oct 23, 2023 10:22 am
    —
daveran27703

Technically, it should work. Is it the side block or center block?
Is it the same exact theme on both sites?

I will take a look at it tonight on my local and my site here and see if I missed something. It is possible I missed something.

#24: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Mon Oct 23, 2023 10:58 am
    —
Yes, I believe the main difference is version -e vs version -f, definitely same theme. Obviously, something is different. I don't want to supply misinformation accidently.  The live site stuck at version e because of the database and has been a very long running site that has had many edits over the years/ decades. Where the version F site (.info) was a fresh build starting at version 2.09f.

Center block


+edited+
again, not worthy of investing much time in this, as I can just put v1 back. v1 had a tiny graphic imperfection, but was hardly noticeable.  This just seemed weird, and didn't know if there was something I could tweak in the discord code to make it fit. Live site url is in my profile here.

Another thought of differences is the live site has collapsible blocks, no idea if this is relevant.

#25: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Tue Oct 24, 2023 7:05 am
    —
Can you send me a link to see it? I can probably inspect the element to come up with the change that would be needed.

#26: No icon Re: Discord Module Author: daveran27703Location: North Carolina USA PostPosted: Wed Oct 25, 2023 7:28 pm
    —
If anyone else is reading this thread, it turns out there was nothing wrong with the discord block v1.1.
My site, that was at version 1.0 of the discord block, when I uploaded the v1.1 files it displayed cropped the far right side of the discord block content. In Edge (my default browser) clearing the browser's cache made the block display correctly. This was suggested by coRpSE via PM and I thought I would just update this tread in case anyone else goes down this road and is reading this thread. Thanks coRpSE for your help again sir!

#27: No icon Re: Discord Module Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Wed Oct 25, 2023 8:51 pm
    —
n/p, any time.  big grin



HeadShot Extreme -> Nuke Blocks / Modules Support


output generated using printer-friendly topic mod. All times are GMT - 7 Hours

Page 1 of 1