TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 561
  • Total: 561

Teamspeak block!

Started by -Prismatic-, October 14, 2005, 11:20:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xadio

Ehh.. you copied over the text... :P Let me find the code that I modified and post the directions here... :), for now go and undo what you did...

xadio

Quote from: IchBinâââ,¬Å¾Ã,¢ on February 23, 2006, 06:16:26 AM
I took a look at those files some time ago xadio and I totally agree. Commenting and naming things properly sure makes it easier to figure out what is happening.

Glad someone agrees with me! :D

For those who have modified their ts_config.inc.php, directions follow:

Open ts_config.inc.php
Find:
$_1C=count($this->g_channels);
Replace with:

  //xadio hack
  $_1C = isset($this->g_channels)?count($this->g_channels):0;


Find:

                        while($_2B=fgets($_27, 4096))
{
$_2B=explode(" ", $_2B);
$_2C=trim($_2B[0]);
$_2D=trim($_2B[1]);
$_2E=trim($_2B[2]);
$_2F=trim($_2B[3]);
$_30=trim($_2B[4]);
$_31=trim("$_2B[5]");
$_31=$this->_9($_31);
$_32=trim($_2B[6]);
$_33=trim($_2B[7]);
$_34=trim("$_2B[8]");
$_34=$this->_9($_34);
$_35=$_2C;
if ($_35 > 0)
{
$_10[$_35]=array("channelid" => $_35,"codec" => $_2D,"parent" => $_2E,"order" => $_2F,"maxplayers" => $_30,"channelname" => $_31,"attribute" => $this->_F($_32),"isdefault" => 0,"topic" => $_34);
}
}
}
fclose($_27);
}
usort($_10, array ($this, _B));
return $_10;
}

Replace with:

            while($_2B=fgets($_27, 4096)) {
              //xadio hack
        if(strlen($_2B) <= 6) {
        }
        else {
        $_2B=explode(" ", $_2B);
        $_2C=trim($_2B[0]);
        $_2D=trim($_2B[1]);
        $_2E=trim($_2B[2]);
        $_2F=trim($_2B[3]);
        $_30=trim($_2B[4]);
        $_31=trim($_2B[5]);
        $_31=$this->_9($_31);
        $_32=trim($_2B[6]);
        $_33=trim($_2B[7]);
        $_34=trim($_2B[8]);
        $_34=$this->_9($_34);
        $_35=$_2C;
          if ($_35 > 0) {
          $_10[$_35]=array("channelid" => $_35,"codec" => $_2D,"parent" => $_2E,"order" => $_2F,"maxplayers" => $_30,"channelname" => $_31,"attribute" => $this->_F($_32),"isdefault" => 0,"topic" => $_34);
          }
          }
        }
    }
          fclose($_27);
        }
        //xadio hack
      usort($_10, array ($this, "_B"));
      return $_10;
    }


Find:

while($_38=fgets($_27, 4096))
{
$_38=explode(" ", $_38);
$_39=trim($_38[0]);
$_3A=trim($_38[1]);
$_3B=trim($_38[2]);
$_3C=trim($_38[3]);
$_3D=trim($_38[4]);
$_3E=trim($_38[5]);
$_3F=trim($_38[6]);
$_40=trim($_38[7]);
$_41=trim($_38[8]);
$_42=trim($_38[9]);
$_43=trim($_38[10]);
$_44=trim($_38[11]);
$_45=trim($_38[12]);
$_46=trim($_38[13]);
$_47=trim("$_38[14]");
$_47=$this->_9($_47);
$_48=trim("$_38[15]");
$_48=$this->_9($_48);
$_49=$_39;
$_F[$_49]=array("playerid" => $_49,"channelid" => $_3A,"receivedpackets" => $_3D,"receivedbytes" => $_3E,"sentpackets" => $_3B,"sentbytes" => $_3C,"paketlost" => $_3F / 100,"pingtime" => $_40,"totaltime" => $this->_11($_41),"idletime" => $this->_11($_42),"privileg" => $_43,"userstatus" => $_44,"attribute" => $this->_10($_45),"attribute_2" => $_45,"flags" => $this->_E($_44,$_43),"s" => $_46,"playername" => $_47);
}
fclose($_27);
}
usort($_F, array ($this, _D));
return $_F;
}

Replace with:

