WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
<div id="slideshow"> [[SlideShow?dir=folder_name_from_media_folder]]</div>
$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.'); $names = array();while ($file = readdir($folder)) { $ext=strtolower(substr($file,-4)); if ($ext==".jpg"||$ext==".gif"||$ext==".png"){ $names[count($names)] = $file; }}closedir($folder);reset(shuffle($names));array_unshift($names," ");if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}$count=1;while(($image=next($names))and(($count<=$num)or(!isset($num)))){if( $count ==1){$class=' class="active"';}else{$class='';}$name=substr($image,0,-4);if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.' border=0"/>';}else{$images=$images.' <img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' />';}if($link=="y"){$images=$images.'</a>';}$count++;}return $images;
<?php //ignore$wb_page_data = str_replace('</head>','<script type="text/javascript">your script</script><link href="'.TEMPLATE_DIR.'/gyour styles.css" rel="stylesheet" type="text/css" /></head>', $wb_page_data );
[[SlideShow?dir=folder_name_from_media_folder]]
<?php //ignorereturn '<div id="slideshow">'.$slideshow.'</div>;
I dint know that, but I keep learning php every day
$wb_page_data = str_replace('</head>','<script language="JavaScript" type="text/javascript" src="'.TEMPLATE_DIR.'/slideshow.js"></script> </head>', $wb_page_data );$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.'); $names = array();while ($file = readdir($folder)) { $ext=strtolower(substr($file,-4)); if ($ext==".jpg"||$ext==".gif"||$ext==".png"){ $names[count($names)] = $file; }}closedir($folder);reset(shuffle($names));array_unshift($names," ");if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}$count=1;while(($image=next($names))and(($count<=$num)or(!isset($num)))){if( $count ==1){$class=' class="active"';}else{$class='';}$name=substr($image,0,-4);if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.' border=0"/>';}else{$images=$images.' <img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' />';}if($link=="y"){$images=$images.'</a>';}$count++;}return '<div id="slideshow">'.$images.'</div>';
if($scriptsin=="media"){$wb_page_data = str_replace('</head>','<script language="JavaScript" type="text/javascript" src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/jquery-1.2.6.min.js"></script><script language="JavaScript" type="text/javascript" src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/slideshow.js"></script></head>', $wb_page_data );} elseif ($scriptsin=="template") {$wb_page_data = str_replace('</head>','<script language="JavaScript" type="text/javascript" src="'.TEMPLATE_DIR.'/jquery-1.2.6.min.js"></script><script language="JavaScript" type="text/javascript" src="'.TEMPLATE_DIR.'/slideshow.js"></script></head>', $wb_page_data );}else {$wb_page_data = str_replace('</head>','<script language="JavaScript" type="text/javascript" src="'.TEMPLATE_DIR.'/jquery-1.2.6.min.js"></script><script language="JavaScript" type="text/javascript" src="'.TEMPLATE_DIR.'/slideshow.js"></script></head>', $wb_page_data );}$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.'); $names = array();while ($file = readdir($folder)) { $ext=strtolower(substr($file,-4)); if ($ext==".jpg"||$ext==".gif"||$ext==".png"){ $names[count($names)] = $file; }}closedir($folder);reset(shuffle($names));array_unshift($names," ");if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}$count=1;while(($image=next($names))and(($count<=$num)or(!isset($num)))){if( $count ==1){$class=' class="active"';}else{$class='';}$name=substr($image,0,-4);if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.' border=0"/>';}else{$images=$images.' <img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' />';}if($link=="y"){$images=$images.'</a>';}$count++;}return '<div id="slideshow">'.$images.'</div>';
#slideshow { position:relative; width: 250px; height: 250px;}#slideshow IMG { position:absolute; top:0; left:0; z-index:8; opacity:0.0;}#slideshow IMG.active { z-index:10; opacity:1.0;}#slideshow IMG.last-active { z-index:9;}
Parse error: syntax error, unexpected T_STRING in /home/welcom/public_html/index.php on line 109
$(function() { setInterval( "slideSwitch()", 4000 ); ---- 4000 = 4 seconds});
$(function() { setInterval( "slideSwitch()", $some_variable ); });
<?php //ignore$wb_page_data = str_replace('</body>','<!--Jquery Core--><script src="'.WB_URL.'/include/jquery/jquery-min.js" type="text/javascript"></script></body>', $wb_page_data );return true;
<?php //ignore as usual$wb_page_data = str_replace('</body>','<!--Jquery Gallery--><script src="'.WB_URL.'/include/jquery/plugins/jquery-gallery.js" type="text/javascript"></script><link href="'.WB_URL.'//include/jquery/plugins/jquery-gallery.css" rel="stylesheet" type="text/css"/></body>', $wb_page_data );$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.'); $names = array();while ($file = readdir($folder)) { $ext=strtolower(substr($file,-4)); if ($ext==".jpg"||$ext==".gif"||$ext==".png"){ $names[count($names)] = $file; }}closedir($folder);reset(shuffle($names));array_unshift($names," ");if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}$count=1;while(($image=next($names))and(($count<=$num)or(!isset($num)))){if( $count ==1){$class=' class="active"';}else{$class='';}$name=substr($image,0,-4);if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.'/>';}else{$images=$images.' <img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' />';}if($link=="y"){$images=$images.'</a>';}$count++;}return '<div id="gallery"><div id="pictures">'.$images.'</div></div><div id="prev"><a href="#previous">« Previous Picture</a></div><div id="next"><a href="#next">Next Picture »</a></div>';
[[jquery]][[JqueryGallery?dir=images]]
If you wonder how, images are curved in photoshop Anyway, I like this script
reset(shuffle($names));
shuffle(reset($names));