النتائج 1 إلى 1 من 1

الموضوع: [product] أخفاء النص

  1. #1
    الصورة الرمزية ضيف المهاجر
    Title
    المدير العام
    تاريخ التسجيل
    05- 2002
    المشاركات
    6,428

    [product] أخفاء النص

    السلام عليكم
    الهاك هو هاك اخفاء النص المطور
    المميزات التي اضيفت له هي
    اخفاء النص و اشتراط عدد مشاركات كي يستطيع العضو رؤيه النص المخفي (نستبدل علامة السؤال بعدد المشاركات)

    كود:
    [HIDE=?][/HIDE]
    اخفاء النص و جعله متاح للمجموعات فقط ( المشرفين - الزوار-الأعضاء) وغيرهم اي مجموعه موجوده بالمنتدي(نستبدل علامة السؤال برقم المجموعه)

    كود:
    [SHOWTOGROUPS=?][/SHOWTOGROUPS]
    طريقة التركيب
    ترفع الصور المرفقه مع الهاك الي مجلد images/editor بالمنتدي
    تعديل الملفات
    تفتح ملف search.php
    تبحث عن

    كود:
       $post['pagetext'] = preg_replace('#\[quote(=("|"|\'|)??.*\\2)?\](((?>[^\[]*?|(?R)|.))*)\[/quote\]#siUe', "process_quote_removal('\\3', \$display['highlight'])", $post['pagetext']);
    تضع تحته

    كود:
    $post['pagetext'] = strip_tags(str_replace("<br />", "\n", parseHide($post['pagetext'])));
    تفتح ملف archive/index.php
    تبحث عن

    $post['pagetext_simp'] = strip_bbcode($post['pagetext']);
    وتستبدله بالتالي

    كود:
      /**
      /* [hide] Hack Resurrection (Limited) for vBulletin 3.5
      /* Author: Dark Visor
      /* E-mail: ankan925@optonline.net
      /*
      /* OLD VERSION OF THIS CODE:
      /* $post['pagetext_simp'] = strip_bbcode($post['pagetext']);
      */
      
      $post['pagetext_simp'] = stripHide($post['pagetext'], 'archive');  
      $post['pagetext_simp'] = strip_bbcode($post['pagetext_simp']);  
      
      /**
      /* [hide] Hack Resurrection for vBulletin 3.5 [END]
      */
    تفتح ملف includes/functions.php
    تبحث عن

    كود:
    // #############################################################################
    /**
    * Performs general clean-up after the system exits, such as running shutdown queries
    */
    function exec_shut_down()
    وتضع فوقه

    كود:
     
    // #############################################################################
    /**
    * [HIDE] Hack Resurrection (Limited) by Dark Visor :: Custom Function
    * Parses the text block for [HIDE] and [SHOWTOGROUPS] tags and calls the apporpriate functions to perform replacements.
    *
    * @param string Raw text block that needs parsing
    *
    * @return string Parsed text block
    */
    function parseHide($text) 
    {
     global $vbulletin;
     $text = preg_replace("/\[hide\]/siU", "[hide=".$vbulletin->options['hidetag_defaultposts']."]", $text);
     $text = preg_replace_callback("/\[hide=(&quot;|\"|'|)([0-9]*)\\1\](.*)\[\/hide\]/siU", 
      create_function(
       '$matches',
       'return parseHide2($matches[2],$matches[3]);'
      ), 
      $text);
     $text = preg_replace_callback("/\[showtogroups=(&quot;|\"|'|)([0-9,]+)\\1\](.*)\[\/showtogroups\]/siU", 
      create_function(
       '$matches',
       'return parseShowToGroups($matches[2],$matches[3]);'
      ), 
      $text);
     return $text;
    }
    // #############################################################################
    /**
    * [HIDE] Hack Resurrection (Limited) by Dark Visor :: Custom Function
    * Parses the [HIDE] tag and replaces it with appropriate HTML code.
    *
    * @param int  The amount of required posts
    * @param string Raw text block that needs parsing
    *
    * @return string Parsed text block
    */
    function parseHide2($postsrequired,$text) 
    {
     // ####################################################
     // init
     // ####################################################
     global $vbulletin, $vbphrase, $thread, $threadinfo, $post;
     $forumid = (is_array($thread) ? $thread['forumid'] : $threadinfo['forumid']);
     
     if (THIS_****** == 'search')
     {
      $forumid = $post['forumid'];
     }
     
     $threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
     
     if (THIS_****** == 'search')
     {
      $threadid = $post['threadid'];
     }
     $threaddata = (is_array($thread) ? $thread : $threadinfo);
     $posterid = (is_array($post) ? $post['userid'] : $threaddata['postuserid']);
     // ####################################################
     
     $postsrequired = intval($postsrequired);
     
     $hidetag['usergroups_viewer'] = $vbulletin->userinfo['usergroupid'] . iif(!empty($vbulletin->userinfo['membergroupids']), ",", "") . $vbulletin->userinfo['membergroupids'];
     $hidetag['usergroups_viewer'] = explode(",", $hidetag['usergroups_viewer']);
     // ####################################################
     // check user's eligibility to view the content
     // ####################################################
     $hidetag['canview'] = false;
     foreach($hidetag['usergroups_viewer'] as $usergroup) 
     {
      if (in_array($usergroup, array(5,6)))
      {
       $hidetag['canview'] = true; // allowed if [user = supermod | user = admin]
      }
     }
     if (can_moderate($forumid) AND in_array(THIS_******, array('forumdisplay', 'showthread', 'showpost', 'archive', 'printthread')))
     {
      $hidetag['canview'] = true; // allowed if [user = mod]
     }
     if ($vbulletin->userinfo['posts'] >= $postsrequired)
     {
      $hidetag['canview'] = true; // allowed if [user = conditional match]
     }
        if ($vbulletin->userinfo['usergroupid'] == 3 OR $vbulletin->userinfo['usergroupid'] == 4)
     {
      $hidetag['canview'] = false; // disallowed if [user has changed his/her email and is not confirmed or is an unmoderated coppa]
     }
     if ($vbulletin->userinfo['userid'] != NULL AND $vbulletin->userinfo['userid'] == $posterid)
     {
      $hidetag['canview'] = true; // allowed if [user matched but not guest]
     }
     if (!$post['postid'] AND in_array(THIS_******, array('newthread', 'newreply'))) 
     {
      $hidetag['canview'] = true; // allowed if [user is making a post]
     }
     
     if (in_array(THIS_******, array('editpost'))) 
     {
      $hidetag['canview'] = true; // allowed if [user is editing a post]
     }
     // ####################################################
     // output
     // ####################################################
     if ($vbulletin->userinfo['userid'] == NULL) 
     {
      if ($postsrequired == 0)
      {
       $vbphrase['hidetag_and_x_posts'] = "";
      }
      else
      {
       $vbphrase['hidetag_and_x_posts'] = " " . construct_phrase($vbphrase['hidetag_and_x_posts'], $postsrequired);
      }
      $text = "<font color='" . $vbulletin->options['hidetag_color'] . "'><b>" . construct_phrase($vbphrase['hidetag_posts_guest_caption'], $vbphrase['hidetag_and_x_posts']) . ":</b><br />" . $vbphrase['hidetag_accessdenied'] . "</font>";
     } 
     elseif ($hidetag['canview'] == true)
     {
      $text = "<font color='" . $vbulletin->options['hidetag_color'] . "'><b>" . construct_phrase($vbphrase['hidetag_posts_registered_caption'], $postsrequired, $vbulletin->userinfo['posts']) . ":</b><br />" . $text . "</font>";
     } 
     else 
     {
      $text = "<font color='" . $vbulletin->options['hidetag_color'] . "'><b>" . construct_phrase($vbphrase['hidetag_posts_registered_caption'], $postsrequired, $vbulletin->userinfo['posts']) . ":</b><br />" . $vbphrase['hidetag_accessdenied'] . "</font>";
     }
     return $text;
    }
    // #############################################################################
    /**
    * [HIDE] Hack Resurrection (Limited) by Dark Visor :: Custom Function
    * Parses the [SHOWTOGROUPS] tag and replaces it with appropriate HTML code.
    *
    * @param string A list of acceptable userids, separated by commas
    * @param string Raw text block that needs parsing
    *
    * @return string Parsed text block
    */
    function parseShowToGroups($usergroupids,$text) 
    {
     // ####################################################
     // init
     // ####################################################
     global $vbulletin, $vbphrase, $db, $thread, $threadinfo, $post;
     $forumid = (is_array($thread) ? $thread['forumid'] : $threadinfo['forumid']);
     
     if (THIS_****** == 'search')
     {
      $forumid = $post['forumid'];
     }
     
     $threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
     
     if (THIS_****** == 'search')
     {
      $threadid = $post['threadid'];
     }
     
     $threaddata = (is_array($thread) ? $thread : $threadinfo); 
     $posterid = (is_array($post) ? $post['userid'] : $threaddata['postuserid']);
     
     // ####################################################
     
     $hidetag['usergroups_viewer'] = $vbulletin->userinfo['usergroupid'] . iif(!empty($vbulletin->userinfo['membergroupids']), ",", "") . $vbulletin->userinfo['membergroupids'];
     $hidetag['usergroups_viewer'] = explode(",", $hidetag['usergroups_viewer']);
     $hidetag['usergroups_allowed_list'] = '';
     // hash the group names so that they are called only once
      static $mysql_data = '';
      static $usergroups_data = '';
     
      $hidetag['usergroups_allowed'] = explode(",", $usergroupids);
      if ($mysql_data == '') 
      {
       $mysql_data = $db->query_read("SELECT usergroupid,title FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid");
      }
      if ($usergroups_data == '')
      {
       while ($i = $db->fetch_array($mysql_data))
       {
        $usergroups_data[] = $i;
       }
      }
     // end hash
     // retrieve usergroup titles from hash
      foreach ($usergroups_data as $row) 
      {
       if (in_array($row['usergroupid'],$hidetag['usergroups_allowed']))
       {
        $hidetag['usergroups_list'] = $hidetag['usergroups_list'] . iif($hidetag['usergroups_list'] == '', "", ", ") . $row['title'] . " :: " . $row['usergroupid'];
       }
      }
      if (empty($hidetag['usergroups_list']))
      {
       $hidetag['usergroups_list'] = "N/A :: 0";
      }
     // end retrieve
     // ####################################################
     // check user's eligibility to view the content
     // ####################################################
     $hidetag['canview'] = false;
     foreach ($hidetag['usergroups_viewer'] as $usergroup) 
     {
      if (in_array($usergroup, array(5,6)) OR in_array($usergroup, $hidetag['usergroups_allowed']))
      {
       $hidetag['canview'] = true; // allowed if [user = conditional match | user = supermod | user = admin]
      }
     }
     if (can_moderate($forumid) AND in_array(THIS_******, array('forumdisplay', 'showthread', 'archive', 'printthread')))
     {
      $hidetag['canview'] = true; // allowed if [user = mod]
     }
         if ($vbulletin->userinfo['usergroupid'] == 3 OR $vbulletin->userinfo['usergroupid'] == 4)
     {
      $hidetag['canview'] = false; // disallowed if [user has changed his/her email and is not confirmed or is an unmoderated coppa]
     }
     if ($vbulletin->userinfo['userid'] != NULL AND $vbulletin->userinfo['userid'] == $posterid)
     {
      $hidetag['canview'] = true; // allowed if [user matched but not guest]
     }
     if (!$post['postid'] AND in_array(THIS_******, array('newthread', 'newreply'))) 
     {
      $hidetag['canview'] = true; // allowed if [user is making a post]
     }
     
     if (in_array(THIS_******, array('editpost'))) 
     {
      $hidetag['canview'] = true; // allowed if [user is editing a post]
     }
     // ####################################################
     // output
     // ####################################################
     if ($hidetag['canview'] == true)
     {
      $text = "<font color='" . $vbulletin->options['hidetag_color'] . "'><strong>" . construct_phrase($vbphrase['hidetag_showtogroups_caption'], $hidetag['usergroups_list']) . ":</strong><br />" . $text . "</font>";
     } 
     else 
     {
      $text = "<font color='" . $vbulletin->options['hidetag_color'] . "'><strong>" . construct_phrase($vbphrase['hidetag_showtogroups_caption'], $hidetag['usergroups_list']) . ":</strong><br />" . $vbphrase['hidetag_accessdenied'] . "</font>";
     }
     return $text;
    }
    // #############################################################################
    /**
    * [HIDE] Hack Resurrection (Limited) by Dark Visor :: Custom Function
    * Strips [HIDE], [SHOWTOGROUPS] from where it should not be shown.
    *
    * @param string Raw text block that needs parsing
    * @param string A place pointer, which defines the replacement.
    *
    * @return string Parsed text block
    */
    function stripHide($text,$where='') 
    {
     global $vbphrase;
     switch ($where)
     {
      case 'editor':
       $replacement = $vbphrase['hidetag_stripped_quote'];
       break;
      case 'email':
       $replacement = $vbphrase['hidetag_stripped_email'];
       break;
      case 'archive':
       $replacement = $vbphrase['hidetag_stripped_archive'];
       break;
      default:
       $replacement = "[HIDE] Hack Resurrection by Dark Visor: Undefined Replacement [ErrorCode SH01]";
       break; 
     }
     $text = preg_replace("/\[hide\](.*)\[\/hide\]/siU", $replacement, $text);
     $text = preg_replace("/\[hide=(&quot;|\"|'|)([0-9]*)\\1\](.*)\[\/hide\]/siU", $replacement, $text);
      
     $text = preg_replace("/\[showtogroups=(&quot;|\"|'|)([0-9,]+)\\1\](.*)\[\/showtogroups\]/siU", $replacement, $text);
       
     return $text;
    }
    تفتح ملف includes/functions_digest.php
    تبحث عن

    $post['pagetext'] = unhtmlspecialchars(strip_bbcode($post['pagetext']));
    وتضع فوقه

    كود:
     
    $post['pagetext'] = strip_tags(str_replace("<br />", "\n", stripHide($post['pagetext'], 'email')));
    تفتح ملف includes/functions_forumdisplay.php
    تبحث عن

    كود:
    $thread['preview'] = htmlspecialchars_uni(fetch_trimmed_title(strip_bbcode($thread['preview'], false, true), $vbulletin->options['threadpreview']));
    تضع فوقه

    كود:
    $thread['preview'] = strip_tags(str_replace("<br />", "\n", parseHide($thread['preview'])));
    تفتح ملف includes/functions_newpost.php
    تبحث عن

    كود:
    $pagetext = strip_bbcode($pagetext, 1);
    تضع فوقه

    كود:
    $pagetext = stripHide($pagetext, 'email');
    تفتح ملف client******/vbulletin_textedit.js
    تبحث عن

    كود:
       case 'PHP':
       {
        this.apply_format('removeformat');
       }
    وتضع تحته

    كود:
       break;   
       case 'HIDE':
       case 'SHOWTOGROUPS':
       {
        useoption = true;
       }
    انتهينا من تعديل الملفات
    تعديل القوالب
    تفتح قالب editor_toolbar_on
    تبحث عن

    كود:
    $vBeditTemplate[extrabuttons]
    و تضع فوقه

    كود:
        <td><img src="$stylevar[imgdir_editor]/separator.gif" width="6" height="20" alt="" /></td>
        <td><div class="imagebutton" id="{$editorid}_cmd_wrap0_hide"><img src="$stylevar[imgdir_editor]/hide.gif" width="41" height="20" alt="$vbphrase[wrap_hide_tags]" /></div></td>
        <td><div class="imagebutton" id="{$editorid}_cmd_wrap0_showtogroups"><img src="$stylevar[imgdir_editor]/showtogroups.gif" width="31" height="20" alt="$vbphrase[wrap_showtogroups_tags]" /></div></td>
    ترفع ملف البرودكت
    product-darkvisor_hide
    وانتهي تركيب الهاك

    منقول للفائدة


    تحياتي
    الملفات المرفقة الملفات المرفقة
    <div style=text-align: center;><b><span style=font-family: Courier New><font size=4><a href=http://www.sultanqaboos.net target=_blank>موقع السلطان قابوس</a>
<a href=https://hmhaitham.om/ target=_blank><b><span style=font-family: Courier New><font size=4>موقع السلطان هيثم</font></span></b></a>
<a href=http://www.alrasby.net target=_blank>الراسبي نت</a>
</font></span></b>

</div>

معلومات الموضوع

الأعضاء الذين يشاهدون هذا الموضوع

الذين يشاهدون الموضوع الآن: 1 (0 من الأعضاء و 1 زائر)

ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

RSS RSS 2.0 XML MAP HTML