Tarih: 2009-03-11, 12:04:56 Mesaj konusu: Mesj İçeriginden Belirli Bölgeyi Gizleyin [hide]mesaj[/hide]
Kod:
############################################################################
## MOD HIDE | Made By / Auteur: Philiweb <http>
############################################################################
## Description : MOD "HIDE" (aka lockdown) - this mod allow users to hide
## a message via some "bbcodes", ex : [hide] message [/hide]. To see the
## hidden message, you must be a member and you must post a reply to
## the message...
############################################################################
## VERSION DE PHPBB : PHPBB 2.0 RC3 - RC4 - 2.0.x (gold) - 2.0.4 |02/2003|
############################################################################
## You can find the last versions and informations here on the official
## website (in English and French) :
## http://membres.lycos.fr/philiweb/accueil.php?num=15
## Info : There is also some pre-modified files if you have difficulties !
############################################################################
## And you can find some modifications to "hide" mod here :
## http://membres.lycos.fr/philiweb/accueil.php?num=23
## new : version 4 => administrators and moderators can see "hidden
## messages" immediatly...)
############################################################################
## Demo : http://membres.lycos.fr/philiweb/forums/viewtopic.php?t=167
############################################################################
## This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
############################################################################
There is 7 files to modify :
1 - posting.php
2 - viewtopic.php
3 - search.php
4 - topic_review.php // in the "/includes" directory
5 - bbcode.php // in the "/includes" directory
6 - bbcode.tpl // in the Templates/{Used template}/ directory
7 - posting_body.tpl // in the Templates/{Used template}/ directory
This mod is easy to install. (20 mn)
------------------
1 - In posting.php
------------------
if( !$userdata['session_logged_in'] ) {$message = hide_in_quote($message);}
else { $sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
if(!$db->sql_numrows($resultat)) {$message = hide_in_quote($message);}
}
--------------------
2 - In viewtopic.php
--------------------
Find
//
// Generate a 'Show posts in previous x days' select box. If the postdays var is POSTed
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
Add below
$valid = FALSE;
if( $userdata['session_logged_in'] ) {
$sql = "SELECT p.poster_id, p.topic_id
FROM " . POSTS_TABLE . " p
WHERE p.topic_id = $topic_id
AND p.poster_id = " . $userdata['user_id'];
$resultat = $db->sql_query($sql);
$valid = $db->sql_numrows($resultat) ? TRUE : FALSE;}
/**
* Does second-pass bbencoding. This should be used before displaying the message in
* a thread. Assumes the message is already first-pass encoded, and we are given the
* correct UID as used in first-pass encoding.
*/
Add this functions
function hide_in_quote($text)
{
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","--- phpBB : The Protected Message is not copied in this quote ---", $text);
return $text;
}
function bbencode_third_pass($text, $uid, $deprotect)
{
global $bbcode_tpl;
// pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).
// This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.
$text = " " . $text;
// First: If there isn't a "[" and a "]" in the message, don't bother.
if (! (strpos($text, "[") && strpos($text, "]")) )
{
// Remove padding, return.
$text = substr($text, 1);
return $text;
}
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();
<BEGIN>
</span>
<table>
<tr>
<td><span><b>Protected Message:</b></span></td>
</tr>
<tr>
<td>
<center>--- If you are a *registered user* : you need to post in this topic to see the message ---</center>
</td>
</tr>
</table>
<span>
<END>
-----------------------
7 - In posting_body.tpl // in the Templates/{Used template}/ directory
-----------------------
This part add a button in the dialog box (newtopic,...).
In the list of "// Helpline messages", add :
h_help = "Hide: [hide]message[/hide] (alt+h)";
Find this line :
bbtags = new Array('[b]','[/b]'...
And add at the end :
'[hide]' and '[/hide]'
You will obtain something like this :
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[hide]','[/hide]');
Find
<td><span>
<input>
</span></td>
Add Below : (Don't forget to adapt the "addbbcode" numbers if neccesary ! (exemple: addbbcode18 -> addbbcode20, 20 -> 22, etc)
<td><span>
<input>
</span></td>
Next, you need to modify all the "addbbcodexx" in the rest of the file. (exemple : addbbcode20 -> addbbcode22)
That's all ! :-)
Philippe
IF YOU HAVE A PROBLEM ("undefined" instead of [hide]...) - Go on my website or contact me :
http://membres.lycos.fr/philiweb/download/hide/hackhide.php?ver=rc3&num=7&lang=en
Official page => http://membres.lycos.fr/philiweb/accueil.php?num=15
Denemek Istedim Fakat Kuramadım Kuran Varsa Bana da Göndersin
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız