السلام عليكم
الهاك هو هاك اخفاء النص المطور
المميزات التي اضيفت له هي
اخفاء النص و اشتراط عدد مشاركات كي يستطيع العضو رؤيه النص المخفي (نستبدل علامة السؤال بعدد المشاركات)
اخفاء النص و جعله متاح للمجموعات فقط ( المشرفين - الزوار-الأعضاء) وغيرهم اي مجموعه موجوده بالمنتدي(نستبدل علامة السؤال برقم المجموعه)كود:[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']);
تفتح ملف archive/index.phpكود:$post['pagetext'] = strip_tags(str_replace("<br />", "\n", parseHide($post['pagetext'])));
تبحث عن
$post['pagetext_simp'] = strip_bbcode($post['pagetext']);
وتستبدله بالتالي
تفتح ملف includes/functions.phpكود:/** /* [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] */
تبحث عن
وتضع فوقهكود:// ############################################################################# /** * Performs general clean-up after the system exits, such as running shutdown queries */ function exec_shut_down()
تفتح ملف includes/functions_digest.phpكود:// ############################################################################# /** * [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=("|\"|'|)([0-9]*)\\1\](.*)\[\/hide\]/siU", create_function( '$matches', 'return parseHide2($matches[2],$matches[3]);' ), $text); $text = preg_replace_callback("/\[showtogroups=("|\"|'|)([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=("|\"|'|)([0-9]*)\\1\](.*)\[\/hide\]/siU", $replacement, $text); $text = preg_replace("/\[showtogroups=("|\"|'|)([0-9,]+)\\1\](.*)\[\/showtogroups\]/siU", $replacement, $text); return $text; }
تبحث عن
$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']));
تفتح ملف includes/functions_newpost.phpكود:$thread['preview'] = strip_tags(str_replace("<br />", "\n", parseHide($thread['preview'])));
تبحث عن
تضع فوقهكود:$pagetext = strip_bbcode($pagetext, 1);
تفتح ملف client******/vbulletin_textedit.jsكود:$pagetext = stripHide($pagetext, 'email');
تبحث عن
وتضع تحتهكود: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
وانتهي تركيب الهاك
منقول للفائدة
تحياتي
الذين يشاهدون الموضوع الآن: 1 (0 من الأعضاء و 1 زائر)