Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Pages : 1
Salut
Cette mod ajoute un bbcode qui permet de mettre des annotations ou références en bas de chaque message.
Un petit aperçu:
Cliquez ici
(Une adaptation en 1.4 viendra prochainement)
Modifications à faire dans les fichiers:
common.php
chercher 43:
@include PUN_ROOT.'config.php';
ajouter après:
$note_message = '';
$note_count = 0;parser.php
chercher 73:
$a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
ajouter après:
$a[] = '#\[note\]\s*#i';
$a[] = '#\s*\[/note\]#i';
chercher 78:
$b[] = '[code]$1[/code]'."\n";
ajouter après:
$b[] = '[note]';
$b[] = '[/note]';
chercher 99:
if (preg_match('#\[quote=("|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
message($lang_prof_reg['Signature quote/code']);
ajouter après:
elseif (preg_match('%\[/?(?:note)\b[^\]]*\]%i', $text))
{
message('No Note in signature');
}
chercher 260:
//
// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
//
ajouter avant:
function Note_mod($txt, $post_id)
{
global $note_message, $note_count;
$retour = '';
$note_count++;
$note = '<div id="note'.$post_id.'-'.$note_count.'"><a class="note_link" href="#backnote'.$post_id.'-'.$note_count.'">('.$note_count.')</a>: <span class="note_value">'.$txt.'</span></div>';
$retour = '<a class="note_link" href="#note'.$post_id.'-'.$note_count.'"><sup id="backnote'.$post_id.'-'.$note_count.'">('.$note_count.')</sup></a>';
$note_message .= $note;
return $retour;
}
chercher 303:
function do_bbcode($text)
remplacer:
function do_bbcode($text, $post_id = 0)
chercher 305:
global $lang_common, $pun_user;
remplacer:
global $lang_common, $pun_user, $note_message, $note_count;
chercher 332:
// This thing takes a while! :)
ajouter avant:
$pattern[] = '#\[note\](.*?)\[/note\]#es';
$replace[] = 'Note_mod(\'$1\', $post_id)';
chercher 375:
function parse_message($text, $hide_smilies)
remplacer:
function parse_message($text, $hide_smilies, $post_id = 0)
chercher 377:
global $pun_config, $lang_common, $pun_user;
remplacer:
global $pun_config, $lang_common, $pun_user, $note_message, $note_count;
$note_message = '';
$note_count = 0;
chercher 401:
$text = do_bbcode($text);
remplacer:
$text = do_bbcode($text, $post_id);
chercher 406:
$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
ajouter après:
if($note_message != null)
$note_message = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $note_message);
chercher 413:
$text = str_replace($pattern, $replace, $text);
ajouter après:
if($note_message != null)
$note_message = str_replace($pattern, $replace, $note_message);
chercher 436:
$text = str_replace('<p></p>', '', '<p>'.$text.'</p>');
ajouter après:
if($note_message != null)
{
$text .= '<hr class="note" />'.stripslashes($note_message);
}votre_style.css:
ajouter à la fin:
a.note_link
{
TEXT-DECORATION: none;
}Dernière modification par PascL (08-01-2012 00:56:01)
Bouh !
StarShip Renaissance
Hors ligne
Pages : 1