xoops forums

sabahan

Quite a regular
Posted on: 2013/3/23 13:47
sabahan
sabahan (Show more)
Quite a regular
Posts: 317
Since: 2006/3/4 5
#1

Publisher: Add Image for other articles listed under article ?

Hi

Need some help with the Publisher Module by Trabis

i have set the "Other articles display type: All articles" in preferences

how do I add the item image of all of the "other articles" listed

Now it is displaying Title, Hits, Date submission, i need to add image for the respective article

i know we have have to edit the file item.php somewhere line 118 and in the template publisher_item.html


but i have limited php knowledge..

sabahan

Quite a regular
Posted on: 2013/3/24 10:51
sabahan
sabahan (Show more)
Quite a regular
Posts: 317
Since: 2006/3/4 5
#2

Re: Publisher: Add Image for other articles listed under article ?

i manage to find the solution

in item.php somewhere in line 118 add this

$mainImage $theitemObj->getMainImage();
            
// check to see if GD function exist
            
$theitem['item_image'] = $mainImage['image_path'];
            if (!empty(
$mainImage['image_path']) && function_exists('imagecreatetruecolor')) {
                
$theitem['item_image'] = ARTIKEL_URL '/thumb.php?src=' $mainImage['image_path'] . '&w=100';
            }




in publisher_item.html

use this to call the image
<{if $item.item_image != ''}> <a href="<{$item.itemurl}>" title="<{$item.title}>">
           
                    <
img src="<{$item.item_image}>" alt="<{$item.title}>" align="left" width="100" /> 
</
a><{/if}>

Cesagonchu

Moderator
Posted on: 2013/3/24 13:31
Cesagonchu
Cesagonchu (Show more)
Moderator
Posts: 881
Since: 2010/2/1 2
#3

Re: Publisher: Add Image for other articles listed under article ?

Thank you sabahan, maybe we'll add it to publisher module