CUSTOM BLOCK WITH FLASH WHICH I CAN NOT GET TO DISPLAY

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   CUSTOM BLOCK WITH FLASH WHICH I CAN NOT GET TO DISPLAY
tribaljohn
CZ Newbie
tribaljohn has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 29, 2005
0.00 posts per day
Posts: 6
Points: 902
   
Hi i am trying to add some flash to this block, but I can not get the flash to display, could some one please help me to alter the code and display this flash.

Thanks in advance.

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
    Header("Location: index.html");
    die();
}
$content = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=6,0,29,0\" width=\"150\" height=\"100\"> "
. "<param name=\"movie\" value=\"small-logo.swf\"> "
. "<param name=quality value=high> "
. "<embed src=\"http://www.toolclan.com/small-logo.swf\" quality=high
pluginspage=\"http://www.macromedia.com/shockwave/
download/index.cgi?P1_Prod_Version=ShockwaveFlash\"
type=\"application/x-shockwave-flash\"
width=\"150\" height=\"100\"></embed>"
. "</object>";

?>

<?php

// NOTE: XML FEEDS ARE ONLY AVALIBLE TO EXCLUSIVE SUBSCRIBERS

// Simple script to print out a very basic server status page using the ServerSpy.net Monitor xml
//
// Use this code in a 'block' on php-Nuke websites. Should also work as a simple webpage for
// others that have php/xml support.
//
// Tutorial for XML/PHP http://www.webmasterbase.com/article/560
//
// This PHP script is developed as an example method of retrieving ServerSPy data via XML


ob_start();

$smonXML = 'http://www.serverspy.net/bin/smonXml.mpl?mid=85343';
// This is the XML URL of the servermonitor you wish to query.

// Scroll down to amend the HTML output to the style you wish to achieve.

$smon = Array();
global $smon;
$smon['PLAYERS'] = Array();
$smon['DETAILS'] = Array();
$smon['RULES'] = Array();
$smon['SERVERSPY'] = Array();

function startElement($parser, $tagName, $attrs) {
global $smon;
if ($tagName == 'PLAYERS'){
$smon['PLAYERS'][$attrs['NAME']] = Array();
$smon['PLAYERS'][$attrs['NAME']]['CONNECTED'] = $attrs['CONNECTED'];
$smon['PLAYERS'][$attrs['NAME']]['KILLS'] = $attrs['KILLS'];

} elseif ($tagName == 'SERVERSPY'){
$smon['SERVERSPY'][$attrs['NAME']] = $attrs['VALUE'];

} elseif ($tagName == 'RULES'){
$smon['RULES'][$attrs['NAME']] = $attrs['VALUE'];

} elseif ($tagName == 'DETAILS'){
$smon['DETAILS'][$attrs['NAME']] = $attrs['VALUE'];
}

// while (list ($key, $val) = each ($attrs)) {
// } // end while
}


function characterData($parser, $data) {
// no wrapped data used
}


function endElement($parser, $tagName) {
// no wrapped data used
}



// Create an XML parser
$xml_parser = xml_parser_create();

// Set the functions to handle opening and closing tags
xml_set_element_handler($xml_parser, "startElement", "endElement");

// Set the function to handle blocks of character data
xml_set_character_data_handler($xml_parser, "characterData");

// Open the XML file for reading
$fp = fopen($smonXML,"r") or die("Error reading ServerSpy.net XML feed. Either the URL is invalid or the XML feed has been updated.");

// Read the XML file 4KB at a time
while ($data = fread($fp, 4096))
// Parse each 4KB chunk with the XML parser created above
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
// Close the XML filef
fclose($fp);

// Free up memory used by the XML parser
xml_parser_free($xml_parser);


// Print EXAMPLE HTML layout.
// Below is just the sample code to get you started on creating your own layout.
// We're assuming that if you want to use the XML/PHP API solution that
// you'd rather tweak this output yourself. So we've kept it simple for you below.

print "<TABLE BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" WIDTH=\"100%\">\n";
print "<TR><TD ALIGN=\"left\" WIDTH=\"100%\" VALIGN=\"top\" >\n";

// Details
print "<b><center>".$smon['DETAILS']['name']."</center></b>\n";
print "<b><center>".$smon['DETAILS']['ip']."</center></b><br>\n";
print "Map: ".$smon['DETAILS']['map']."<br>\n";
print "Players: <b>".$smon['DETAILS']['currentPlayers']."/".$smon['DETAILS']['maxPlayers']."</b><br>\n";




//while (list ($key, $val) = each ($smon['DETAILS'])){
// print "$val<br>\n";
//}
print "<br><br>";

// Players
//print "<b>Server Rules</b><br>\n";
//while (list ($key, $val) = each ($smon['RULES'])){
// print "$key = $val<br>\n";
//}
//print "<br><br>";

// Players
print "<b><center>-Players Online-</center></b><br>\n";
while (list ($key, $val) = each ($smon['PLAYERS'])){
print "$key<br>\n";
}

print "</TD></TR>";
print "</TABLE><BR>";

// end of file

$output = ob_get_contents();
ob_end_clean();
$content = $output;
$content .= "<center><A HREF=\"http://www.serverspy.net/site/serverranks/\"><img src=\"http://www.serverspy.net/bin/srank.mpl?a=64.237.62.226:12203\" width=\"120\" height=\"100\" border=\"0\"></A><br></center>";
// end of file


?>


If you can help me with this could you please email me at [ Register or login to view links on this board. ]

Thanks


Back to top Reply with quote
#2   re: CUSTOM BLOCK WITH FLASH WHICH I CAN NOT GET TO DISPLAY
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.49 posts per day
Posts: 3765
Points: 351,412
   
You have two different paths to your flash file:
[ Register or login to view links on this board. ] and
small-logo.swf

They must both be the same.



Back to top Reply with quote
#3   re: CUSTOM BLOCK WITH FLASH [FIXED]
tribaljohn
CZ Newbie
tribaljohn has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 29, 2005
0.00 posts per day
Posts: 6
Points: 902
   
I adjusted the code, by adding an echo in from of the flash content.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum