Fonta / TSLink

Servergroup control on TeamSpeak from MyBB forum
GNU General Public License v3.0
4 stars 1 forks source link

Plugin errors whenever I change the status of a user #2

Closed skwerlman closed 10 years ago

skwerlman commented 10 years ago

Whenever a user attempts to update their status or an admin or mod attempts to change a user's status, the plugin causes this error:

Warning [2] mysql_fetch_array() expects parameter 1 to be resource, boolean given - Line: 236 - File: inc/plugins/tslink/tslinkfunctions.php PHP 5.5.3 (Darwin)

File Line Function
[PHP] errorHandler->error
/inc/plugins/tslink/tslinkfunctions.php 236 mysql_fetch_array
/inc/plugins/tslink/tslinkfunctions.php 76 tslink_doupdategroups
/inc/class_plugins.php 139 tslink_admin
/admin/index.php 595 pluginSystem->run_hooks

I'm using version 1.0.2

It's probably worth noting that the user's status does actually change (on the forum only) despite the error.

Fonta commented 10 years ago

Might be an issue on the php version used. Will check when I get home.

Fonta commented 10 years ago

Made some changes to the php yesterday evening, it's now using mysqli in stead of the deprecated mysql. Could you download the latest version and try it? Just updating the tslink.php in /inc/plugins and tslinkfunctions.php in /inc/plugins/tslink should do the trick.

skwerlman commented 10 years ago

It no longer reports an error, but I'm left at a completely blank page... Perhaps I've misconfigured it somehow?

Fonta commented 10 years ago

Could you uncomment the following lines in tslinkfunctions.php:

ini_set('display_errors', 'On');

#error_reporting(E_ALL | E_STRICT);

And try again? This should show the error.

skwerlman commented 10 years ago

It definitely looks like misconfiguration on my end, since it's a 'connection refused' error:

Notice: Undefined variable: givenip in /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink.php on line 312

Notice: Undefined variable: givenip in /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink.php on line 313 Warning [2] Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink.php:312) - Line: 53 - File: admin/index.php PHP 5.5.3 (Darwin)

File Line Function
[PHP] errorHandler->error
/admin/index.php 53 header

Fatal error: Uncaught exception 'TeamSpeak3_Transport_Exception' with message 'Connection refused' in /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/Transport/TCP.php:54 Stack trace: #0 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/Transport/TCP.php(108): TeamSpeak3_Transport_TCP->connect() #1 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/Adapter/ServerQuery.php(76): TeamSpeak3_Transport_TCP->readLine() #2 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/Adapter/Abstract.php(60): TeamSpeak3_Adapter_ServerQuery->syn() #3 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/TeamSpeak3.php(320): TeamSpeak3_Adapter_Abstract->__construct(Array) #4 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/tslinkfunctions.php(263): TeamSpeak3::factory('serverquery://A...') #5 /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/tslinkfunctions.php(76): tslink_doupdategroups('166.147.120.45') #6 /Applications in /Applications/MAMP/htdocs/wp/forums/octo/inc/plugins/tslink/Teamspeak3/Transport/TCP.php on line 54

Fonta commented 10 years ago

Looks like it indeed. Check your TeamSpeak ip-address and port numbers in the config.php. It might also be possible that your webhosting provider doesn't allow outgoing connections to the defined ports. In that case, you'll have to ask them to open the ports (9987 and 10011 standard) in the firewall, or find some ports which are open and make a NAT on the teamspeak server.

Also don't forget to re-comment the 2 lines.

skwerlman commented 10 years ago

I had forgotten to alter the ports. Thanks for the help, its working now!

Fonta commented 10 years ago

Great! Have fun!