By npeeters on Wednesday, 20 February 2013
Replies 2
Likes 0
Views 3.3K
Votes 0
Hi, I have noticed that in a multi-category set-up the tag {{Category Image:CATEGORYIMG}} only shows the image from a single category.
To resolve the issue and show the image of all event categories, please replace the getCategoryImage function in jeventcal.php with the function(s) below.

Code probably needs clean-up.

	function getCategoryImage( ){
$data = $this->getCategoryData();
if (is_array($data)) {
$count = count($data);
$retVal = "";
for ($iCount = 0; $iCount <$count; $iCount++) {
$iData = $data[$iCount];
$retVal .= $this->getOneCategoryImage($iData);
}
return $retVal;
}
else
{
return $this->getOneCategoryImage($data);
}
return "";
}

function getOneCategoryImage ($data) {
if ($data){
if (JVersion::isCompatible("1.6.0") ){
$params = json_decode($data->params);
if (isset($params->image)){
return "<img src = '".JURI::root().$params->image."' class='catimage' />";
}
}
else {
$image = $data->image;
if (!empty ($image)){
return "<img src = '".JURI::root().$image."' class='catimage' />";
}
}
}
return "";
}


Cheers and enjoy
In JEvents 3.0.7 we already support {{Category Images:CATEGORYIMGS}} which gives you the multiple images.

Hope you didn't spend too much time on this - good detective work though
·
Wednesday, 20 February 2013 10:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks and great to hear that you keep on improving a great extension...

Me still on 2.2 though <!-- s:? --><img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
·
Wednesday, 20 February 2013 12:34
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post