المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : [product] أخفاء النص



ضيف المهاجر
01 - 01 - 2006, 23:47
السلام عليكم
الهاك هو هاك اخفاء النص المطور
المميزات التي اضيفت له هي
اخفاء النص و اشتراط عدد مشاركات كي يستطيع العضو رؤيه النص المخفي (نستبدل علامة السؤال بعدد المشاركات)



اخفاء النص و جعله متاح للمجموعات فقط ( المشرفين - الزوار-الأعضاء) وغيرهم اي مجموعه موجوده بالمنتدي(نستبدل علامة السؤال برقم المجموعه)




طريقة التركيب
ترفع الصور المرفقه مع الهاك الي مجلد 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_bbc ode($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
وانتهي تركيب الهاك

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


تحياتي