thumpn8974
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/4ade72c64f31ab2ff2b97.jpg)
Joined: Feb 09, 2011
Posts: 188
Location: US
|
Posted:
Thu Mar 08, 2012 4:13 pm |
|
I am trying to get my Wimpy mp3 player to center on my website. It works fine in Internet Explorer, but it doesn't in Firefox. I have it in a block and I have tried to tinker with it, but I have had no success in getting it to center. I am pasting the code for the block (if that is the issue) but I have tried to mess with the settings with no effect there either.
Quote: | <?php
/////////////////////////////////////////////////////////////////
// //
// //
// Wimpy Block //
// v2.8 //
// available at //
// www.wimpyplayer.com //
// //
// //
/////////////////////////////////////////////////////////////////
// //
// //
// Thanks to: //
// //
// Zaster: //
// www.uwfnetwork.com //
// //
// Nomad: //
// music@nomad76.com //
// //
// //
/////////////////////////////////////////////////////////////////
//*
if (eregi("block-Wimpy.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
//*/
// ===================
// ===================
// ===================
//
// BASIC CONFIGURATION
//
// ===================
// ===================
// ===================
// ========================================================================
// Wimpy Page Location
// ========================================================================
// This script assumes the following:
// - You created a new folder called "mp3s" at the root of your web site.
// Example:
// http://www.yoursite.com/mp3s
// - You use the Customizer Tool at wimplyayer.com to generate
// a "myWimpy.html" page and uploaded the page to the newly
// created mp3s folder.
// Example
// http://www.yoursite.com/mp3s/myWimpy.html
//
// If you decided to use a different folder or file name,
// you will have to edit $wimpyPage so that it reflects the proper
// location of the "myWimpy.html" page on your server.
//
//
// --------------------------------------
// Full URL
// --------------------------------------
// $wimpyPage = "http://www.yoursite.com/mp3s/myWimpy.html";
// $wimpyPage = "http://www.yoursite.com/PHPnuke/mp3s/myWimpy.html";
//
// --------------------------------------
// Website Root (recommended)
// --------------------------------------
// When using a website root path, the path must start with a "/"
// -- doing so will cuase this block to automatically tack on the
// domain name to the beginning of the string. For example, if you use
//
// $wimpyPage = "/mp3s/myWimpy.html";
//
// Then the resulting path that this script will use will be:
// http://www.yoursite.com/mp3s/myWimpy.html
// If you do not use a slash in the front of the path,
// this script will assume that you are trying to use a Relative System Path.
//
// Examples:
// $wimpyPage = "/PHPnuke/mp3s/myWimpy.html";
// $wimpyPage = "/mp3s/myWimpy.html";
// $wimpyPage = "/PHPnuke/mp3s/myWimpy.html";
//
// --------------------------------------
// Relative System Path
// --------------------------------------
// (Relative to "modules.php")
// $wimpyPage = "myWimpy.html";
// $wimpyPage = "./mp3s/myWimpy.html";
// $wimpyPage = "../mp3s/myWimpy.html";
// $wimpyPage = "../PHPnuke/mp3s/myWimpy.html";
$wimpyPage = "./Rave/myWimpy.html";
// ========================================================================
// Extra Margins
// ========================================================================
// Some browsers will automatically add scroll bars to the right and bottom of
// the IFRAME. To prevent this from happening, set this value to a higher number:
$extraMargin = auto;
// ========================================================================
// Width and Height Over-ride
// ========================================================================
// By default, this block will attempt to determine the width and height for the
// block based on the width and height attributes found in the "myWimpy.html" page
// that you created using the Customizer tool at www.wimpyplayer.com. If you want
// to over-ride the automatic parsing of the width and height, set these values
// to the size you want to use.
//
// If you want this block to automatically parse the width and height, leave
// these values as 0;
$manualWidth =650;
$manualHeight = 450;
// ========================================================================
// ========================================================================
//
// POP UP WINDOW SETTINGS
//
// ========================================================================
// ========================================================================
// ========================================================================
// Show Popup Link:
// ========================================================================
// You can cause this block to display a link above or below the
// player so that users can pop up the player into a new window,
// so they can listen while they surf your site.
//
// Options:
// 0 = don't show popup link
// 1 = put link on bottom only
// 2 = put link on top only
// 3 = put link on both top and bottom
$showPopupLink = 1;
// ========================================================================
// Text Link:
// ========================================================================
// Default Text to use for the pop up link (if used):
$popupButtonText = "Launch External Jukebox";
// ========================================================================
// Use Image As Pop Up Button:
// ========================================================================
// If you want to use an image (button), rather than a text link,
// enter the URL to the image file.
//
// NOTE: Leave as "" if you just want to use a text link
// NOTE: Setting this to a file loction will automatically set the link to an image,
// and any text defined in "Text Link" above will be dis-regarded.
//
// Example:
// $popupButtonImage = "http://www.yoursite.com/mp3s/popupJukeboxButton.gif";
$popupButtonImage = "http://h3llclan.com/Rave/popupJukeboxButton.gif";
// ========================================================================
// Just Show Pop up Link
// ========================================================================
// This will cause this block to NOT display the player within the page,
// and only show a link to pop up Wimpy (either a text link or image button as defined above)
//
// Options:
// 0 = Player will display on the page in addition to the pop up links
// 1 = Player will not display in your page, only a link to pop up the player.
$justShowLink = 0;
// ========================================================================
// Pop Up On Load:
// ========================================================================
// If you want Wimpy to pop up when the page loads, set this to 1 or true
//
// NOTE: In order to use this option, you MUST set an image button
// (see above "Use Image As Pop Up Button")
//
// Options:
// 0 = don't automatically pop up wimpy when the page loads.
// 1 = pop up wimpy when the page loads
$popupOnLoad = 0;
/////////////////////////////////////////////////////
// //
// DO NOT EDIT BELOW HERE //
// //
/////////////////////////////////////////////////////
if(substr($wimpyPage,0,1) == "/"){
$myProtocol = "http://";
$myDomain = $_SERVER["HTTP_HOST"];
} else {
$myProtocol = "";
$myDomain = "";
}
$wimpyPageURL = $myProtocol.$myDomain.$wimpyPage;
// If showPopupLink, turn off all pop up link settings.
if($showPopupLink == 0){
$justShowLink = 0;
$popupButtonImage = "";
$popupButtonText = "";
$popupOnLoad = 0;
}
// Did user set popupOnLoad, but forgot to enter a URL to an image?
// If this is the case, try and set a URL to an image that may exist.
if($popupOnLoad && $popupButtonImage == ""){
$popupButtonImage = "/mp3s/popupJukeboxButton.gif";
}
// If manual widht and height are set, don't try to parse the
// "myWimpy.html" page, just move on and use the manual settings.
if(!$manualWidth || !$manualHeight){
$handle = @fopen($wimpyPageURL, "r");
$wimpyData = "";
if ($handle) {
while (!feof($handle)) {
$wimpyData .= @fgets($handle, 4096);
}
@fclose($handle);
}
// Try and open the defined "myWimpy.html" page.
if($wimpyData !== ""){
$myWimpyExists = true;
} else {
$myWimpyExists = false;
}
// If the page doesn't exist, set the width and height to the default values
if($myWimpyExists){
$AwimpyWidthA = explode('<object', $wimpyData);
$AwimpyWidthB = explode(' width="', $AwimpyWidthA[1]);
$AwimpyWidthC = explode('"', $AwimpyWidthB[1]);
$wimpyWidth = $AwimpyWidthC[0]+$extraMargin;
$AwimpyHeightA = explode('<object', $wimpyData);
$AwimpyHeightB = explode(' height="', $AwimpyHeightA[1]);
$AwimpyHeightC = explode("'", $AwimpyHeightB[1]);
$wimpyHeight = $AwimpyHeightC[0]+$extraMargin;
} else {
$wimpyWidth = "600";
$wimpyHeight = "400";
}
} else {
// Set width and height to the values set for the manula option
$myWimpyExists = true;
$wimpyWidth = $manualWidth;
$wimpyHeight = $manualHeight;
}
if($wimpyWidth <= $extraMargin){
$wimpyWidth = "400";
}
if($wimpyHeight <= $extraMargin){
$wimpyHeight = "400";
}
$newline = "\n";
$indent = " ";
// Pop up window HTML code:
$popUpHTML = $indent;
$popUpHTML .= '<a href="javascript:;" onClick="wimpyPopPlayer(\'';
$popUpHTML .= $wimpyPage;
$popUpHTML .= "','wimpyMP3player','width=";
$popUpHTML .= $wimpyWidth;
$popUpHTML .= ',height=';
$popUpHTML .= $wimpyHeight;
$popUpHTML .= '\')">';
// Text Link
$popUpHTMLdisplay = $popupButtonText;
// If using an image button, over-write the "Text" code with
// new code to display the image
if($popupButtonImage != ""){
$popUpHTMLdisplay = "";
$popUpHTMLdisplay .= '<img src="';
$popUpHTMLdisplay .= $popupButtonImage;
$popUpHTMLdisplay .= '" border="0" align="top"';
if($popupOnLoad){
$popUpHTMLdisplay .= ' onload="wimpyPopPlayer(\'';
$popUpHTMLdisplay .= $wimpyPage;
$popUpHTMLdisplay .= "','wimpyMP3player','width=";
$popUpHTMLdisplay .= $wimpyWidth;
$popUpHTMLdisplay .= ',height=';
$popUpHTMLdisplay .= $wimpyHeight;
$popUpHTMLdisplay .= '\')"';
}
$popUpHTMLdisplay .= '>'.$newline;
}
$popUpHTML .= $popUpHTMLdisplay.'</a>'.$newline;
// Wimpy HTML code
$wimpyHTML = $indent;
if($myWimpyExists){
// Dispaly "myWimpy.html" in an IFRAME:
$wimpyHTML .= '<IFRAME src="'.$wimpyPage.'" name="wimpy" width="'.$wimpyWidth.'" height="'.$wimpyHeight.'" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" ></IFRAME>'.$newline;
} else {
// Display error if "myWimpy.html" can not be found:
$wimpyHTML .= '
<p align="left"><b><font color="#CC0000">ERROR</font></b></p>
<p align="left">Could not locate the file: <a href="'.$wimpyPage.'" target="_BLANK">'.$wimpyPage.'</a>, </p>
<p align="left">The location to this file can be adjusted by editing the "wimpPage" variable within the file named "block-wimpy.php."</p>
<p align="left">Try opening "block-wimpy.html?quot; in a text editor and adjusting the "wimpyPage" option to the proper location to either "wimpy.php" or a customized "myWimpy.html?quot; page that you created (or can create) using the <a href="http://www.wimpyplayer.com/customize/" target="_blank">Customizer tool at www.wimpyplayer.com</a>. </p>
<p align="left">See the "readme.html?quot; file in the download package for more information, or <a href="http://www.wimpyplayer.com/support/PHPnuke.html" target="_blank">click here</a> for more information on using the Wimpy MP3 Player PHPnuke Block or to receive the latest version of the block. </p>'.$newline;
}
// Start the output table:
$displayHTML = "";
// if pop up link is ued, insert the javaScript Code:
if($showPopupLink){
$displayHTML = '<script language="JavaScript" type="text/JavaScript">'.$newline;
$displayHTML .= 'function wimpyPopPlayer(theFile,id,stuff) {'.$newline;
$displayHTML .= ' window.open(theFile,id,stuff);'.$newline;
$displayHTML .= '}'.$newline;
$displayHTML .= '</script>'.$newline;;
}
if($justShowLink && $showPopupLink){
$displayHTML .= '<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">'.$newline;
} else {
$displayHTML .= '<table width="'.($wimpyWidth+1).'" height="'.($wimpyHeight+1).'" border="0" cellpadding="0" cellspacing="0" align="center">'.$newline;
}
// See popup link option is set
if($showPopupLink){
// See if we should put pop up link on "top" or "both"
if($showPopupLink == 2 || $showPopupLink == 3 || $justShowLink == 1){
// generate a new row / cell for the top
$displayHTML .= ' <tr>'.$newline;
$displayHTML .= ' <td align="center" nowrap>'.$newline;
$displayHTML .= $popUpHTML;
$displayHTML .= ' </td>'.$newline;
$displayHTML .= ' </tr>'.$newline;
}
}
// If using a pop up, and pop up is set to pop up wimpy when the page
// loads, or if "Just Show Link" is set to 1, then don't display // wimpy in the page, just display the pop up link code:
if($justShowLink == 0){
$displayHTML .= ' <tr>'.$newline;
$displayHTML .= ' <td align="center">'.$newline;
$displayHTML .= $wimpyHTML;
$displayHTML .= ' </td>'.$newline;
$displayHTML .= ' </tr>'.$newline;
}
// See popup link option is set
if($showPopupLink){
// If "Just Show Link" is set, don't display the second link:
if($justShowLink == 0){
// See if we should put pop up link on "bottom" or "both"
if($showPopupLink == 1 || $showPopupLink == 3){
// generate a new row / cell for the bottom
$displayHTML .= ' <tr>'.$newline;
$displayHTML .= ' <td align="center" nowrap>'.$newline;
$displayHTML .= $popUpHTML;
$displayHTML .= ' </td>'.$newline;
$displayHTML .= ' </tr>'.$newline;
}
}
}
// Close the table
$displayHTML .= '</table>'.$newline;
// Set the "content" variable for PHP Nuke:
$content = $displayHTML;
// Only used during developement to test the PHP output
//print ($content);
?> |
|
|
|
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Sat Mar 10, 2012 11:25 am |
|
Glad you got it sorted out. Just a note, the align attribute is depreciated in html5, so if you don't want to fix this again later, I would suggest <div style="margin: 0 auto;">
It should work, although some table based themes may give a little trouble as there is a different set or rules for aligning inside of table cells. If you are using rn 2.5 you could use <div class="centered"> instead of inline styling as above.
BTW, nice theme ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|