Page 1 of 1

New image functions - for dummies?

Posted: Tue 2. Aug 2005, 04:35
by Marko
Hi,

I built a wap-site around 1.1RC4 and I managed to find a solution to show small thumbnails (The ones visible on admin-section) in my mobile pages. How ever some built-in image functions have been changed since 1.1RC4 and functions I made don't work anymore.

So if anyone knows where information about those very small thumbnails is beeing stored nowdays in the database, please give me a hint. I wouldn't like to do anymore image manipulation with the large files since files suited for my purpose allready exists.

Posted: Sun 14. Aug 2005, 01:10
by Marko
Ok, let's bring this to the top...

I want to find a way to show small thumbnails on the mobile-site I've created. PHPWCMS is already doing almost everything for me, but I haven't figured out where information about the little picture (sample beneath) is beeing stored.

Imageยด

The path to the image is something like http://www.yourdomain.com/content/image ... pg/gif/png, but there seems to be no reference in the database to this file in either phpwcms_article or phpwcms_file.

Can someone help me? :shock:

Posted: Sun 14. Aug 2005, 05:16
by jsw_nz
Hi Marko,

I had a similar situation (similar but not identical) where I was trying to find the image handle. It is likely stored in a similar hash:

http://www.phpwcms.de/forum/viewtopic.php?t=6552

In my case I was trying to extract the ACTUAL article image (not the backend thumb), however the code may be of some help:

Code: Select all

			
//get the wcms article image data - need to extract this data from hash
$specific_article = mysql_query("SELECT * FROM phpwcms_article WHERE article_id = '$this_article_id'"); 
$article = mysql_fetch_assoc($specific_article);
$article_image=$article['article_image'];
if ($article_image){
     $image_array=unserialize($article_image); 
     $thumb_image = get_cached_image(array(
     "ext" =>$image_array['ext'],
     "hash" =>$image_array['hash'].'.'.$image_array['ext'],
     "width"=>$image_array['width'],
     "height" =>$image_array['height'],
     "thumb_name"=>md5($image_array['hash'].$image_array['width'].$image_array['height'].$GLOBALS['phpwcms']["sharpen_level"])));
          $this_article_thumbnail = $thumb_image[0];
          $this_image_size = $thumb_image[3];
          $this_image_size = str_replace('width="','',$this_image_size);
          $this_image_size = str_replace('" height="',',',$this_image_size);
          $this_article_image_size = str_replace('"','',$this_image_size);
}else{
     $this_article_thumbnail = NULL;
     $this_article_image_size = NULL;
} //end if article_image
Maybe OliG will come across your question and offer some help.... :D

Posted: Sun 14. Aug 2005, 13:20
by Marko
Thanks!

I didn't have time to dig into your reply, but I will in next couple of days. However I'm quite hopefull that solution may come up with your hints... :D