• [MOD] Photo Preview Hack 5 0 5 1
Currently:  

Author Topic: [MOD] Photo Preview Hack  (Read 236258 times)

0 Members and 1 Guest are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Photo Preview Hack
« Reply #30 on: September 26, 2007, 08:19:58 PM »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Photo Preview Hack
« Reply #31 on: September 26, 2007, 09:07:10 PM »
@Kai
... a demo you can also find here ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: [MOD] Photo Preview Hack
« Reply #32 on: October 15, 2007, 08:28:23 PM »
Hi ivan,

 :!: :!:
Quote
3. Modify your own details.php, and search the string called: Show Comments
4. Above the line you searched, please insert a line: include(ROOT_PATH.'preview_photo.php');
:!: :!:
Thanks to rinaldos for this tip


Kurt

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.290
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Photo Preview Hack
« Reply #33 on: February 12, 2008, 10:02:10 PM »
gibt es denn hier nur tote links  :wink:
hat denn einer eine anleitung zur 1.7.6

Hrald
Danke Harald




Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Photo Preview Hack
« Reply #34 on: April 29, 2008, 06:19:31 PM »
hi! where can i download the mod? the urls are in 404 error
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

devil201

  • Guest
Re: [MOD] Photo Preview Hack
« Reply #35 on: June 12, 2008, 12:53:09 AM »
gibt es denn hier nur tote links  :wink:
hat denn einer eine anleitung zur 1.7.6

Hrald

Die Frage ist wohl, gibt dieser User den Code frei!?

