Advertisement:

Author Topic: View Only Boards  (Read 231108 times)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: View Only Boards
« Reply #460 on: February 11, 2010, 02:36:52 AM »
The changes in the RC2 installer were not done properly.

Substitute the following into DB_2_x.php in the installer zip file.

Code: [Select]
<?php
/***********************************************************************
View Only Boards MOD - version 1.2
This file makes the necessary changes in the database.
***********************************************************************/
if (!defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');

vob_install();

// Used to avoid collision with variables in the global scope...
function vob_install()
{
global $smcFunc;

db_extend('packages');

$table_columns $smcFunc['db_list_columns']('{db_prefix}boards');

// The column exists so there's nothing to do here ...
if (in_array('member_groups_view'$table_columns))
return;

$vob_column = array(
'name' => 'member_groups_view',
'type' => 'varchar',
'size' => 255,
);

// Are we upgrading from smf 1.x?
if (in_array('memberGroupsView'$table_columns))
return $smcFunc['db_change_column']('{db_prefix}boards''memberGroupsView'$vob_column);

// Add the column the new column
return $smcFunc['db_add_column']('{db_prefix}boards'$vob_columnnull'skip_if_exists');
}
?>
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline scenerip2k

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • Scene-Network
    • Xtreme Gaming Network
Re: View Only Boards
« Reply #461 on: February 11, 2010, 02:58:33 AM »
wow, thank you so much Arantor!! It worked! Attached is the proper working version of the mod.
« Last Edit: February 11, 2010, 03:05:57 AM by scenerip2k »

Offline LondonDragon

  • Semi-Newbie
  • *
  • Posts: 64
Re: View Only Boards
« Reply #462 on: February 16, 2010, 03:42:58 PM »
Many thanks, just what I was looking for, worked a treat :)

Offline Zmey

  • Semi-Newbie
  • *
  • Posts: 13
Re: View Only Boards
« Reply #463 on: February 27, 2010, 05:20:34 PM »
I search this Mod for SMF2 RC2..... ! Nothing ? Sorry for my Bad English !
http://www.simplemachines.org/community/index.php?topic=146964.msg2424309#msg2424309   :)

Some of theme changes are missing in this patch compared to original one.
For example, BoardIndex.template.php is not modified.

Offline LondonDragon

  • Semi-Newbie
  • *
  • Posts: 64
Re: View Only Boards
« Reply #464 on: March 11, 2010, 03:04:04 PM »
RC3 update in the near future? Thanks

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: View Only Boards
« Reply #465 on: March 11, 2010, 03:05:46 PM »
It hasn't been updated to even RC1, putting it over a year old... I wouldn't hold your breath for an RC3 update.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline LondonDragon

  • Semi-Newbie
  • *
  • Posts: 64
Re: View Only Boards
« Reply #466 on: March 15, 2010, 09:53:43 AM »
It hasn't been updated to even RC1, putting it over a year old... I wouldn't hold your breath for an RC3 update.
There is an update to RC2 a few posts back which I was using, so there is hope ;)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: View Only Boards
« Reply #467 on: March 15, 2010, 09:54:33 AM »
Not an official one by the author, though...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: View Only Boards
« Reply #468 on: April 06, 2010, 10:03:48 AM »
Hi all,

I'm looking into updating and fixing the mod for SMF2.
Still don't hold your breath. It would take some weeks. :(

Regards,
Rudolf
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline MaNaRa

  • Full Member
  • ***
  • Posts: 462
Re: View Only Boards
« Reply #469 on: May 19, 2010, 09:32:58 PM »
Thanks a lot for this update!

running in RC3 ;D
mi versión de foro es SMF 2.0

Offline scenerip2k

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • Scene-Network
    • Xtreme Gaming Network
Re: View Only Boards
« Reply #470 on: June 28, 2010, 01:51:04 AM »
How to make it work in RC3 version:

1. Download the attached file
2. Install it you will get error message in ManageBoards.template.php
3. Edit your ManageBoards.template.php

Find:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<label for="groups_', $group['id'], '">
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" />
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
', $group['name'], '
</span>
</label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

Replace with:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' /> <input type="checkbox" name="groupsView[]" value="', $group['id'], '" id="groupsView_', $group['id'], '"', $group['view'] ? ' checked="checked"' : '', ' /> <label for="groups_', $group['id'], '"><span', $group['is_post_group'] ? ' style="border-bottom: 1px dotted;" title="' . $txt['mboards_groups_post_group'] . '"' : '', '>', $group['name'], '</span></label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

4. Enjoy!

Offline Calcricho

  • Semi-Newbie
  • *
  • Posts: 65
Re: View Only Boards
« Reply #471 on: June 30, 2010, 01:32:12 AM »
How to make it work in RC3 version:

1. Download the attached file
2. Install it you will get error message in ManageBoards.template.php
3. Edit your ManageBoards.template.php



Thanks

Cal   ;)

Offline jaisi

  • Full Member
  • ***
  • Posts: 518
Re: View Only Boards
« Reply #472 on: July 01, 2010, 06:25:33 AM »
How to make it work in RC3 version:

