PHP Classes

File: w2sp/w2sp.test.explanation.php

Recommend this page to a friend!
  Classes of Horst Nogajski   Winamp Shell ProXy   w2sp/w2sp.test.explanation.php   Download  
File: w2sp/w2sp.test.explanation.php
Role: Example script
Content type: text/plain
Description: checks configuration and explains all functions
Class: Winamp Shell ProXy
Control server side WinampPlayer via shell
Author: By
Last change: (see description of classfile)
Date: 20 years ago
Size: 18,428 bytes
 

Contents

Class file image Download
<?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\">&nbsp;&nbsp;&#36;W2SP->DoShellCMD(&#36;_GET['DO'],&#36;_GET['VAL']) is "; $doString .= "&#36;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>&nbsp;&nbsp;Also have set the value for META-Refresh to ".$W2SP->NextRefresh." seconds\r\n"; } } $Title = "Winamp2 ShellProXy :: configuration test &amp; 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>&#36;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 &copy; 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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&#36;&#87;&#50;&#83;&#80;&#32;&#61;&#32;&#110;&#101;&#119;&#32;&#87;&#105;&#110;&#97;&#109;&#112;&#50;&#83;&#104;&#101;&#108;&#108;&#80;&#114;&#111;&#120;&#121;&#59;</h2>\r\n"; echo "<br><h4 class=\"output\">"; $fn = "&#36;W2SP->W2SPEXE&nbsp;=&nbsp;'".$W2SP->W2SPEXE."'&#59;"; echo file_exists($W2SP->W2SPEXE) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; $fn = "&#36;W2SP->PathToWinampExe&nbsp;=&nbsp;'".$W2SP->PathToWinampExe."'&#59;"; echo file_exists($W2SP->PathToWinampExe) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; $fn = "&#36;W2SP->ReturnFilename&nbsp;=&nbsp;'".$W2SP->ReturnFilename."'&#59;"; echo file_exists($W2SP->ReturnFilename) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; $fn = "&#36;W2SP->ButtonFolder&nbsp;=&nbsp;'".$W2SP->ButtonFolder."'&#59;"; echo file_exists($W2SP->ButtonFolder) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; $fn = "&#36;W2SP->Playlist1&nbsp;=&nbsp;'".$W2SP->Playlist1."'&#59;"; echo file_exists($W2SP->Playlist1) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; $fn = "&#36;W2SP->Playlist2&nbsp;=&nbsp;'".$W2SP->Playlist2."'&#59;"; echo file_exists($W2SP->Playlist2) ? $fn."<br>\r\n" : "<span class=\"error\">".$fn."</span><br>\r\n"; echo "&#36;W2SP->hrefactor&nbsp;=&nbsp;'".$W2SP->hrefactor."'&#59;<br>\r\n"; echo "&#36;W2SP->DoServerLog&nbsp;=&nbsp;".(int)$W2SP->DoServerLog."&#59;<br>\r\n"; echo "&#36;W2SP->AlsoLogGetInfo&nbsp;=&nbsp;".(int)$W2SP->AlsoLogGetInfo."&#59;<br>\r\n"; echo "&#36;W2SP->DefaultRefresh&nbsp;=&nbsp;".(int)$W2SP->DefaultRefresh."&#59;<br>\r\n"; echo "&#36;W2SP->RefreshAdjust&nbsp;=&nbsp;".(int)$W2SP->RefreshAdjust."&#59;<br>\r\n"; echo "&#36;W2SP->TrackListWidth&nbsp;=&nbsp;".(int)$W2SP->TrackListWidth."&#59;<br>\r\n"; echo "&#36;W2SP->ImageType&nbsp;=&nbsp;'".$W2SP->ImageType."'&#59;<br>\r\n"; echo "&#36;W2SP->RecentTrackCount&nbsp;=&nbsp;".(int)$W2SP->RecentTrackCount."&#59;<br>\r\n"; echo "&#36;W2SP->JS&nbsp;=&nbsp;".(int)$W2SP->JS."&#59;</h4>\r\n"; echo "<p><br><a href=\"#top\"><i>TOP</i></a></p>"; // ClassSettingsArray // echo "<hr>\r\n"; echo "<h3>&#36;W2SP->const</h3>\r\n"; echo "<p>&#102;&#111;&#114;&#101;&#97;&#99;&#104;&#32;&#40;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#99;&#111;&#110;&#115;&#116;&#32;&#97;&#115;&#32;&#36;&#75;&#101;&#121;&#61;&#62;&#36;&#86;&#97;&#108;&#117;&#101;&#41;<br>&#101;&#99;&#104;&#111;&#32;&#36;&#75;&#101;&#121;&#61;&#62;&#36;&#86;&#97;&#108;&#117;&#101;&#59;\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 "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"".$k."\"=>\"".$v."\",<br>"; } echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<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>&#36;W2SP->GetWinampInfo()</h3>\r\n"; echo "<p>&#102;&#111;&#114;&#101;&#97;&#99;&#104;&#32;&#40;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#71;&#101;&#116;&#119;&#105;&#110;&#97;&#109;&#112;&#105;&#110;&#102;&#111;&#40;&#41;&#32;&#97;&#115;&#32;&#36;&#75;&#101;&#121;&#61;&#62;&#36;&#86;&#97;&#108;&#117;&#101;&#41;<br>&#101;&#99;&#104;&#111;&#32;&#36;&#75;&#101;&#121;&#32;&#46;&#32;&#34;&#32;&#61;&#62;&#34;&#32;&#46;&#32;&#36;&#86;&#97;&#108;&#117;&#101;&#59;\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>&#36;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>&#36;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>&#36;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>&#36;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>&#36;W2SP->DisplayLink(&#36;id)</h3>\r\n"; echo "<p>&#102;&#111;&#114;&#101;&#97;&#99;&#104;&#32;&#40;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#119;&#50;&#115;&#112;&#67;&#77;&#68;&#115;&#32;&#97;&#115;&#32;&#36;&#75;&#101;&#121;&#61;&#62;&#36;&#86;&#97;&#108;&#117;&#101;&#41;<br>&#101;&#99;&#104;&#111;&#32;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#68;&#105;&#115;&#112;&#108;&#97;&#121;&#76;&#105;&#110;&#107;&#40;&#36;&#75;&#101;&#121;&#41;&#59;\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>&#36;W2SP->DisplayButton(&#36;id,'','',&amp;&#36;TotalImageWidth)</h3>\r\n"; echo "<p>&#102;&#111;&#114;&#101;&#97;&#99;&#104;&#32;&#40;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#119;&#50;&#115;&#112;&#67;&#77;&#68;&#115;&#32;&#97;&#115;&#32;&#36;&#75;&#101;&#121;&#61;&#62;&#36;&#86;&#97;&#108;&#117;&#101;&#41;<br>&#101;&#99;&#104;&#111;&#32;&#36;&#87;&#50;&#83;&#80;&#45;&#62;&#68;&#105;&#115;&#112;&#108;&#97;&#121;&#66;&#117;&#116;&#116;&#111;&#110;&#40;&#36;&#75;&#101;&#121;&#41;&#59;\r\n<p style=\" margin-left: 40px;\" class=\"output\">"; echo "<b>using &#36;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) . "&nbsp;&nbsp;&nbsp;&nbsp;(&#36;TotalImageWidth&nbsp;=&nbsp;".$counter.")<br>" : "No Image available for ID <b>".$Key ."</b>=>Array(\"<b>".$Value[0]."</b>\", \"".$Value[1]."\")&nbsp;&nbsp;&nbsp;&nbsp;(&#36;TotalImageWidth&nbsp;=&nbsp;".$counter.")<br>"; } echo "<br>\r\n"; echo "<h3>&#36;W2SP->DisplayButton(55555,'','',&amp;&#36;TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">"; echo $W2SP->DisplayButton(55555,'','',&$nix)."\r\n"; echo "<h3>&#36;W2SP->DisplayButton(55555,'alternative name text','alternative description text',&amp;&#36;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>&#36;W2SP->DisplayButton('blank',16,16,&amp;&#36;TotalImageWidth)</h3>\r\n<p style=\" margin-left: 40px;\" class=\"output\">"; echo $W2SP->DisplayButton('blank',16,16,&$nix)."\r\n"; echo "<h3>&#36;W2SP->DisplayButton('blank',100,16,&amp;&#36;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>&#36;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>&#36;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>&#36;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>&#36;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>&#36;W2SP->DisplayRecentTrackList()</h3>\r\n"; echo "<p style=\" margin-left: 40px;\">&#36;W2SP->RecentTrackCount&nbsp;=&nbsp;".(int)$W2SP->RecentTrackCount."&#59;\r\n"; echo "<p style=\" margin-left: 40px;\" class=\"output\"><table><tr><td>" . $W2SP->DisplayRecentTrackList() . "</td></tr></table>\r\n"; echo "<h3>&#36;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>&#36;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>&#36;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>&#36;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>&#36;W2SP->DisplayWinampInfo()</h3>"; echo "<p style=\" margin-left: 40px;\" class=\"output\">"; echo $W2SP->DisplayWinampInfo(); echo "<h3>&#36;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>&#117;&#110;&#115;&#101;&#116;&#40;&#36;&#87;&#50;&#83;&#80;&#41;&#59;</h2>\r\n"; echo $TEMPLATE_FOOTER; // UNSET THE CLASS // unset($W2SP); ?>