How do you dynamically access a thumbnail of an uploaded image? As it is right now it just sticks in a URL to the original image, but I see no way to get it to output the URL to the thumb?
Any news on a neat way to approach this (that isn’t clunky and problematic, like what I’ve come up with…)!
Simon, I think I’ve found a fairly stable way around this. Someone earlier in this thread mentioned a php script called PHPThumb (http://phpthumb.sourceforge.net/). This and a bit of creative HTML has allowed me to achieve what I need. Take a look at http://www.unclegamer.com/news/discuss/microsoft_officially_announces_xbox_360_elite/ to see an example page of how the File extension and PHPThumb together has allowed me to list off unlimited rows of thumbnails with a link to the original image. I could even have linked it to another size limited image.
While it works great I still haven’t achieved quite what I want. The divine solution would allow me to click the thumbnail which would open a new HTML page with that image embedded, allowing me to stick an advertisement, or anything for that matter, above and/or below the image. Even better would be prev/next links to cycle through all images associated with the entry. This solution only allows me to link up a thumbnail directly to the image.
I’m quite new to EE so please bear with me…
I can’t seem to find any documentation on this extension and I think this is something that I’m interested in.
I’m trying to find a way to insert up to 3 images on a weblog post as well as possibly a link to a pdf file. I know I can do this with html and my FTP program, but getting my client to be able to do this is key! thats why this extension seems to be pretty appealing.
so how can I insert image1, image2, image3, and pdf1 all in various places through out my weblog post? I’ve named my custom field “file_upload”
Thanks for the help with the code!
Wow thanks for the super fast response… I think your solution will certainly work.
2 questions though:
Thanks again for the help
—- EDIT —- I’ve found a good solution to my problems, but now how do i only list my file names if I’m using the multi list feature.
{file_uploads}
<a href="http://{file_upload}">{file_upload}</a>
{/file_uploads}
This my files great, but the text that is linked is the entire uri. Is there any way to only display the pdf or doc file name only?
Great extension! In fact, all of your extensions have been extremely helpful. 😊
Many many thanks!
Just have a quick thought on this extension… I hope I am not way out of line or off-base on this one:
Seems like this would be totally perfect if you could change settings based on the folder uploaded… Kinda like how EE has the option to Create New Upload Destination (see “Main Screen”.) Then, per upload destination, one can set variables specifically for that upload folder.
For example, I would like to have a couple (thumb) images per blog post that get sized differently… The thumb images uploaded to “index” would get resized to 100x100px, and the thumb images that get uploaded to “articles” get resized to 250x300px…
Just a thought… Either way, perfect addition to EE. Many thanks! 😊
Cheers, Micky
@zitro62: that would have to be done with a simple PHP regular expression running on “Output”
@Wild Garden: You most certainly can have different settings per field. As you alluded to just set up different upload destinations and then when creating the field choose those upload destinations. If you’re going to go this route, just be sure to clear out all your “Extension Settings” because those will override any per-field Upload Destination settings you may have set.
This extension is great. Just what I have been looking for! I’ve got a question though. How do you dynamically access a thumbnail of an uploaded image? As it is right now it just sticks in a URL to the original image, but I see no way to get it to output the URL to the thumb?
This is my quick/dirty approach for a single upload:
<?php
$cust = '{article_image}'; // Name of custom field.
# pathinfo might work better if using PHP 5.2.0
# http://www.php.net/manual/en/function.pathinfo.php
//$file_name = pathinfo($cust); echo $file_name['filename'];
$path_to_files = dirname($cust); // Path to file.
$parts = explode('.', basename($cust));
# $parts[0]; // file_name
# $parts[1]; // .ext
echo $path_to_files.'/'.$parts[0].'_t.'.$parts[1];
# Output:
# <img src="http://www.site.com/images/articles/red-lilly_1_t.jpg" alt="" />
?>
I think this would be great so my authors could attach multiple images to any posting and it would just append a series of thumbnails that can be clicked through to the full sized image. What would be the best way of going about this?
You could use the built-in extension code “{images}..{image}..{/images}” to loop and use something like the above code (might be best to convert it to a function) to generate your links… But, keep in mind, I just discovered this extension an hour ago, and I have been up all night, so maybe there is an easier way to get the thumb. 😊
@Wild Garden: You most certainly can have different settings per field. As you alluded to just set up different upload destinations and then when creating the field choose those upload destinations. If you’re going to go this route, just be sure to clear out all your “Extension Settings” because those will override any per-field Upload Destination settings you may have set.
Thanks for the quick reply Mark! I really appreciate the help. 😊
O.k., I need some zzZZzz’s.
Cheers, M
try something like this:
<?php
$cust = '{article_image}'; // Name of custom field.
$filename = basename($cust); // name of file with extension.
$parts = explode('.', $filename); // array of file name
# $parts[0]; // file_name
# $parts[1]; // ext
echo $parts[0]; // just the file name without the ext.
?>
Mark, thank you so much for this great script. I am running into two problems, my fault of course. 1st, I tried using the two arrays as mentioned above but I get a blank screen. I have enabled php in the template. What I would like to do is like the following:
{if attach}
{attachs}
<a href="http://{exp:download_lock:link">Download</a>
{/attachs}
{/if}
2nd, I am having troubles with the SAEF. I copied and pasted from the publish html source and the js. The form seems to work, it enters a title, but in the exp_weblogs_data table, nothing is entered. When I remove the tag below, it works. It also works just fine when I use the CP. Below is the code I have in the template: 1st js in the head, I have only added the function addRow and second in the body:
Thanks for everything you do. Dave
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.