1. Download the attached file
2. Install it you will get error message in ManageBoards.template.php
3. Edit your ManageBoards.template.php

Find:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<label for="groups_', $group['id'], '">
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" />
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
', $group['name'], '
</span>
</label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

Replace with:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' /> <input type="checkbox" name="groupsView[]" value="', $group['id'], '" id="groupsView_', $group['id'], '"', $group['view'] ? ' checked="checked"' : '', ' /> <label for="groups_', $group['id'], '"><span', $group['is_post_group'] ? ' style="border-bottom: 1px dotted;" title="' . $txt['mboards_groups_post_group'] . '"' : '', '>', $group['name'], '</span></label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

4. Enjoy!

it's working or not please reply ....

Offline scenerip2k

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • Scene-Network
    • Xtreme Gaming Network
Re: View Only Boards
« Reply #473 on: July 02, 2010, 08:04:08 AM »
yeah its working if you follow the steps properly

« Last Edit: July 02, 2010, 08:10:11 AM by scenerip2k »

Offline jaisi

  • Full Member
  • ***
  • Posts: 518
Re: View Only Boards
« Reply #474 on: July 06, 2010, 09:03:39 AM »
How to make it work in RC3 version:

1. Download the attached file
2. Install it you will get error message in ManageBoards.template.php
3. Edit your ManageBoards.template.php

Find:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<label for="groups_', $group['id'], '">
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" />
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
', $group['name'], '
</span>
</label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

Replace with:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' /> <input type="checkbox" name="groupsView[]" value="', $group['id'], '" id="groupsView_', $group['id'], '"', $group['view'] ? ' checked="checked"' : '', ' /> <label for="groups_', $group['id'], '"><span', $group['is_post_group'] ? ' style="border-bottom: 1px dotted;" title="' . $txt['mboards_groups_post_group'] . '"' : '', '>', $group['name'], '</span></label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

4. Enjoy!
this code is not there in my Themes/default/BoardIndex.template.php please check once

Offline scenerip2k

  • Jr. Member
  • **
  • Posts: 106
  • Gender: Male
  • Scene-Network
    • Xtreme Gaming Network
Re: View Only Boards
« Reply #475 on: July 07, 2010, 03:35:40 PM »
How to make it work in RC3 version:

1. Download the attached file
2. Install it you will get error message in ManageBoards.template.php
3. Edit your ManageBoards.template.php

Find:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<label for="groups_', $group['id'], '">
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" />
<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
', $group['name'], '
</span>
</label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

Replace with:
Code: [Select]
// List all the membergroups so the user can choose who may access this board.
foreach ($context['groups'] as $group)
echo '
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' /> <input type="checkbox" name="groupsView[]" value="', $group['id'], '" id="groupsView_', $group['id'], '"', $group['view'] ? ' checked="checked"' : '', ' /> <label for="groups_', $group['id'], '"><span', $group['is_post_group'] ? ' style="border-bottom: 1px dotted;" title="' . $txt['mboards_groups_post_group'] . '"' : '', '>', $group['name'], '</span></label><br />';
echo '
<em>', $txt['check_all'], '</em> <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" /><br />
<br />
</dd>';

4. Enjoy!
this code is not there in my Themes/default/BoardIndex.template.php please check once

I edited the code for you.

Offline sharks

  • Sr. Member
  • ****
  • Posts: 891
  • Gender: Male
  • There's always a way.
Re: View Only Boards
« Reply #476 on: July 07, 2010, 07:10:47 PM »
Here is how i did it. I installed the mod from scenerip2k's attachment above and then i proceeded to install it even thought it gave me an error. I then edited the file after installation. Is that correct?
Also, it would be great if someone could add a "check all" box for the visibility as well. :)

Thanks everyone for the great work!
SMF 2.0 Theme Color Editor
http://www.colorizeit.com/browse/24/smf-20-themes.html

SMF Package Parser to view all edits made by any modification package:
http://resourcez.biz/PackageParser/

Firefox is the best browser for SMF!
http://www.mozilla.com/en-US/firefox/fx/

Offline Agent 0E

  • Semi-Newbie
  • *
  • Posts: 31
Re: View Only Boards
« Reply #477 on: July 28, 2010, 02:35:14 PM »
In Errors.english.php
Code: [Select]
$txt['topic_gone'] = 'The topic or board you are looking for appears to be either missing or off limits to you.';

I love this mod. I also modified the errors.php message pointed out above to what I want it to say. However, I would also like to add a link to this error message that would direct members to a page such as FAQ's or some such to explain more in detail how the mod works and which boards are accessible to which membergroups.

IS this possible? If so, how do I go about doing it?

Offline searchgr

  • Sophist Member
  • *****
  • Posts: 1,247
Re: View Only Boards
« Reply #478 on: July 28, 2010, 02:44:21 PM »
Good idea!

Offline Agent 0E

  • Semi-Newbie
  • *
  • Posts: 31
Re: View Only Boards
« Reply #479 on: July 30, 2010, 10:11:12 AM »
Does anyone know how to add a link?