Welcome to Geeklog Saturday, November 18 2017 @ 05:03 am EST


Status: offline

Ralpharama

Forum User
Newbie
Registered: 06/05/2016
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

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1239
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.

Status: offline

Ralpharama

Forum User
Newbie
Registered: 06/05/2016
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

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1239
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.

Status: offline

Ralpharama

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

Status: offline

Ralpharama

Forum User
Newbie
Registered: 06/05/2016
Posts: 4
happy
Yes, that works fine. That comment block, inside it you can simply add a conditional code block, for example:

PHP 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

All times are EST. The time is now 05:03 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