اغلق هذه النافذة  أنت غير مسجل بشبكة ابن الخليج; للتسجيل اضغط هنا; للمساعده وشرح طريقة التسجيل اضغط هنا

شبكة ابن الخليج

Sitemap | Archive | Tag Could
موقع ولد الامارات - ينتهي الاعلان بتاريخ 20\8\2008
التسجيل البحث مشاركات اليوم اجعل جميع المنتديات مقروءة الأرشيف

احدث الافلام واخبار الفندليل مواقع ابن الخليجشبكة مدينة الحب - ينتهي الإعلان بتاريخ 19\8\2008
كل مايخص المرأة والمجتمعاجمل واروع الصورمعهد مطور - ينتهي الإعلان بتاريخ 6\11\2008
     

أريد هاك اخفاء النص توجد صور

مناقشة موضوع أريد هاك اخفاء النص توجد صور في مشاكل وحلول الـ مواقع; السلام عليكم ورحمة الله وبركاته أخواني أرجو التكرم بوضع هاك أخفاء النص وكيفية تركيبه أن أمكن وهذه صور الهاك قبل الرد على الموضوع بعد الرد على الموضوع وشكراً لكم جميعاً ...

العودة شبكة ابن الخليج > تطوير المواقع و المنتديات > مشاكل وحلول الـ مواقع

رد
 
LinkBack أدوات الموضوع طرق مشاهدة الموضوع
قديم 04-28-2006, 10:52 صباحاً   #1 (permalink)
عضــو
 
تاريخ التسجيل: Apr 2006
المشاركات: 22
معدل تقييم المستوى: 12 daralkramah يستاهل ترحيب
Red face أريد هاك اخفاء النص توجد صور


السلام عليكم ورحمة الله وبركاته

أخواني أرجو التكرم بوضع هاك أخفاء النص وكيفية تركيبه أن أمكن

وهذه صور الهاك

قبل الرد على الموضوع



بعد الرد على الموضوع



وشكراً لكم جميعاً





من مواضيع daralkramah في المنتدى

daralkramah غير متواجد حالياً   رد مع اقتباس
قديم 04-28-2006, 11:01 صباحاً   #2 (permalink)
اسرة ابن الخليج
 
تاريخ التسجيل: Apr 2006
الدولة: فلسطين الحبيبة
المشاركات: 549
معدل تقييم المستوى: 285 محمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيط
مشاركة: أريد هاك اخفاء النص توجد صور

اقتباس:
المشاركة الأصلية كتبت بواسطة Dr.MinD
السلام عليكم ورحمة الله

لقدم قام الاخ الغالى Dar4arab بوضع هذا الهاك ولكنه لم يضع له شرح

ولقد قمت بتجربته على النسخة 3.5.4 وتم عمل الهاك بنجاح

هذا هو الشرح :




ولكن الهاك مختلف عن الهاكات الاخرى الخاصة بالاخفاء

الهاك يقوم باخفاء المحتوى عن العضو الذى مشاركاته اقل من 5 مشاركات


نبدأ ببسم الله

اولا قم بأخذ نسخة احتياظة من كل ملف راح تقوم بتعديله

اولا بعد فك الضغط عن المرفق راح يظهر لك صورتان بعنوان hide.gif ، showtogroups.gif

قم رفع الصورتان الى مجلد بعنوان editor بداخل مجلد الصور" images " داخل مجلد المنتدى ليكون بهذا المسار :
./images/editor/hide.gif
./images/editor/showtogroups.gif

ملحوظة : يتم وضع الصورتان فى مجلد الصور الخاص بالاستايل الموجود على نسخة المنتدى
==========================
بعد ذلك نتقل الى مرحلة اخرى وهى التعديل على الملفات :

اولا : التعديل على ملف : search.php الذى يوجد فى المجلد الرئيسى للمنتدى

قم بالبحث فيه عن هذا الكود :

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

كود PHP:
$post['pagetext'] = strip_tags(str_replace("<br />""\n"parseHide($post['pagetext']))); 
بعد ذلك قم بحفظ الملف ورفعه الى مكانه

ثانيا : التعديل على ملف : index.php الذى يوجد بداخل مجلد archive :

قم بالبحث عن الكود :

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

كود 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]
        */ 
ثم قم بحفظ الملف ورفعه

ثالثا : التعديل على الملف : functions.php والذى ستجده بداخل مجلد includes :

ابحث عن :

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

كود 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=(&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_SCRIPT == 'search')
    {
        
$forumid $post['forumid'];
    }
    
    
$threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
    
    if (
THIS_SCRIPT == '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_SCRIPT, 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'] == 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_SCRIPT, array('newthread''newreply'))) 
    {
        
$hidetag['canview'] = true// allowed if [user is making a post]
    
}
    
    if (
in_array(THIS_SCRIPT, 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_SCRIPT == 'search')
    {
        
$forumid $post['forumid'];
    }
    
    
$threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
    
    if (
THIS_SCRIPT == '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_SCRIPT, array('forumdisplay''showthread''archive''printthread')))
    {
        
$hidetag['canview'] = true// allowed if [user = mod]
    
}

        if (
$vbulletin->userinfo['usergroupid'] == 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_SCRIPT, array('newthread''newreply'))) 
    {
        
$hidetag['canview'] = true// allowed if [user is making a post]
    
}
    
    if (
in_array(THIS_SCRIPT, 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;

ثم قم بحفظ المف ورفعه

رابعا : التعديل على الملف functions_digest.php بداخل مجلد includes :

ابحث عن :

كود PHP:
$post['pagetext'] = unhtmlspecialchars(strip_bbcode($post['pagetext'])); 
اضف اعلاه:

كود PHP:
$post['pagetext'] = strip_tags(str_replace("<br />""\n"stripHide($post['pagetext'], 'email'))); 
واحفظ الملف

خامسا : التعديل على الملف functions_forumdisplay.php بداخل مجلد includes :

ابحث عن :

كود PHP:
$thread['preview'] = htmlspecialchars_uni(fetch_censored_text(fetch_trimmed_title(
            
strip_bbcode($thread['preview'], falsetrue),
            
$vbulletin->options['threadpreview'
اضف اعلاه :

كود PHP:
$thread['preview'] = strip_tags(str_replace("<br />""\n"parseHide($thread['preview']))); 
واحفظ الملف

سادسا: التعديل على ملف functions_newpost.php فى مجلد includes :

ابحث عن :

كود PHP:
$pagetext strip_bbcode($pagetext1); 
اضف اعلاه :

كود PHP:
$pagetext stripHide($pagetext'email'); 
واحفظه

سابعا : التعديل على ملف vbulletin_textedit.js فى مجلد clientscript :

ابحث عن :

كود PHP:
case 'PHP':
            {
                
this.apply_format('removeformat');
            } 
اضف اسفله :

كود PHP:
break;            
            case 
'HIDE':
            case 
'SHOWTOGROUPS':
            {
                
useoption true;
            } 
واحفظ الملف
=======================
الخطوة القبل الاخيرة

وهى التعديل على تمبلت editor_toolbar_on

قم بالحث عن :

كود PHP:
$vBeditTemplate[extrabuttons
اضف اعلاه :

كود PHP:
<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

قم برفع ملف product-darkvisor_hide.xml من لوحة التحكم

وبهذا نكون قد انتهينا من تركيب الهاك بنجاح

لتشغيل الهاك :

عند اخفاء نص نقوم بعمله كالاتى :

النص المراد اخفائه


واى سؤال انا تحت امركم

اخوكم Dr.MinD :shiny:

للتحميل من هنا
http://www.traidnt.net/vb/attachment...1&d=1146058177





من مواضيع محمد الفرح في المنتدى
محمد الفرح غير متواجد حالياً   رد مع اقتباس
قديم 04-28-2006, 11:04 صباحاً   #3 (permalink)
اسرة ابن الخليج
 
تاريخ التسجيل: Apr 2006
الدولة: فلسطين الحبيبة
المشاركات: 549
معدل تقييم المستوى: 285 محمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيطمحمد الفرح نشيط
مشاركة: أريد هاك اخفاء النص توجد صور

وعندك هااد كمان
اقتباس:
المشاركة الأصلية كتبت بواسطة netzoner
السلام عليكم
اليوم اردت ان اعرب هاك اردت ان استخدمه وحبيت اشاركم به

الهاك هو هاك اخفاء النص المطور
المميزات التي اضيفت له هي

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


طريقة التركيب

ترفع الصور المرفقه مع الهاك الي مجلد images/editor بالمنتدي

تعديل الملفات

تفتح ملف search.php

تبحث عن
كود:
			$post['pagetext'] = preg_replace('#\[quote(=(&quot;|"|\'|)??.*\\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_SCRIPT == 'search')
	{
		$forumid = $post['forumid'];
	}
	
	$threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
	
	if (THIS_SCRIPT == '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_SCRIPT, 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_SCRIPT, array('newthread', 'newreply'))) 
	{
		$hidetag['canview'] = true; // allowed if [user is making a post]
	}
	
	if (in_array(THIS_SCRIPT, 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_SCRIPT == 'search')
	{
		$forumid = $post['forumid'];
	}
	
	$threadid = (is_array($thread) ? $thread['threadid'] : $threadinfo['threadid']);
	
	if (THIS_SCRIPT == '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_SCRIPT, 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_SCRIPT, array('newthread', 'newreply'))) 
	{
		$hidetag['canview'] = true; // allowed if [user is making a post]
	}
	
	if (in_array(THIS_SCRIPT, 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');
تفتح ملف clientscript/vbulletin_textedit.js

تبحث عن
كود:
			case 'PHP':
			{
				this.apply_format('removeformat');
			}
وتضع تحته
كود:
			break;			
			case 'HIDE':
			case 'SHOWTOGROUPS':
			{
				useoption = true;
			}
انتهينا من تعديل الملفات

تعديل القوالب

تفتح قالب editor_toolbar_on

تبحث عن