fredd Posted March 5, 2010 Share Posted March 5, 2010 Hi guys,I'm new with php and at the moment I'm in trouble. I'm having on my small site a photogallery. The structure is this:-form with uploader -directories for originals and thumbs -database with the originals information -a pagination code that give me a table of clickable thumbs that send me to a gallery of the originals. I'm working on it and the result I want to reach is to have a structure like this:-form with uploader -directory and database for the flv files -a pagination code that give me a table with all the video of my dir. I'm having the form and the uploader working fine. My problem is that I don't know how to create a code to insert in each td my flv file with the associated swf object. The pagination code is this: <title>visual.php</title> </head> <body> <?php include('config.php'); //contatore per l'impaginazione $i = 0; //query recupera informazioni immagini $sql = 'SELECT * FROM gallery ORDER BY pic_id DESC'; $result = mysql_query($sql); if (!$result) { die(mysql_error()); } //memorizzo i risultati in un'array multidimensionale while($row = mysql_fetch_array($result)) { $field[$i] = $row; $i++; } //informa lo script quale pagina si sta visualizzando $page = empty($_GET['page']) ? 1 : $_GET['page']; //numero totale di immagini equivale alle righe estratte dal database $total_files = count($field); //pagine totali dividendo il totale delle immagini fratto il numero d'immagini per pagina $total_pages = ceil($total_files/$pagination); //creo il menu di navigazione $pages = array(); if($total_files > 0) { for($p =1; $p <= $total_pages; $p++) { $class = ($page == $p) ? 'active' : 'item'; $pages[] = '<li class=" ' .$class . ' "><a href=" ' . $_SERVER['PHP_SELF'] . '?page=' .$p. ' ">' . $p . '</a></li>'; } echo '<ul class="menu">'; echo implode(" ", $pages); echo '</ul>'; //contatore per la tabella html che contiene le thumbs $td = 0; //contatore per immagini di ciascuna pagina $file = 0; ?> <div class="clear"></div> <table align="center" class="table_gallery"> <?php $thumbs = "./thumbs/"; $upload = "./uploads/"; $caption = array(); // il ciclo parte dalla prima immagine all'ultima della stessa pagina for($i = ($page - 1) * $pagination; $i < $page * $pagination; $i++) { $caption[$i] = (!$field[$i][7]) ? $field[$i][6] : $field[$i][7]; if ($td == 0) echo "<tr>"; echo '<td class="thumber" align="center" valign="top">'; echo '<div class="container">'; echo '<div class="thumb">'; echo '<a href="'. $upload . $field[$i][1] . $field[$i][5] .'" rel="shadowbox[gallery]" title="'.$caption[$i].'">'; echo '<img src="'. $thumbs . $field[$i][1] . $field[$i][5] .'" width="'.$field[$i][3].'" height="'.$field[$i][4].'" />'; echo '</a>'; echo '</div>'; echo '<div class="details">'; echo '<div class="title">' . $field[$i][6] . '</div>'; echo '<div class="time">' . $field[$i][9] . '</div>'; echo '<div class="author">Caricato da : <span>' . $field[$i][8] . '</span></div>'; echo '</div>'; echo '</div>'; echo '</td>'; $td++; $file++; if($td == $rows) { $td = 0; echo "</tr>"; } if(($i + 1) == $total_files) { while($blank = $file % $rows) { echo '<td> </td>'; $file++; } echo "</tr>"; break; } } } ?> </table> </body> I guess I should change this part: echo '<a href="'. $upload . $field[$i][1] . $field[$i][5] .'" rel="shadowbox[gallery]" title="'.$caption[$i].'">'; echo '<img src="'. $thumbs . $field[$i][1] . $field[$i][5] .'" width="'.$field[$i][3].'" height="'.$field[$i][4].'" />'; echo '</a>'; With my swf object that should be something like this: <div id="player_box"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="240" id="FLVPlayer"> <param name="movie" value="FLVPlayer_Progressive.swf" /> <param name="quality" value="high" /> <param name="wmode" value="opaque" /> <param name="scale" value="noscale" /> <param name="salign" value="lt" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=uploads/sp11&autoPlay=false&autoRewind=false" /> <param name="swfversion" value="8,0,0,0" /> <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. --> <param name="expressinstall" value="Scripts/expressInstall.swf" /> <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="FLVPlayer_Progressive.swf" width="320" height="240"> <!--<![endif]--> <param name="quality" value="high" /> <param name="wmode" value="opaque" /> <param name="scale" value="noscale" /> <param name="salign" value="lt" /> <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=uploads/sp11&autoPlay=false&autoRewind=false" /> <param name="swfversion" value="8,0,0,0" /> <param name="expressinstall" value="Scripts/expressInstall.swf" /> <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --> <div> <h4>Content on this page requires a newer version of Adobe Flash Player.</h4> <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> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> <script type="text/javascript"> <!-- swfobject.registerObject("FLVPlayer"); //--> </script> The second problem is that the .flv file into the .swf object should be a '$file' to have a sort of multiplayer. I'm lost,I know, but I hope anyone of you would have any good suggest,idea,example or tutorial for me. Cheers guys,bye. Link to comment https://forums.phpfreaks.com/topic/194245-flvswfobject-and-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.