Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

How can I disable 'reply' in a particular forum?

Quote Reply
How can I disable 'reply' in a particular forum?
Hello,

I have several forums and want one of them to be just listings with no ability to reply. I don't see a forum parameter where people can read/edit but not reply. Can someone help with code and where to place it so that I can disable the reply selection for a particular forum?

thanks!

(p.s. I have the private reply option also, but I want to keep that as a selection.)

Last edited by:

Jumbolaya: Jan 8, 2008, 2:34 PM
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Hi,

In short, I don't think you can :(

I took a look at include_post_display.html (which is the template in question) - and it has this bit:

Code:
<%GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",
reply => "Reply",
a_attribs => ""
)%>

I tried editing it to:

Code:
<%GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",

a_attribs => ""
)%>

<%-- reply => "Reply", --%>

..but it still shows "reply" Frown

If that had worked, it would have been as simple as :

Code:
<%if forum_id == 1234%>
dont show with reply
<%else%>
show with reply
<%endif%>

Unfortunately, that won't work though :(

I also took a look at forum "permissions" - but that only has the option to allow for "read/reply" - "read/write/reply" - but what you really want to "write", and thats it :/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Edit the forum from the admin, and change the Guest, Non-Validated, and Registered users to Read access only. Then add whoever that has access to post in the forum to a new group and give that group read/reply access.

Adrian
Quote Reply
Re: [brewt] How can I disable 'reply' in a particular forum? In reply to
Andy, thank you for the attempt. I was hoping it would be as simple as you thought it might be. alas.

Brewt - I didn't want anyone at all to be able to reply to a post in this particular forum. not even the original poster (though they could still edit their post). So the read/reply won't work in this instance. A write only function for the forum would indeed have worked. thanks for taking the time though, much appreciated.

Here's a stupid question, can you change the color of 'reply' maybe? I'm just thinking what if the color could be the same as the background and therefore users wouldn't be able to see it, maybe they wouldn't think about it. A clumsy hack indeed, but maybe.

Last edited by:

Jumbolaya: Jan 9, 2008, 2:52 PM
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Hey Andy, I can get to this point ! Edit | Delete | Quote | | Private Reply and there is no link either.

The double hashes don't bother me. I was thinking maybe there was a 'failsafe' for what the code considered erroneous text - it checks for a null value and if you don't have anything in the "Reply" part of (reply => "Reply", ) then the display puts in Reply for you. But if you leave the string blank ( reply => " ", ) it puts out the text I posted above. So with that could I possibly use that <%if forum_id == 1234%>... check you detailed?
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Hi,

What are you using to get that output? I think I can give you a global and way of getting rid of the | | - but just need to see how your doing it so far :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How can I disable 'reply' in a particular forum? In reply to
Andy, taking your first suggestion of editing include_post_display_html, instead of totally removing the "Reply" part, I just put a space in the text value:


<%GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",
reply => " ",
a_attribs => ""
)%>

I don't mind the | | at all, I'm justing hoping that some type of if-code processing could be done like "if forum_id in (x,y,z)" it could resolve to reply => " " for those forums, and reply => "Reply" for every other forum or default.

.

Last edited by:

Jumbolaya: Jan 10, 2008, 2:41 PM
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Hi,.

Easy when you think about it <G>

Ok, try this:

Code:
<%set reply_stuff = GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",
reply => " ",
a_attribs => ""
)%>

<%clean_it($reply_stuff)%>

Then, add a new global called "clean_it"- with:

Code:
sub {
my $in = $_[0];
$in =~ s/| |//;
return $in;
}

I'm not 100% sure, but you MAY need something a bit more complex, like:

Code:
sub {
my $in = $_[0];
$in =~ s/\Q<b><font size="2"> | </font></b><b><font size="2"><b>| </font><b>/|<b><font size="2">| </font></b>/;
return $in;
}


Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!

Last edited by:

Andy: Jan 10, 2008, 2:55 PM
Quote Reply
Re: [Andy] How can I disable 'reply' in a particular forum? In reply to
thanks for the help Andy, but I'm lost. Where do you check for the forum_id in that code and return reply =>" " or reply => "Reply"? Its seems like your example is just for cleaning up the "| |".
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
rats! nevermind! I forget you posted a forum_id check routine up above. I will insert that right after the quote => "Quote" line and see what happens.
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
didn't work. I guess I'm not putting the <%if forum_id = 34%> in the right place.
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
after analyzing the code I got this to work

Code:

<%if forum_id=99%>
<%GForum::GUI::draw(
draw => post_display_options,
separator => " ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => " ",
reply => " ",
a_attribs => ""
)%>
<%else%>
<%GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",
reply => "Reply",
a_attribs => ""
)%>
<%endif%>


Not sure if its the most efficient method, but it works exactly like I wanted it too. Took out quote => "Quote" too as that is a form of reply.

Last edited by:

Jumbolaya: Jan 10, 2008, 10:28 PM
Quote Reply
Re: [Jumbolaya] How can I disable 'reply' in a particular forum? In reply to
Hi,

Yup, thats exactly how I was thinking of doing it :)

You can also do it with multiple forums:

Code:
<%if forum_id=99 or forum_id = 1234%>
<%GForum::GUI::draw(
draw => post_display_options,
separator => " ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => " ",
reply => " ",
a_attribs => ""
)%>
<%else%>
<%GForum::GUI::draw(
draw => post_display_options,
separator => " | ",
edit => "Edit",
delete => "Delete",
cant_post => "Can't Post",
quote => "Quote",
reply => "Reply",
a_attribs => ""
)%>
<%endif%>

Sorry I didn't reply to your other posts - was sleeping =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!