Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Exclude Articles in module
Pages: [1]   Go Down
  Print  
Author Topic: Exclude Articles in module  (Read 2099 times)
0 Members and 2 Guests are viewing this topic.
mosim
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« on: April 27, 2010, 10:34:31 »

It would be a huge help if along with excluding sections and categories I could exclude articles.

Currently, the site layout for our educational program is by semester so all classes are grouped into a single category of 'Fall' or 'Spring'. I'd like to able to have the latest comments module tied to each class - I could do this if there was an option to exclude articles.

Great component! Thanks for all your hard work.
Cheers,
mosim
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: April 27, 2010, 12:44:58 »

Ok, I understand you. At this moment I could suggest you small modification.

Open /modules/mod_jcomments.xml and after line:

Code: (xml)
<param name="exclude_catid" type="textarea" cols="20" rows="5" default="" label="Exclude categories" description="Excludes comments from a specific Category or set of Categories (to specify more than one Category, seperate with a comma , )." />
add new parameter:
Code: (xml)
<param name="exclude_articleid" type="textarea" cols="20" rows="5" default="" label="Exclude articles" description="Excludes comments from a specific Article or set of Articles (to specify more than one Article, seperate with a comma , )." />

Open /modules/mod_jcomments.php

Find line:
Code: (php)
$exclude_catid = trim($params->get('exclude_catid', ''));
and replace with:
Code: (php)
$exclude_catid = trim($params->get('exclude_catid', ''));
$exclude_articleid = trim($params->get('exclude_articleid', ''));

Note, that this line occurs more than one time and you need replace all occurences.

Find line:
Code: (php)
. "\n   AND cc.object_group = 'com_content'"
and replace with:
Code: (php)
. "\n   AND cc.object_group = 'com_content'"
. ($exclude_articleid != '' ? "\n AND (c.id NOT IN (".$exclude_articleid.") )" : '')

Note, that this line occurs more than one time and you need replace all occurences.

After this you'll be able exclude comments from certain articles.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
mosim
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #2 on: April 28, 2010, 01:21:01 »

Smiley This is encouraging!

Thanks for the great step-by-step. Being a newbie I appreciate it when dev/programmers give good instructions and don't expect everyone to know about coding. Ill try this out and let you know how it goes.

Any plans for the jcomment team to include this in a near future release so hacking isn't necessary?

Cheers,
m.
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #3 on: April 28, 2010, 03:11:38 »

Any plans for the jcomment team to include this in a near future release so hacking isn't necessary?
I'm alone developer so I could promise that this feature will be added in next module release Smiley
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
mosim
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« Reply #4 on: April 29, 2010, 10:42:46 »

 Cheesy It worked. Thank You for taking the time to solve my question.

FYI, I found 3 instances of each of the last two code changes.
/modules/mod_jcomments.php

Code:
$exclude_catid = trim($params->get('exclude_catid', ''));

Was on line66, 188, and 254...

Code:
. "\n   AND cc.object_group = 'com_content'"

Was on line 80, 208, 274


Thank you again for a great component and I appreciate your hardwork and support!
Ill be sure to add a review on JED.

Cheers,
m.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Exclude Articles in module
 
Jump to: