عرض مشاركة واحدة
عضو سوبر نشيط
تاريخ التسجيل: May 2004-
#2 (permalink)  

السلام عليكم

جرب هذا الكود

كود:
<?php
$dir="thumbs72/";
$path=getcwd().'/'.$dir;
$handle=opendir($path);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CHEERS pics</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body {
background-color:#fff;
}
ul, li {
padding:0;
list-style:none;
}
ul {
position:relative;
width:745px;
margin:auto;
background:url(cheerslogo500.jpg) 125px 70px no-repeat;
border:1px solid #ccc;
height:525px;
padding-left:5px;
}
li {
margin:5px 0;
float:left;
width:82px;
height:54px;
background-position:center center;
background-repeat:no-repeat;
}
<?php
$i=1;
while ($file=readdir($handle)) {
if (strpos($file, '.jpg')) {
echo "#pic$i {".(($i>9)? '
margin-top:400px;' :'')."
background-image:url($dir$file);
}
";
$i++;
}
}
?>
a {
display:block;
height:54px;
}
a img {
position:absolute;
top:70px;
left:125px;
width:1px;
border:0;
}
* html a:hover {
display:block;
height:53px;
}
a:hover img {
width:500px;
}
a:active img,
a:focus img {
z-index:1;
width:500px;
}
-->
</style>
</head>
<body>
<ul>
<?php
$i=1;
$handle=opendir($path);
while ($file=readdir($handle)) {
if (strpos($file, '.jpg')) {
echo "<li id=\"pic$i\"><a href=\"#n\"><img src=\"/thumbs500/$file\" alt=\"pic$i\" /></a></li>
";
$i++;
}
}
?>
</ul>
</body>
</html>
لا تنسى تغيير اسم الفولدر في اول سطر

كود:
$dir="thumbs72/";
هنا مثال ايضا قبل التركيب

http://bonrouge.com/cheerspics.php

وهذا مثال بتعدد الصفحات

http://cheers-sendai.com/4thparty.php

بالتوفيق






Stylat غير متواجد حالياً   قديم 22-07-2007, 05:52 AM
رد مع اقتباس