Początkujący
Postów: 150 Ostrzeżeń: 3
Data rejestracji: 10.02.2008 15:10
|
Jak dodac miniaturki dla konktentych galerii? Oto moj plik galerie.php:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."galerie.php";
if (isset($galeria_id) && !isNum($galeria_id)) fallback("index.php");
if (isset($galeria_id)) {
$res = 0;
if ($data = dbarray(dbquery("SELECT galeria_url,galeria_cat FROM ".$db_prefix."galerie WHERE galeria_id='$galeria_id'"))) {
$cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE galeria_cat_id='".$data['galeria_cat']."'"));
$result2 = dbquery("UPDATE ".$db_prefix."galerie SET galeria_reads=galeria_reads+1 WHERE &info_id='$galeria_id'");
$data['page_reads']++;
if (checkgroup($cdata['galeria_cat_access'])) {
$res = 1;
$result = dbquery("UPDATE ".$db_prefix."galerie SET galeria_count=galeria_count+1 WHERE galeria_id='$galeria_id'");
redirect($data['galeria_url']);
}
}
if ($res == 0) redirect(BASEDIR."galerie.php");
}
if (!isset($cat_id)) {
opentable($locale['400']);
echo "<br>";
$result = dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE ".groupaccess('galeria_cat_access')." ORDER BY galeria_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 1;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 1)) echo "<br>";
$num = dbcount("(galeria_cat)", "galerie", "galeria_cat='".$data['galeria_cat_id']."'");
echo "<table border='0' width='100%' align='center' cellspacing='1' cellpadding='0' class='tbl1'>
<tr>
<td class='forum-caption' colspan='2'>".$data['galeria_cat_name']."</td>
</tr>";
if ($data['download_cat_description']) {
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['galeria_cat_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['galeria_cat_id']."&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
$counter++;
}
echo "<br>";
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
closetable();
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = dbquery("SELECT * FROM ".$db_prefix."galerie WHERE galeria_id='$info_id'");
if ($info_id) {
while ($data = dbarray($result)) {
opentable($locale['400']." » ".$data['galeria_title']);
echo "<table border='0' width='95%' class='tbl1'>
<tr>
<td><a href='".$data['galeria_screen']."' target='_blank' rel='lightbox'><img src='".$data['galeria_screen']."' title='Kliknij aby powiększyć' alt='".$data['galeria_title']."' border='0' width='350px' height='250px'></a></td>
</tr>
<tr>
<td><b>".$locale['D012'].":</b></td>
</tr>
<tr>
<td>".$data['galeria_description']."<br><br></td>
</tr>
<tr>
<td><b>".$locale['D003']."</b></td>
</tr>
<tr>
<td><small>".$locale['D005']." ".$data['galeria_title']."</small></td>
</tr>
<tr>
<td><small>".$locale['D006']." ".$data['galeria_author']."</small></td>
</tr>
<tr>
<td><small>".$locale['D007']." ".$data['galeria_filesize']."</small></td>
</tr>
<tr>
<td><small>".$locale['D009']." ".showdate("%d.%m.%Y %H:%M:%S", $data['galeria_datestamp'])."</small></td>
</tr>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td align='left' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
</tr>
</table><br><br>";
closetable();
showcomments("Z","galerie","galeria_id",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=comment");
showratings("Z",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=rate");
}
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE galeria_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['galeria_cat_access'])) {
$res = 1;
opentable($locale['400']." - ".$cdata['galeria_cat_name']);
echo "<br>";
echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
echo "<tr>";
echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
echo "</tr></table><br>";
$rows = dbcount("(*)", "galerie", "galeria_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (!isset($sort) || !isNum($sort)) $sort = 0;
$sorting = $cdata['galeria_cat_sorting'];
if ($sort == 1) $sorting = "galeria_title ASC";
if ($sort == 2) $sorting = "galeria_count DESC";
if ($sort == 3) $sorting = "galeria_datestamp DESC, galeria_title ASC";
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."galerie WHERE galeria_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,10");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['galeria_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'>".$locale['410']."</span>";
} else {
$new = "";
}
$count = dbcount("(comment_id)", "comments", "comment_type='Z' AND comment_item_id='".$data['galeria_id']."'");
echo "<table border='0' width='95%' class='tbl1'>
<tr>
<td class='forum-caption' colspan='4'>".$data['galeria_title']." $new</td>
</tr>
<tr>
<td><a href='galerie.php?cat_id=$cat_id&info_id=".$data['galeria_id']."'><img src='".$data['galeria_screen']."' title='Kliknij aby wej¶ć' alt='".$data['galeria_title']."' border='0' width='150px' height='105px'></a></td>
</tr>
<tr>
<td><small>".$locale['D009']." ".showdate("%d.%m.%Y %H:%M:%S", $data['galeria_datestamp'])."</small></td>
</tr>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td align='left' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
</tr>
<tr>
<td>Komentarzy: ".$count."</td>
</tr>
</table>";
echo ($i != $numrows ? "<br>" : "\n"); $i++;
}
echo "<br>";
closetable();
if ($rows > 10) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,3,FUSION_SELF."?cat_id=$cat_id&sort=$sort&")."\n</div>\n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
EDIT: Mam problem gdyz jak klikam na zdjecie otwiera je w nowym panelu a powinno otwierac tak:
to moj kod galerii:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."galerie.php";
if (isset($galeria_id) && !isNum($galeria_id)) fallback("index.php");
if (isset($galeria_id)) {
$res = 0;
if ($data = dbarray(dbquery("SELECT galeria_url,galeria_cat FROM ".$db_prefix."galerie WHERE galeria_id='$galeria_id'"))) {
$cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE galeria_cat_id='".$data['galeria_cat']."'"));
$result2 = dbquery("UPDATE ".$db_prefix."galerie SET galeria_reads=galeria_reads+1 WHERE &info_id='$galeria_id'");
$data['page_reads']++;
if (checkgroup($cdata['galeria_cat_access'])) {
$res = 1;
$result = dbquery("UPDATE ".$db_prefix."galerie SET galeria_count=galeria_count+1 WHERE galeria_id='$galeria_id'");
redirect($data['galeria_url']);
}
}
if ($res == 0) redirect(BASEDIR."galerie.php");
}
if (!isset($cat_id)) {
opentable($locale['400']);
echo "<br>";
$result = dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE ".groupaccess('galeria_cat_access')." ORDER BY galeria_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 1;
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 1)) echo "<br>";
$num = dbcount("(galeria_cat)", "galerie", "galeria_cat='".$data['galeria_cat_id']."'");
echo "<table border='0' width='100%' align='center' cellspacing='1' cellpadding='0' class='tbl1'>
<tr>
<td class='forum-caption' colspan='2'>".$data['galeria_cat_name']."</td>
</tr>";
if ($data['download_cat_description']) {
echo "<tr>
<td class='tbl1' colspan='2' calign='top' style='padding:5px;'>";
echo "<small>".nl2br(stripinput($data['galeria_cat_description']))."</small>";
echo "</td>
</tr>";
}
echo "<tr>
<td class='tbl2' align='center' width='50%'><small>".$locale['D001'].$num."</small></td>
<td class='tbl2' align='center' width='50%'><a href='".FUSION_SELF."?cat_id=".$data['galeria_cat_id']."&sort=1'><small>".$locale['D002']."</small></a></td>
</tr>
</table>";
$counter++;
}
echo "<br>";
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
closetable();
} else {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
$result = dbquery("SELECT * FROM ".$db_prefix."galerie WHERE galeria_id='$info_id'");
if ($info_id) {
while ($data = dbarray($result)) {
opentable($locale['400']." » ".$data['galeria_title']);
echo "<table border='0' width='95%' class='tbl1'>
<tr>
<td><a href='".$data['galeria_screen']."' target='_blank' rel='lightbox'><img src='".$data['galeria_screen']."' title='Kliknij aby powiększyć' alt='".$data['galeria_title']."' border='0' width='350px' height='250px'></a></td>
</tr>
<tr>
<td><b>".$locale['D012'].":</b></td>
</tr>
<tr>
<td>".$data['galeria_description']."<br><br></td>
</tr>
<tr>
<td><b>".$locale['D003']."</b></td>
</tr>
<tr>
<td><small>".$locale['D005']." ".$data['galeria_title']."</small></td>
</tr>
<tr>
<td><small>".$locale['D006']." ".$data['galeria_author']."</small></td>
</tr>
<tr>
<td><small>".$locale['D007']." ".$data['galeria_filesize']."</small></td>
</tr>
<tr>
<td><small>".$locale['D009']." ".showdate("%d.%m.%Y %H:%M:%S", $data['galeria_datestamp'])."</small></td>
</tr>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td align='left' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
</tr>
</table><br><br>";
closetable();
showcomments("Z","galerie","galeria_id",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=comment");
showratings("Z",$info_id,FUSION_SELF."?cat_id=$cat_id&info_id=$info_id&act=rate");
}
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."galeria_cats WHERE galeria_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['galeria_cat_access'])) {
$res = 1;
opentable($locale['400']." - ".$cdata['galeria_cat_name']);
echo "<br>";
echo "<table width='70%' align='center' cellspacing='1' cellpadding='1' class='tbl-border'>";
echo "<tr>";
echo "<td align='center' width='33%' class='".(FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo (FUSION_QUERY == "cat_id=$cat_id" || $sort == 1 ? "<b>".$locale['D014']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=1'>".$locale['D014']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 3 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 3 ? "<b>".$locale['D015']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=3'>".$locale['D015']."</a>")."</span></td>\n";
echo "<td align='center' width='33%' class='".($sort == 2 ? "tbl1" : "tbl2")."'><span class='small'>\n";
echo ($sort == 2 ? "<b>".$locale['D016']."</b>" : "<a href='".FUSION_SELF."?cat_id=$cat_id&sort=2'>".$locale['D016']."</a>")."</span></td>\n";
echo "</tr></table><br>";
$rows = dbcount("(*)", "galerie", "galeria_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (!isset($sort) || !isNum($sort)) $sort = 0;
$sorting = $cdata['galeria_cat_sorting'];
if ($sort == 1) $sorting = "galeria_title ASC";
if ($sort == 2) $sorting = "galeria_count DESC";
if ($sort == 3) $sorting = "galeria_datestamp DESC, galeria_title ASC";
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."galerie WHERE galeria_cat='$cat_id' ORDER BY $sorting LIMIT $rowstart,5");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['galeria_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span style='font-size:8px;'>".$locale['410']."</span>";
} else {
$new = "";
}
$count = dbcount("(comment_id)", "comments", "comment_type='Z' AND comment_item_id='".$data['galeria_id']."'");
echo "<table border='0' width='95%' class='tbl1'>
<tr>
<td class='forum-caption' colspan='4'>".$data['galeria_title']." $new</td>
</tr>
<tr>
<td><a href='galerie.php?cat_id=$cat_id&info_id=".$data['galeria_id']."'><img src='".$data['galeria_screen']."' title='Kliknij aby wej¶ć' alt='".$data['galeria_title']."' border='0' width='150px' height='105px'></a></td>
</tr>
<tr>
<td><small>".$locale['D009']." ".showdate("%d.%m.%Y %H:%M:%S", $data['galeria_datestamp'])."</small></td>
</tr>";
$wynik = dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$info = dbresult($wynik,0);
$num_rating = dbcount("(rating_vote)", "ratings", "rating_type='Z' AND rating_item_id='".$data['galeria_id']."'");
$wyn_rating = ($num_rating ? $info / $num_rating : 0);
echo "<td align='left' width='25%'><small>".$locale['D019']."<img src='".IMAGES."rate/".ceil($wyn_rating).".gif' alt='' style='vertical-align:middle;' title='".$locale['D019'].ceil($wyn_rating)."'></small></td>
</tr>
<tr>
<td>Komentarzy: ".$count."</td>
</tr>
</table>";
echo ($i != $numrows ? "<br>" : "\n"); $i++;
}
echo "<br>";
closetable();
if ($rows > 5) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,5,$rows,3,FUSION_SELF."?cat_id=$cat_id&sort=$sort&")."\n</div>\n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
}
require_once "side_right.php";
require_once "footer.php";
?>
PW od moderatora:
- Odświeżenie Tematu - Pieka 16.03 - 22:53
Edytowane przez kamy dnia 16.03.2008 22:45:53
|