Need help for a php/flash slideshow error, please!
Posted: Fri May 29, 2009 11:33 am
Our client has a website that uses a php/flash slideshow throughout. The script used is licensed and the script uses a license number to confirm that it's a registered copy.
The Problem: The client bought a new domain name which is redirected to the site. When visitors come in through the new domain name in some browsers on a pc, the license number isn't working. Strangely, it does work on a Mac and on some PCs. The script is using an if/else statement to decipher which domain the user is coming from, and then using the correct license code.
Anyway, if you feel like you know what's going on we would love the help.
Here is the code where we inserted the if/else script to send the correct license number:
The Problem: The client bought a new domain name which is redirected to the site. When visitors come in through the new domain name in some browsers on a pc, the license number isn't working. Strangely, it does work on a Mac and on some PCs. The script is using an if/else statement to decipher which domain the user is coming from, and then using the correct license code.
Anyway, if you feel like you know what's going on we would love the help.
Here is the code where we inserted the if/else script to send the correct license number:
Code: Select all
<?php
// slideshow.php v2.4
// ------------------------------------------------------------------------
// Copyright (c) 2004, maani.us
// ------------------------------------------------------------------------
// This file is part of "PHP/SWF Slideshow"
//
// PHP/SWF Slideshow is a shareware. See http://www.maani.us/slideshow/ for
// more information.
// ------------------------------------------------------------------------
# adjust the license code for tjpa.com or konstlifestyle.com
# tjpa.com: IU2QE-2G2EMPU4T7KBGRZB67041P9K
# konstlifestyle.com: HUBEF0AAQM26YFSLRTO9DN6IKN49JK
function Insert_Slideshow( $flash_file, $php_source, $width=320, $height=240, $license){
if($_SERVER['HTTP_HOST']=="www.konstsiematic.com"){
$license='GUB83015Z0G6YFSLRTO9DN6IKN49JK';
}else{
$license='HUBEF0AAQM26YFSLRTO9DN6IKN49JK';
}
$php_source=urlencode($php_source);
$html="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' ";
$html.="WIDTH=".$width." HEIGHT=".$height." id='slideshow' ALIGN=''>";
$html.="<PARAM NAME=movie VALUE='".$flash_file."?php_source=".$php_source;
if($license!=null){$html.="&license=".$license;}
$html.="'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#000000> <PARAM NAME=wmode VALUE=transparent> ";
$html.="<EMBED src='".$flash_file."?php_source=".$php_source;
if($license!=null){$html.="&license=".$license;}
$html.="' quality=high bgcolor=#000000 WIDTH=".$width." HEIGHT=".$height." NAME='slideshow' ALIGN='' wmode=transparent ";
$html.="TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>";
return $html;
}
//====================================
function Send_Slideshow_Data( $slideshow=array() ){
$xml="<slideshow>\r\n\r\n";
$index=0;
$aList=array("slide","transition","motion","sound","navigation","action", "link","draw_circle","draw_line","draw_rect","draw_text");
do {
$continue=false;
for($i=0;$i<count($aList);$i++){
if(isset($slideshow[$aList[$i]][$index])){
$continue=true;
break;
}
}
if($continue){
$xml.="\t<slide>\r\n";
for($i1=0;$i1<6;$i1++){
if(isset($slideshow[$aList[$i1]][$index])){
if($aList[$i1]=="slide"){$xml.="\t\t<image";}
else{$xml.="\t\t<".$aList[$i1];}
$keys=array_keys((array) $slideshow[$aList[$i1]][$index]);
for($i2=0;$i2<count($keys);$i2++){
$xml.=" ".$keys[$i2]."='".$slideshow[$aList[$i1]][$index][$keys[$i2]]."'";
}
$xml.=" />\r\n";
}
}
for($i1=6;$i1<count($aList);$i1++){
if(isset($slideshow[$aList[$i1]][$index])){
$xml.="\t\t<".$aList[$i1].">\r\n";
for($i2=0;$i2<count($slideshow[$aList[$i1]][$index]);$i2++){
if($aList[$i1]=="link"){$xml.="\t\t\t<area";}
else{$xml.="\t\t\t<".substr($aList[$i1],5);}
$keys=array_keys((array) $slideshow[$aList[$i1]][$index][$i2]);
for($i3=0;$i3<count($keys);$i3++){
if($keys[$i3]!="text"){$xml.=" ".$keys[$i3]."='".$slideshow[$aList[$i1]][$index][$i2][$keys[$i3]]."'";}
}
if($aList[$i1]=="draw_text"){$xml.=">".$slideshow[$aList[$i1]][$index][$i2]['text']."</text>\r\n";}
else{$xml.=" />\r\n";}
}
$xml.="\t\t</".$aList[$i1].">\r\n";
}
}
$xml.="\t</slide>\r\n\r\n";
$index++;
}
} while ($continue);
for($i=0;$i<count($aList);$i++){
unset($slideshow[$aList[$i]]);
}
$keys1= array_keys((array) $slideshow);
for ($i1=0;$i1<count($keys1);$i1++){
$keys2=array_keys((array) $slideshow[$keys1[$i1]]);
$xml.="\t<".$keys1[$i1];
for($i2=0;$i2<count($keys2);$i2++){
$xml.=" ".$keys2[$i2]."='".$slideshow[$keys1[$i1]][$keys2[$i2]]."'";
}
$xml.=" />\r\n";
}
$xml.="</slideshow>\r\n";
echo $xml;
}
//====================================
?>