Posted on: 05/06/16 08:03am
By: Ralpharama
Hi all, I'm up and running and busy customising my Geeklog. It's due to be in use as a community classified and noticeboard. All good so far except one point.
I want to disable comments on certain topics. Imagine a personals section where comments wouldn't be welcome, only emailing the poster is allowed. I'd want comment enabled on other topics though, such as community notices etc.
I'm a developer and programmer so am happy to dig under the bonnet, I've been looking but can't quite figure it out. Any ideas?
Thanks for any help, or pointers in the right direction!
Ralph
Re: Allow comments on some topics, not others?
Posted on: 05/06/16 01:27pm
By: Laugh
Comments are controlled by individual articles.
From the sounds of this you want to disable comments completely for one or more topics whether they have been enabled for the story or not, Correct?
If you are approving article submissions yourself or manually adding the articles for the classifieds you could enable/disable comments as needed.
Also remember an article can belong to more than one topic so if you enable comments for the article it will be enabled under all topics and on the front page.
Re: Allow comments on some topics, not others?
Posted on: 05/10/16 02:31am
By: Ralpharama
Thanks for the reply.
There's no vetting of submissions - they all just go live for anything posted by a logged in user. The system is supposed to be as automated and hands-off as possible.
So it needs to be that if a certain topic is selected for that submission, then we automatically disable comments for it.
I really don't mind hacking the code, I just need a pointer as to where to look!
Ralph
Re: Allow comments on some topics, not others?
Posted on: 05/10/16 06:56am
By: Laugh
You could probably start in /system/lib-story.php around line 440.
Look for the column commentcode that is what is used in the story table to see if a story should display comments or not.
You will also have to hack the topic editor and table to allow you to specify which topics have comments.
Re: Allow comments on some topics, not others?
Posted on: 05/10/16 08:55am
By: Ralpharama
Thanks! Much appreciated, I'll report back if I get anywhere
Re: Allow comments on some topics, not others?
Posted on: 05/11/16 07:04am
By: Ralpharama
Yes, that works fine. That comment block, inside it you can simply add a conditional code block, for example:
Text Formatted Code
if ($topicname=="Notices and News") {
// All the comment code gets run
}
Seems fine, though I'm not sure it's 100% secure!
Thanks for your help.
Ralph