while($_38=fgets($_27, 4096))
{
  //xadio hack
  if(strlen($_38) <= 6) {
  }
  else {
  $_38=explode(" ", $_38);
  $_39=trim($_38[0]);
  $_3A=trim($_38[1]);
  $_3B=trim($_38[2]);
  $_3C=trim($_38[3]);
  $_3D=trim($_38[4]);
  $_3E=trim($_38[5]);
  $_3F=trim($_38[6]);
  $_40=trim($_38[7]);
  $_41=trim($_38[8]);
  $_42=trim($_38[9]);
  $_43=trim($_38[10]);
  $_44=trim($_38[11]);
  $_45=trim($_38[12]);
  $_46=trim($_38[13]);
  $_47=trim($_38[14]);
  $_47=$this->_9($_47);
  $_48=trim($_38[15]);
  $_48=$this->_9($_48);
  $_49=$_39;
  $_F[$_49]=array("playerid" => $_49,"channelid" => $_3A,"receivedpackets" => $_3D,"receivedbytes" => $_3E,"sentpackets" => $_3B,"sentbytes" => $_3C,"paketlost" => $_3F / 100,"pingtime" => $_40,"totaltime" => $this->_11($_41),"idletime" => $this->_11($_42),"privileg" => $_43,"userstatus" => $_44,"attribute" => $this->_10($_45),"attribute_2" => $_45,"flags" => $this->_E($_44,$_43),"s" => $_46,"playername" => $_47);
  }
}
fclose($_27);
}
  //xadio hack
usort($_F, array($this,"_D"));
return $_F;
}


I had to go back and find where I modified the file, so if you get any errors let me know cause I might (not likely) have missed something.

core

Hi m8,

Just did above edite and thay work!

but... I still have a few errors, I will post them here and add my ts_config.inc.php


8: Undefined variable: g_userName
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 44

8: Undefined variable: _4C
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 342

8: Undefined variable: g_userName
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 44

8: Undefined variable: _50
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 395


[attachment deleted by admin]

core

above  ts_config.inc.php allow users to click the channel name and connect with their forum name,
so if you want to use this file be aware that this script STILL produces errors in the log file!!!

xadio

#124
Quote from: core on February 24, 2006, 07:42:35 PM
above  ts_config.inc.php allow users to click the channel name and connect with their forum name,
so if you want to use this file be aware that this script STILL produces errors in the log file!!!

I may not get the same errors, but I am going to look at the code and try to fix these.  I'll send you copies via PM untill we get a working copy to post.

Edit: Realized that can't have attachments in PM

The following attachment may or may not work... intended for CORE only.
FIXED:
Basically the coder did not declare his variables so in some situations the if case is false (which contains the declaration) so the function is trying to return a memory location that doesn't exist.
Also remember when using data members in a class you must declare it in the class definition.

class ts_viewer {
//... class variable declaraitons
var $g_userName="";

//... class methods
}


//ATTACHMENT REMOVED, USE
http://www.tinyportal.net/smf/index.php?topic=1021.msg25718#msg25718

core

#125
looks like we are getting somewhere, the file did work but with following errors:


8: Uninitialized string offset: 9
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 402

8: Undefined variable: g_userName
File: /home/resellers/841289/841289/corenation.com/www/smf/teamspeak/ts_config.inc.php
Line: 46


not really sure what you mean with those declarations...


xadio

#126
Quote from: core on February 26, 2006, 12:13:55 PM
not really sure what you mean with those declarations...

Don't worry about it, I am just loging what I am doing incase anyone is curious.
All the errors should be fixed now.

//Edit use file found at:
http://www.tinyportal.net/smf/index.php?topic=1021.msg26161#msg26161

IchBin

xadio, you are awesome. Thanks for taking care of the teamspeak block. Karma you're way dude!

xadio

Quote from: IchBinâââ,¬Å¾Ã,¢ on February 26, 2006, 06:51:54 PM
xadio, you are awesome. Thanks for taking care of the teamspeak block. Karma you're way dude!

Thanks a bunch! I am honored to be a member of TinyPortal and to use it.  It is the least I can do ;)

MentalMuscle

Quote from: xadio on February 16, 2006, 05:28:56 PM
Quote from: disisme on February 16, 2006, 05:25:15 PM
Guys, I display a button on my helios theme, in the smf 1.0.6 part (not TP).  I added the buttons to index.template.php and use $context['user']['name'] in the teamspeak string.  Thats after I do an if $context['user']['is_logged').  so if they arent logged in, they dont see the buttons....

That's a clean alternative to keep 'unwanted' guests limited, but if he still wants to have passwords then it will still be a problem...

Are there any special considerations when using $context['user']['name']?  My ts_config.inc.php file is configured to use this, but I'm not captured the name of the person who is logged in.

This website is proudly hosted on Crocweb Cloud Website Hosting.