ข่าวประชาสัมพันธ์

มาร่วมเป็นกำลังใจให้เว็บด้วยการสมัครสมาชิกวีไอพี ~~ เลือกปีที่ท่านต้องการได้โดยไม่ต้องเรียงปี ~~ ปีละ 350 บาท สมัคร 2 ปีลดเหลือ 600 บาท ~~ มีไลน์กลุ่ม VIP จำนวนหลายร้อยท่าน เอาไว้ปรึกษางานซ่อม ~~ เข้าถึงข้อมูลด้านเทคนิค ข้อมูลเชิงลึกมากมาย.....


ผู้เขียน หัวข้อ: Mod บล็อคสมาชิกบางกลุ่มไม่ให้เห็นบอร์ดหรือเห็นแต่เข้าไม่ได้  (อ่าน 3107 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ Auto Man

  • Administrator
  • หัวหน้าศูนย์ซ่อมสร้าง
  • *****
  • เจ้าของกระทู้
  • Joined: ก.ย. 2558
  • กระทู้: 37962
  • สมาชิกลำดับที่ : 1
  • เพศ: ชาย
  • มือผู้ให้ย่อมสูงกว่ามือผู้รับ
    • เว็บชุมชนคนรักช่างยนต์
    • อีเมล์
Mod บล็อคสมาชิกบางกลุ่มไม่ให้เห็นบอร์ดหรือเห็นแต่เข้าไม่ได้

Mod Name:View/Enter Board Permissions

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ


การใช้งาน
-เข้าไปกลุ่มทีต้องการตามภาพ เลือกmodify

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ


ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ


ดาวน์โหลดที่ลิ้งก์ด้านล่าง หรือที่ไฟล์แนบ (สำหรับสมาชิกเว็บ)

http://pordoo.com/mod/t897/
« แก้ไขครั้งสุดท้าย: 24 กันยายน 2561, 19:16:13 โดย Auto Man »
สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai

ออฟไลน์ Auto Man

  • Administrator
  • หัวหน้าศูนย์ซ่อมสร้าง
  • *****
  • เจ้าของกระทู้
  • Joined: ก.ย. 2558
  • กระทู้: 37962
  • สมาชิกลำดับที่ : 1
  • เพศ: ชาย
  • มือผู้ให้ย่อมสูงกว่ามือผู้รับ
    • เว็บชุมชนคนรักช่างยนต์
    • อีเมล์
ระหว่างติดตั้งแจ้ง

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ


File Edits
./Sources/ManagePermissions.php
Find: [Select]
   // All permission groups that will be shown in the left column on classic view.
Add Before: [Select]
   // View & Enter perms; /me wants at the top of the board perms!
   $permissionList['board'] = array(
      'view_board' => array(false, 'general_board', 'view_board'),
      'enter_board' => array(false, 'general_board', 'view_board'),
   ) + $permissionList['board'];


./Sources/Load.php
Find: [Select]
   if ($user_info['is_admin'])
      $user_info['query_see_board'] = '1=1';
   // Otherwise just the groups in $user_info['groups'].
   else
      $user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.member_groups) != 0 OR FIND_IN_SET(', $user_info['groups']) . ', b.member_groups) != 0' . (isset($user_info['mod_cache']) ? ' OR ' . $user_info['mod_cache']['mq'] : '') . ')';
Replace With: [Select]
loadBoardsVisibility();

Find: [Select]
WHERE b.id_board = {raw:board_link}
Replace With: [Select]
WHERE {query_see_board} AND b.id_board = {raw:board_link}

Find (at the end of the file): [Select]
?>
Add Before: [Select]


// Figure out what we can see. Note, because this sets up query_see_board, we cannot call boardsAllowedTo() :(
function loadBoardsVisibility() {
   global $user_info, $smcFunc;
   
   if($user_info['is_admin']) {
      $user_info['query_see_board'] = '1=1';
      $user_info['query_see_only_board'] = '1=1';
      return;
   }
   
   // SLOW QUERY?
   $query = $smcFunc['db_query']('', '
      SELECT b.id_board, bp.permission, bp.add_deny
      FROM {db_prefix}boards AS b INNER JOIN {db_prefix}board_permissions AS bp ON (b.id_profile = bp.id_profile)
      WHERE id_group IN ({array_int:groups}) AND bp.permission IN ({array_string:permission})',
      array(
         'groups' => $user_info['groups'],
         'permission' => array('view_board', 'enter_board'),
      )
   );
   
   $boards = array(
      'allow' => array(
         'view_board' => array(),
         'enter_board' => array(),
      ),
      'deny' => array(
         'view_board' => array(),
         'enter_board' => array(),
      )
   );
   
   while($row = $smcFunc['db_fetch_assoc']($query)) {
      $area = $row['add_deny'] ? 'allow' : 'deny';
      $boards[$area][$row['permission']][] = $row['id_board'];
   }
   $smcFunc['db_free_result']($query);
   
   $allow = array_diff($boards['allow']['view_board'], $boards['deny']['view_board']);
   $user_info['query_see_only_board'] = count($allow) > 0 ? 'b.id_board IN (' . implode(',', $allow) . ')' : '1=0';
   
   $allow = array_diff($boards['allow']['enter_board'], $boards['deny']['enter_board']);
   $user_info['query_see_board'] = count($allow) > 0 ? 'b.id_board IN (' . implode(',', $allow) . ')' : '1=0';
}

./Sources/Subs-BoardIndex.php
Find: [Select]
WHERE {query_see_board}
Replace With: [Select]
WHERE {query_see_only_board}

./Sources/MessageIndex.php
Find: [Select]
   // If this is a redirection board head off.
Add Before: [Select]
   // Hmm, sometimes we get here but user doesn't have enter_board (which is just plain odd)
   if(!allowedTo('enter_board'))
      fatal_lang_error('topic_gone', false);


./Sources/Subs-Db-mysql.php
Find: [Select]
   if ($matches[1] === 'query_see_board')
Add Before: [Select]
   if ($matches[1] === 'query_see_only_board')
      return $user_info['query_see_only_board'];


./Sources/Subs-Db-postgresql.php
Find: [Select]
   if ($matches[1] === 'query_see_board')
Add Before: [Select]
   if ($matches[1] === 'query_see_only_board')
      return $user_info['query_see_only_board'];


./Sources/Subs-Db-sqlite.php
Find: [Select]
   if ($matches[1] === 'query_see_board')
Add Before: [Select]
   if ($matches[1] === 'query_see_only_board')
      return $user_info['query_see_only_board'];


./Themes/default/ManageBoards.template.php
Find: [Select]
                  </dd>
                  <dt>
                     <strong>', $txt['mboards_groups'], ':</strong>

                     <span class="smalltext">', $txt['mboards_groups_desc'], '</span>
                  </dt>
                  <dd>';

   // 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>
';
   echo '
                     ', $txt['check_all'], ' <input type="checkbox" class="input_check" onclick="invertAll(this, this.form, \'groups[]\');" />

                     

                  </dd>';
Replace With: [Select]
</dd>';
   // We don't need membergroups, we don't need no DB control :P

./Themes/default/languages/Modifications.english.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'View board on board listing';
$txt['permissionname_enter_board'] = 'Enter the board and see the threads in it';
$txt['permissiongroup_simple_view_board'] = 'Viewing the board';

./Themes/default/languages/Modifications.english-utf8.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'View board on board listing';
$txt['permissionname_enter_board'] = 'Enter the board and see the threads in it';
$txt['permissiongroup_simple_view_board'] = 'Viewing the board';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.english_british.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'View board on board listing';
$txt['permissionname_enter_board'] = 'Enter the board and see the threads in it';
$txt['permissiongroup_simple_view_board'] = 'Viewing the board';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.english_british-utf8.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'View board on board listing';
$txt['permissionname_enter_board'] = 'Enter the board and see the threads in it';
$txt['permissiongroup_simple_view_board'] = 'Viewing the board';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.spanish_es.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'Ver el foro en la lista de foros';
$txt['permissionname_enter_board'] = 'Entrar a el foro y ver los temas que hay en el';
$txt['permissiongroup_simple_view_board'] = 'Ver el foro';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.spanish_es-utf8.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'Ver el foro en la lista de foros';
$txt['permissionname_enter_board'] = 'Entrar a el foro y ver los temas que hay en el';
$txt['permissiongroup_simple_view_board'] = 'Ver el foro';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.spanish_latin.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'Ver el foro en la lista de foros';
$txt['permissionname_enter_board'] = 'Entrar a el foro y ver los temas que hay en el';
$txt['permissiongroup_simple_view_board'] = 'Ver el foro';
This operation isn't vital to the installation of this mod.

./Themes/default/languages/Modifications.spanish_latin-utf8.php
Find (at the end of the file): [Select]
?>
Add Before: [Select]

$txt['permissionname_view_board'] = 'Ver el foro en la lista de foros';
$txt['permissionname_enter_board'] = 'Entrar a el foro y ver los temas que hay en el';
$txt['permissiongroup_simple_view_board'] = 'Ver el foro';
This operation isn't vital to the installation of this mod.
« แก้ไขครั้งสุดท้าย: 28 กันยายน 2561, 19:15:17 โดย Auto Man »
สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai