print pathinfo($varrer[$i], PATHINFO_BASENAME) . "<br />";[]s Até mais
Listando Arquivos De Um Diretório...
#16
Posted 28/01/2006, 13:08
#17
Posted 31/01/2006, 15:04
#19
Posted 11/03/2006, 00:27
#20
Posted 12/03/2006, 08:47
#21
Posted 12/03/2006, 09:02
#22
Posted 31/03/2006, 14:17
mas gostaria de saber, como poderia fazer a paginacao para passar para o proximo arquivo.
Por exemplo, eu tenho uma pasta com fotos. Faco a listagem delas em miniaturas com link para abrir a foto grande em janela.
Ao abrir a pagina com 1 unica foto, precisava de um link para passar para a proxima imagem ou arquivo.
Como fazer isso ?
#23
Posted 01/04/2006, 13:07
Tentei entende-lo para alterar, mas nao achei como resolver.
<?php $dir = 'pasta' $filtro=".jpg;"; $nivel=""; $n_foto = 0; $diraberto = opendir($dir); // Abre o diretorio especificado chdir($dir); // Muda o diretorio atual p/ o especificado while($arq = readdir($diraberto)) { // Le o conteudo do arquivo if($arq == ".." || $arq == ".")continue; // Desconsidera os diretorios $arr_ext = explode(";",$filtro); foreach($arr_ext as $ext) { $extpos = (strtolower(substr($arq,strlen($arq)-strlen($ext)))) == strtolower($ext); if ($extpos == strlen($arq) and is_file($arq)) { // Verifica se o arquivo é igual ao filtro $foto[$n_foto] = $nivel.$arq; // Imprimi em forma de arvore $n_foto++; } } if (is_dir($arq)) { $foto[$n_foto] = $nivel.$arq; // Imprimi em forma de arvore $n_foto++; varre($arq,$filtro,$nivel." "); // Executa a funcao novamente se subdiretorio } } chdir(".."); // Volta um diretorio closedir($diraberto); // Fecha o diretorio atual if($nfoto < $n_foto){ echo "<IMG SRC=\"$dir/$foto[$nfoto]\">"; } else { $nfoto = 0; echo "<IMG SRC=\"$dir/$foto[$nfoto]\">"; } ?> <form> <?php if($nfoto != 0) { $aux_foto = $nfoto - 1; echo "<A HREF=\"fotos.php?id=$dir&nfoto=$aux_foto&play=cancelar\" class='menu1'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Anterior</font></a>"; } else { echo " "; } echo " "; if($nfoto != $n_foto-2) { $aux_foto = $nfoto + 1; echo "<A HREF=\"fotos.php?id=$dir&nfoto=$aux_foto&play=cancelar\" class='menu1'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>Próxima</font></a>"; } else { echo " "; } ?> <br> <a href="fotos.php?id=<? echo $dir; ?>&nfoto=1&play=cancelar" class="menu1"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Primeira</font></a> <? $ulfoto = $n_foto-2; echo "<font size='2' face='Verdana, Arial, Helvetica, sans-serif'><a href='fotos.php?id=$dir&nfoto=$ulfoto&play=cancelar' class='menu1'>Última</a></font>"; ?><br> <br> <br></center> </form>
Alguem pode ajudar ?
#24
Posted 03/04/2006, 09:16
#25
Posted 12/04/2007, 08:43
victor/redstyle
[Primeiro Exemplo]
Acrescentando javascript - innerHTML e fazendo a foto abrir em uma div após clicada
coisinha boba né ?
mais garanto que na hora do sufoco um se mata para achar algo assim.....
<? $pag = $_GET['pag'] ? $pag : 1; $rpp = 3; $inicio = $pag * $rpp - $rpp; $dir = ("./"); $abrir = opendir($dir); $arquivos = array(); while (false !== ($file = readdir($abrir))) { if ($file <> "." && $file <> "..") { if (!is_dir($file)){ $arquivos[] = $file; } } } $total = count($arquivos); $paginas = ceil ($total/$rpp); echo ("<table cellpadding='5' cellspacing='5' border='0'>"); for ($i = $inicio; $i < $inicio+$rpp && $i < $total; $i++) { if($i%3==0) { if (substr("$dir/$arquivos[$i]", -4) == ".jpg") { echo ("</tr><tr><td><a href=\"#\" onClick=\"abre('$dir/$arquivos[$i]')\"><img src='$dir/$arquivos[$i]' width='80' height='60'></a></td>"); } } else { if (substr("$dir/$arquivos[$i]", -4) == ".jpg") { echo "<td><a href=\"#\" onClick=\"abre('$dir/$arquivos[$i]')\"><img src='$dir/$arquivos[$i]' width='80' height='60'></a></td>"; } } } echo ("</table>"); if ($pag > 1) { $ant = $pag - 1; echo "< <a href=\"".$PHP_SELF."?pag=".$ant."\">Anterior</a> "; } echo "| <em>Página <b>".$pag."</b> </em> | "; if ($pag < $paginas) { $pro = $pag + 1; echo "<a href=\"".$PHP_SELF."?pag=".$pro."\">Próxima</a> > "; } ?> <script language="JavaScript"> function abre(imagem) { document.getElementById("fotos").innerHTML="<img src='"+ imagem +"'>"; } </script> <div id="fotos"></div>
[Segundo Exemplo]
Usando paginação e dividido em coluna tableless (usando div's)
peguei um poco do victor e do redstyle, felipe juntei os 3
só para mostrar um exemplo em div, mais precisa tirar aquela segunda opção do felipe
depois do primeiro }else{ (senão) pq a div não tem erro é facinho para colunizar
fiz meio rapidaum so para dar um exemplo, pq todo mundo coloca em tabela, mais
é legal tb montar em DIV.
<style> .container { width: 160px; } .div_imagem { float: left; width: 75px; } .div_paginacao { float: left; width: 160px; } </style> <?php $pag = $_GET['pag'] ? $pag : 1; $rpp = 10; // Registros por página $inicio = $pag * $rpp - $rpp; $dir = '../galerias/fotos/croco090207'; // Diretório a ser varrido $abrir = opendir($dir); $arquivos = array(); while (false !== ($file = readdir($abrir))) { if ($file <> "." && $file <> "..") { if (!is_dir($file)){ $arquivos[] = $file; } } } $total = count($arquivos); $paginas = ceil ($total/$rpp); echo "<div class=\"container\">"; for ($i = $inicio; $i < $inicio+$rpp && $i < $total; $i++) { if($i%2==0) { if (substr("$dir/$arquivos[$i]", -4) == ".jpg") { echo ("<div class='div_imagem'><a href=\"#\" onClick=\"abre('$dir/$arquivos[$i]')\"><img src='$dir/$arquivos[$i]' width='75' height='56' border='0' alt=''/></a></div>"); } } else { if (substr("$dir/$arquivos[$i]", -4) == ".jpg") { echo "<div class='div_imagem'><a href=\"#\" onClick=\"abre('$dir/$arquivos[$i]')\"><img src='$dir/$arquivos[$i]' width='75' height='56' border='0' alt=''/></a></div>"; } } } echo ("</div><br/>"); echo "<div class=\"container\">"; echo "<div class='div_paginacao'>"; if ($pag > 1) { $ant = $pag - 1; echo "<a href=\"".$PHP_SELF."?pag=".$ant."\">Ant</a> "; } echo "| <em>Página <b>".$pag."</b> </em> | "; if ($pag < $paginas) { $pro = $pag + 1; echo "<a href=\"".$PHP_SELF."?pag=".$pro."\">Próx</a>"; } echo "</div></div>"; ?> <script language="JavaScript"> // função para vc abrir a imagem clicada dentro da div abaixo !! function abre(imagem) { document.getElementById("fotos").innerHTML="<img src='"+ imagem +"'>"; } </script> <div id="fotos"></div>
Edição feita por: Norefenk, 12/04/2007, 08:48.
#26
Posted 07/05/2007, 15:07
preciso listar os arquivos do diretorio mas preciso de links direcionando para download.
desde ja agradeço
obrigado
#27
Posted 14/10/2007, 05:31
php 5.2.3 para cima e esse aqui funciona se quiserem usar em versão mais para cima. do mesmo.
<?php #ESSE FUNFA COM PHP 5.2.2.3 # Página $pag = $_GET['pag'] ? $_GET['pag'] : 1; # Registros por página $rpp = 4; # Inínio da página $inicio = $pag * $rpp - $rpp; # Diretório $dir = "fotos/pre"; # Listando arquivos $varrer = glob($dir."/*"); # Total de arquivos encontrados $total = count($varrer); # Número de páginas $paginas = ceil($total/$rpp); for ($i = $inicio; $i < $inicio+$rpp && $i < $total; $i++) { if($i%4==0) { if (substr("$varrer[$i]", -4) == ".jpg") { echo ("</tr><tr><td><a href=\"#\" onClick=\"abre('$varrer[$i]')\"><img src='$varrer[$i]' width='80' height='60' border='0'></a></td>"); } } else { if (substr("$dir/$varrer[$i]", -4) == ".jpg") { echo "<td><a href=\"#\" onClick=\"abre('$varrer[$i]')\"><img src='$varrer[$i]' width='80' height='60' border='0'></a></td>"; } } } if ($pag > 1) { $anterior = $pag - 1; print "< <a href=\"{$_SERVER['PHP_SELF']}?pag={$anterior}\">Anterior</a> | "; } print "<em>Pagina <b>{$pag}</b></em>"; if ($pag < $paginas) { $proxima = $pag + 1; print " | <a href=\"{$_SERVER['PHP_SELF']}?pag={$proxima}\">Proxima</a> >"; } ?> <script language="JavaScript"> function abre(imagem) { document.getElementById("fotos").innerHTML="<img src='"+ imagem +"'>"; } </script> <div id="fotos"></div>
#28
Posted 04/11/2017, 18:04
Buy now isotretinoin Effexor Xr Discount Card Levitra 10 buy viagra online Kamagra Legal
#29
Posted 06/11/2017, 05:00
Discounts! best buy product availability
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Rodina (4 sezon)
LCD Screen! With FM Function! 800M 3 Riders Hi-Fi Speaker Motorcycle Intercom BT Bluetooth Wireless Interphone Helmet Headset. ( 55.88 $)
Authentic hot sale 16 inch business oxford trolley luggage suitcase board travel computer bag for men and women specials 4 color ( 114.70 $)
Men's hooded solid colorzipper design short sleeve t-shirt ( 11.98 $)
Sunblock Baseball Cap ( $2.80 )
Big Size 42 Men Thick Denim Straight Jeans High Waist Casual Long Trousers 2016 Winter Male Jeans Plus Velvet Thermal Warm Pants ( 64.81 $)
17KM 4 Colors Black Leather Natural Stone Tattoo Choker Necklace for Women Fashion Turquoise Beads Boho Gothic Jewelry Gift ( 1.86 $)
XuanWheel X1 192pcs RGB LED Colorful Bicycle Wheel Spoke Light Mobile Phone App Control 61.59$
Ceramic Bearing Gyro Focus Toy for Killing Time ( 3.63 $)
лада новочебоксарск официальный дилер цены
Simple pu leather and colour block design women's sandals ( 33.27 $)
Luggage double-shoulder professional valiz camouflage mountaineering bag camouflage 80 l waterproof backpack travel backpacks ba ( 106.13 $)
Tissage Bresilienne Mocha Hair Products Peruvian Virgin Hair Straight Natural Black Straight Virgin Hair Human Hair Extensions ( 51.10 $)
Breathable Mesh Small Dog Pet Harness and Leash Set Puppy Vest Pink Red Blue Black For Chihuahua ( 3.99 $)
EP0011 Fantasy Acetate Frame Cat Eye Sunglasses ( 200.00 $)
Discounts! best 2017 products Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). READ MORE GX — 03K Aroma Diffuser-24.68 $Women's fluffy side bang human hair wig ( 51.18 $)Brand designer natural leather women wallets hot genuine leather crocodile female clutch purse long card holder wallet women bag ( 28.00 $)Practical Skull Shape Egg Frying Mould Frying Pancake Mold Breakfast Mould with Silicone Material Home Outdoor DIY Supplies 3.39$For iphone 7 cases 5s 5 military camouflage men leather cover case for iphone 7 7 ( 2.49 $)NANKA 8611 Male UV-resistant Polarized Sunglasses ( $9.16 )Xiaozhai II 3D VR Glasses-11.39 $Stylish cut out spaghetti strap solid color women's romper ( 14.06 $)Slide Wallet Credit Card Slot Phone Case For Samsung Galaxy S3 S4 S5 S6 S7 S7 Edge NOTE 5 7 A5 A7 J5 J7 Grand Core Prime Covers ( 4.59 $)лучшие антиутопии книги +всех временNew vintage oil waxed genuine leather men organizer wallet money purse card holder phone photo coin ( 16.99 $)Brass and Woven Leather Mini Arrow Earrings ( 108.00 $)Solid wood child dining chair baby multifunctional portable baby dining table and chairs fashion folding baby chair ( 119.20 $)Black Gloves ( 112.00 $)UMi Z 4G Phablet ( 229.99 $)
Discounts! hair wax for men
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Leagoo Shark 1 Android 5.1 4G Phablet 6.0 inch MTK6753 64bit Octa Core Fingerprint ID 2.5D Corning Glass Gorilla Screen 3GB RAM 16GB ROM 13.0MP Rear Camera OTG 173.99$
Hot selling Colorful Key Chain Bag AccessoriesIce Silk Tassel Pompom Car Keychain Handbag Key Ring ( 1.59 $)
read +and draw +the monster перевод
капитальный ремонт двигатель
скачать counter strike condition zero +на русском
Free shipping 7a brazilian lace closure 4x4 brazilian virgin hair body wave closure human hair closure soft brazilian hair ( 48.89 $)
Khaki Master Clock Print Silk Tie ( 48.41 $)
2016 new fashion men bags leather business travel messenger bag brand design men's shoulder bag 2 colors ( 85.66 $)
Lenovo Vibe P1 Case High Quality with holder Protector TPU+Hard Back Case Cover for Lenovo Vibe P1 Smartphone Free Shipping ( 2.80 $)
Oberline red suede ankle wrap shoe ( 359.48 $) Zoe Lee
Stylish lace-up and buckle design solid color ankle boots for women ( 20.94 $)
new hot sale modern caravaggio pendant lights creative suspension lamps,black white color e27 110-240v ( 100.09 $)
Magnoliya (film)
Malaysian virgin hair body wave ear to ear lace frontal closure with bundles 4 pcslot 100% human hair weave rosa hair products ( 105.25 $)
nike air lunar force 1
Discounts! makeup products list
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).
READ MORE
Tourist in Florence Print Silk Square Scarf ( 145.00 $)
8a clip in human hair extensions kinky straight clip in hair extensions 7pcs mongolian italian coarse yaki hair clip ins human ( 82.00 $)
nike sf af1 special field air force
New japan anime yuri!!! on ice victor nikiforov short synthetic hair grey peruca cosplay wig ( 19.99 $)
Official Online Shop of REDMOND Multicookers in UK | REDMOND
Top quality 20 frets electric bass guitar neck guitar parts no frets musical instruments accessories ( 110.67 $)
Jade Drop Clip-On Earrings ( 178.00 $)
4 Bundles Brazilian Body Wave 100g 7A Unprocessed Brazilian Virgin Hair Body Wave Nadula Hair Products Top Brazilian Human Hair ( 72.00 $)
WLtoys Q333 - A 5.8G FPV RC Drone ( 109.08 $)
Casual flower and zip design women's satchel ( 19.23 $)
Women daily backpacks daypack girl school bag pu leather bags candy color travel bag ( 26.00 $)
Jewelrypalace infinity forever love cubic zirconia anniversary promise ring pure 925 sterling silver jewelry for women ( 8.99 $)
Brazilian deep wave with lace closure 7a remy human hair 3 bundles with closure brazilian virgin hair deep curly with closure ( 80.65 $)
Tinta de cabelo tic tac grizzly mega hair extension fast dendy aplique de sintetico freetress synthetic ( 10.37 $)
SCISHION V88 PRO TV Box Amlogic S905X Quad Core-32.88 $
#30
Posted 07/11/2017, 12:52
Cephalexin Product Information eva pills levitra Mail Order Finasteride Aurora Amoxicillin Liqiud Dosage
Allergic Reaction Amoxicillin Levitra Zu Verkaufen vardenafil Ampicillin Cvs Over The Counter Viagra Originalverpackung Baclofene Et Methadone
Viagra Prescription Without Cialis One Day Quanto Costa cialis Viagra Rezeptfrei 25 Mg Viagra Nebenwirkungen Sodbrennen Propecia Sterility
Cialysis cialis buy online Buy Generic Tamoxifen Online
Wo Viagra Bestellen Cheapest Cialis 20mg generic cialis Can I Order Synthroid Over The Internet Kamagra Achat 100 Mg Cialis Comprar En Andorra
Buy Tamoxifen 20 Mg Viagra Ausprobieren cialis Liquid Amoxicillin For Kittens Venta De Viagra Espana
Clobetasol Buy Low Price Zithromax Effects On Birth Control Buy Generic Cialis cheap vardenafil 20mg Viagra Opinioni Alli Canada Walmart Radio Advertisments For Healthy Man
Acheter Cialis Angleterre cialis online Viagra Soft Pills Cialis Lilly Prix Cialis Viagra Prezzo
Cialis With Dapoxetine Buy Propecia Without Doctor Donde Comprar Cialis Seguro En Espana cialis Is It Safe To Buy Levitra On Line Viagra Cialis Levitra Comparacion Get Generic Cheapeast Provera Medication Shop
Vardenafil Warnings Cialis Para Mejorar La Ereccion Purchase Viagra Without Precription vardenafil canadian pharmacy Levitra Wirkung Order Xenical Orlistat Cheap
Can Amoxicillin Cause A Stuffy Nose Prix Viagra 50 100 Mg Generic 40 Mg Cialis Cheapest Prices viagra Cialis E Controindicazioni Cialis E Favismo Acheter Viagra Sur Le Net
Prospecto Cialis 20 Buy Online Cialis viagra Online Pharmacies Without Scripts Buy Silagra Uk Kamagra 100 Mg Jelly
Drug Classification And Type On Amoxicillin Cialis Prix Suisse viagra Cialis Super Active Prix Du Viagra France En Beziers Prix Du Viagra Pfizer
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)