By Pawan on Tuesday, 24 May 2016
Posted in Technical Issues
Likes 0
Views 423
Votes 0
can you help me to locate the file which has the code for filtering the 'All/Unanswered' posts on load (for 'All' and 'unanswered' filters)?
Thanks. Its Done.

I added the following code in file: com_easydiscuss/views/index/view.html.php , on line no. 56 onward:

$my = JFactory::getUser(); // get user info
$gid = $my->groups; // get array containing all user groups

//8 is the group_id of superuser, 11 is for lawyer, 17 is for moderator
$lawyer ='11'; $superuser = '8'; $moderator= '17';

if (in_array($lawyer, $gid)){$activeFilter='unanswered'; $filter='unanswered';}
if (in_array($moderator, $gid)){$activeFilter='unanswered';$filter='unanswered';}
if (in_array($superuser, $gid)){$activeFilter='unanswered';$filter='unanswered';}
·
Wednesday, 25 May 2016 20:37
·
0 Likes
·
0 Votes
·
0 Comments
·
You should be more specific about your request as I have absolutely no idea which page you are referring to. At least a link to the page would be more helpful

Anyway I believe you are referring to this, /components/com_easydiscuss/themes/wireframe/frontpage/filters.php
·
Wednesday, 25 May 2016 00:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry for not being very clear. But you have got it almost right.
The file you named deals with the names of the filter; but it does not actually filter the posts shown on teh front page.

What I want to achieve:
I have two groups of users. (i) Lawyers and (ii) non-lawyers. In the previous versions of ED I had customized the code so that when lawyers log in, they saw only 'unanswered' posts, so that unanswered posts are not missed.
But with the latest version of ED I am not able to achieve that.

I am able to find the user group and on that basis I am able to change the name of active filter. I am able to show 'unanswered' as the active filter when lawyer log in. But the posts below that remain in 'All" filter mode. They do not change to 'Unanswered' filter mode. I know I am very close, bust something is missing.

I'll be grateful if you could guide me to do this.
·
Wednesday, 25 May 2016 18:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing, glad that your issues are resolved now
·
Thursday, 26 May 2016 00:25
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post