4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: jengwen on March 17, 2003, 01:31:59 AM

Title: [Mod] Add thumbnails to admin edit images list
Post by: jengwen on March 17, 2003, 01:31:59 AM
This mod will show the thumbnail before the image name in the control panel edit images list used for deleting or editting images.

File to change is admin/images.php

find:
Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_date".get_user_table_field(", u.", "user_name")."
            FROM ".IMAGES_TABLE." i, ".USERS_TABLE." u
            WHERE $condition AND ".get_user_table_field("u.", "user_id")." = i.user_id
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";
    $result = $site_db->query($sql);


add after i.image_media_file,:
Code: [Select]
i.image_thumb_file,

find:
Code: [Select]
echo "<td><b><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\" target=_blank>".htmlspecialchars($image_row['image_name'])."</a></b> (".$image_row['image_media_file'];

add after target=_blank>:
Code: [Select]
<img src=\"".THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />

final code should look like this if you just want to cut and paste the entire section:
Code: [Select]
   $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_media_file, i.image_thumb_file, i.image_date".get_user_table_field(", u.", "user_name")."
            FROM ".IMAGES_TABLE." i, ".USERS_TABLE." u
            WHERE $condition AND ".get_user_table_field("u.", "user_id")." = i.user_id
            ORDER BY $orderby $direction
            LIMIT $limitstart, $limitnumber";
    $result = $site_db->query($sql);

    while ($image_row = $site_db->fetch_array($result)) {
      echo "<tr class=\"".get_row_bg()."\">";
      echo "<td><input type=\"checkbox\" name=\"deleteimages[]\" value=\"".$image_row['image_id']."\" /></td>";

      echo "<td><b><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\" target=_blank><img src=\"".THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />".htmlspecialchars($image_row['image_name'])."</a></b> (".$image_row['image_media_file'];
Title: Re: [mod] Add thumbnails to admin edit images list
Post by: V@no on March 17, 2003, 03:08:22 AM
Exelent! good job!
here is little fix, if an image is some media, or it doesnt have thumbnail, it shows red X
just change this code:
Quote from: jengwen
add after target=_blank>:
Code: [Select]
<img src=\"".THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />


To this:
Code: [Select]
<img src=\"".((empty($image_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif" : ((is_remote($image_row['image_thumb_file'])) ? $image_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_thumb_file']))."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />&nbsp;
Title: [Mod] Add thumbnails to admin edit images list
Post by: soze on March 22, 2003, 12:56:03 AM
Very usefull MOD!  :D
Title: [Mod] Add thumbnails to admin edit images list
Post by: eXup on March 22, 2003, 08:18:23 AM
Great job, thank you...

...can you do "this" to comments.php, too? - I tried it on my own, but i failed because i'm a beginner in php.
Title: [Mod] Add thumbnails to admin edit images list
Post by: V@no on March 22, 2003, 01:13:46 PM
Quote from: eXup
Great job, thank you...

...can you do "this" to comments.php, too? - I tried it on my own, but i failed because i'm a beginner in php.


Open /admin/comments.php
Find:
Code: [Select]
   $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name, c.comment_headline, c.comment_text, c.comment_date, i.image_name
Replace with:
Code: [Select]
   $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name, c.comment_headline, c.comment_text, c.comment_date, i.image_name, i.image_media_file, i.image_thumb_file, i.cat_id


Find:
Code: [Select]
<td class=\"tableseparator\">".$lang['field_comment']."</td>
Replace with:
Code: [Select]
<td class=\"tableseparator\" colspan=2>".$lang['field_comment']."</td>

Find:
Code: [Select]
     echo "<td><input type=\"checkbox\" name=\"deletecomments[]\" value=\"".$comment_row['comment_id']."\" /></td>";
Add after:
Code: [Select]
     echo "<td><img src=\"".((empty($comment_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($comment_row['image_media_file']).".gif" : ((is_remote($comment_row['image_thumb_file'])) ? $comment_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$comment_row['cat_id']."/".$comment_row['image_thumb_file']))."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" /></td>";
Title: [Mod] Add thumbnails to admin edit images list
Post by: Neo1 on March 22, 2003, 01:37:02 PM
Thanks a lot jengwen V@no: Great Mod.

I have to use the second code cause i got remote images. Works godd :)
Title: [Mod] Add thumbnails to admin edit images list
Post by: eXup on March 23, 2003, 03:43:18 PM
Thank you very much. Works perfect on comments.php, too.

(Can comprehend what you did and i learn step by step  :idea: )
Title: kategorieauswahl
Post by: Cancy on March 23, 2003, 04:43:25 PM
Gibt es evtl. die Möglichkeit, die Kategorien dort nicht als Link sondern als Dropdown anzeigen zu lassen, so das man dort die Kategorie auch ändern könnte, in die das Bild nach der Freischaltung kommt?

LG
Cancy
Title: [Mod] Add thumbnails to admin edit images list
Post by: Bodyworks on April 13, 2003, 05:50:00 AM
This is a great MOD. Thank you for that great help.
Would it be possible to add the functionality editing keywords, description and picture name after they have been uploaded in that kind of view? The thumbnails are big enough to identify the picture. Editing keywords after upload is a very poor job when you have a slow internet connection.
Perhaps you can think about this idea.

It would rather help to edit my about 2.000 photos.

Thank you in advance and kind regards.
Title: [Mod] Add thumbnails to admin edit images list
Post by: Biggi on April 13, 2003, 10:22:53 AM
Thanks a lot, V@ano! That a great mod!

But there seems to be a very little bug. Please have a look:
(http://www.hilfebullet.de/bibodia/Anzeigeoptionen.jpg)

What do I have to change to see the WORD in dropdown instead of the php-code? In this way it works, but I'd like to see the "sort images by VOTES, RATINGS" etc.

Thanks in advance!

Kind regards, Biggi
Title: [Mod] Add thumbnails to admin edit images list
Post by: V@no on April 13, 2003, 12:37:59 PM
Quote from: Biggi
Thanks a lot, V@ano! That a great mod!

dont thank me, thank jengwen ;)

Quote from: Biggi
But there seems to be a very little bug.
What do I have to change to see the WORD in dropdown instead of the php-code? In this way it works, but I'd like to see the "sort images by VOTES, RATINGS" etc.

My guess is u did something wrong when installing the mod. check again the changes u made.
also, did u install anything else that do any changes /admin/ files?

[EDITED]
but did it work before modification?
I dont see anything that could cause it, unless the PHP on your host doesnt support on one line:
<?php echo $lang['order_by'] ?>
maybe try to add <?php echo $lang['order_by']; ?> and check the rest simular lines. (I doubt it cause the problem)
Title: [Mod] Add thumbnails to admin edit images list
Post by: Biggi on April 13, 2003, 01:02:10 PM
Ouuuuups - my mistake  :oops:  Special thanks to jengwen  :D

You are right, V@no. There was a mistake made by my editor. I took another one and now it works perfectly  :P

Thx,

Biggi
Title: [Mod] Add thumbnails to admin edit images list
Post by: fossil on April 18, 2003, 01:52:37 AM
I know i have done everything right as jengwen writes. but when im done and go to the ACP and press edit images, nothing wont show. if i reverse what i have done. everything works fine.

Im using 4images v1.7
Title: Re: [mod] Add thumbnails to admin edit images list
Post by: uksoreeyes on April 24, 2003, 02:53:23 AM
Hi V@no I have spotted a little mistake in the code you supplied:
Code: [Select]
<img src="".((empty($image_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif" : ((is_remote($image_row['image_thumb_file'])) ? $image_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_thumb_file']))."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />&nbsp;

You missed out a \ in the <img src="".((empty($im... which I think was down to this forum because I have had trouble getting the forum to display the \. Anyways the missing \ caused me to get this error:
Quote
Parse error: parse error, expecting `','' or `';'' in \htdocs\admin\images.php on line 769

So if anyone else got this error just change the above code to this:
Quote
<img src=\"".((empty($image_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif" : ((is_remote($image_row['image_thumb_file'])) ? $image_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_thumb_file']))."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />&nbsp;


I have also made a little mod to the way this mod is layed out, I'll post that here in a bit if anyone is interested. It just gives it a nicer ordered look :)
Title: [Mod] Add thumbnails to admin edit images list
Post by: uksoreeyes on April 24, 2003, 03:14:31 AM
Ok here is my little mod to give the thumbnails their own column in the table :)

Open admin/images.php

find:
Code: [Select]
echo "<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";
replace with:
Code: [Select]
echo "<td class=\"tableseparator\">Image thumbnail</td>\n";
echo "<td class=\"tableseparator\">".$lang['field_image_name']."</td>\n<td class=\"tableseparator\">".$lang['field_category']."</td>\n<td class=\"tableseparator\">".$lang['field_username']."</td>\n<td class=\"tableseparator\">".$lang['field_date']."</td>\n<td class=\"tableseparator\">".$lang['options']."</td>\n</tr>\n";

assuming you have followed v@nos little update along with mine above, find:
Code: [Select]
echo "<td><b><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\" target=_blank><img src=\"".((empty($image_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif" : ((is_remote($image_row['image_thumb_file'])) ? $image_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_thumb_file']))."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />&nbsp;".htmlspecialchars($image_row['image_name'])."</a></b> (".$image_row['image_media_file'];
replace with:
Code: [Select]
echo "<td align=\"center\"><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\" target=_blank><img src=\"".((empty($image_row['image_thumb_file'])) ? ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif" : ((is_remote($image_row['image_thumb_file'])) ? $image_row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_thumb_file']))."\" border=\"1\" alt=\"\" /></a></td>\n";
echo "<td><b><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\" target=_blank>".htmlspecialchars($image_row['image_name'])."</a></b> (".$image_row['image_media_file'];

And thats it. Save your file. If you find a fault with this little add on mod feel free to tell me.

Carl
Title: Re: [Mod] Add thumbnails to admin edit images list
Post by: marius26 on November 06, 2005, 11:28:55 PM
i installed just the original one by jengwen, its cool and it works great  :mrgreen: well done
Title: Re: [Mod] Add thumbnails to admin edit images list
Post by: Ch*yeuk on July 21, 2006, 12:55:02 AM
Hi, I've installed this mod and it works almost perfectly. It shows a thumbnail beside each file name.. but it doesn't show that file's thumbnail. Instead, I have the default "jpg" picture .. which is for broken images, right? My images aren't broken though.. they're all fine, and they all have thumbnails.
Title: Re: [Mod] Add thumbnails to admin edit images list
Post by: flattley on September 11, 2010, 02:16:20 AM
I installed this MOD and it works almost as it should. I am getting the default JPG image instead of the thumbnail. I followed all the instructions in the MOD.

Here is a screenshot



Any help would be greatly appreciated
Title: Re: [Mod] Add thumbnails to admin edit images list
Post by: V@no on September 11, 2010, 04:51:34 AM
try this:
[MOD] Batch Copy/Move/Edit Images v4.15.1 (2010-08-14) (http://www.4homepages.de/forum/index.php?topic=6759.0)
Title: Re: [Mod] Add thumbnails to admin edit images list
Post by: flattley on September 11, 2010, 02:05:56 PM
Thanks for the redirect V@no. I like the Batch MOD. Works a treat