Modification to show all images with {{Category Image:CATEGO
We are looking for developers, forum moderators and translators for this project.
If you would like to help out then please add a message in this forum.
If you would like to help out then please add a message in this forum.
Modification to show all images with {{Category Image:CATEGO
by npeeters » Wed Feb 20, 2013 10:05 am
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.
Cheers and enjoy
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.
- Code: Select all
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
- npeeters
- Posts: 8
- Joined: Tue Feb 19, 2013 9:18 pm
Re: Modification to show all images with {{Category Image:CA
by Geraint » Wed Feb 20, 2013 10:24 am
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
Hope you didn't spend too much time on this - good detective work though
------------
JEvents club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits.
Join the JEvents club today!
JEvents club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits.
Join the JEvents club today!
-

Geraint - Posts: 30529
- Joined: Fri Feb 15, 2008 6:14 pm
Re: Modification to show all images with {{Category Image:CA
by npeeters » Wed Feb 20, 2013 12:34 pm
Thanks and great to hear that you keep on improving a great extension...
Me still on 2.2 though
Me still on 2.2 though
- npeeters
- Posts: 8
- Joined: Tue Feb 19, 2013 9:18 pm
3 posts
• Page 1 of 1
Return to Contribute to JEvents
Who is online
Users browsing this forum: No registered users

