1
pw-kw
Comments function just only for one topic in news module
  • 2009/5/7 8:53

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


Hi community,

is there a posibility or hack to allow the comment function just only for one topic in the news module. All other topics should be without the comment function - hm, how can I do this - have anyone an idea?

Thanks in advantage!

2
pw-kw
Re: Comments function just only for one topic in news module
  • 2009/5/8 11:19

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


hm .. anybody an idea????

3
trabis
Re: Comments function just only for one topic in news module
  • 2009/5/8 12:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


That is complicated because the topic id is not stored in the comments table. That means that you would need to perform a join with the stories table on comments.com_itemid=stories.storyid, and another join for topics table on topics.topic_id=stories.topicid and to add a condition for topics.topic_id='topic to match'.

4
pw-kw
Re: Comments function just only for one topic in news module
  • 2009/5/9 9:16

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


@ trabis - thanks for your information. hm ... is it simpler to do that direct for articles? I meen that one or two articles have the comment function. All others are without comment function.

5
trabis
Re: Comments function just only for one topic in news module
  • 2009/5/9 17:44

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I think I misunderstood your post.

You want to display comments(in system comments block) for one module and topic only

or

You want to allow users to comment only in one topic?

6
pw-kw
Re: Comments function just only for one topic in news module
  • 2009/5/11 6:31

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


@ trabis - yes the second one: I would like to allow useres to comment only in one topic!

7
trabis
Re: Comments function just only for one topic in news module
  • 2009/5/11 12:14

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


At the end of article.php replace with this:
$allowed_topics_ids = array(168); //just add the ids of the topics you allow to comment
if (in_array($article->topicid(), $allowed_topics_ids)) {
    include_once 
XOOPS_ROOT_PATH.'/include/comment_view.php';
}
include_once 
XOOPS_ROOT_PATH.'/footer.php';
?>


Not tested.

8
pw-kw
Re: Comments function just only for one topic in news module
  • 2009/5/12 6:15

  • pw-kw

  • Just popping in

  • Posts: 50

  • Since: 2007/2/1 8


@ trabis - thanks a lot. it works great!!!

9
vietnam
Re: Comments function just only for one topic in news module
  • 2009/6/9 9:23

  • vietnam

  • Just popping in

  • Posts: 59

  • Since: 2007/5/25


Quote:

trabis wrote:
I think I misunderstood your post.

You want to display comments(in system comments block) for one module and topic only

or

You want to allow users to comment only in one topic?

display comments(in system comments block) for one module and topic only

I would like to ask how to achieve that? Thanks!

10
vietnam
Re: Comments function just only for one topic in news module
  • 2009/6/19 4:46

  • vietnam

  • Just popping in

  • Posts: 59

  • Since: 2007/5/25


Quote:

vietnam wrote:
Quote:

trabis wrote:
I think I misunderstood your post.

You want to display comments(in system comments block) for one module and topic only

or

You want to allow users to comment only in one topic?

display comments(in system comments block) for one module and topic only

I would like to ask how to achieve that? Thanks!

http://waterlily-lsl.com/modules/article/view.article.php/c11/184
Specific practices have been found, thank you!

Login

Who's Online

330 user(s) are online (138 user(s) are browsing Support Forums)


Members: 0


Guests: 330


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits