Академический Документы
Профессиональный Документы
Культура Документы
#
#-----[ find ]---------------------------------------------
#
if( $bbcode_on )
{
$preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
}
#
#-----[ replace with ]-------------------------------------------
#
$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;}
if( $bbcode_on )
{
$preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
$preview_message = bbencode_third_pass($preview_message, $bbcode_uid,
$valid);
}
#
#-----[ find ]---------------------------------------------
#
#
#-----[ add below ]-------------------------------------------
#
#
#-----[ open 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;}
#
#-----[ find ]---------------------------------------------
#-----[ be sure to use a recent version of phpbb or you will not find this
part ]---------------------------------------------
#
if ($bbcode_uid != '')
{
$message = ($board_config['allow_bbcode']) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:$bbcode_uid/si",
'', $message);
}
#
#-----[ replace with ]-------------------------------------------
#
if ( $bbcode_uid != '' )
{
$message = ($board_config['allow_bbcode']) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:$bbcode_uid/si",
'', $message);
$message = bbencode_third_pass($message, $bbcode_uid, $valid);
}
#
#-----[ open serarch.php ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
//
// if the board has html off but the post has html
// on then we process it, else leave it alone
//
if ( $return_chars != -1 )
#
#-----[ replace with ]---------------------------------------------
#
//
// if the board has html off but the post has html
// on then we process it, else leave it alone
//
if( $return_chars == -1 )
#
#-----[ find ]---------------------------------------------
#
if ( $bbcode_uid != '' )
{
$message = ( $board_config['allow_bbcode'] ) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si',
']', $message);
}
#
#-----[ replace with ]---------------------------------------------
#
if ( $bbcode_uid != '' )
{
$message = ( $board_config['allow_bbcode'] ) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si',
']', $message);
$message = bbencode_third_pass($message, $bbcode_uid, false);
}
#
#-----[ open topic_review.php (in includes
directory) ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
//
// okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
if ( $row = $db->sql_fetchrow($result) )
{
#
#-----[ 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;}
#
#-----[ find ]---------------------------------------------
#
if ( $bbcode_uid != "" )
{
$message = ( $board_config['allow_bbcode'] ) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si',
']', $message);
}
#
#-----[ replace with ]---------------------------------------------
#
if ( $bbcode_uid != "" )
{
$message = ( $board_config['allow_bbcode'] ) ?
bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si',
']', $message);
$message = bbencode_third_pass($message, $bbcode_uid, $valid);
}
#
#-----[ open bbcode.php (includes
directory) ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
#
#-----[ add below ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
/**
* 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 before !!!! ]---------------------------------------------
#
function hide_in_quote($text)
{
global $lang;
$text =
preg_replace("#\[hide\](.*?)\[\/hide\]#si",$lang['modhide_quote'],$text);
return $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();
if ( $deprotect ) {
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['show'];
}
else
{
$patterns[0] = "#\[hide:$uid\](.*?)\[/hide:$uid\]#si";
$replacements[0] = $bbcode_tpl['hide'];
}
return $text;
}
#
#-----[ find ]---------------------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^
\?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' .
str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
#
#-----[ add below ]---------------------------------------------
#
//[hide]message[/hide]
$text = preg_replace("#\[hide\](.*?)\[\/hide\]#si","[hide:$uid]\\1[/hide:$uid]",
$text);
#
#-----[ open bbcode.tpl (template
directory) ]---------------------------------------------
#
#
#-----[ add at top ]---------------------------------------------
#
#
#-----[ open posting_body.tpl ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
<img border="0" src="mods/bbcode_box/images/spoil.gif" class="postimage"
name="spoil" type="image" onclick="bbcspoil()" onmouseover="helpline('spoil')"
alt="" />
#
#-----[ add after ]---------------------------------------------
#
<img border="0" src="mods/bbcode_box/images/hide.gif" class="postimage"
name="hide" type="image" onclick="bbchide()" onmouseover="helpline('hide')"
alt="hide" />
#
#-----[ open lang_main.php ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
>
#
#-----[ add before ]---------------------------------------------
#
// mod "hide"
$lang['modhide_title'] = 'protected message :';
$lang['modhide_info'] = '--- if you are a *registered user* : you need to post in
this topic to see the message ---';
$lang['modhide_quote'] = '--- phpbb : the protected message is not copied in this
quote ---';
#
#-----[ open add_bbcode.js ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
googlevid_help = "post a google video";
#
#-----[ add below ]---------------------------------------------
#
#
#-----[ find ]---------------------------------------------
#
var gvideo = 0;
#
#-----[ add below ]---------------------------------------------
#
var hide = 0;
#
#-----[ find ]---------------------------------------------
#
function bbclist() {
#
#-----[ add !!!!! before !!!!!! ]---------------------------------------------
#
function bbchide() {
var txtarea = document.post.message;
#
#-----[ open bbcode_box.js and perform same steps as for
add_bbcode.js ]---------------------------------------------
#
#
#-----[ create an icon for hide function, name it hide.gif and hide1.gif and put
it in mods/images folder ]---------------------------------------------
#