Thanks for this. It's very simple and does nearly everything I'd like. I tried to finish your testform, but haven't been successful. I don't know html well, and php even less. But I was hoping to enable the option to allow registered users to login with their info. It looks like the only thing lacking (apart from uncommenting the LOGINNAME & PASSWORD areas) is to complete this url:
But I don't know how to write the php code to generate that based on the information inputed into the forms above. I thought you might not have finished it because you were worried about sending empty data in the LOGINNAME & PASSWORD fields, should people choose to enter a nickname only. So if it helps I tried entering the following url:
And it seems to login just fine as an anonymous user with the nickname specified. So I think the one complete url will do fine for both registered & anon logins.
Also, if it helps, I modified the entire testform to the following code, which I think appears more clean, concise & self-explanatory:
Lastly, on the subject of appearance, I can't seem to find the location of the "quotation marks" that appear around both the channel & nicknames of connected users. I would like to remove them if I can.
You can see the work in progress on a soon-to-be-launched (and moved) site here: http://clan-ai.org:8080 (after move, site will be just clan-ai.org).
Thank you for this much desired block & any future help you can offer.
Raver Private
Joined: Oct 03, 2004
Posts: 36
Posted:
Sat Nov 20, 2004 1:26 am
How do i get it right that you can login as a registred user? i dont get the message above
I tried to finish your testform, but haven't been successful.
I'm still hoping jaj (or anyone else who knows php, for that matter) will fill in the blank described above so that we can allow registered users to login from the site. I wasn't describing how to do it myself.
jaj Corporal
Joined: Feb 25, 2004
Posts: 56
Posted:
Sat Nov 20, 2004 8:17 pm
I have updated the TS script....you would just need to input your values...Just edit (at the begining) your server address, query port, UDP port and (at the bottom) "img src=" (the location of your button image)...also this script has the quotes removed... and you should have no problems with registerd user login now....and now you can just input the url of an image that you would to use as a button... if you need any help or would like a button image just im me or make a new post....
Code:
<?php
// **** settings - to be edited before first use ****
$serverAddress = "xx.xxx.xx.xxx"; // can be ip address or url
$serverQueryPort = 51234; // default 51234, must be accessible and usable. check server.ini
$serverUDPPort = 8767; // default 8767
// **** end of settings ****
if (eregi("block-Teamspeak.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $cookie;
getusrinfo($user);
cookiedecode($user);
$username = $cookie[1];
// opens a connection to the teamspeak server
function getSocket($host, $port, $errno, $errstr, $timeout) {
global $errno, $errstr;
@$socket = fsockopen($host, $port, $errno, $errstr, $timeout);
if($socket and fread($socket, 4) == "[TS]") {
fgets($socket, 128);
return $socket;
}// end if
return false;
}// end function getSocket(...)
// sends a query to the teamspeak server
function sendQuery($socket, $query) {
fputs($socket, $query."\n");
}
// determine number of players in channel
$playercount = 0;
foreach($playerList as $playerInfo) {
if($playerInfo[channelid] == $channelid) $playercount++;
}
You are awesome! There's really nothing more to say--awesome.
(PS How about a simple, centered chat block using the integrated site users now? j/k)
-Javier- Nuke Cadet
Joined: Nov 17, 2004
Posts: 5
Posted:
Sat Nov 20, 2004 10:16 pm
Great!
Just one thing: The names with a space between...
Thanks,
Javier--
jaj Corporal
Joined: Feb 25, 2004
Posts: 56
Posted:
Sun Nov 21, 2004 5:19 am
I have updated the TS script....you would just need to input your values...Just edit (at the begining) your server address, query port, UDP port and (at the bottom) "img src=" (the location of your button image)...also this script has the quotes removed and will show names with spaces...... and you should have no problems with registerd user login now....and now you can just input the url of an image that you would to use as a button... if you need any help or would like a button image just im me or make a new post....
***************************************************
Just save the other TS block in case there is any issues with this new one...it was just done and has not been field tested....should be fine ..but heh who knows... ***************************************************
Code:
<?php
// **** settings - to be edited before first use ****
$serverAddress = "xx.xxx.xx.xxx"; // can be ip address or url
$serverQueryPort = 51234; // default 51234, must be accessible and usable. check server.ini
$serverUDPPort = 8767; // default 8767
// **** end of settings ****
if (eregi("block-Teamspeak.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $cookie;
getusrinfo($user);
cookiedecode($user);
$username = $cookie[1];
// opens a connection to the teamspeak server
function getSocket($host, $port, $errno, $errstr, $timeout) {
global $errno, $errstr;
@$socket = fsockopen($host, $port, $errno, $errstr, $timeout);
if($socket and fread($socket, 4) == "[TS]") {
fgets($socket, 128);
return $socket;
}// end if
return false;
}// end function getSocket(...)
// sends a query to the teamspeak server
function sendQuery($socket, $query) {
fputs($socket, $query."\n");
}
// determine number of players in channel
$playercount = 0;
foreach($playerList as $playerInfo) {
if($playerInfo[channelid] == $channelid) $playercount++;
}
Fantastic!!
Thank you very much!
It's work perfectly.
LordSmack Nuke Cadet
Joined: Nov 17, 2003
Posts: 6
Posted:
Fri Dec 17, 2004 11:55 am
I have run into a problem with my block if someone can help me I would appreciate it. When you select a channel from the dropdown menu you get a pop up window that says
Quote:
Unable to select database
I think everything has been installed correctly.
our site can be viewed here www.memphisgibfest.com
jaj Corporal
Joined: Feb 25, 2004
Posts: 56
Posted:
Sat Dec 18, 2004 4:10 pm
Post the script for the block...so that it can be looked at...
ridersofthewind.com Nuke Cadet
Joined: Dec 19, 2004
Posts: 4
Posted:
Tue Dec 21, 2004 11:26 am
saved the script in my blocks section on my nuke site, and it does not appear under blocks administration for activation
jaj Corporal
Joined: Feb 25, 2004
Posts: 56
Posted:
Tue Dec 21, 2004 3:15 pm
you have to name the script....
block-whatever and save it as a php file and put in your blocks folder...
then look for it in your administartion page under blocks then go down the page some in "add new block" and you find it under file name
CaptDD Corporal
Joined: Jan 02, 2005
Posts: 51
Location: Manistee, MI, USA
Posted:
Sun Jan 02, 2005 6:54 am
jaj,
I hope you don't mind but I have tweaked your code listed above. I gave you credit in the code as the creator. The tweak allows for registered users to enter thier Teamspeak server login information and includes a submit button. It was generated using your codes listed here. My new code is as follows.
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/************************************************************************/
/* block-Teamspeak3.php */
/* =========================== */
/* */
/* Copyright (c) 2004 by jaj (jaj@nukecops.com) */
/* http://nukecops.com */
/************************************************************************/
/* Cosmetic changes by CaptDD at webmaster@rapidfireclan.com */
/* http://rapidfireclan.com */
/************************************************************************/
// **** settings - to be edited before first use ****
$serverAddress = "xxx.xxx.xxx.xxx"; // can be ip address or url
$serverQueryPort = 51234; // default 51234, must be accessible and usable. check server.ini
$serverUDPPort = 8767; // default 8767
// **** end of settings ****
if (eregi("block-Teamspeak3.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $cookie;
getusrinfo($user);
cookiedecode($user);
$username = $cookie[1];
// opens a connection to the teamspeak server
function getSocket($host, $port, $errno, $errstr, $timeout) {
global $errno, $errstr;
@$socket = fsockopen($host, $port, $errno, $errstr, $timeout);
if($socket and fread($socket, 4) == "[TS]") {
fgets($socket, 128);
return $socket;
}// end if
return false;
}// end function getSocket(...)
// sends a query to the teamspeak server
function sendQuery($socket, $query) {
fputs($socket, $query."\n");
}
// determine number of players in channel
$playercount = 0;
foreach($playerList as $playerInfo) {
if($playerInfo[channelid] == $channelid) $playercount++;
}
I would like to thank jaj and CaptDD for their excellent posts. My other webadmin, Aleister, edited the code to fit inside of a narrower block. The alignment is set to the left, and there are no images which offers a much cleaner look IMHO. He also set the max number of characters to 15, but you can modify the number, as well as the colors, to fit you needs. You are welcome to see it in action on our website http://www.dcw