Maybe I need to understand better what you are trying to do. You have a path to an image and are trying to use the plugin to create a new img tag based on your parameters?
The plugin will only do something if it finds an img tag. Maybe you could put your image path into a img tag and see what happens.
{exp:Shj_imgmodifier phpthumb="true" phpthumb_path="/thumb/phpThumb.php" phpthumb_attributes="q=50&zc=1" width="100" height="100" lightbox="false"}
{image}
{/exp:Shj_imgmodifier}
Optimised the test page:
[code}Just Image:
{image}
XMP code :
<xmp>{image}</xmp>
XMP code with ee_typography:
<xmp>{exp:ee_typography allow_image_urls="y"}{ image}{/exp:ee_typography}</xmp>
{exp:shj_imgmodifier phpthumb="true" phpthumb_path="/thumb/phpThumb.php" phpthumb_attributes="q=50&zc=1" width="420" lightbox="false" clear="true" parse="inward"} Modified image with ee_typography:
{exp:ee_typography allow_image_urls="y"}{ image}{/exp:ee_typography}
Modified image without ee_typography:
{image}
{/exp:shj_imgmodifier}
{/exp:query}
</code></pre>
On top, I have added a parameter to the ee_typography tag to allow for image URL’s. As you can see in the XMP statement, it parses fine. You can try one of the images and see that they exist. However, no images show up :-(. I really don’t know what could be the problem. Maybe a night of sleep will help…
I have tried your suggestions but also the parse inward on the SQL statement don’t work.
But browsing, browsing, browsing, I have found this solution:
http://ellislab.com/forums/viewthread/56324/ by Sue.
Which just says: define a global var filedir_5 (in my case). This works! It is not the solution which will get an EE innovation award, but it works… And as the deadline is approaching very fast, I am really happy right now.
thanks for all your support!
Erwin
Hi,
Thank you for mentioning my little plugin 😉
I was looking at what might be causing this division by zero problem and found the bug causing it. I have fixed it and you can download the updated plugin from the site.
The problem did not have anything to do with the images being from an external domain. The problem occurred in the calculation routine that automatically figured out image height or with if only one of the two was given.
If you want to create thumbnails of images on a remote server I think you have to fiddle with this part of the phpThumb config (not sure though if that is enough):
// * Off-server Thumbnailing Configuration:
$PHPTHUMB_CONFIG['nohotlink_enabled'] = false; // If false will allow thumbnailing from any source domain
$PHPTHUMB_CONFIG['nohotlink_valid_domains'] = array(@$_SERVER['HTTP_HOST']); // This is the list of domains for which thumbnails are allowed to be created. Note: domain only, do not include port numbers. The default value of the current domain should be fine in most cases, but if neccesary you can add more domains in here, in the format "www.example.com"
$PHPTHUMB_CONFIG['nohotlink_erase_image'] = true; // if true thumbnail is covered up with $PHPTHUMB_CONFIG['nohotlink_fill_color'] before text is applied, if false text is written over top of thumbnail
$PHPTHUMB_CONFIG['nohotlink_text_message'] = 'Off-server thumbnailing is not allowed'; // text of error message
Best, Sami
What a great plugin! Almost everything works as expected, but i only can’t get “align” to work. Whatever i try it’s not aligning. Am i doing something wrong or is there an error in the plugin. This is my code:
{exp:shj_imgmodifier phpthumb="true" phpthumb_path="../phptumb/phpThumb.php" phpthumb_attributes="q=50&zc=1" clear="true" align="right" width="100" height="100"}
{body}
{/exp:shj_imgmodifier}
Thanks in advance!
UPDATE: That was easy: Add under line 156 $attributeList[“align”] = $this->ppAlign;
Hey Sambo
I’m having problems getting the plugin to work. I’m getting an error when using the exact same code as I’m using on another project, which is working fine.
Template:
{exp:shj_imgmodifier phpthumb="true" phpthumb_path="/images/thumb/phpThumb.php" phpthumb_attributes="q=50&zc=1" width="40" height="40" lightbox="true"}
{nyheter_bild}
{/exp:shj_imgmodifier}
Error: “Fatal error: Call to undefined function: array_combine() in /home/evntyr/www.eventyr.se/eventsinside/plugins/pi.shj_imgmodifier.php on line 98”
Using the latest version of the plugin, downloaded today.
Tnx/Takk
Hi,
I find it very strange that you are getting this error because in the latest code there is no array_combine method. I had to create a new method called array_combine_php4 because array_combine was not available in PHP4.
I bet your other site is running on a PHP 5 server - and therefor working.
Please try to download the latest source code again and verify that lines 100 and 185 are using array_combine_php4.
Best, Sambo
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.