./Sources/Load.php
Find: [Select]
b.member_groups,
Add After: [Select]
b.member_groups_view,
Find: [Select]
$board_info['groups'] = $row['member_groups'] == '' ? array() : explode(',', $row['member_groups']);
Add After: [Select]
$board_info['groups_view'] = $row['member_groups_view'] == '' ? array() : explode(',', $row['member_groups_view']);//-View Only Boards MOD-
Find: [Select]
if (count(array_intersect($user_info['groups'], $board_info['groups'])) == 0 && !$user_info['is_admin'])
$board_info['error'] = 'access';
Replace With: [Select]
//-View Only Boards MOD- Start
if (count(array_intersect($user_info['groups'], $board_info['groups'])) == 0 && !$user_info['is_admin'])
if (!empty($topic) || isset($_REQUEST['action']))
$board_info['error'] = 'access';
elseif (count(array_intersect($user_info['groups'], $board_info['groups_view'])) == 0 || empty($modSettings['vob_allowMessageIndexView']))
$board_info['error'] = 'access';
//-View Only Boards MOD- End
Find: [Select]
// Load the mod cache so we can know what additional boards they should see, but no sense in doing it for guests
Add Before: [Select]
//-View Only Boards MOD- Start
$user_info['view_only_boards'] = array();
$result = $smcFunc['db_query']('', '
SELECT b.id_board
FROM {db_prefix}boards as b
WHERE (FIND_IN_SET(' . implode(', b.member_groups_view) OR FIND_IN_SET(', $user_info['groups']) . ', b.member_groups_view)) AND NOT ' . $user_info['query_see_board']
);
while ($row = $smcFunc['db_fetch_row']($result))
$user_info['view_only_boards'][] = $row[0];
$query_see_board = $user_info['query_see_board'];
if ($user_info['query_see_board'] != '1=1' && (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('recent','profile','.xml','search','search2'))))
if (!$user_info['is_guest'])
$user_info['query_see_board'] = substr($query_see_board,0,-1) . ' OR FIND_IN_SET(\'' . implode('\', b.member_groups_view) OR FIND_IN_SET(\'', $user_info['groups']) . '\', b.member_groups_view))';
else
$user_info['query_see_board'] = '(' . $query_see_board . ' OR FIND_IN_SET(-1, b.member_groups_view))';
//-View Only Boards MOD- End
./Sources/Subs-Recent.php
Find: [Select]
'id' => $row['id_board'],
Add After: [Select]
'protected' => !empty($user_info['view_only_boards']) && in_array($row['id_board'], $user_info['view_only_boards']), //- View Only Boards MOD-
./Sources/Recent.php
Find: [Select]
// Censor everything.
censorText($row['body']);
censorText($row['subject']);
Add Before: [Select]
//- View Only Boards MOD- START
// Do not show protected topics
if (empty($modSettings['vob_allowMessageIndexView']) && !empty($user_info['view_only_boards']) && in_array($row['id_board'], $user_info['view_only_boards']))
continue;
//- View Only Boards MOD- END
Find: [Select]
if ($row['id_poll'] > 0 && $modSettings['pollMode'] == '0')
continue;
Add Before: [Select]
//- View Only Boards MOD- START
// Do not show protected topics
if (empty($modSettings['vob_allowMessageIndexView']) && !empty($user_info['view_only_boards']) && in_array($row['id_board'], $user_info['view_only_boards']))
continue;
//- View Only Boards MOD- END
Find: [Select]
'views' => comma_format($row['num_views']),
'board' => array(
'id' => $row['id_board'],
Add After: [Select]
'protected' => !empty($user_info['view_only_boards']) && in_array($row['id_board'], $user_info['view_only_boards']), //- View Only Boards MOD-
./Sources/ManageSettings.php
Find: [Select]
array('check', 'allow_guestAccess'),
Add After: [Select]
array('check', 'vob_allowMessageIndexView'), //-View Only Boards MOD-
./Themes/default/BoardIndex.template.php
Find: [Select]
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', $board['last_post']['member']['link'] , '
', $txt['in'], ' ', $board['last_post']['link'], '
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Replace With: [Select]
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', ($board['last_post']['protected'] ? '<span class="vob_protected">' . (empty($modSettings['vob_allowMessageIndexView']) ? $txt['vob_protected'] : $board['last_post']['member']['link']) . '</span>' : $board['last_post']['member']['link']) , '
', $txt['in'], ' ', ($board['last_post']['protected'] ? '<span class="vob_protected">' . (empty($modSettings['vob_allowMessageIndexView']) ? $txt['vob_protected'] : $board['last_post']['link']) . '</span>' : $board['last_post']['link']), '
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Find: [Select]
foreach ($category['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2">
Replace With: [Select]
foreach ($category['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2' , ($board['protected'] ? ' vob_protected"' : '') , '">
Find: [Select]
$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
Replace With: [Select]
$children[] = $child['protected'] ? '<span class="vob_protected">' . $child['link'] . '</span>' : ($child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']);
Find: [Select]
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '[/url]</strong>
<p id="infocenter_onepost" class="middletext">
Replace With: [Select]
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '[/url]</strong>
<p id="infocenter_onepost" class="middletext', ($context['latest_post']['protected'] ? ' vob_protected' : '') ,'">
Find: [Select]
foreach ($context['latest_posts'] as $post)
echo '
<dt>
Replace With: [Select]
foreach ($context['latest_posts'] as $post)
echo '
<dt ' , ($post['board']['protected'] ? 'class="vob_protected"' : '') , '>
./Themes/default/MessageIndex.template.php
Find: [Select]
foreach ($context['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2">
Replace With: [Select]
foreach ($context['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2' , ($board['protected'] ? ' vob_protected"' : '') , '">
Find: [Select]
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', $board['last_post']['member']['link'], '
', $txt['in'], ' ', $board['last_post']['link'], '
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Replace With: [Select]
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong> ', $txt['by'], ' ', ($board['last_post']['protected'] ? '<span class="vob_protected">' . (empty($modSettings['vob_allowMessageIndexView']) ? $txt['vob_protected'] : $board['last_post']['member']['link']) . '</span>' : $board['last_post']['member']['link']), '
', $txt['in'], ' ', ($board['last_post']['protected'] ? '<span class="vob_protected">' . (empty($modSettings['vob_allowMessageIndexView']) ? $txt['vob_protected'] : $board['last_post']['link']) . '</span>' : $board['last_post']['link']), '
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
Find: [Select]
$children[] = $child['new'] ? '' . $child['link'] . '</strong>' : $child['link'];
Replace With: [Select]
$children[] = $child['protected'] ? '<span class="vob_protected">' . $child['link'] . '</span>' : ($child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']);
This operation isn't vital to the installation of this mod.
Find: [Select]
$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
Replace With: [Select]
$children[] = $child['protected'] ? '<span class="vob_protected">' . $child['link'] . '</span>' : ($child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link']);
This operation isn't vital to the installation of this mod.
./Themes/default/Recent.template.php
Find: [Select]
$color_class2 = !empty($color_class) ? $color_class . '2' : '';
echo '
<tr>
Replace With: [Select]
$color_class2 = !empty($color_class) ? $color_class . '2' : '';
echo '
<tr ', ($topic['board']['protected'] ? 'class="vob_protected"' : '') ,'>
Find: [Select]
$color_class2 = !empty($color_class) ? $color_class . '2' : '';
echo '
<tr>
Replace With: [Select]
$color_class2 = !empty($color_class) ? $color_class . '2' : '';
echo '
<tr ', ($topic['board']['protected'] ? 'class="vob_protected"' : '') ,'>
./Themes/default/ManageBoards.template.php
Find: [Select]
<input type="checkbox" name="groups[]" value="', $group['id'], '" id="groups_', $group['id'], '"', $group['checked'] ? ' checked="checked"' : '', ' class="input_check" />
Add After: [Select]
<input type="checkbox" name="groupsView[]" value="', $group['id'], '" id="groupsView_', $group['id'], '"', $group['view'] ? ' checked="checked"' : '', ' class="input_check" />
./Themes/default/css/index.css
Find (at the end of the file): [Select]
?>
Add Before: [Select]
/* //-View Only Boards MOD- START */
/* You can customize here the appearence of the protected areas */
.vob_protected
{
cursor: default;
}
.vob_protected, .vob_protected a:link, .vob_protected a:visited, .vob_protected a:hover
{
color: #666 !important;
text-decoration: none;
cursor: default;
}
/* //-View Only Boards MOD- END */
./Themes/default/languages/ManageBoards.english.php
Find: [Select]
$txt['mboards_groups_desc'] = 'Groups allowed to access this board.
Note: if the member is in any group or post group checked, they will have access to this board.';
Replace With: [Select]
$txt['mboards_groups_desc'] = 'Groups allowed to access this board.
Note: if the member is in any group or post group checked, they will have access to this board. <strong>Important:</strong> The first checkbox controls the <strong>access</strong> while the second the <strong>visibility</strong>. Access overrrides visibility but not the other way around. Hence visibility is optional in case access is checked.'; //-View Only Boards MOD- modified
./Themes/default/languages/Modifications.english.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]
//-View Only Boards MOD- Start
$txt['vob_allowMessageIndexView'] = 'Show the message index for "view only" boards';
$txt['vob_protected'] = 'Protected';
//-View Only Boards MOD- End
ยาวจริงๆ ติดตั้งแบบออโต้ เกิดเออเรอร์มาก ว่างๆ ค่อยแมนวลเอา