Log in

View Full Version : phpbb 2.x How do you make a sub forum private?



SHFM!
01-12-2007, 05:05 PM
I own a site called omgimstuck.net

On the forum i am adding an bullying support forum.

But i want to make it private, by this i mean that only the poster and the bullying-support team can see it.

Any one know how or any ideas?

the forum is http://forum.omgimstuck.net

Jamesy
01-12-2007, 06:32 PM
http://www.phpbb.com/community/viewtopic.php?f=17&t=604634

Hope this helps.


################################################## ############
## MOD Title: Self auth
## MOD Author: Niels < [email protected] > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: This mod makes it posible to define forum
## permission as "SELF", basically this enable
## admin to make forum where only the original
## poster can read or reply.
## MOD Version: 0.9.3
## MOD Compatibility: 2.0.6
##
## Installation Level: Intermediate
## Installation Time: 10 Minutes
## Files To Edit: 8
## posting.php
## viewforum.php
## viewtopic.php
## admin/admin_forumauth.php
## includes/auth.php.php
## includes/constants.php
## language/lang_english/lang_admin.php
## language/lang_english/lang_main.php
##
## Included Files: 0
##
################################################## ############
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
################################################## ############
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod, makes it posible to define forum permission as
## "SELF", basically this enable admin to make forum, where
## only the original poster can read or reply.
## Moderators or admin can still read, post, reply ect. any
## topic even if permission is set to SELF.
## Only the permission READ, REPLY and QUOTE are currently
## affected, original phpbb DELETE, EDIT ect. works default
## as SELF, when set to REG.
## If other mods are installed, they may need to be adjusted,
## the SELF permission will in these mods default to MOD,
## if not adjusted.
## Announcements are not affected by SELF auth, this makes
## it posible to post a message by admin, witch all users may
## see even though it does not belong to them.
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 2.1 Translation are not managed
## -----------
## EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=3034
##
## 4. Warning
## -----------
## This mod, will MAYBE not be compatible with some other mods,
## since it changes the permission control!
##
################################################## ############
## MOD History:
##
## 2003-12-21 - Version 0.9.3
## - phpBB template & EasyMOD compliance enhancement
## - French & Italian translations now provide with the MOD
##
## ????-??-?? - Version 0.9.2
## - corrected that SELF users could not see a announcement post
##
## ????-??-?? - Version 0.9.1
## - missed to include some code changes into viewtopic.php
## now included :D
##
## ????-??-?? - Version 0.9.0
## - initial BETA
##
################################################## ############
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
################################################## ############
#
#-----[ OPEN ]------------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------------
#
redirect(append_sid("login
}

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Self auth MOD
else if (intval($is_auth[$is_auth_type]) == AUTH_SELF)
{
//self auth mod
switch( $mode )
{
case 'quote':
case 'reply':
$sql = "SELECT t.topic_id FROM ". TOPICS_TABLE ." t, ". USERS_TABLE." u
WHERE t.topic_id=$topic_id
AND t.topic_poster=u.user_id
AND u.user_id=".$userdata['user_id'];
break;
}
if ( !($result = $db->sql_query($sql) ))
{
message_die(GENERAL_ERROR, 'Could not obtain self auth data for this topic', '', __LINE__, __FILE__, $sql);
}
$self_auth = $db->sql_fetchrow($result);
if ( empty($self_auth) )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
}
// End add - Self auth MOD

#
#-----[ OPEN ]------------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------------
#
// Grab all the basic data (all topics except announcements)
// for this forum
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Self auth MOD
$self_sql = ( intval($is_auth['auth_read']) == AUTH_SELF ) ? " AND t.topic_poster=".$userdata['user_id'] : "";
// End add - Self auth MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT t.*
FROM
WHERE t.forum_id = $forum_id

#
#-----[ IN-LINE FIND ]----------------------------------------
#
WHERE t.forum_id = $forum_id

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
$self_sql

#
#-----[ FIND ]------------------------------------------------
#
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ?

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$lang['Rules_reply_can']

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
(( intval($is_auth['auth_reply']) == AUTH_SELF) ? $lang['Rules_reply_can_own'] : $lang['Rules_reply_can'])

#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------------
#
// Go ahead and pull all data for this topic
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Self auth MOD
$self_sql_tables = (intval($is_auth['auth_read']) == AUTH_SELF) ? " , ".TOPICS_TABLE." t, ".USERS_TABLE." u2" : "";
$self_sql = (intval($is_auth['auth_read']) == AUTH_SELF) ? " AND p.topic_id=t.topic_id AND t.topic_poster=u2.user_id AND ( u2.user_id=".$userdata['user_id']." OR t.topic_type = " . POST_ANNOUNCE .")" : "";
// End add - Self auth MOD

#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT u.username
FROM " . POSTS_TABLE . " p

#
#-----[ IN-LINE FIND ]----------------------------------------
#
POSTS_TEXT_TABLE . " pt

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
$self_sql_tables

#
#-----[ FIND ]------------------------------------------------
#
WHERE p.topic_id = $topic_id

#
#-----[ IN-LINE FIND ]----------------------------------------
#
WHERE p.topic_id = $topic_id

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
$self_sql

#
#-----[ FIND ]------------------------------------------------
#
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ?

#
#-----[ IN-LINE FIND ]----------------------------------------
#
$lang['Rules_reply_can']

#
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
(( intval($is_auth['auth_reply']) == AUTH_SELF) ? $lang['Rules_reply_can_own'] : $lang['Rules_reply_can'])

#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_forumauth.php

#
#-----[ FIND ]------------------------------------------------
#
$forum_auth_levels = array('ALL'

#
#-----[ IN-LINE FIND ]----------------------------------------
#
'PRIVATE',

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
'SELF',

#
#-----[ FIND ]------------------------------------------------
#
$forum_auth_const = array(AUTH_ALL

#
#-----[ IN-LINE FIND ]----------------------------------------
#
AUTH_ACL,

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
AUTH_SELF,

#
#-----[ OPEN ]------------------------------------------------
#
includes/auth.php

#
#-----[ FIND ]------------------------------------------------
#
$auth_user[$key . '_type'] = $lang['Auth_Users_granted_access'];
break;

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Self auth MOD
case AUTH_SELF:
$auth_user[$key] = ( $userdata['session_logged_in'] ) ? ((auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin)) ? TRUE : AUTH_SELF ) : 0;
$auth_user[$key . '_type'] = $lang['Auth_Self_Users'];
break;
// End add - Self auth MOD

#
#-----[ FIND ]------------------------------------------------
#
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Users_granted_access'];
break;

#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Self auth MOD
case AUTH_SELF:
$auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? ((auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin)) ? TRUE : AUTH_SELF) : 0;
$auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Self_Users'];
break;
// End add - Self auth MOD

#
#-----[ OPEN ]------------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Self auth MOD
define('AUTH_SELF', 9);
// End add - Self auth MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Self auth MOD
$lang['Self'] = 'Self';
$lang['Forum_SELF'] = 'SELF';
// End add - Self auth MOD

#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Self auth MOD
$lang['Auth_Self_Users'] = '<b>specific users</b>';
$lang['Rules_reply_can_own'] = 'You <b>can</b> reply to your topics in this forum';
// End add - Self auth MOD

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

Flisker
11-12-2007, 07:47 PM
Just some advise... phpBB has lost its glory, people are now using MyBB (www.mybboard.net) or vBulletin (www.vBulletin.com) NOTE: vBulletin is NOT free but MyBB is :)

Jamesy
11-12-2007, 07:55 PM
Just some advise... phpBB has lost its glory, people are now using MyBB (www.mybboard.net (http://www.mybboard.net)) or vBulletin (www.vBulletin.com (http://www.vBulletin.com)) NOTE: vBulletin is NOT free but MyBB is :)

Agreed, phpbb3 runs soo slowly and seems very clinky, MyBB is awesome.

Want to hide these adverts? Register an account for free!