[beta] Forum Permissions Control

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Sleipnir64
Registered User
Posts: 26
Joined: Thu Apr 11, 2002 6:24 am
Contact:

[beta] Forum Permissions Control

Post by Sleipnir64 »

I want to get your opinions/suggestions/complaints on this mod before (if) i submit it to the database. I wrote it for my own forum and it does what i want it too, so i probably won't do much else to it. If there is a suggestion i like, i may add it though.
Everything you need to know is in the howto below.

Code: Select all

############################################################## 
## MOD Title: Forum Permission Control from Forum Administration
## MOD Version: 0.9.0 
## Author: Sleipnir64 < paul@chote.net > - http://paul.chote.net/phpBB/
##
## Description: Replaces the link in the admin panel sidebar to the forum permissions with  
## links to each individual forum in Forum Administration
##
## Installation Level: easy 
## Installation Time: 2 Minutes
##
## Files To Edit: 2
##	admin/admin_forums.php, 
## 	templates/subSilver/admin/forum_admin_body.tpl 
##
## Included Files: n/a
############################################################## 
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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/downloads/ 
############################################################## 
## Authors Notes: 
## I don't know about you, but i found it annoying to have to go through the Forum Permissions
## panel with the drop down box to modify the forum permissions (especially if you have a lot 
## of forums), so i made this simple mod to directly link to each forum's permissions instead.
## Btw, this is my first mod, so don't blame me if it sucks.
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

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

# 
#-----[ FIND ]------------------------------------------ 
# 
'L_RESYNC' => $lang['Resync'])

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
'L_PERMS' => $lang['Permissions'],

# 
#-----[ FIND ]------------------------------------------ 
# 
'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id"))

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# Note: change adv=0 to adv=1 to access the forum permissions in advanced mode
# 
'U_EDIT_PERMS' => append_sid("admin_forumauth.$phpEx?adv=0&" . POST_FORUM_URL . "=$forum_id"),

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

# 
#-----[ FIND & DELETE ]------------------------------------------ 
# Note: Skip this step if you wish to leave the link in the 
#       admin sidebar to the Forum Permission Controls
#
	$filename = basename(__FILE__);
	$module['Forums']['Permissions']   = $filename;

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/admin/forum_admin_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
<th class="thHead" colspan="7">{L_FORUM_TITLE}</th>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
<th class="thHead" colspan="8">{L_FORUM_TITLE}</th>

# 
#-----[ FIND ]------------------------------------------ 
# 
<td class="catLeft" colspan="3"><span class="cattitle"><b><a href="{catrow.U_VIEWCAT}">{catrow.CAT_DESC}</a></b></span></td>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
<td class="catLeft" colspan="4"><span class="cattitle"><b><a href="{catrow.U_VIEWCAT}">{catrow.CAT_DESC}</a></b></span></td>

# 
#-----[ FIND ]------------------------------------------ 
# 
<td class="row2" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_RESYNC}">{L_RESYNC}</a></span></td>

# 
#-----[ IN-LINE, FIND ]------------------------------------------ 
# 
</td>

# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
#

<td class="row1" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_EDIT_PERMS}">{L_PERMS}</a></span>

# 
#-----[ FIND ]------------------------------------------ 
# 
<td colspan="7" class="row2"><input type="text" name="{catrow.S_ADD_FORUM_NAME}" /> <input type="submit" class="liteoption"  name="{catrow.S_ADD_FORUM_SUBMIT}" value="{L_CREATE_FORUM}" /></td>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
<td colspan="8" class="row2"><input type="text" name="{catrow.S_ADD_FORUM_NAME}" /> <input type="submit" class="liteoption"  name="{catrow.S_ADD_FORUM_SUBMIT}" value="{L_CREATE_FORUM}" /></td>

# 
#-----[ FIND ]------------------------------------------ 
# 
<td colspan="7" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
<td colspan="8" height="1" class="spaceRow"><img src="../templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>

# 
#-----[ FIND ]------------------------------------------ 
# 
<td colspan="7" class="catBottom"><input type="text" name="categoryname" /> <input type="submit" class="liteoption"  name="addcategory" value="{L_CREATE_CATEGORY}" /></td>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
<td colspan="8" class="catBottom"><input type="text" name="categoryname" /> <input type="submit" class="liteoption"  name="addcategory" value="{L_CREATE_CATEGORY}" /></td>

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

water
Registered User
Posts: 170
Joined: Sun Oct 21, 2001 11:15 am

Post by water »

love it, i've wanted to do something like this for a long time never found the time too actually do it :wink:

i added

Code: Select all

width="40%"

to the td tag in this line (# 20 i think) :

Code: Select all

		<td class="row2" width="40%"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
to avoid the links from getting all cramped together and making the page way longer. the percentage might need to vary depending on the language being used, i found 40% to work best with norwegian & 1024x768

:water
Image

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

WOW! Talk about timing, i've just done this today and thought i'd search before posting!!

my version is almost identical until it comes to changing the template file...

instead of changing all the colspans, i've just added the link to the permissions below the link to rsync, e.g.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/admin/forum_admin_body.tpl 

# 
#-----[ FIND ]------------------------------------------ 
# 
<td class="row2" align="center" valign="middle"><span class="gen"><a href="{catrow.forumrow.U_FORUM_RESYNC}">{L_RESYNC}</a></span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 
</span>

# 
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------ 
# 
<br /><a href="{catrow.forumrow.U_FORUM_PERMS}">{L_PERMS}</a>
et voila!

i generally find it's best to keep the hacking to a minimum and not a good idea to use replace with if you can avoid. keep it simple :wink:

[Edit]i used U_FORUM_PERMS where you used U_EDIT_PERMS[/Edit]
Defend the game:
Image

Sleipnir64
Registered User
Posts: 26
Joined: Thu Apr 11, 2002 6:24 am
Contact:

Post by Sleipnir64 »

Good idea! i should have thought of that myself :oops:
You mind if i used that idea for my version?

Post Reply

Return to “[2.0.x] MODs in Development”