Offline vredin

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Photo Preview Hack
« Reply #36 on: August 04, 2008, 09:57:25 AM »
Does anybody know where patch can be downloaded? all links in this post are 404 :(

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: [MOD] Photo Preview Hack
« Reply #37 on: September 19, 2008, 06:41:51 PM »
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:
Code: [Select]
$image_id_cache = array();

- before add:
- davor einfügen:
Code: [Select]
/*--- 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:
Code: [Select]
<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:
Code: [Select]
                 {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:
Code: [Select]
?>
- before add:
- davor einfügen:
Code: [Select]
/*--- 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
« Last Edit: December 25, 2009, 06:33:26 AM by KurtW »

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.290
    • View Profile
    • Discover the New World of Kindersurprise
Re: [MOD] Photo Preview Hack
« Reply #38 on: September 19, 2008, 07:36:25 PM »
Danke Anke (ähmm, Kurt  :wink:)

Klappt wie immer erste Sahne

LG. Harald

Ps. wenn man die Bilderanzahl erhöht z.B.

    $start = $lastPage - 9;
    $end = $lastPage - 1;
} else {
    $start = $act_key -4;
    $end   = $act_key +4;

dann kommt auf einigen Seiten ein Thumb (Bild nicht gefunden ) ohne Bild ID details.php?image_id=

was muss denn alles geändert werden, um die Anzahl zu erhöhen
Danke Harald




rinaldos

  • Guest
Re: [MOD] Photo Preview Hack
« Reply #39 on: September 20, 2008, 11:08:23 AM »
Ich habe nun mal versucht die Anzahl der Bilder zu erhöhen. Geschafft habe ich es aufgrund meines Design's das 7 Bilder angezeigt werden.
Code: [Select]
if($lastPage <= 6){
    $start = 0;
    $end = $lastPage -1;
} elseif ($act_key == 0 || $act_key == 1 || $act_key == 2){
    $start = 0;
    $end   = 6;
} elseif ($act_key == $lastPage-1 || $act_key == $lastPage -2|| $act_key == $lastPage -3 || $act_key == $lastPage -4){
    $start = $lastPage - 7;
    $end = $lastPage - 1;
} else {
    $start = $act_key -3;
    $end   = $act_key +3;
}

Damit auch Bilder bei der Suche aus anderen Kategorien angezeigt werden, und nicht nur das JPG media File, habe ich folgendes geändert.
$cat_id ausgetauscht gegen $preview_row[$image_preview[$i]]['cat_id']
finde
Code: [Select]
    $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);
ersetze
Code: [Select]
    $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'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);

Wenn man die Anzahl der Bilder erhöht, muss man auch für seine Galerie die Anzahl derer die Abgefragt werden ausschliessen. Das passiert mit den $act_key Anweisungen.Da habe ich bei mir eben noch ein paar eingefügt. Vielleicht gibt es da noch eine einfacherer Lösung. Also wirklich try and ERROR  :?:

Gruß
Ingo


Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [MOD] Photo Preview Hack
« Reply #40 on: September 29, 2008, 01:17:37 AM »
Nice MOD, thanks!
Quote
dann kommt auf einigen Seiten ein Thumb (Bild nicht gefunden ) ohne Bild ID details.php?image_id=
This problem I'have too. I couldn't fix it (maybe I didn't properly understand you)  :|

Does anyone know how this mode affects on speed of gallery? Is here anybody, who tested that MOD on gallery with many pictures?
4images running as a music portal http://music.kurman.ru/

rinaldos

  • Guest
Re: [MOD] Photo Preview Hack
« Reply #41 on: September 29, 2008, 07:47:39 AM »
Like this?
http://rinaldos.homeip.net/img8673.htm

Quote
dann kommt auf einigen Seiten ein Thumb (Bild nicht gefunden ) ohne Bild ID details.php?image_id=
This problem I'have too. I couldn't fix it (maybe I didn't properly understand you)  :|

Does anyone know how this mode affects on speed of gallery? Is here anybody, who tested that MOD on gallery with many pictures?

The Problem with "Picture not found" is solved with this line:
Code: [Select]
    $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'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode, 1);
This little Modifikatio worked for me.

Gruß
Ingo

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Re: [MOD] Photo Preview Hack
« Reply #42 on: September 30, 2008, 12:01:16 AM »
Yes, rinaldos, it works properly while viewing 7 thumbnails, but when they are 9, problem remains. (I used 9 thumbnails viewer)

So, I'have decided to use 7-thumbnails instean of 9, like you in your gallery. (Of course I want 9 and more thumbnails to be viewed, but if there still no solution for that, we prefer to stay in mod, working without bugs)  8)

thanks!
4images running as a music portal http://music.kurman.ru/

Rembrandt

  • Guest
Re: [MOD] Photo Preview Hack
« Reply #43 on: February 24, 2009, 08:14:21 AM »
Hi!

EDIT: hat sich erledigt, manchmal sieht man den wald vor lauter bäume nicht.

mfg Andi
« Last Edit: September 29, 2009, 06:13:16 AM by Rembrandt »

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
Re: [MOD] Photo Preview Hack
« Reply #44 on: February 24, 2009, 09:25:45 AM »
Hi!

könnte mir da wer weiterhelfen ich möchte den seitlichen abstand zwischen den bildern größer haben.
hier mein code:

/*--------------------------------------------- Start MOD: Photo Preview Hack ----------------------------------------- */
$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 "<table height=\"0\"width=\"0\"  border=\"0\" cellspacing=\"5\" cellpadding=\"3\" align=\"center\"><tr>\n";
if(
$lastPage 6){
    
$start 0;
    
$end $lastPage -1;
} elseif (
$act_key == || $act_key == 1){
    
$start 0;
    
$end   4;
} elseif (
$act_key == $lastPage-|| $act_key == $lastPage -2){
    
$start $lastPage 5;
    
$end $lastPage 1;
} else {
    
$start $act_key -2;
    
$end   $act_key +2;
}
$sizeTimes 0.5;
for(
$i=$start$i<=$end$i++){
    if (
$preview_row[$image_preview[$i]]['image_id'] == $image_row['image_id']) {
    
$t_template .= "<td style=\"border: 1px dashed #004C75; text-align:center; padding: .1cm \">\n";
    } else {
    
$t_template .= "<td style=text-align:center; padding: .1cm\">\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'], $preview_row[$image_preview[$i]]['cat_id'], format_text(trim($preview_row[$image_preview[$i]]['image_name']), 2), $mode1);
    
$oriWidth substr($tagstrpos($tag"width")+7strpos($tag"\" height")-strlen($tag));
    
$oriHeight substr($tagstrpos($tag"height")+8strpos($tag" alt")-strlen($tag)-1);
    
$tag str_replace('width="'.$oriWidth.'"''width="'.$oriWidth*$sizeTimes.'"'$tag);
    
$tag str_replace('height="'.$oriHeight.'"''height="'.$oriHeight*$sizeTimes.'"'$tag);
    
$t_template .= $tag."<br>\n";
    
$t_template .= "<font class=\"smalltext\">".$preview_row[$image_preview[$i]]['image_name']."</font>\n";
}
$t_template .= "</td></table>\n";
$site_template->register_vars("preview_box"$t_template);
unset(
$image_preview);
/*--- End MOD: Photo Preview Hack  ------------------------------------------ */


mfg Andi


Thanks i like this one :D bro can we also add previous image next image on both side :D by any chance ?