1 (edited by cuteseal 2004-06-15 13:02)

Topic: Reply only forums

Hi guys,

I've been looking for this feature in punbb but it's not available.  It's the ability to mark certain forums as being "reply only" forums - where guests can only reply to existing topics, and only admin and mods can post.  Example usage would be in an announcements forum - where the site admin makes announcements (and allows users to post replies) but users can't  make thier own announcements.

I've modified my site to be able to do this, but am tossing up whether to release it or not - depending on interest, to make it worth my while.

You can test it out on my site (http://shuttertalk.com):
- The first two forums, Announcements and News are Reply Only (new posts allowed for admin and mods only)
- All others are normal

In reply only forums, the "Post new topic" link is hidden.

Screenshot of the modified admin console:

http://shuttertalk.com/images/other/replyonly.gif

Let me know what you think!

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

Re: Reply only forums

i use punBB++ but i have searched for this and i want it smile

3 (edited by cuteseal 2004-06-16 08:08)

Re: Reply only forums

Ok, here it is.  Download the install files here:
http://www.shuttertalk.com/reply_only.zip

Please backup your files and db before proceeding!!

Let me know how you go with this!

Jules

REPLY ONLY FORUMS PUNBB MOD
by Julian Tan
===========================

Description:
------------

This mod allows forums to be set to reply-only mode, 
on a forum by forum basis, through the administration panel.  
In this mode, only administrators and moderators can 
post new topics in those forums.  Users (and guests, 
depending on your permissions) can post replies though.  
This is useful for forums such as announcement forums, 
you want to control what topics are posted, but also wish 
to allow people to post feedback.


Version History:
----------------
1.0     Initial Release


Disclaimer:
-----------
Please take backups of both your punbb files and 
database before proceeding with this mod.  Use of 
this mod is at your own risk.  No responsibility will 
taken for any damage, loss, or inconvenience caused 
due to the usage of this mod.


Installation Instructions:
--------------------------

1.  Backup files and database.  Please.

2.  Use a mysql admin tool to execute the following 
(note, please replace [forum-prefix] with the your forum prefix for table names:

    ALTER TABLE `[forum-prefix]forums` ADD `reply_only` TINYINT AFTER `admmod_only` ;

    UPDATE `[forum-prefix]forums` SET reply_only = 0 ;

3.  Modify your admin_forums.php, viewforum.php and post.php files, 
as per the similarly named html files within the zip file.  
The changed lines are highlighted - the column on the left shows the new file.

Note that line numbers are approximate only - it may differ from yours 
due to modifications, etc.

4.  Log into your administration area, and under Forums, 
check "Reply only" for those forums which you wish to set to reply-only mode.


Enjoy!
Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

4

Re: Reply only forums

oh man! ive soo been wanting a mod like this smile

Re: Reply only forums

cool!  let me know how it goes for you smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

6 (edited by pen 2004-06-18 12:46)

Re: Reply only forums

you should write one of those install_mod.php
because i dont understand that sql edit

i have phpMyAdmin and i went to my forum table and clicked sql
because its the only place where i can see anything code like
and the only thing that stands there is:

SELECT * FROM `tagmonkey_forums` WHERE 1

anyone knows where/how to edit that? smile

EDIT: ok.. sorry i got it smile

for those who are as stupid as me, just go there i went, paste

ALTER TABLE `<prefix>forums` ADD `reply_only` TINYINT AFTER `admmod_only`

and press go.. and do the same with the other big_smile

7

Re: Reply only forums

ok.. the mod works perfect.. i had a litte problems tho smile
first that first one with the sql, then this mod collided with the usergroup system, but i got it working anyway smile

Re: Reply only forums

awesome! big_smile

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

9 (edited by pgregg 2004-06-20 21:03)

Re: Reply only forums

Cool beans - thanks Paul for the pointer to this thread...

All in - not too difficult to install.

For the Postgres users out there, you'll need to use:

ALTER TABLE [forum-prefix]forums ADD reply_only SMALLINT;
update [forum-prefix]forums SET reply_only = 0;


Finally, cuteseal - couple of things:

In your viewforum diff, the logic gets a little hairy I prefer making it a little more explicit - You have:
79     if ($pun_config['p_guests_post_topic'] == '0' && $cookie['is_guest'] || $pun_config['p_users_post_topic'] == '0' && $cur_user['status'] < PUN_MOD || $reply_only == 1 && $cur_user['status'] < PUN_MOD)

It should be:
if ( ($pun_config['p_guests_post_topic'] == '0' && $cookie['is_guest']) || (($pun_config['p_users_post_topic'] == '0' || $reply_only == 1) && $cur_user['status'] < PUN_MOD))


Also in admin_forums (line 146) you need to add:
if ($cur_reply_only != '1') $cur_reply_only = '0';
or postgres will b0rk.

Now it works lovely smile

I only dread when punBB 1.2 is released - all this updating will make us not want to have to go through this again. sad

Cheers,

Paul.

Re: Reply only forums

Hey Paul,

Thanks for the comments and suggestions.  I'll try your stuff out tonight and will update the distribution files.

I visited your site by the way... looks really good!

Jules

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

11

Re: Reply only forums

For those who are getting confused. pgregg is also Paul in the real world.

12

Re: Reply only forums

smile cuteseal - also see my reply on your news/blog script
http://punbb.org/forums/viewtopic.php?id=3818&p=2
which will allow you to include the script without having the make a http call.

Re: Reply only forums

Hey Paul (pgregg) big_smile

Yeah I spotted that one.  Sounds interesting!  I'll look into it.

Jules

Digital photography news, reviews, discussions and more!
http://www.shuttertalk.com

The online bible for all
http://www.publicbible.com

14 (edited by Dr.Jeckyl 2004-07-19 16:49)

Re: Reply only forums

i'm having trouble with editing/modifying the sql tables.

here is what i put in, and here is what i get. what am i doing wrong? am i typing in the correct command the correct way? any help is appreciated.

pgregg wrote:

For the Postgres users out there, you'll need to use:

ALTER TABLE [forum-prefix]forums ADD reply_only SMALLINT;
update [forum-prefix]forums SET reply_only = 0;

i also tried this and get

Database punbbe107  running on localhost

Error

SQL-query :

ALTER TABLE [punbbe107]forums ADD reply_only SMALLINT

MySQL said:

You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '[punbbe107]forums ADD reply_only SMALLINT' at line 1

this.

~James
FluxBB - Less is more

15

Re: Reply only forums

Dr.Jeckyl wrote:

i'm having trouble with editing/modifying the sql tables.

Have you tried going into the forums table structure and add a field from that interface?

Re: Reply only forums

yes i just tried that and i get the same thing. am i typing in the correct command?

thank you for the quick response.

~James
FluxBB - Less is more

Re: Reply only forums

update:

this is what i put in just to test

ALTER TABLE `forums` ADD `reply_only` TINYINT AFTER `admmod_only` ;
UPDATE `forums` SET reply_only = 0 ;

and i get this

Your SQL-query has been executed successfully
SQL-query : [Edit] [Create PHP Code]
ALTER TABLE `forums` ADD `reply_only` TINYINT AFTER `admmod_only` ;

UPDATE `forums` SET reply_only = 0;
~James
FluxBB - Less is more

18

Re: Reply only forums

Dr.Jeckyl wrote:

am i typing in the correct command?

The correct command in your case is:

ALTER TABLE `forums` ADD `reply_only` TINYINT AFTER `admmod_only`

Re: Reply only forums

ok another problem... again i appreciate all the help.

i get this error

An error was encountered
File: /usr/local/psa/home/vhosts/forgamers-bygamers.com/httpdocs/e107forum/admin_forums.php
Line: 158

PunBB reported: Unable to fetch category/forum list
Database reported: Unknown column 'f.reply_only' in 'field list' (Errno: 1054)

when i click on "forums" in my admin panel.

this is line 158 of the admin_forums.php

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.closed, f.admmod_only, f.reply_only, f.disp_position FROM '.$db->prefix.'categories AS c LEFT JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());

does any of this make sense?

~James
FluxBB - Less is more

20

Re: Reply only forums

Dr.Jeckyl wrote:

ok another problem... again i appreciate all the help.

I'm not familiar with this mod, so I don't know what to advise you.

Re: Reply only forums

Any chance we can get a install_mod.php file for this modification?

Re: Reply only forums

I tried to install this mod and followed the directions. I can now see the 'reply only' tab within the forum admn area, but when I click the tab and hit submit I get direct back to that page just to find out that the 'reply only' tab  I just clicked isn't clicked anymore. Any ideas why this would happen?

Re: Reply only forums

you didn't run the sql commands?

Re: Reply only forums

I ran them, but I ran them before I made the edits to the php files. Also, I deleted them and readded them twice.

Re: Reply only forums

Any ideas? I really wanna get this mod installed since I would rather not have people post topics in my announcement board. Thanks!