Stretchr
01-17-2002, 10:00 PM
This is a simple hack designed to address what may be merely an oversight in the Forumpermission Table. When you're editing a forum, the name of that forum appears in the table head, but when you're editing the permissions, it doesn't. When you're modifying a long string of forum permissions, it's easy to forget which one you're currently doing. This hack addresses that issue and only requires 3 lines of code to the admin/forumpermission.php file. I couldn't have completed this hack without the help of MrLister, who showed me the variable I'd been fruitlessly searching for.
Here's my first hack:
In admin/forumpermission.php, find:
if (isset($forumpermissionid)) {
$forumpermission=$DB_site->query_first("SELECT * FROM forumpermission WHERE forumpermissionid=$forumpermissionid");
makehiddencode("forumpermissionid","$forumpermissionid");
Replace with:
if (isset($forumpermissionid)) {
$forumpermission=$DB_site->query_first("SELECT * FROM forumpermission WHERE forumpermissionid=$forumpermissionid");
makehiddencode("forumpermissionid","$forumpermissionid");
$foruminfo=$DB_site->query_first("SELECT title FROM forum WHERE forumid='$forumpermission[forumid]'");
Note the line that is not indented must stay that way!
Next Find:
} else {
$forumpermission = getpermissions($forumid, 1, intval($usergroupid));
makehiddencode("forumid",$forumid);
Replace with:
} else {
$forumpermission = getpermissions($forumid, 1, intval($usergroupid));
makehiddencode("forumid",$forumid);
$foruminfo=$DB_site->query_first("SELECT title FROM forum WHERE forumid='$forumid'");
Still in admin/forumpermission.php,
Find:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"1\" ".iif (!isset($forumpermissionid),"checked","")."><span class='tblhead'>Use usergroup default</b> (Note: this will delete any previous custom settings)</span></td></tr>\n";
and Replace with:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"1\" ".iif (!isset($forumpermissionid),"checked","")."><span class='tblhead'>Use usergroup default</b> (Note: this will delete any previous custom settings)<br>Forum: <b>$foruminfo[title]</b></span></td></tr>\n";
Finally, still in admin/forumpermission.php
Find:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"0\" ".iif(isset($forumpermissionid),"checked","")."><span class='tblhead'>Use custom settings:</span></b></td></tr>\n";
Replace with:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"0\" ".iif(isset($forumpermissionid),"checked","")."><span class='tblhead'>Use custom settings:</b><br>Group: <b><i>$forumpermission[title]<i></b></span></td></tr>\n";
Save and upload the file to your admin directory and that's it! Enjoy the hack.
If you have any problems with this hack, please do not email or PM me. Post them to this board so that others can benefit from our experiences.
Here's my first hack:
In admin/forumpermission.php, find:
if (isset($forumpermissionid)) {
$forumpermission=$DB_site->query_first("SELECT * FROM forumpermission WHERE forumpermissionid=$forumpermissionid");
makehiddencode("forumpermissionid","$forumpermissionid");
Replace with:
if (isset($forumpermissionid)) {
$forumpermission=$DB_site->query_first("SELECT * FROM forumpermission WHERE forumpermissionid=$forumpermissionid");
makehiddencode("forumpermissionid","$forumpermissionid");
$foruminfo=$DB_site->query_first("SELECT title FROM forum WHERE forumid='$forumpermission[forumid]'");
Note the line that is not indented must stay that way!
Next Find:
} else {
$forumpermission = getpermissions($forumid, 1, intval($usergroupid));
makehiddencode("forumid",$forumid);
Replace with:
} else {
$forumpermission = getpermissions($forumid, 1, intval($usergroupid));
makehiddencode("forumid",$forumid);
$foruminfo=$DB_site->query_first("SELECT title FROM forum WHERE forumid='$forumid'");
Still in admin/forumpermission.php,
Find:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"1\" ".iif (!isset($forumpermissionid),"checked","")."><span class='tblhead'>Use usergroup default</b> (Note: this will delete any previous custom settings)</span></td></tr>\n";
and Replace with:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"1\" ".iif (!isset($forumpermissionid),"checked","")."><span class='tblhead'>Use usergroup default</b> (Note: this will delete any previous custom settings)<br>Forum: <b>$foruminfo[title]</b></span></td></tr>\n";
Finally, still in admin/forumpermission.php
Find:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"0\" ".iif(isset($forumpermissionid),"checked","")."><span class='tblhead'>Use custom settings:</span></b></td></tr>\n";
Replace with:
echo "<tr class='tblhead'><td colspan=2><b><input type=\"radio\" name=\"useusergroup\" value=\"0\" ".iif(isset($forumpermissionid),"checked","")."><span class='tblhead'>Use custom settings:</b><br>Group: <b><i>$forumpermission[title]<i></b></span></td></tr>\n";
Save and upload the file to your admin directory and that's it! Enjoy the hack.
If you have any problems with this hack, please do not email or PM me. Post them to this board so that others can benefit from our experiences.