<< Back
Message for this thread
Posted by Messages text
ee hang liang

Avatar
Total post : 144
> Profile
Written on : 02/03/2010 17:45 ( more than one month )
Object : Display No of Courses in Category Listing
Hi,

Could someone advise how to display number of courses in the category listing? like screenshot below.


From LiangEH
 
ee hang liang

Avatar
Total post : 144
> Profile
Written on : 03/03/2010 06:45 ( more than one month )
Object : Re: Display No of Courses in Category Listing
Hi All,

I look at the code doceboLms/modules/coursecatalogue/lib.coursecatalogque.php, starting line 242

$GLOBALS['page']->add('<li'.( !isset($descendant[$id_cat])  ? ' class="empty_folder"' : '' ).'>'
                    .'<a href="'.$url->getUrl('id_parent='.$id_cat).'">'.$cat['name'].'<br />'
                    .'<b>'.str_replace(    array('[course]', '[category]'),
                                        array(    ( isset($descendant[$id_cat]['course']) ? $descendant[$id_cat]['course'] : 0 ),
                                                ( isset($descendant[$id_cat]['category']) ? $descendant[$id_cat]['category'] : 0 )    ),
                                        $lang->def('_COURSE_CONTENT', 'course')).'</b>'
                    .'</a></li>', 'content');

$descendant[$id_cat]['course']  is to count how many courses inside the respective category.

But, it seems does not work for me. Anyone, pls help?


From LiangEH
Message modified by : liangeh on : 03/03/2010 07:22
 
ee hang liang

Avatar
Total post : 144
> Profile
Written on : 03/03/2010 07:39 ( more than one month )
Object : Re: Display No of Courses in Category Listing

Dear All,

I change the code from:
$lang->def('_COURSE_CONTENT', 'course')) . '</b>'

to
$lang->def('_COURSE_CONTENT', 'course')). ':' . $descendant[$id_cat]['course'] . '</b>'

This enables the display of total number of courses in the category.

But, i have catalog function implemented, this catalog function is to control course visibility to certain groups. This $descendant[$id_cat]['course'] does not consider the existence of the catalog function. For example, the course inside the N Water Category shall be hidden under the catalog formula. But, the folder still show as blue and no of courses is 1.  

Please help.




 
<< Back