Welcome to Geeklog, Anonymous Thursday, January 23 2025 @ 11:30 pm EST
Geeklog Forums
Allow comments on some topics, not others?
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
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
11
15
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
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.
One of the Geeklog Core Developers.
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.
One of the Geeklog Core Developers.
12
12
Quote
Status: offline
Ralpharama
Forum User
Newbie
Registered: 05/06/16
Posts: 4
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
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
11
8
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
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.
One of the Geeklog Core Developers.
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.
One of the Geeklog Core Developers.
11
12
Quote
Status: offline
Ralpharama
Forum User
Newbie
Registered: 05/06/16
Posts: 4
Thanks! Much appreciated, I'll report back if I get anywhere
9
9
Quote
Yes, that works fine. That comment block, inside it you can simply add a conditional code block, for example:
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
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
11
10
Quote
All times are EST. The time is now 11:30 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content