News pro GK4

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Mon Apr 02, 2012 12:04 pm
Hi,

i used News Pro GK4 in order to pus forward my K2 Articles.
For some articles, i do not have Image.

So i would like to show the default category image ...
-> How to do this ?
-> Whitch files have to to edit and where

thanks a lot for your help
cheers
User avatar
Expert Boarder

GK User
Mon Apr 02, 2012 5:34 pm
All data from K2 is generate in file gk.source.k2.php in /classes subdirectory but it will be not easy issue to add this feature and it is huge module customization.
User avatar
Platinum Boarder

GK User
Mon Apr 02, 2012 8:03 pm
thank;

i found how to create a new Method in gk.source.k2.php

Code: Select all
// Method to get default K2 Category Image
   function getK2CategoryImage($idCat) {
      //
      $db = JFactory::getDBO();
      
      // creating SQL query
      $query_news = '
      SELECT id,
            image,
            alias
      FROM  #__k2_categories
      WHERE id = ' . $idCat ;
      
      // run SQL query
      $db->setQuery($query_news);
      
      // when exist some results
      if($counters = $db->loadObjectList()) {
            // generating tables of news data
            foreach($counters as $item) {                  
               $result['catImage_'.$item->id] = $item->image;               
            }
      }
      return $result;


then i found how to modify hrlper.php in order to return my result (with array push function)

i just have to edit and customize layout.parts.php.

I have done it for custom div class and add special css style on specific article (like 'news' when article published within the last 6 days) :whistle:

not easy, but it will works :blush:
http://www.petitbidou.fr/blog_new/
User avatar
Expert Boarder


cron