Jump to content
php.lv forumi

Thumb'i un Bildes.


laucinieks

Recommended Posts

Ir vajadzīgs tā, lai no vienas mapes ņem thumbnailus, bet no otrās ņem lielās bildes. uz php esmu uzlicis, lai ņem lielās bildes, mēģināju likt arī, lai ņem thumbnailus no citas mapes, bet nesanāca.

<?php
$files = glob("images/slideshow/aksesuari/*.*");
for ($i=1; $i<count($files); $i++)
{
$bilde = $files[$i];
echo '<a href="'.$bilde.'" target="_blank"><img src="'.$bilde.'" alt="bilde" width="80" height="105"></a>'."  ";
}
?>

 

Tur kur ir a href= tur jābūt $bilde , bet tur kur ir img src= tur jābūt thumbam, kurš atrodas mapē images/slideshow/aksthumb .

Biju mēģinājis taisīt ar diviem for, bet nesanāca. Varbūt variet palīdzēt?

Link to comment
Share on other sites

<?php
$files = glob("images/slideshow/aksesuari/*.*");
for ($i=1; $i<count($files); $i++)
{
$bilde = $files[$i];
$bilde_thumb=str_replace('aksesuari','aksthumb',$bilde);
echo '<a href="'.$bilde.'" target="_blank"><img src="'.$bilde_thumb.'" alt="bilde" width="80" height="105"></a>'."  ";
}
?>

galigi neglits risinajums, bet vajadzetu stradat.

Edited by Blitz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...