Autor Zpráva
kuba95
Profil
Ahoj, mám flash fotogalerii na http://fotogalerie.mzf.cz. Fotky, které se tam zobrazují jsou napsané v jednom xml souboru:
<?xml version="1.0" encoding="utf-8"?>
<photos>
	
	<config
		folder="photos/"
		enable_fullscreen="true"
		galaxy_background="true"	
		no_of_rings="4"
		radius="300"
		vertical_spacing="30"
		default_zoom="10"			
		show_tooltip="true"
		thumbnail_width="100"
		thumbnail_height="100"
		thumbnail_back_alpha="0.3"
		photo_border_size="10"
		photo_border_color="#FFFFFF"
		close_button="true"
		previous_button="true"
		next_button="true"
		description="true"
		description_bg_color="#000000"
		description_bg_alpha="0.6"
		css_file="flashmo_210_style.css"
		tween_duration="0.6">
	</config>
	
	<photo>
		<thumbnail>s_photo_001.jpg</thumbnail>
		<filename>photo_001.jpg</filename>
		<tooltip>Photo Title 01</tooltip>
		<description><![CDATA[<p class="subtitle">Photo Title 01 goes here</p><p><a href="http://www.flashmo.com/donate" target="_parent">Lorem ipsum dolor sit amet</a>, consectetur adipiscing elit. <span class="highlight">Quisque at ante sit amet</span> erat laoreet <u>fermentum</u>. Quisque nec nisl. Nam scelerisque cursus dolor. Duis nulla diam, posuere ac, varius id, ullamcorper sit amet, libero.</p><p><span class="note">This text is dynamically loaded from the external XML file. This textfield supports HTML and CSS.</span></p>]]></description>
	</photo>
	
	<photo>
		<thumbnail>s_photo_002.jpg</thumbnail>
		<filename>photo_002.jpg</filename>
		<tooltip>Photo Title 02</tooltip>
		<description><![CDATA[<p class="subtitle">Photo Title 02 goes here</p><p><a href="http://www.flashmo.com/page/1" target="_blank">Fusce quis diam sit</a> amet tortor luctus pellentesque. Donec accumsan urna non elit tristique mattis. <b>Vivamus fermentum</b> orci viverra nisl. In nec magna id ipsum aliquam dictum. Quisque nec nisl.</p>]]></description>
	</photo>
	
	<photo>
		<thumbnail>s_photo_003.jpg</thumbnail>
		<filename>photo_003.jpg</filename>
		<tooltip>Photo Title 03</tooltip>
		<description><![CDATA[<p class="subtitle">Photo Title 03 goes here</p><p>In velit urna, <u>convallis id</u>, pharetra in, iaculis sit amet, mi. Praesent consectetur imperdiet mauris. Suspendisse at pede vel lorem pulvinar laoreet. Etiam et neque. Donec dapibus viverra est.</p><p><span class="note">This text is dynamically loaded from the external XML file. This textfield supports HTML and CSS.</span></p>]]></description>
	</photo>
</photos>

... atd atd

Potřeboval bych poradit nějaký script, který bych spustil po nahrání fotek a on by mi sám udělal ten soubor xml na ty moje fotky. Na jeden už jsem koukal, ale nevim, co s tim mam dělat:
<?php 
 $d = 'photos/' ; 
 $endline = "\n" ; 
 
 $dir = opendir ( $d ); 
 
 $output = '<?xml version="1.0" encoding="utf-8"?> '.$endline; 
 $output .= '<photos>
  	<config
		folder="photos/"
		enable_fullscreen="true"
		galaxy_background="true"	
		no_of_rings="4"
		radius="300"
		vertical_spacing="30"
		default_zoom="10"			
		show_tooltip="true"
		thumbnail_width="100"
		thumbnail_height="100"
		thumbnail_back_alpha="0.3"
		photo_border_size="10"
		photo_border_color="#FFFFFF"
		close_button="true"
		previous_button="true"
		next_button="true"
		description="true"
		description_bg_color="#000000"
		description_bg_alpha="0.6"
		css_file="flashmo_210_style.css"
		tween_duration="0.6">
	</config> '.$endline; 
 while($e = readdir($dir)) 
 { 
 if($e!='.' && $e!='..') 
 { 
 $output .= '   <image photo="'.$e.'">'.$endline; 
 $output .= '       <title>'.$e.'</title>'.$endline; 
 $output .= '   </image>'.$endline; 
 } 
 } 
 $output .= '<photos>'.$endline; 
 
 //code to write the $output to a file 
print_r($output)

$f =fopen("flashmo_236_photo_list.xml", "w");
fwrite($f, .$output);
fclose($f);
?>


A nebo aby se ten seznam nějak udělal do toho index.html a vůbec se nepoužíval externí xml soubor. To by se pak asi dělalo při každé návštěvě.
Poradí mi prosím někdo??

P.S. ten tag <description> tam nechci.

P.S.2 dam sem ještě index.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>3D Spiral Gallery</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta name="Keywords" content="3D Spiral Gallery, Photo Gallery, Flash XML, Papervision3D, Tweener, ActionScript 3, flashmo, open source" />
		<meta name="Description" content="3D Spiral Gallery is a free photo gallery using Flash XML ActionScript 3.0, Papervision3D and Tweener." />
		<style type="text/css" media="screen">
			html, body, #flashmo_carousel	
			{ height:100%; }
			body						
			{ margin:0; padding:0; overflow:hidden; }
		</style>	
		<script type="text/javascript" src="swfobject.js"></script>
		<script type="text/javascript">
		var flashvars = {};
		flashvars.xml_file = "flashmo_238_photo_list.xml";
		var params = {};
		params.allowfullscreen = true;
		var attributes = {};
		swfobject.embedSWF("flashmo_238_3d_spiral_gallery.swf", "flashmo_gallery", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
		</script>

	</head>
	<body>
		<div id="flashmo_gallery">
			<div id="alternative_content">
				<h1><a href="http://www.flashmo.com" title="3D Spiral Gallery">3D Spiral Gallery</a> from flashmo.com</h1>
        		<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
			</div>
            <br /><br />
			<a href="http://www.flashmo.com">Free Flash Gallery</a>
		</div>

	</body>
</html>
Michal Benda
Profil
Moc nechápu na co se ptáš... Ten script dělá přesně to, co ty požaduješ... Přes ftp si nahraješ do zvolené složky fotky a tento script ti pak po jeho spuštění z této složky vybere všechny soubory a vytvoří xml soubor... Jediný co, tak musíš poupravit ten převod, aby souhlasil s formátem toho xml souboru pro tu fotogalerii...

konkrétně takto:
místo tohoto
$output .= '   <image photo="'.$e.'">'.$endline; 
 $output .= '       <title>'.$e.'</title>'.$endline; 
 $output .= '   </image>'.$endline; 
 

napsat
$output .= "<photo>".$endline;
$output .= "<thumbnail>s_".$e."</thumbnail>".$endline;
$output .= "<filename>".$e."</filename>".$endline;
$output .= "<tooltip>".$e."</tooltip>".$endline;
$output .= "</photo>".$endline;
kuba95
Profil
děkuji, už jsem to vyřešil jinak
Toto téma je uzamčeno. Odpověď nelze zaslat.