Проблема е следния, когато кача картинка се показва на главната страница, във точния размер с ховър, но когато цъкнете върху избраната от вас картинка, не я показва, все едно не съществува. Ето го кода
Снимките се съхраняват в папка uploads ... ако има значение
Код:
<table><tr>
<td valign='top'>
<div class='bbox'>
<div class='zaglavie'>Последни картинки</div>
<div class='info'><center>
<?
if (!filter($_GET[p])) {
$page = 1;
} else {
$page = (int)filter($_GET[p]);
}
if ($page <= 0) {
$page = $page + 1;
redict("index.php?page=top&p=$page", 0);
}
$min = ($page * 16) - 16;
$pp = 16;
$cat = (int)filter($_GET[cat]);
if ($cat <> 0) {
$query = mysql_query("select * from pics where category='$cat' order by `id` DESC limit $min,$pp");
$prev = $page - 1;
$prev = "$prev&cat=$cat";
$next = $page + 1;
$next = "$next&cat=$cat";
} else {
$query = mysql_query("select * from pics where category>0 order by `id` DESC limit $min,$pp");
$prev = $page - 1;
$next = $page + 1;
}
$color = 1;
$i = $min;
while ($row = mysql_fetch_array($query)) {
echo "<A href=index.php?page=pic&id=$row[id]>
<div class='lastimg'>
<div class='lastimgimg'>
<center>
<img src='$row[preview]' width='120' height='120' class='tooltip' id='$row[id]'>
</center>
</div>
</div></a>";
}
?></center><Br><br>
<Center>
<?
$num = mysql_num_rows(mysql_query("select * from pics where category>0"));
$pages = round($num/$pp);
$first = $page;
$second = $page+1;
$third = $page+2;
$fourth = $page+3;
$fifth = $page+4;
$sixth = $pages;
if($page==1){
echo "
<a href = 'index.php?page=pics&cat=$cat&p=$first'><div class = 'page2'>$first</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$second'><div class = 'page'>$second</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$third'><div class = 'page'>$third</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$fourth'><div class = 'page'>$fourth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$sixth'><div class = 'page'>$sixth</div></a>
";
}elseif($page==2){
$first = ($page-1);
$second = $page;
$third = $page+1;
$fourth = $page+2;
$sixth = $page+3;
echo "
<a href = 'index.php?page=pics&cat=$cat&p=$first'><div class = 'page'>$first</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$second'><div class = 'page2'>$second</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$third'><div class = 'page'>$third</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$fourth'><div class = 'page'>$fourth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$sixth'><div class = 'page'>$sixth</div></a>
";
}
elseif($page==3){
$first = ($page-2);
$second = $page-1;
$third = $page;
$fourth = $page+1;
$sixth = $page+2;
echo "
<a href = 'index.php?page=pics&cat=$cat&p=$first'><div class = 'page'>$first</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$second'><div class = 'page'>$second</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$third'><div class = 'page2'>$third</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$fourth'><div class = 'page'>$fourth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$sixth'><div class = 'page'>$sixth</div></a>
";
}elseif($page>=4 and $page!=$pages){
$first = ($page-3);
$second = $page-2;
$third = $page+-1;
$fourth = $page;
$sixth = $page+1;
$seventh = $page+2;
$eight = $page+3;
echo "
<a href = 'index.php?page=pics&cat=$cat&p=$first'><div class = 'page'>$first</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$second'><div class = 'page'>$second</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$third'><div class = 'page'>$third</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$fourth'><div class = 'page2'>$fourth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$sixth'><div class = 'page'>$sixth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$seventh'><div class = 'page'>$seventh</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$eight'><div class = 'page'>$eight</div></a>
";
}
elseif($page==$pages){
$first = ($page-6);
$second = $pages-5;
$third = $pages-4;
$fourth = $pages-3;
$sixth = $pages-2;
$seventh = $pages-1;
$eight = $pages;
echo "
<a href = 'index.php?page=pics&cat=$cat&p=$first'><div class = 'page'>$first</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$second'><div class = 'page'>$second</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$third'><div class = 'page'>$third</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$fourth'><div class = 'page'>$fourth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$sixth'><div class = 'page'>$sixth</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$seventh'><div class = 'page'>$seventh</div></a>
<a href = 'index.php?page=pics&cat=$cat&p=$eight'><div class = 'page2'>$eight</div></a>
";
}
?>
</center>
</div>
</div>
</td>
<td valign='top'>
<div class='obox'>
<div class='zaglavie'>Категории</div>
<div class='info'>
<?
$getpics = mysql_query("select * from pic_cats order by id ASC");
while ($row = mysql_fetch_array($getpics)) {
if (filter($_GET[cat] == $row[id])) {
$style = 'catsactive';
} else {
$style = 'cats';
}
echo "<a href='index.php?page=pics&cat=$row[id]'><div class='$style'>$row[name]</div></a>";
}
?>
</div>
</div>
</td>
</tr>
</table>
Снимките се съхраняват в папка uploads ... ако има значение