New image functions - for dummies?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Marko
Posts: 65
Joined: Tue 2. Dec 2003, 23:58
Location: Finland

New image functions - for dummies?

Post 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.
Marko
Posts: 65
Joined: Tue 2. Dec 2003, 23:58
Location: Finland

Post 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:
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Post 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
Marko
Posts: 65
Joined: Tue 2. Dec 2003, 23:58
Location: Finland

Post 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
Post Reply