K2 Item Image and intro

More
28 Apr 2011 07:45 #1031 by empea
joomlamailer version: 1.7
Joomla! version: 1.5.22
PHP version: 5.2.15
MySQL version: 5.0.90

Hi
Can anyone suggest a way to allow the k2 item image to be displayed with the k2 item intro text? (I'm happy to patch files if need be).
I really need each items small image (eg. media/k2/items/cache/e7c0584255fa6f2981e510285a9e9e4f_S.jpg) to be displayed left aligned to each k2 item title and intro text. Is this achievable do you think?
Cheers
Emily :)

Please Log in or Create an account to join the conversation.

More
28 Apr 2011 13:21 #1044 by pete
Replied by pete on topic K2 Item Image and intro
Hi Emily,

The image in the same line as the title is tricky and would involve modifications in quite a few different places.
Here is how to show the image next to the article text:

Edit the file administrator/components/com_joomailermailchimpintegration/controllers/create.php
(Line numbers apply to version 1.7)

Replace:
Code:
$html_content = $art->introtext;

with:
Code:
if( JFile::exists( JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$id).'_S.jpg' ) ){ $html_content = '<img src="'.JURI::root().'media/k2/items/cache/'.md5("Image".$id).'_S.jpg" align="left" alt="'.$art->title.'" title="'.$art->title.'" /> '; } $html_content .= $art->introtext;

in line 1347 and 309.

Kind regards,
Pete

Please Log in or Create an account to join the conversation.

More
28 Apr 2011 14:17 #1045 by empea
Replied by empea on topic K2 Item Image and intro
Hi Pete,
Thanks for the speedy reply. I've tried the code you supplied - but alas - still no images showing in the preview. I've double checked that all the k2 items I'm including have images - which they do.... just can't get them to show up. Thought maybe it was something to do with the truncate patch I'd applied earlier - so i removed that...but still no luck!
Any ideas?
Thanks for the help.
Cheers
Emily

Please Log in or Create an account to join the conversation.

More
28 Apr 2011 14:27 #1047 by pete
Replied by pete on topic K2 Item Image and intro
I can't really tell why it's not working. If you like you can send me a superadmin login and ftp credentials to your site and I'll take a look. pete@freakedout.de

Please Log in or Create an account to join the conversation.

More
28 Apr 2011 17:19 #1059 by pete
Replied by pete on topic K2 Item Image and intro
Done. The truncate patch doesn't have anything todo with it. Maybe you didn't replace = with .= in the line where you call the truncate function. = does assign a new value to the var while .= appends something to the end of the current value.

Kind regards,
Pete

Please Log in or Create an account to join the conversation.

More
29 Apr 2011 04:34 #1086 by empea
Replied by empea on topic K2 Item Image and intro
Thanks so much Pete - Working beautifully now :) You were right - I hadn't replaced = with .= - all makes sense now.
Thanks again for your help. An awesome mailchimp integration!

Cheers
Emily

Please Log in or Create an account to join the conversation.

More
29 Aug 2011 07:25 #1967 by directivesi
Replied by directivesi on topic K2 Item Image and intro
Hello! Has support for k2 Images been implemented yet? I just want to make sure before I try to apply this hack. Need K2 images also.

Please Log in or Create an account to join the conversation.

More
29 Aug 2011 13:00 #1969 by pete
Replied by pete on topic K2 Item Image and intro
Hi,

No it's not implemented in the current version. You need to apply the hack from above.

Kind regards,
Pete

Please Log in or Create an account to join the conversation.