你可以用3210一個目錄來生成使用PHP的縮略圖。我用我的攝影網站這種方法:
<?php
$counter = 0; // Set counter to 0
foreach (glob("images/photo-strip/thumb/*.jpg") as $pathToThumb) { // Grab files from the thumbnail path and save them to variable
$th_filename = basename($pathToThumb); // Strip the thumbnail filename from the path
$filename = str_replace('th_', '', $th_filename); // Strip th_ from the filename and save it to a different variable
$pathToFull = 'images/photo-strip/' . $filename; // Rebuild the path to the full-size image
echo ("<section class=\"photo-box\"><a href=\"$pathToFull\"><img src=\"$pathToThumb\" /></a></section>"); // Echo the photobox
$counter++; // Increment counter by 1 until no file exists
}
?>
你可以對這個代碼的一些,以生成你的「字幕」擴大甚至可能是你的風格字幕關閉<img>
標籤內title=""
屬性。如何將這些標題與文件相匹配取決於您。
'我是這個論壇的新手,希望有人會回答我的問題< - 什麼?請先付出一些努力:) – 2013-05-09 13:08:10
你有它倒退,我們不告訴你要走的路,我們在你開始後的路上幫助你。 – Pitchinnate 2013-05-09 13:10:16
給我們魚,而不是釣魚竿。 – Cam 2013-05-09 13:11:27