killermark91 Posted October 22, 2009 Share Posted October 22, 2009 Hi, I'm getting a problem with a shareware photo slideshow php code, and I hope you guys can help me here. Now as I said earlier, I didn't write this code myself, so I don't know what the heck everything means. I'm posting all of the code because I can't find it where it is wrong, except with that line 17 but as said before, I don't even get this piece of code ><. Thanks in advance whoever can help me ^^. Oh and if someone could tell me how to remove the link on the slideshow, much appreciated ^^ <?php // slideshow.php v2.6 // ------------------------------------------------------------------------ // Copyright (c) 2004-2006, 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. // ------------------------------------------------------------------------ function Insert_Slideshow( $flash_file, $php_source, $width=320, $height=240, $license=null ){ $php_source=urlencode($php_source); $protocol = (strtolower($_SERVER['HTTPS']) != 'on')? 'http': 'https'; $html="<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='".$protocol."://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' "; if(strpos ($flash_file,"slideshow_id=")===false){$id="slideshow";} else{ $id=substr($flash_file,strpos($flash_file,"slideshow_id=")+strlen("slideshow_id=")); $id=substr($id,0,strpos($id,"&")); } $html.="WIDTH='".$width."' HEIGHT='".$height."' id='".$id."' />"; $u=(strpos ($flash_file,"?")===false)? "?" : ((substr($flash_file, -1)==="&")? "":"&"); $html.="<PARAM NAME='movie' VALUE='".$flash_file.$u."php_source=".$php_source."&stage_width=".$width."&stage_height=".$height; if($license!=null){$html.="&license=".$license;} $html.="' /> <PARAM NAME='quality' VALUE='high' /><PARAM NAME='bgcolor' VALUE='#000000' /><PARAM NAME='wmode' VALUE='transparent' /><PARAM NAME='AllowScriptAccess' value='sameDomain' />"; $html.="<EMBED src='".$flash_file.$u."php_source=".$php_source."&stage_width=".$width."&stage_height=".$height; if($license!=null){$html.="&license=".$license;} $html.="' quality='high' bgcolor='#000000' WIDTH='".$width."' HEIGHT='".$height."' NAME='".$id."' wmode='transparent' swLiveConnect='true' AllowScriptAccess='sameDomain' "; $html.="TYPE='application/x-shockwave-flash' PLUGINSPAGE='".$protocol."://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++){ if($keys1[$i1]=="license"){$xml.="\t<".$keys1[$i1].">".$slideshow[$keys1[$i1]]."</".$keys1[$i1].">\r\n";} else{ $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; } //==================================== ?> Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/ Share on other sites More sharing options...
Daniel0 Posted October 22, 2009 Share Posted October 22, 2009 $_SERVER['HTTPS'] is only set if you're running on HTTPS, so you could do $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http'; instead. Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-941976 Share on other sites More sharing options...
killermark91 Posted October 22, 2009 Author Share Posted October 22, 2009 aaaah great, thx bud :D :D Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-941983 Share on other sites More sharing options...
Daniel0 Posted October 22, 2009 Share Posted October 22, 2009 You're welcome. I've marked your topic as solved. There is a little button on the bottom left corner (almost right above Quick Reply) you can use yourself as well. Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-941994 Share on other sites More sharing options...
killermark91 Posted October 22, 2009 Author Share Posted October 22, 2009 yeah well that's one part solved. the error part. Now the other part, the link. If I click on the slideshow, it will link me to a page, but I want the link to be removed, if that is possible. any chance? Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-942005 Share on other sites More sharing options...
Daniel0 Posted October 22, 2009 Share Posted October 22, 2009 Oh sorry, I didn't notice there was two questions. I'm not sure which link you're talking about though. Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-942008 Share on other sites More sharing options...
killermark91 Posted October 22, 2009 Author Share Posted October 22, 2009 well if I click the slideshow, I get directed to a website (http://www.maani.us/slideshow/) but I would like to remove that. I tried searching the code which contained that URL, but I couldn't find it, strangely. Oh and got another question added: how can I put that slideshow in the center of the page, because if I use some HTML with it like this (I collapsed the php part) : <HTML> <BODY> <center> <?php ?> </center> </BODY> </HTML> then I can't see the pictures I put in it anymore Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-942033 Share on other sites More sharing options...
Daniel0 Posted October 22, 2009 Share Posted October 22, 2009 well if I click the slideshow, I get directed to a website (http://www.maani.us/slideshow/) but I would like to remove that. I tried searching the code which contained that URL, but I couldn't find it, strangely. Well, the slideshow is made in Flash, so I couldn't possibly tell you. Oh and got another question added: how can I put that slideshow in the center of the page, because if I use some HTML with it like this (I collapsed the php part) : A typical way of centering a block element is to give it a width and then set the left and right margin to auto. Quote Link to comment https://forums.phpfreaks.com/topic/178605-notice-undefined-index-https-in-hslideshowphp-on-line-17/#findComment-942037 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.