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

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


ผู้เขียน หัวข้อ: มอดดูหัวข้อได้ แต่คลิ๊กเข้าไปอ่านไม่ได้  (อ่าน 2560 ครั้ง)

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

ออฟไลน์ Auto Man

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

http://custom.simplemachines.org/mods/index.php?mod=610

View Only Boards  มองเห็นกระทู้ แต่...เข้าไปดูไม่ได้

   อธิบายสั้นๆเพราะไม่มีรูปประกอบให้   การทำงานก็ประมาณว่า ให้สมาชิกมองเห็นบอร์ดได้และหััวข้อต่างๆ ได้
แต่ไม่ได้รับอนุญาตให้เข้าดู ถ้าจะเข้าดูได้ ก็ต้องได้รับการอนุญาต โดยการตั้งค่าที่ mod โดยอ้างถึง กลุ่มสมาชิก
ประมาณนี้ (เข้าใจกันป่าวเนี่ย)  5 5 5

 :o

มาจากที่นี่
« แก้ไขครั้งสุดท้าย: 05 กันยายน 2559, 01:44:55 โดย Auto Man »
สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai

ออฟไลน์ Auto Man

  • Administrator
  • หัวหน้าศูนย์ซ่อมสร้าง
  • *****
  • เจ้าของกระทู้
  • Joined: ก.ย. 2558
  • กระทู้: 42177
  • สมาชิกลำดับที่ : 1
  • เพศ: ชาย
  • มือผู้ให้ย่อมสูงกว่ามือผู้รับ
    • เว็บชุมชนคนรักช่างยนต์
    • อีเมล์
« แก้ไขครั้งสุดท้าย: 23 มกราคม 2562, 14:31:07 โดย Auto Man »
สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai

ออฟไลน์ Auto Man

  • Administrator
  • หัวหน้าศูนย์ซ่อมสร้าง
  • *****
  • เจ้าของกระทู้
  • Joined: ก.ย. 2558
  • กระทู้: 42177
  • สมาชิกลำดับที่ : 1
  • เพศ: ชาย
  • มือผู้ให้ย่อมสูงกว่ามือผู้รับ
    • เว็บชุมชนคนรักช่างยนต์
    • อีเมล์
มอดดูหัวข้อได้ แต่คลิ๊กเข้าไปอ่านไม่ได้
« ตอบกลับ #2 เมื่อ: 02 ตุลาคม 2559, 16:49:21 »
  • ขึ้นบน
  • ลงล่าง
  • File Edits

    ./Sources/Subs-BoardIndex.php
    Find:
    โค๊ด: [Select]
    $this_category[$row_board['id_board']] = array(
                   'new' => empty($row_board['is_read']),

    Add After:
    โค๊ด: [Select]
                   'protected' => !empty($user_info['view_only_boards']) && in_array($row_board['id_board'], $user_info['view_only_boards']), //- View Only Boards MOD-
    Find:
    โค๊ด: [Select]
    $this_category[$row_board['id_parent']]['children'][$row_board['id_board']] = array(
                'id' => $row_board['id_board'],

    Add After:
    โค๊ด: [Select]
                'protected' => !empty($user_info['view_only_boards']) && in_array($row_board['id_board'], $user_info['view_only_boards']), //- View Only Boards MOD-
    Find:
    โค๊ด: [Select]
    $this_last_post = array(
             'id' => $row_board['id_msg'],

    Add After:
    โค๊ด: [Select]
             'protected' => !empty($user_info['view_only_boards']) && in_array($row_board['id_board'], $user_info['view_only_boards']), //- View Only Boards MOD-
    Find:
    โค๊ด: [Select]
          // Set the last post in the parent board.
          if ($row_board['id_parent'] == $boardIndexOptions['parent_id'] || ($isChild && !empty($row_board['poster_time']) && $this_category[$row_board['id_parent']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time'])))

    Replace With:
    โค๊ด: [Select]
          // Set the last post in the parent board. //- View Only Boards MOD- modified condition
          if ($row_board['id_parent'] == $boardIndexOptions['parent_id'] || ($isChild && !empty($row_board['poster_time']) && (!$this_last_post['protected'] || !empty($modSettings['vob_allowMessageIndexView'])) && $this_category[$row_board['id_parent']]['last_post']['timestamp'] < forum_time(true, $row_board['poster_time'])))

    ./Sources/ManageBoards.php

    Find:
    โค๊ด: [Select]
          // Change '1 & 2' to '1 &amp; 2', but not '&amp;' to '&amp;amp;'...Add Before:
    โค๊ด: [Select]
          //-View Only Boards MOD- Start - prepare the view information to save
          $boardOptions['access_groups_view'] = array();
          if (!empty($_POST['groupsView']))
             foreach ($_POST['groupsView'] as $group)
                $boardOptions['access_groups_view'][] = (int) $group;
          //-View Only Boards MOD- End


    Find:
    อ้างถึง
    'member_groups' => array(0, -1),
    Add After:
    โค๊ด: [Select]
             'member_groups_view' => array(), //-View Only Boards MOD-
    Find:
    โค๊ด: [Select]
    'checked' => in_array('-1', $curBoard['member_groups']),Add After:
    โค๊ด: [Select]
             'view' => in_array('-1', $curBoard['member_groups_view']), //-View Only Boards MOD-
    Find:
    โค๊ด: [Select]
    'checked' => in_array('0', $curBoard['member_groups']),Add After:
    โค๊ด: [Select]
             'view' => in_array('0', $curBoard['member_groups_view']), //-View Only Boards MOD-
    Find:
    โค๊ด: [Select]
    'checked' => in_array($row['id_group'], $curBoard['member_groups']),Add After:

    โค๊ด: [Select]
             'view' => in_array($row['id_group'], $curBoard['member_groups_view']), //-View Only Boards MOD-
    ./Sources/Subs-Boards.php

    Find:
    โค๊ด: [Select]
       // Who's allowed to access this board.Add Before:
    โค๊ด: [Select]
       //-View Only Boards MOD- Who's allowed to view this board.
       if (isset($boardOptions['access_groups_view']))
          $boardUpdates[] = 'member_groups_view = \'' . implode(',', $boardOptions['access_groups_view']) . '\'';


    Find:
    โค๊ด: [Select]
    b.member_groups,Add After:
    โค๊ด: [Select]
    b.member_groups_view,
    Find:
    โค๊ด: [Select]
       // Getting all the board and category information you'd ever wanted.Add After:
    โค๊ด: [Select]
       //-View Only Boards MOD- query modified
    Find:
    โค๊ด: [Select]
    'member_groups' => explode(',', $row['member_groups']),
    Add After:
    โค๊ด: [Select]
                'member_groups_view' => explode(',', $row['member_groups_view']), //-View Only Boards MOD-
    « แก้ไขครั้งสุดท้าย: 02 ตุลาคม 2559, 16:58:49 โดย Auto Man »
    สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
    ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai

    มอดดูหัวข้อได้ แต่คลิ๊กเข้าไปอ่านไม่ได้
    « ตอบกลับ #2 เมื่อ: 02 ตุลาคม 2559, 16:49:21 »


    ออฟไลน์ Auto Man

    • Administrator
    • หัวหน้าศูนย์ซ่อมสร้าง
    • *****
    • เจ้าของกระทู้
    • Joined: ก.ย. 2558
    • กระทู้: 42177
    • สมาชิกลำดับที่ : 1
    • เพศ: ชาย
    • มือผู้ให้ย่อมสูงกว่ามือผู้รับ
      • เว็บชุมชนคนรักช่างยนต์
      • อีเมล์
    มอดดูหัวข้อได้ แต่คลิ๊กเข้าไปอ่านไม่ได้
    « ตอบกลับ #3 เมื่อ: 02 ตุลาคม 2559, 17:00:24 »
  • ขึ้นบน
  • ลงล่าง
  • ./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

    ยาวจริงๆ ติดตั้งแบบออโต้ เกิดเออเรอร์มาก ว่างๆ ค่อยแมนวลเอา
    สวัสดีคุณ...ผู้เยี่ยมชม  กด ❤ ถูกใจโพสท์นี้ หรือยัง...
    ต้องการสมัครสมาชิก VIP สมัครได้ที่นี่...   หรือทาง Line ID: k.sonchai

    มอดดูหัวข้อได้ แต่คลิ๊กเข้าไปอ่านไม่ได้
    « ตอบกลับ #3 เมื่อ: 02 ตุลาคม 2559, 17:00:24 »