Ony visible activity - forum

Ony visible activity - forum

by m question -
Number of replies: 0

Hi

I need a report of the available forum for students

many forums are hidden or old 

how to show a list of only available forums

this sql provides a list of the forum (not news) which is what I need but even hidden forum are shown

I tried many sql but I can not figure relations between course_module and module and forum

the visible attribute of the forum  in course_module relation but until now it did not work with me

I hope you can help

---------------------------------------------------

here what I come with but the result is empty


SELECT 

concat('<a target="_new" href="%%WWWROOT%%/course/view.php?id=',c.id,'">',c.shortname,'</a>') AS Course

,c.fullname

,c.category

,f.name

,f.TYPE

,startdate

,enddate

,cutoffdate


,CONVERT_TZ(FROM_UNIXTIME( startdate),'+00:00','+03:00') startDate

,CONVERT_TZ(FROM_UNIXTIME( enddate),'+00:00','+03:00') enddate

,CONVERT_TZ(FROM_UNIXTIME( cutoffdate),'+00:00','+03:00') cutoffdate

FROM prefix_forum f

INNER JOIN prefix_course c ON c.id = f.course

JOIN prefix_course_modules AS cm ON cm.course = c.id AND cm.module=5 AND cm.instance=f.id

WHERE  NOT(f.TYPE = 'news')

AND cm.visible = 1


ORDER BY c.category


Average of ratings: -