Contribute to JEvents

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.

Postby 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.

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

Postby 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
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!
User avatar
Geraint
 
Posts: 42850
Joined: Fri Feb 15, 2008 6:14 pm

Postby 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 :?
npeeters
 
Posts: 8
Joined: Tue Feb 19, 2013 9:18 pm


Return to Contribute to JEvents

  • Who is online
  • View new posts
  • View unanswered posts
  • In total there are 0 users online :: 0 registered and 0 hidden (based on users active over the past 5 minutes)
  • Most users ever online was 94 on Tue Sep 01, 2009 12:33 am
  • Users browsing this forum: No registered users