<?php
// require Configfile (and Classfile)
require_once('hidden/w2sp.config.php');
$w2sp_settings['DoDebug'] = TRUE;
// Initialize the ClassInstance
$W2SP =& new Winamp2ShellProXy($w2sp_settings);
// validate requeted action and execute if valid
$W2SP->ValidateRequest($_GET);
if(isset($_GET['DO']))
{
if((int)$_GET['DO'] != 55555)
{
$doString = "<h3 class=\"gray\">Have done a Shellcommand:</h3>\r\n<h4 class=\"output\"> $W2SP->DoShellCMD($_GET['DO'],$_GET['VAL']) is ";
$doString .= "$W2SP->DoShellCMD(".$_GET['DO'].",".$_GET['VAL'].")</h4><p>[".$W2SP->w2spCMDs[$_GET['DO']][0]." : ".$W2SP->w2spCMDs[$_GET['DO']][1]."]\r\n";
}
else
{
// get Info!
If ($doString == "") $doString = "<h3 class=\"gray\">Have done a Refresh (".date('h:i:s').")</h3>\r\n<p> Also have set the value for META-Refresh to ".$W2SP->NextRefresh." seconds\r\n";
}
}
$Title = "Winamp2 ShellProXy :: configuration test & class explanation";
$meta_refresh = $W2SP->MetaRefresh(1,$Title);
$W2SP_CSS = $W2SP->CSSclasses();
$TEMPLATE_HEADER = <<< CODEHEADER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd">
<html>
<head>
{$meta_refresh}
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en">
<meta name="description" lang="en" content="Winamp2 ShellProxy is a little prog which interacts between a Winamp player and a PHP-Script. This page shows how you can use Winamp2 ShellProXy with it's PHP-Class in a simple way.">
<meta name="keywords" lang="en" content="Winamp, 2, Shell, Proxy, w2sp, phpclass">
<meta name="author" content="Horst Nogajski">
<meta name="generator" content="handwritten =:)">
<style type="text/css">
<!--
a {
font: 12px Verdana,Helvetica,Arial,sans-serif;
text-decoration: none;
}
a:link {
color: #E0E0E0;
}
a:visited {
color: #E0E0E0;
}
a:hover {
color: #999999;
background-color: #EEEEEE;
}
a:active {
color: #66CC00;
}
body {
font-family: Verdana,Helvetica,Arial,sans-serif;
text-align: left;
color: #DDDDDD;
background-color: #999999;
margin-top: 20px;
margin-bottom: 50px;
margin-left: 30px;
margin-right: 30px;
}
p,h1,h2,h3,h4,h5,h6,ul,ol,li,td,th {
font-family: Verdana,Helvetica,Arial,sans-serif;
}
h1 {
font: bold 14px Verdana,Helvetica,Arial,sans-serif;
color: #555555;
}
h2 {
font: bold 16px Verdana,Helvetica,Arial,sans-serif;
color: #FEFCAF;
margin-left: -25px;
}
h3 {
font: bold 14px Verdana,Helvetica,Arial,sans-serif;
color: #C2E9FE;
margin-left: 10px;
}
h4 {
font: bold 11px Verdana,Helvetica,Arial,sans-serif;
color: #C2E9FE;
margin-left: 40px;
}
p {
font: 12px Verdana,Helvetica,Arial,sans-serif;
margin-left: 20px;
}
ol,ul {
list-style-type: none;
}
.gray {
color: #DDDDDD;
background-color: #999999;
}
.but:hover {
background-color: #FFFF00;
}
.output {
background: #888888;
border: 2px dashed #FFCC99;
padding : 5px 5px 5px 5px;
min-width : 444px;
}
.legende {
font: bold 10px Verdana,Helvetica,Arial,sans-serif;
padding: 0 0 0 0;
margin-left : 5px;
margin-right : 5px;
}
.small {
font: bold 10px Verdana,Helvetica,Arial,sans-serif;
color: #555555;
}
.error {
font: bold 12px Verdana,Helvetica,Arial,sans-serif;
color: #FF6633;
background: #666666;
}
{$W2SP_CSS}
-->
</style>
</head>
<body>
<a name="top"></a>
<h1>{$Title}</h1>
<hr>
<p>
<table border="1">
<tr>
<th align="left" valign="middle" colspan="2"><p class="legende">Winamp2 ShellProXy: Legend</th>
</tr>
<tr>
<td><p class="legende">Classfunction</td>
<td><h3>$class->FunctionName()</h3></td>
</tr>
<tr>
<td><p class="legende">Output</td>
<td><p class="output">Output of the ClassFunction</td>
</tr>
<tr>
<td><p class="legende">Description</td>
<td><p>Additional Descriptions, Informations</td>
</tr>
</table>
CODEHEADER;
$TEMPLATE_FOOTER = <<< CODEFOOTER
<hr>
<div align="center">
<p><br><a href="http://horst.nogajski.de/w2sp/">Winamp2 ShellProXy</a> V-0.9 © 2003 Horst Nogajski - horst AT nogajski DOT de<br><br>
</div>
</body>
</html>
CODEFOOTER;
// Starting OutPut:
echo $TEMPLATE_HEADER;
// Function Index
//
echo "<hr>\r\n";
echo "<h2 style=\" margin-left: 40px;\">Public Functions</h2>\r\n";
echo "<p style=\" margin-left: 40px;\">";
echo "<ul style=\" margin-left: 20px;\">\r\n";
echo " <li><a href=\"#MetaRefresh\">MetaRefresh()</a></li>\r\n";
echo " <li><a href=\"#DisplayCSS\">CSSclasses()</a></li>\r\n";
echo " <li> </li>\r\n";
echo " <li><a href=\"#DisplayWinampInfo\">DisplayWinampInfo()</a></li>\r\n";
echo " <li><a href=\"#DisplayPanel\">DisplayPanel()</a></li>\r\n";
echo " <li><a href=\"#DisplayTrackListSelect\">DisplayTrackListSelect()</a></li>\r\n";
echo " <li><a href=\"#DisplayRecentTrackList\">DisplayRecentTrackList()</a></li>\r\n";
echo " <li> </li>\r\n";
echo " <li><a href=\"#DisplayButton\">DisplayButton()</a></li>\r\n";
echo " <li><a href=\"#DisplayLink\">DisplayLink()</a></li>\r\n";
echo " <li> </li>\r\n";
echo " <li><a href=\"#GetWinampInfo\">GetWinampInfo()</a></li>\r\n";
echo "</ul>\r\n\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Last Action Msg
//
echo "<hr>\r\n".$doString;
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Variables
//
echo "<hr><h2>$W2SP = new Winamp2ShellProxy;</h2>\r\n";
echo "<br><h4 class=\"output\">";
$fn = "$W2SP->W2SPEXE = '".$W2SP->W2SPEXE."';";
echo file_exists($W2SP->W2SPEXE) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
$fn = "$W2SP->PathToWinampExe = '".$W2SP->PathToWinampExe."';";
echo file_exists($W2SP->PathToWinampExe) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
$fn = "$W2SP->ReturnFilename = '".$W2SP->ReturnFilename."';";
echo file_exists($W2SP->ReturnFilename) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
$fn = "$W2SP->ButtonFolder = '".$W2SP->ButtonFolder."';";
echo file_exists($W2SP->ButtonFolder) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
$fn = "$W2SP->Playlist1 = '".$W2SP->Playlist1."';";
echo file_exists($W2SP->Playlist1) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
$fn = "$W2SP->Playlist2 = '".$W2SP->Playlist2."';";
echo file_exists($W2SP->Playlist2) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n";
echo "$W2SP->hrefactor = '".$W2SP->hrefactor."';<br>\r\n";
echo "$W2SP->DoServerLog = ".(int)$W2SP->DoServerLog.";<br>\r\n";
echo "$W2SP->AlsoLogGetInfo = ".(int)$W2SP->AlsoLogGetInfo.";<br>\r\n";
echo "$W2SP->DefaultRefresh = ".(int)$W2SP->DefaultRefresh.";<br>\r\n";
echo "$W2SP->RefreshAdjust = ".(int)$W2SP->RefreshAdjust.";<br>\r\n";
echo "$W2SP->TrackListWidth = ".(int)$W2SP->TrackListWidth.";<br>\r\n";
echo "$W2SP->ImageType = '".$W2SP->ImageType."';<br>\r\n";
echo "$W2SP->RecentTrackCount = ".(int)$W2SP->RecentTrackCount.";<br>\r\n";
echo "$W2SP->JS = ".(int)$W2SP->JS.";</h4>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// ClassSettingsArray
//
echo "<hr>\r\n";
echo "<h3>$W2SP->const</h3>\r\n";
echo "<p>foreach ($W2SP->const as $Key=>$Value)<br>echo $Key=>$Value;\r\n<p style=\" margin-left: 40px;\" class=\"output\"><b>";
foreach ($W2SP->const as $Key=>$Value){
if(is_array($Value)){
echo $Key."=>array(<br>";
foreach ($W2SP->const[$Key] as $k=>$v){
echo " \"".$k."\"=>\"".$v."\",<br>";
}
echo " );<br>\r\n";
}
}
echo $Key . " => " . $Value ."<br>";
echo "</b>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Get WinampInfo from Array
//
echo "<a name=\"GetWinampInfo\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->GetWinampInfo()</h3>\r\n";
echo "<p>foreach ($W2SP->Getwinampinfo() as $Key=>$Value)<br>echo $Key . " =>" . $Value;\r\n<p style=\" margin-left: 40px;\" class=\"output\"><b>";
foreach ($W2SP->Getwinampinfo() as $Key=>$Value)
echo $Key . " => " . $Value ."<br>";
echo "</b>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print Meta-Refresh and additional Headers
//
echo "<a name=\"MetaRefresh\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->MetaRefresh()</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><b>";
echo nl2br(htmlentities($W2SP->MetaRefresh()));
echo "</b><br>\r\n";
echo "<h3>$W2SP->MetaRefresh(1)</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><b>";
echo nl2br(htmlentities($W2SP->MetaRefresh(1)));
echo "</b><br>\r\n";
echo "<h3>$W2SP->MetaRefresh(1,'Alternative Browser Title Text')</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><b>";
echo nl2br(htmlentities($W2SP->MetaRefresh(1,'Alternative Browser Title Text')));
echo "</b><br>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print CSS-STyles in Headsection
//
echo "<a name=\"DisplayCSS\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->CSSclasses()</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><b>";
echo nl2br(htmlentities($W2SP->CSSclasses()));
echo "</b><br>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print TextLink for ID
//
echo "<a name=\"DisplayLink\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->DisplayLink($id)</h3>\r\n";
echo "<p>foreach ($W2SP->w2spCMDs as $Key=>$Value)<br>echo $W2SP->DisplayLink($Key);\r\n<p style=\" margin-left: 40px;\" class=\"output\"><b>";
foreach ($W2SP->w2spCMDs as $Key=>$Value)
echo $W2SP->DisplayLink($Key) . "<br>";
echo "</b><br>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print Button for ID
//
echo "<a name=\"DisplayButton\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->DisplayButton($id,'','',&$TotalImageWidth)</h3>\r\n";
echo "<p>foreach ($W2SP->w2spCMDs as $Key=>$Value)<br>echo $W2SP->DisplayButton($Key);\r\n<p style=\" margin-left: 40px;\" class=\"output\">";
echo "<b>using $W2SP->ButtonFolderURL = \"".$W2SP->const['ButtonFolder']['url']."\" returns:</b><br><br>";
foreach ($W2SP->w2spCMDs as $Key=>$Value){
echo ($W2SP->DisplayButton($Key,'','',&$nix) <> "") ? $W2SP->DisplayButton($Key,'','',&$counter) . " ($TotalImageWidth = ".$counter.")<br>" : "No Image available for ID <b>".$Key ."</b>=>Array(\"<b>".$Value[0]."</b>\", \"".$Value[1]."\") ($TotalImageWidth = ".$counter.")<br>";
}
echo "<br>\r\n";
echo "<h3>$W2SP->DisplayButton(55555,'','',&$TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayButton(55555,'','',&$nix)."\r\n";
echo "<h3>$W2SP->DisplayButton(55555,'alternative name text','alternative description text',&$TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayButton(55555,'alternative name text','alternative description text',&$nix)."\r\n";
echo "<h3>$W2SP->DisplayButton('blank',16,16,&$TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayButton('blank',16,16,&$nix)."\r\n";
echo "<h3>$W2SP->DisplayButton('blank',100,16,&$TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayButton('blank',100,16,&$nix)."\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print DropDown-Select with TrackList
//
echo "<a name=\"DisplayTrackListSelect\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->DisplayTrackListSelect()</h3>\r\n";
echo "<p style=\" margin-left: 40px;\">current default setting for width of DropDownSelects is: " . $W2SP->TrackListWidth . "\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayTrackListSelect() . "</td></tr></table>\r\n";
$newWidth = ((int)$W2SP->TrackListWidth != 0) ? (int)((int)($W2SP->TrackListWidth) * 3 / 2) : 300;
echo "<h3>$W2SP->DisplayTrackListSelect(".$newWidth.")</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayTrackListSelect($newWidth) . "</td></tr></table>\r\n";
$newWidth = (int)((int)($W2SP->TrackListWidth) * 4 / 3);
echo "<h3>$W2SP->DisplayTrackListSelect(".$newWidth.")</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayTrackListSelect($newWidth) . "</td></tr></table>\r\n";
echo "<h3>$W2SP->DisplayTrackListSelect(0)</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayTrackListSelect(0) . "</td></tr></table>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Print DropDown-Select with Recent TrackList
//
echo "<a name=\"DisplayRecentTrackList\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->DisplayRecentTrackList()</h3>\r\n";
echo "<p style=\" margin-left: 40px;\">$W2SP->RecentTrackCount = ".(int)$W2SP->RecentTrackCount.";\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayRecentTrackList() . "</td></tr></table>\r\n";
echo "<h3>$W2SP->DisplayRecentTrackList(1)</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayRecentTrackList(1) . "</td></tr></table>\r\n";
echo "<h3>$W2SP->DisplayRecentTrackList(2)</h3>\r\n";
echo "<p style=\" margin-left: 40px;\">current default setting for width of DropDownSelects is: " . $W2SP->TrackListWidth . "\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayRecentTrackList(2) . "</td></tr></table>\r\n";
$newWidth = ((int)$W2SP->TrackListWidth != 0) ? (int)0 : (int)((int)($W2SP->TrackListWidth) * 3 / 2);
echo "<h3>$W2SP->DisplayRecentTrackList(2,".$newWidth.")</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayRecentTrackList(2,(int)$newWidth) . "</td></tr></table>\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Display Player Panel in a Table
//
echo "<a name=\"DisplayPanel\"></a>\r\n";
echo "<hr>\r\n<h3>$W2SP->DisplayPanel()</h3>\r\n";
echo "<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayPanel();
echo "\r\n\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Display Full Winamp- and Trackinfos in a Table
//
echo "<a name=\"DisplayWinampInfo\"></a>\r\n";
echo "<hr>\r\n";
echo "<h3>$W2SP->DisplayWinampInfo()</h3>";
echo "<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayWinampInfo();
echo "<h3>$W2SP->DisplayWinampInfo(1)</h3>";
echo "<p style=\" margin-left: 40px;\" class=\"output\">";
echo $W2SP->DisplayWinampInfo(1);
echo "\r\n\r\n";
echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>";
// Footer
//
echo "<hr>\r\n<h2>unset($W2SP);</h2>\r\n";
echo $TEMPLATE_FOOTER;
// UNSET THE CLASS
//
unset($W2SP);
?> |