4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: MaveriC on June 30, 2007, 08:57:50 PM
-
Name: UploadInfo v1.0
Works on 1.7.4
Last updated: June 30 2007
Requirements: GD or any other image editor to create thumbnails on the fly
How this works:
Whenever a user uploads an image, 4images by default does not include any details apart from the image. This mod will display the below codes on the successful upload page just like any free image hosting service.
Apart from the code, the mod will display a thumbnail link to the image rather than the complete image.
Image Codes:
1. Hot link for websites
2. Hot link for forums
3. Thumbnail code for websites
4. Thumbnail code for forums
5. Image link
6. Image path
You can customize the mod to display the complete image and remove any of the above options. This mod should work with other mods and different 4images versions without any issues.
Here's the procedure:
Please take a backup of all the files before modifying the code
Step 1:
Open templates/your template name/header.html
Add the below code anywhere inside the <head> tag
<script type="text/javascript">
function highlight(field) {
field.focus();
field.select();
}
</script>
Step 2:
Open member.php
Find $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
Replace with:
//-----------------------------------------------------
//--- UploadInfo v1.0 Begins --------------------------
//-----------------------------------------------------
// Mod: UploadInfo v1.0
// Version: 1.0
// Description : Display image path, link and bbcode after image upload
// Contact: arjoon@gmail.com
// Last update: June 30 2007
$cat_name = $cat_cache[$cat_id]['cat_name'];
$uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
$uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
$uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
$uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_bbcode = "[URL=http://".$script_url."][IMG]http://".$uploaded_image_path."[/img][/URL]";
$uploaded_thumb_bbcode = "[URL=http://".$uploaded_image_link."][IMG]http://".$uploaded_thumb_path."[/img][/URL]";
$uploadinfo .= "<center><font size='1' face='Tahoma'>click on the above thumbnail for the full sized image</font><br /><br />";
$uploadinfo .= "<font size='2' face='Tahoma'><a href='".$script_url."/member.php?action=uploadform&cat_id=".$cat_id."'><b>Upload another image</b></a> or goto <a href='".$script_url."/categories.php?cat_id=".$cat_id."'><b>".$cat_name."'s gallery</b></a></center><br />";
$uploadinfo .= "<hr color='#C0C0C0' width='80%' size='1'>";
$uploadinfo .= "<br />";
$uploadinfo .= "<b>Image Codes:</b><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Thumbnail for websites<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Thumbnail for forums<br /><br />";
$uploadinfo .= "<font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> Hotlink for websites<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Hotlink for forums<br /><br />";
$uploadinfo .= "<font size='1' face='Tahoma'>Share this image with your friends</font><br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'> Share this image<br />";
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_path."' type='text' name='image'> Direct path to image<br /><br /></font>";
// remove the below line if your site doesnt require image validation
$uploadinfo .= "<center><font size='1' face='Tahoma'>[ This image may require validation before it actually appears on the gallery ]</font></center>";
$content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n<a href='".$uploaded_image_link."'>".$media."</a>\n</td>\n</tr>\n</table>\n";
$content .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";
//-----------------------------------------------------
//--- end of UploadInfo v1.0 --------------------------
//-----------------------------------------------------
That's it! :D
If you want to use the same image codes on the details page as well, click below
http://www.4homepages.de/forum/index.php?topic=17912.0
If there are any bugs/changes/suggestions, do let me know.
-
Good mod!
-
Good Mod
Nice job :o)
but if the user upload an image the option (hotlinks) appears to him/her only ONCE
if he want to see them back later ? how can he get the (hotlinks) information
i like the way and the place of the links :P
hope u have a way
-
morning mr lovalove!
open your eyes! :)
If you want to use the same image codes on the details page as well, click below
http://www.4homepages.de/forum/index.php?topic=17912.0
-
@Loda :P
yeah i know this :P
but i was asking if its possible to save it only for the owner of the image :P so only he/she can see this details kind of privacy :-0
tell ya the truth i didnt try that code !1 but if only the owner of the image can see the hotlinks :P then that what im lookin for ^_*
and thanks for ur try :)
-
I no use this MOD and is look good too but please
find:
$cat_name = $cat_cache[$cat_id]['cat_name'];
replace:
$cat_name = format_text(trim($cat_cache[$cat_id]['cat_name']), 2);
@Loda :P
yeah i know this :P
but i was asking if its possible to save it only for the owner of the image :P so only he/she can see this details kind of privacy :-0
tell ya the truth i didnt try that code !1 but if only the owner of the image can see the hotlinks :P then that what im lookin for ^_*
and thanks for ur try :)
For this, I no test but you need to find:
// Last update: June 30 2007
add after:
if ($check_image_owner = $site_db->query_firstrow("SELECT user_id FROM " . IMAGES_TABLE . " WHERE image_id = " . $image_id . " AND cat_id = " . $cat_id . " AND user_id = " . $user_info['user_id']) || $check_image_owner = $site_db->query_firstrow("SELECT user_id FROM " . IMAGES_TEMP_TABLE . " WHERE image_id = " . $image_id . " AND cat_id = " . $cat_id . " AND user_id = " . $user_info['user_id'])) {
if (isset($check_image_owner) && !empty($check_image_owner) && $user_info['user_level'] > USER_AWAITING && $user_info['user_info['user_id'] == $check_image_owner['user_id']) {
Find:
$content .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";
add after:
}
}
-
@thunder
thanks for ur try but not work !
i will try to add the hotlink at details.html better than at upload coz it might be lost if the user didnot save the info :)
-
i will try to add the hotlink at details.html better than at upload coz it might be lost if the user didnot save the info
This is right and easy with details.html. ;)
In the file, look for: if ($is_image_owner) { condition and add code there.
-
thanks for this :D
tried works with little modifications :P
thnks thunder :D
-
I correct your code. No need for recall SQL for this. Use same object is ok.
Note: Please use good text editor, I see:
ȤԎ ȡࠦϠɇ∓ޡ ⛑֠ȡ֦҉ ȡ䖛҉ ۡ졇⤦Ȟڠ爡䥊
in your line and this cause MOD no work correct and is reason for fail with my MODs you install. Other, is very good. ;)
-
@thunder
was ur last comment for me O_o
-
... yes ...
-
This isnt working for me. I amgetting this error
Parse error: syntax error, unexpected T_STRING in /home/kustom/public_html/ed/member.php on line 64
Thanks
Ed
-
Parse error: syntax error, unexpected T_STRING in /home/kustom/public_html/ed/member.php on line 64
Please post from line 60 to line 70 of member.php file.
-
Lines 60-70
v1.7.4
show_error_page($lang['no_permission']);
exit;
}
$txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=%22%22.$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
$txt_clickstream .= $lang['comment_delete'];
$sql = "UPDATE ".IMAGES_TABLE."
SET image_comments = image_comments - 1
WHERE image_id = ".$comment_row['image_id'];
$site_db->query($sql);
-
Editor problem -
change:
$txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=%22%22.$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
for:
$txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"" . $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'], 2)."</a>".$config['category_separator'];
-
Hello.
The mod works fine but it don´t look like the rest of the gallery (i need a blue line like the EXIF info, and the disceiption on different languages)
I am running 5 lang. so it will be nice if the file coud connect to the lang file....
-
This might help for connect right language:
http://www.4homepages.de/forum/index.php?topic=6749.0
;)
-
I tried to do this like in the first post but it had no effect :oops:
http://www.jackandkate.ru/lostuserbar/details.php?image_id=277
Is it because of my Russian files? How can I make it right?
Please answer in two words as it's difficult for me to seach smth I need in such long instructions in English. :roll:
Hmm... I found out that I've got these codes in the box right after I add file, but then when I go to the category and once again to the file there is no one 8O
And also why my code there is like this?
[URL=http://http://www.jackandkate.ru/lostuserbar][IMG]http://http://www.jackandkate.ru/lostuserbar/data/media/6/1.png[/img][/URL]
I mean two http:// in the code. :(
So while it is member.php it's ok, but how can I make this code visible in the category?
-
work fine for me. :mrgreen: :P
-
hello all, I am back on the forum after a really long break. I will be taking all your suggestions and requests. Thanks to all the guys who chipped in while I was away - Great work!
-
Welcome back! :) Keep up your good work!
-
is it possible to do "image links BB codes" under "thumbnails" (under thumbnails on home page, categories pages), as on picamatic.com "image link BBcode menu" ?
example link BB code menu, on thumbnails, on Picamatic.com :
(http://www.picamatic.com/show/2008/08/23/03/879491_bigthumb.jpg) (http://www.picamatic.com/view/879491_PIC2/)
and possible worked without conflict, with mod [TUT] Tooltip for Thumbnails (http://www.4homepages.de/forum/index.php?topic=22030.0) ?
-
thanks for the welcome Kai! :D
@ Omsky - I'll see if it can be done and nudge ya if done!
-
Thanx for this mod
But it will not work
I receive a t_string error in this line:
$cat_name = $cat_cache[$cat_id]['cat_name'];
Any help?
kr
Michael
-
please quote the exact error messages and show 10 lines above and below the error line
-
Thank you
This was error message I get, when want to upload a pic:
Parse error: syntax error, unexpected T_STRING in /xxx/xxxx/xx/xx/xxxxxxx/xxxxxx/xxx.xx.xx/Bildergalerie/member.php on line 694
And that is the code - 20 above and 10 below:
if (!is_remote($file) && $imageinfo = @getimagesize($file)) {
$width_height = " ".$imageinfo[3];
}
$media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
$site_template->register_vars(array(
"media_src" => $file,
"media_icon" => $media_icon,
"image_name" => format_text(stripslashes($image_name)),
"width_height" => $width_height
));
//--- UploadInfo v1.0 Begins --------------------------
//-----------------------------------------------------
// Mod: UploadInfo v1.0
// Version: 1.0
// Description : Display image path, link and bbcode after image upload
// Contact: arjoon@gmail.com
// Last update: June 30 2007
$cat_name = $cat_cache[$cat_id]['cat_name'];
$uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
$uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
$uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
$uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
$uploaded_image_bbcode = "[URL=http://".$script_url."][IMG]http://".$uploaded_image_path."[/img][/URL]";
$uploaded_thumb_bbcode = "[URL=http://".$uploaded_image_link."][IMG]http://".$uploaded_thumb_path."[/img][/URL]";
$uploadinfo .= "<center><font size='1' face='Tahoma'>click on the above thumbnail for the full sized image</font><br /><br />";
$uploadinfo .= "<font size='2' face='Tahoma'><a href='".$script_url."/member.php?action=uploadform&cat_id=".$cat_id."'><b>Upload another image</b></a> or goto <a href='".$script_url."/categories.php?cat_id=".$cat_id."'><b>".$cat_name."'s gallery</b></a></center><br />";
$uploadinfo .= "<hr color='#C0C0C0' width='80%' size='1'>";
-
Strange, just tried your code and everything works fine...maybe restore backups and try again?
-
Maybe there is a problem at the server :?:
When I replace the line with the old versions, there is no problem. I will ask my provider !!!
kr
Michael
-
Real strange, I´ve tried to fix it with a php.ini, cause my provider think it was a problem with global_registers, but it will not work 8O
@ V@no: Which php-version is runnig at your server?
thx and kr
Michael
-
Tell you what, make a copy of your modified member.php (with the error) and rename it to member.phps, then pm me with the link to that file.
-
Ok, the problem is your editor.
this is what you have in member.php:
Ê Ê Ê $cat_name = $cat_cache[$cat_id]['cat_name'];
every line you've added that had spaces (tabs) infront got these weird characters
So, restore backups and use different editor (don't use notepad or wordpad)
-
Thanxxx, I don´t see that, I´m using Textwrangler :?: Regular i have no problems with Textwrangler - I have to try something.
Thank you very much for your help.
At mac there is no notepad or wordpad 8)
kr
Michael
-
And solved, I´ve used a different uploader and now it works - Sometime it is so easy :oops:
Thanx for your help
kr
Michael
-
Hi
good mod, but can you fix problem with embeded videos?
if someone upload *.html file (with some code inside) .. it will make code with thubmnail/picture ending .html but thats wrong..
look
http://mmoscreens.com/img1614.htm
OK is:
http://mmoscreens.com/data/thumbnails/57/Stormtrooper_training_video.jpg
but your plugin produce URL:
http://mmoscreens.com/data/thumbnails/57/Stormtrooper_training_video.htm because the original (full size) file is htm ..
I think something like "if $new_name contains .htm change it to .jpg" but how to make it ? :)
-
Hi,
May I know how to make the highlighted code copy to clipboard? This is because as common the web is protected by no-right-click. :?:
Thank you.
-
clipboard manipulation only available in IE, therefore, I'd suggest you use this modifications instead:
http://www.4homepages.de/forum/index.php?topic=17912.msg122677#post_rightclick
-
clipboard manipulation only available in IE, therefore, I'd suggest you use this modifications instead:
http://www.4homepages.de/forum/index.php?topic=17912.msg122677#post_rightclick
Thank you. Everything, works well. :D
-
If your direct upload section under the category options was closed to the visitors, image link would be previewed as id=0 like below becouse image is not approved after uploading.
http://www.domain.com/details.php?image_id=0
According to this image codes happens with respect to id=0 links. Links would give errors when people share it some other places.
To correct this, what should we think except changing the category options?
-
Move the new code in member.php below
}
add_searchwords($image_id, $search_words);
This way, it will only show links if image does not require validation.
-
Move the new code in member.php below
}
add_searchwords($image_id, $search_words);
This way, it will only show links if image does not require validation.
Hello Vano, i did this but only registered users can see the codes. i want everybody can see links (true links) after uploading image. This is serious problem for 4images validation uploading. What can we do?
-
You'll have to turn off image validation then
-
You'll have to turn off image validation then
i am not going to close my validation cause some people will upload +18 content.
-
they how do you propose uploaders use urls to the images that are not yet active?
And so you know, when images are awaiting validation, they are stored in different folders, separate from validated images. If you show url to the these images, then once they were validated and images moved to the appropriate folders, these urls will be wrong, pointed to not existing images. Or if you show urls to the images in folders as if they already validated (but not yet), then these urls will be wrong until images validated, which might only confuse.
-
Which folder is using for the awaiting validation images?
they how do you propose uploaders use urls to the images that are not yet active?
And so you know, when images are awaiting validation, they are stored in different folders, separate from validated images. If you show url to the these images, then once they were validated and images moved to the appropriate folders, these urls will be wrong, pointed to not existing images. Or if you show urls to the images in folders as if they already validated (but not yet), then these urls will be wrong until images validated, which might only confuse.
-
data/tmp_media
data/tmp_thumbnails
-
I'm change your code to display path to thumbnails image too...
it's correctly ?
thanks.
-----------------------------------------------------------------------------------
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 500px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_path."' type='text' name='image'> Direct path to thumbnails<br />";
------------------------------------------------------------------------------------
-
Hi, I installed this MOD and everything works "almost well" the problem I have it when I upload an image from a URL code that shows me the MOD did not work, tell them that I have a forum with phpBB phpBB-SEO MOD which adjust the URL's and I think there is the problem, I wonder if you can change the MOD or 4Images code to return a clean URL like the climb from the PC.
I made some changes that are in the post but now I encounter this problem, the URL for thumbnail are inconclusive as the example below:
[IMG] http://crakinet.com/hostimages/data/thumbnails/10/ [/ IMG]
How I can fix this, please if I can help.
In particular I'm interested in that loading the image from a URL, 4Images realize and keep a copy on the server, as if he had risen from the PC.
I hope your help Thanks!
Sorry for my English! :lol: