News:

Wondering if this will always be free?  See why free is better.

Main Menu

BBC Permissions Mod

Started by winrules, September 01, 2006, 12:08:38 PM

Previous topic - Next topic

Biology Forums

Quote from: 017 on September 15, 2011, 08:47:01 PM
Would anyone be willing to convert this to SMF 2.0? I (and a lot of other people I bet) could really use this. (Honestly, this should be a standard feature on SMF...)

Downgrade to 1.x :P ha ha Just kidding

017

Haha, but yeah. It'd be good to have. Hell, I think I'm willing to pay for it, if that helps any.

Iomega0318

Anyone ever take a stab at a 2.0 version of this?

I might try but I am not very familiar with the smf database queries.. modding the files are one thing but the database coding would be something new for me.. anyways I have read through all the posts and it seems the database parts are all that need fixing so I will try my luck..
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Iomega0318

#83
So I found out it's not just the database info that has changed but the templates as well, the following is supposed to be changed in /Themes/default/ManagePermissions.template.php.. if anyone can help me "convert" this lol I can continue, so far I have made the database edits and a few other errors were fixed but I can not test it without this section of code..

Quote from: (Find)echo '
</tr><tr class="windowbg2">
<td colspan="2" align="right"><input type="submit" value="', $txt['permissions_commit'], '" />&nbsp;</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';

Quote from: (Replace)// Show checkboxes for every BBC tag.
if (!$context['local'])
{
echo '
</tr>
<tr class="catbg">
<td colspan="2" align="center">
BBC Permissions - <span style="color: red;">', $context['group']['name'], '</span>
</td>
</tr>
<tr class="windowbg2">
<td colspan="2" align="left">
<fieldset id="allowedBBCTags">
<legend>' . $txt['permissions_bbc_select'] . '</legend>
<table width="100%"><tr>';
foreach ($context['bbc_tags'] as $column)
{
echo '
<td valign="top">';
foreach ($column as $tag)
echo '
<input type="checkbox" name="bbc_allowed[]" id="tag_' . $tag['tag'] . '" value="' . $tag['tag'] . '"' , $tag['disallowed'] ? '' : ' checked="checked"' , ' class="check" /><label for="tag_' . $tag['tag'] . '">' . $tag['tag'] . '</label><br />';
echo '
</td>';
}
echo '
</tr></table><br />
<input type="checkbox" id="select_all" onclick="invertAll(this, this.form, \'bbc_allowed\');"', $context['bbc_all_allowed'] ? ' checked="checked"' : '', ' class="check" /><label for="select_all"><i>' . $txt['permissions_bbc_all'] . '</i></label>
</fieldset>
</td>
</tr>';
}

echo '
</tr><tr class="windowbg2">
<td colspan="2" align="right"><input type="submit" value="', $txt['permissions_commit'], '" />&nbsp;</td>
</tr>
</table>
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>';

The section I believe it is looking for is this:
echo '
<div class="righttext padding">
<input type="submit" value="', $txt['permissions_commit'], '" class="button_submit" />
</div>';

echo '
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
</form>
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

nikan

#84
Updated for SMF 1.1.16 and 2.0.2
I'll appreciate any feedback.

Fixed the log errors created when bbc tags are deselected (Thanks Iomega0318)

Apllicmz

when Update dont forget portuguese

<file name="$languagedir/ManagePermissions.portuguese_pt.php" error="skip">
   
        <operation>
            <search position="replace"><![CDATA[
$txt['permissions_with_selection'] = 'Com a sele&ccedil;&atilde;o';
]]></search>
            <add><![CDATA[
$txt['permissions_bbc_select'] = 'Selecione as tags BBC que este grupo pode usar';
$txt['permissions_bbc_all'] = 'Permitir que todas as tags';

$txt['permissions_with_selection'] = 'com a sele&ccedil;&atilde;o';
]]></add>
        </operation>
       
    </file>
   
    <file name="$languagedir/ManagePermissions.portuguese_pt-utf8.php" error="skip">
   
        <operation>
            <search position="replace"><![CDATA[
$txt['permissions_with_selection'] = 'Com a sele&ccedil;&atilde;o';
]]></search>
            <add><![CDATA[
$txt['permissions_bbc_select'] = 'Selecione as tags BBC que este grupo pode usar';
$txt['permissions_bbc_all'] = 'Permitir que todas as tags';

$txt['permissions_with_selection'] = 'com a sele&ccedil;&atilde;o';
]]></add>
        </operation>
       
    </file>
   
    <file name="$languagedir/ManagePermissions.portuguese_brazilian.php" error="skip">
   
        <operation>
            <search position="replace"><![CDATA[
$txt['permissions_with_selection'] = 'Com a sele&ccedil;&atilde;o';
]]></search>
            <add><![CDATA[
$txt['permissions_bbc_select'] = 'Selecione as tags BBC que este grupo pode usar';
$txt['permissions_bbc_all'] = 'Permitir que todas as tags';

$txt['permissions_with_selection'] = 'com a sele&ccedil;&atilde;o';
]]></add>
        </operation>
       
    </file>
   
    <file name="$languagedir/ManagePermissions.portuguese_brazilian-utf8.php" error="skip">
   
        <operation>
            <search position="replace"><![CDATA[
$txt['permissions_with_selection'] = 'Com a sele&ccedil;&atilde;o';
]]></search>
            <add><![CDATA[
$txt['permissions_bbc_select'] = 'Selecione as tags BBC que este grupo pode usar';
$txt['permissions_bbc_all'] = 'Permitir que todas as tags';

$txt['permissions_with_selection'] = 'com a sele&ccedil;&atilde;o';
]]></add>
        </operation>
       
    </file>




Iomega0318

Quote from: nikan on December 02, 2011, 04:42:34 AM
Updated for SMF 1.1.15 and 2.0.1
I'll appreciate any feedback.
Been a while since I was last able to get on and look at things, but just downloaded this and seems to work great! I haven't done to much testing but it installed good, shows up fine and seems to work ok. I think you should put this one up in the mods where more people can find it. Great job btw!
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Iomega0318

Spoke to soon.. just now created a new group and was modifying permissions, etc. this was the first time I actually unchecked some permissions to "disallow" them..

Here's the errors in my log:
http://www.uofreeshards.net/index.php?action=admin;area=permissions;sa=modify;group=17
8: Undefined variable: disallowed
File: /***/Sources/ManagePermissions.php
Line: 913

http://www.uofreeshards.net/index.php?action=admin;area=permissions;sa=modify;group=17
2: in_array() expects parameter 2 to be array, null given
File: /***/Sources/ManagePermissions.php
Line: 913

http://www.uofreeshards.net/index.php?action=admin;area=permissions;sa=modify2;group=17;pid=0
2: Missing argument 5 for smf_db_insert(), called in /uof/Sources/ManagePermissions.php on line 1083 and defined
File: /***/Sources/Subs-Db-mysql.php
Line: 589


**EDIT**
Looking at my table however it does show that it input the group ID and the disallowed bbcode, so no idea why it threw those errors.. it threw about 100 errors btw, they were just all duplicates of those..
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

nikan

Fixed the log errors. The ~100 errors were the tags.

Iomega0318

#89
Quote from: nikan on April 25, 2012, 03:20:56 AM
Fixed the log errors. The ~100 errors were the tags.
haha ok lol, will install the new mod and test it out, thank you.

**EDIT**
Just tested new mod, no errors.
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Chalky

Has anyone else noticed this mod no longers appears to work since updating to 2.0.14?

Arnox

Quote from: Chalky on June 17, 2017, 06:39:24 AM
Has anyone else noticed this mod no longers appears to work since updating to 2.0.14?

It actually caused me to not be able to make posts (or even install packages weirdly enough) due to PHP errors. It looks like this mod is dead for anything 2.0.14 and beyond. :(

Arnox

#92
Bump. I fixed it.


-edit- attachment removed as the existing license does not allow redistribution of altered files (Kindred)

Advertisement: