Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 05:34 am EDT

Geeklog Forums

Allow comments on some topics, not others?


Status: offline

Ralpharama

Forum User
Newbie
Registered: 05/06/16
Posts: 4
blank
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
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
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.
 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
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
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.
 Quote

Status: offline

Ralpharama

Forum User
Newbie
Registered: 05/06/16
Posts: 4
Thanks! Much appreciated, I'll report back if I get anywhere Smile
 Quote

Status: offline

Ralpharama

Forum User
Newbie
Registered: 05/06/16
Posts: 4
happy
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
 Quote

All times are EDT. The time is now 05:34 am.

  • 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