Hi,
[MOD] Photo Preview Hack
- all steps in one posting
- new file deleted: i changed it... all modcodes now in details.php
=> show 5 preview of images on top of details
=> the current image is additional marked with different bgcolor
[MOD] Photo Preview Hack
- alle Schritte in einem Posting
- neue Datei entfernt: habe ich geändert, alle Modcodes nun in details.php
=> zeige 5 Vorschaubilder oben in der Details
=> das aktuell angezeigte Bild ist zusätzlich noch mit unterschiedlicher Hintergrundfarbe markiert
Mod work with all 4images versions
Changed files:
Geänderte Dateien:
- details.php
- templates/[your template folder]/details.html
- templates/[your template folder]/style.css
1:
- open details.php
- search:
- öffne details.php
- suche:
$image_id_cache = array();
- before add:
- davor einfügen:
/*--- Start MOD: Photo Preview Hack, reworked by KW ------------------------- */
// Start Settings for Thumbs
$thumbsize = 0.5; // Thumb Size in %
// End Settings
$result = $site_db->query($sql);
while($row = $site_db->fetch_array($result)){
$image_preview[] = $row['image_id'];
$preview_row[$row['image_id']] = $row;
}
$lastPage = count($image_preview);
$t_template = "";
if($lastPage < 6){
$start = 0;
$end = $lastPage -1;
} elseif ($act_key == 0 || $act_key == 1){
$start = 0;
$end = 4;
} elseif ($act_key == $lastPage-1 || $act_key == $lastPage -2){
$start = $lastPage - 5;
$end = $lastPage - 1;
} else {
$start = $act_key -2;
$end = $act_key +2;
}
for($i=$start; $i<=$end; $i++){
if ($preview_row[$image_preview[$i]]['image_id'] == $image_row['image_id']) {
$t_template .= "<td class=\"preview_box_colored\">\n";
} else {
$t_template .= "<td class=\"preview_box\">\n";
}
$tag = get_thumbnail_code($preview_row[$image_preview[$i]]['image_media_file'], $preview_row[$image_preview[$i]]['image_thumb_file'], $preview_row[$image_preview[$i]]['image_id'], $cat_id, format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);
$oriWidth = substr($tag, strpos($tag, "width")+7, strpos($tag, "\" height")-strlen($tag));
$oriHeight = substr($tag, strpos($tag, "height")+8, strpos($tag, " alt")-strlen($tag)-1);
$tag = str_replace('width="'.$oriWidth.'"', 'width="'.$oriWidth*$thumbsize.'"', $tag);
$tag = str_replace('height="'.$oriHeight.'"', 'height="'.$oriHeight*$thumbsize.'"', $tag);
$t_template .= $tag."<br />";
$t_template .= "<font class=\"smalltext\">".$preview_row[$image_preview[$i]]['image_name']."</font>\n</td>\n";
}
$site_template->register_vars("preview_box", $t_template);
unset($image_preview);
unset($t_template);
/*--- End MOD: Photo Preview Hack, reworked by KW --------------------------- */
2:
- open templates/[your_template_folder]/details.html
- search:
- öffne templates/[dein_template_verzeichnis]/details.html
- suche:
<b class="title">{image_name}</b>{if image_is_new}
- before add:
- or add the code on your favorite place:
- davor einfügen:
- oder an deiner gewünschten Stelle einfügen:
{if preview_box}
<table border="0" cellspacing="5" cellpadding="3" align="center">
<tr>
{preview_box}
</tr>
</table><br/>
{endif preview_box}
3:
- open templates/[your_template_folder]/style.css
- search:
- öffne templates/[dein_template_verzeichnis]/style.css
- suche:
?>
- before add:
- davor einfügen:
/*--- Start Mod: Photo Preview Hack, reworked by KW ---------------------------*/
.preview_box {
border: 1px dashed #004C75;
vertical-align: top;
text-align: center;
}
.preview_box_colored {
border: 1px solid #004C75;
background: #F1F1F1;
vertical-align: top;
text-align: center;
}
/*--- Start Mod: Photo Preview Hack, reworked by KW ---------------------------*/
KurtW