1

Topic: Make forum postable, yet not readable

How do I make it so users can post in a forum but not read the forum? The standard settings wont let me. Thanks

2

Re: Make forum postable, yet not readable

This guy explains it pretty well. http://www.punres.org/viewtopic.php?id=3725

Re: Make forum postable, yet not readable

You want people to be able to post new topics but not reply? That's 100% possible with the standard settings. However, it might be a little different than you expect because of what not reading the forum means.
Not reading the forum means the user doesn't know that the forum exists. Thus, there's no link to viewforum for that forum and there can be no new topic link there. However, the link to post a new topic will still work assuming the group has permission to post a topic.

4

Re: Make forum postable, yet not readable

It doesn't work unfortunately. I set the forum's permissions to post topic only. Then I have a user go to the post topic for that section and I get "Bad request. The link you followed is incorrect or outdated."

Re: Make forum postable, yet not readable

Yup, I was wrong tongue

In post.php

// Fetch some info about the topic and/or the forum
if ($tid)
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

becomes

// Fetch some info about the topic and/or the forum
if ($tid)
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics, t.subject, t.closed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE t.id='.$tid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE  f.id='.$fid) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());

Basically, I removed the part of the where statement that filtered out forums the user can't read. So, that query should always return a row assuming the tid/fid is valid. However, posting then relies on the post replies/post topics permission.

6

Re: Make forum postable, yet not readable

I'll test it out right now, thanks.

7

Re: Make forum postable, yet not readable

Now when you try to post it says, "Bad request. The link you followed is incorrect or outdated."

8

Re: Make forum postable, yet not readable

Nevermind, it works fine, it just shows that message. How would I change it to something like, "Thank you for you for contributing".

Re: Make forum postable, yet not readable

Mmm, I would add fp.read_forum to the list of columns gotten from those queries and then
FIND

redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);

REPLACE WITH

if ($cur_posting['read_forum'] == '0')
    message('Thank you for contributing');
else
    redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']);

10

Re: Make forum postable, yet not readable

We have a success. Thank you so much for going above and beyond the call of duty. Better support than when I've paid for scripts.