4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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:
$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,:
i.image_thumb_file,
find:
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>:
<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:
$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'];
-
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:
add after target=_blank>:
<img src=\"".THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" />
To this:<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=\"\" />
-
Very usefull MOD! :D
-
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.
-
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: $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: $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: <td class=\"tableseparator\">".$lang['field_comment']."</td>
Replace with:<td class=\"tableseparator\" colspan=2>".$lang['field_comment']."</td>
Find: echo "<td><input type=\"checkbox\" name=\"deletecomments[]\" value=\"".$comment_row['comment_id']."\" /></td>";
Add after: 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>";
-
Thanks a lot jengwen V@no: Great Mod.
I have to use the second code cause i got remote images. Works godd :)
-
Thank you very much. Works perfect on comments.php, too.
(Can comprehend what you did and i learn step by step :idea: )
-
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
-
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.
-
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
-
Thanks a lot, V@ano! That a great mod!
dont thank me, thank jengwen ;)
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)
-
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
-
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
-
Hi V@no I have spotted a little mistake in the code you supplied:
<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=\"\" />
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:
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:
<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=\"\" />
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 :)
-
Ok here is my little mod to give the thumbnails their own column in the table :)
Open admin/images.php
find:
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:
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:
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=\"\" /> ".htmlspecialchars($image_row['image_name'])."</a></b> (".$image_row['image_media_file'];
replace with:
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
-
i installed just the original one by jengwen, its cool and it works great :mrgreen: well done
-
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.
-
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
-
try this:
[MOD] Batch Copy/Move/Edit Images v4.15.1 (2010-08-14) (http://www.4homepages.de/forum/index.php?topic=6759.0)
-
Thanks for the redirect V@no. I like the Batch MOD. Works a treat