Teamspeak Block wie Daten aus ACP übernehmen ?

Post Reply

Topic author
Ypselon
Active Member
Posts: 24
Joined: 16. July 2008 18:36

Teamspeak Block wie Daten aus ACP übernehmen ?

Post by Ypselon »

Ich arbeite derzeit daran, den Teamspeak Block den es hier im Board gibt für meine Zwecke zu modifizieren. Geschafft habe ich es bereits, das ich 2 unabhänige TS Blöcke habe, beide passen in alle Templates und funktionieren sowohl in IE als auf FF und Opera.
Allerdings nehme ich den PHPTS2 und möchte nun die Serverdaten und alle anderen Einstellungen gerne per ACP vorgeben.

Gelöst habe ich das so :

acp_portal.php

Code: Select all

			// <-- START TeamSpeakViewer MOD (1) -->
			case 'teamspeak1':
				$display_vars = array(
					'title'	=> 'ACP_PORTAL_TEAMSPEAK1_SETTINGS',
					'vars'	=> array(
						'legend1'							=> 'ACP_PORTAL_TEAMSPEAK1_SETTINGS',
						'portal_teamspeak1_enabled'			=> array('lang' => 'PORTAL_TEAMSPEAK1'					,	'validate' => 'bool',	 	'type' => 'radio:yes_no',	'explain' => true),
						'portal_teamspeak1_height'			=> array('lang' => 'PORTAL_TEAMSPEAK1_HEIGHT'	,	'validate' => 'int'	, 'type' => 'text:3:3',		 'explain' => true),
						'legend2'							=> 'ACP_PORTAL_TEAMSPEAK1_SETTINGSDATA',
						'portal_teamspeak1_ip1'				=> array('lang' => 'PORTAL_TEAMSPEAK1_IP1'	,	'validate' => 'string', 'type' => 'text:15:15',	 'explain' => true),
						'portal_teamspeak1_ip2'				=> array('lang' => 'PORTAL_TEAMSPEAK1_IP2'			,	'validate' => 'string', 'type' => 'text:15:15',	 'explain' => true),				
						'portal_teamspeak1_queryport'		=> array('lang' => 'PORTAL_TEAMSPEAK1_QUERYPORT'			,	'validate' => 'string', 'type' => 'text:5:6',	 'explain' => true),	
						'portal_teamspeak1_udpport'			=> array('lang' => 'PORTAL_TEAMSPEAK1_UDPPORT'			,	'validate' => 'string', 'type' => 'text:5:6',	 'explain' => true),	
						'portal_teamspeak1_dorefresh'		=> array('lang' => 'PORTAL_TEAMSPEAK1_DOREFRESH'					 ,	'validate' => 'bool',	 'type' => 'radio:yes_no',	'explain' => true),
						'portal_teamspeak1_refreshtime'		=> array('lang' => 'PORTAL_TEAMSPEAK1_REFRESHTIME'			,	'validate' => 'string', 'type' => 'text:3:3',	 'explain' => true),	
			)
				);
			break;
			// <-- END TeamSpeakViewer MOD -->
So wie man sieht habe ich die Möglichkeit vorgegeben, IP Adresse und den anderen Kram per ACP einzugeben. Der part funktioniert einwandfrei, nur leider klappt die Übernahme in den Teamspeak Viewer nicht.
Ich habe es in der config.php ausprobiert :

Original

Code: Select all

<?PHP
/*****************************************************
* Connection variables
*****************************************************/

// $ip  	= "82.149.232.61";    // IP Address to server
// $ip2 	= "82.149.232.61";    // IP Address to server of external or the same IP
// $tPort 	= "51241";			// Server QueryPort number
// $port 	= "10064";			// Port number to the TS2 server

/*****************************************************
* View selection
*****************************************************/
$tree			= true;		// true or false
$iframeHeight 	= 100;		// Adjust iframe height - Presenting info from a selected channel
$downlinkyes	= false;		// true or false for the download link
$downlink		= "http://www.goteamspeak.com/index.php?page=downloads";  // Link to the Download
$downlinktext	= "Download Teamspeak";
$loginwidth		= 210;		// Login-Window width defult 210
$loginheight	= 290;		// Login-Window height defult 290 and without Downloadlink 280

/*****************************************************
* Refresh
*****************************************************/
$RefreshBottom	= false;		// true or false
$doRefresh		= true;		// true or false
$reInterval		= 60;		// Amount of seconds until next refresh

/*****************************************************
* TeamSpeak special colors
*****************************************************/
$bgcolor 		= "#CADCEB"; // Default is TS2 purple background color
$headerColor	= "#5B5B5B"; // Header background color used for "Basic info" and "User info"
$selectColor 	= "#CECECE"; // Used when click on a channel in tree 
?>
Eingebaut habe ich es so :

Code: Select all

<?PHP
/*****************************************************
* Connection variables
*****************************************************/
$ip  	= ($portal_config['portal_teamspeak1_ip1']);
$ip2 	= ($portal_config['portal_teamspeak1_ip2']);
$tPort 	= ($portal_config['portal_teamspeak1_queryport']);
$port 	= ($portal_config['portal_teamspeak1_udpport']);

Rest Code von Oben
?>
leider klappt es nicht, die Varibeln werden nicht genutzt. Dann habe ich es versucht hier einzubauen :

ts2.php

Code: Select all

<?php
/*
 Copyright (C) 2004  Niklas Håkansson <niklas.hk@telia.com>
 Mod by Timo Meyer-Franke <www.forum.meyer-franke.de.vu>

 PHPTS2 ver 2.0 is a free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public.

 Please leave the copyright image as it is if you using this scripts
*/

include "ts2status.php";
require_once "config.php";
$ip  	= ($portal_config['portal_teamspeak1_ip1']);
$ip2 	= ($portal_config['portal_teamspeak1_ip2']);
$tPort 	= ($portal_config['portal_teamspeak1_queryport']);
$port 	= ($portal_config['portal_teamspeak1_udpport']);
?>
<head>
        <title>PHPTS2 Viewer</title>
        <?if($doRefresh) {?>
        <META HTTP-EQUIV="refresh" CONTENT="<?=$reInterval?>; url=ts2.php">
        <?}
        if($tree) {?>
        <script language="javascript">
        var selectColor         = "<?=$selectColor?>";
        var unselectColor         = "<?=$bgcolor?>";
        </script>
        <script src="js/vMenu.js" type="text/javascript"></script>
        <?}?>
        <link rel="STYLESHEET" type="text/css" href="css/stylesheet.css">
        <style>
        body {
                background-color : <?=$bgcolor?>;
        }
</style>
</head>
<body>
................ restcode
Aber auch das klappt nicht ... weiss also jemand was ich zusätzlich einfügen müsste, damit der Viewer die Variabeln aus dem ACP verarbeiten kann ? Oder muss ich die gar anders abfragen ?
Post Reply

Return to “Modifications Support”