mercredi 4 février 2015 à 13:26
Merci Fifi69 de ta réponse, mais c'est là ou je bloque ! Je suis déjà allé voir cet exemple avant de poster mon message sur ce forum.
Je ne comprend pas bien ce que je dois faire avec mes codes pour que ça fonctionne correctement !
Mon premmier code en entier est :
[code] $SearchCode = array(
'quote' => '`(\[quote(=(.*?)\]|\]))(.+?)(\[/quote\])`iUe', //quote
'code1' => '`\
Code PHP ((.*?)\) :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
#####!!!#####
-
(.+?)[/code]`ie', //code
'code2' => '`[code](.+?)[/code]`ie', //code
'code3' => '`([^]])(<?php)(.+?)(?>)`iUe' //code php
);
-
$ReplaceCode = array(
'quote' => 'bb_cite(\'$1$4$5\')',
'code1' => "'<br /><div class=\"code_php_titre\" style=\"font-weight:bold;\">Code PHP ($1) : </div><div style=\"width:600px;max-height:450px;overflow:auto;margin:auto\" class=\"code_php\">'.bb_high('$2').'</div>'",
'code2' => "'<br /><div class=\"code_php_titre\" style=\"font-weight:bold;\">Code PHP : </div><div style=\"width:600px;max-height:450px;overflow:auto;margin:auto\" class=\"code_php\">'.bb_high('$1').'</div>'",
'code3' => '\'$1<br /><div class="code_php_titre" style="font-weight:bold;">Code PHP : </div><div style="width:600px;max-height:450px;overflow:auto;margin:auto" class="code_php">\'.bb_high(\'$2$3$4\').\'</div>\''
);
$texte = preg_replace_callback($SearchCode, $ReplaceCode, ' '.$texte);
-
#####!!!#####
?>
et le second est :
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
#####!!!#####
-
$replace = array(
'taille' => '<span style="font-size:$2px">$4</span>',
'panneau1' => '\'$1
<table cellspacing="0" cellpadding="0" style="border:0px;text-align:center;margin:auto;" summary="pancarte_haut1"><tbody><tr><td><img src="'.$UrlPancarteHaut.'" alt="Panneau haut" /></td></tr><tr><td class="panneau">$2</td></tr><tr><td><img alt="Pancarte" src="'.$UrlPancarte.'" /></td></tr></tbody></table>$3
\'',
'panneau2' => '\'$1
<table cellspacing="0" cellpadding="0" style="border:0px;text-align:center;margin:auto;" summary="pancarte_haut1"><tbody><tr><td><img src="'.$UrlPancarteHaut.'" alt="Panneau haut" /></td></tr><tr><td class="panneau">$2</td></tr><tr><td><img alt="Pancarte" src="'.$UrlPancarte.'" /></td></tr></tbody></table>$3
\'',
'panneau3' => '\'<table cellspacing="0" cellpadding="0" style="border:0px;text-align:center" summary="pancarte_haut1"><tbody><tr><td><img src="'.$UrlPancarteHaut.'" alt="Panneau haut" /></td></tr><tr><td class="panneau">$1</td></tr><tr><td><img alt="Pancarte" src="'.$UrlPancarte.'" /></td></tr></tbody></table>\'',
'puce' => '<ul><li style="margin-left:12px;">$1</li></ul>',
'puce2' => 'bb_liste(\'$2\',\'$5\')',
'surlign1' => '<span class="surlign">$1</span>',
'surlign2' => '<span style="background-color:$1">$2</span>',
'align1' => '<span style="float:left;width:100%;text-align:$1">$2</span><br style="clear:both" />',
'align2' => '<span style="float:left;width:100%;text-align:$1">$2</span><br style="clear:both" />',
'float' => '<span style="margin:5px;float:$1">$2</span>',
'u' => '<span style="text-decoration: underline;">$1</span>',
'glow1' => '<div style="width:100%;filter:glow(color=#000000,strength=1);">$1</div>',
'glow2' => '<div style="width:100%;filter:glow(color=$1,strength=1);">$2</div>',
'mail1' => "'<a style=\"cursor:pointer\" onclick=\"KmTo(\''.BrouilleMail('$1').'\')\"><img style=\"border:none;vertical-align:middle\" src=\"./modules/generateur/topho.php?a='.bb_email('$1').'\" alt=\"email anti-spam\" /></a>'",
'mail2' => "'<a href=\"javascript:void()\" onclick=\"KmTo(\''.BrouilleMail('$1').'\')\"><img style=\"border:none;\" src=\"./images/ico/mail.png\" alt=\"\" /> $2</a>'",
'mail3' => '\''.$aff_autres.'\'==\'0\' ? \'$1\':\'<a style="cursor:pointer" onclick="KmTo(\\\'\'.BrouilleMail(\'$1\').\'\\\')"><img style="border:none;vertical-align:middle" src="./modules/generateur/topho.php?a=\'.bb_email(\'$1\').\'" alt="email anti-spam" /></a>\'',
'font' => '<span style="font-family:$1">$2</span>',
'b' => '<span style="font-weight:bold">$1</span>',
'i' => '<span style="font-style:italic">$1</span>',
'barre' => '<strike>$1</strike>',
'color' => '<span style="color:$2">$3</span>',
'url1' => 'strlen(\'$2$3\') > $Limit ? \'$1<a class="bbcode_url" href="$2$3" target="_blank">Lien ICI</a>\' : \'$1<a class="bbcode_url" href="http://$2$3" target="_blank">$2$3</a>\'',
'url2' => 'strlen(\'$2$3$4\') > $Limit ? \'$1<a class="bbcode_url" href="\'.url_rw(\'$2$3$4\').\'" \'.($K_url_site=="$2$3"?\'\':\'target="_blank"\').\'>Lien ICI</a>\' : \'$1<a class="bbcode_url" href="\'.url_rw(\'$2$3$4\').\'" \'.($K_url_site=="$2$3"?\'\':\'target="_blank"\').\'>\'.url_rw(\'$2$3$4\').\'</a>\'',
'url3' => 'strlen(\'$1$2\') > $Limit ? \'<a class="bbcode_url" href="\'.url_rw(\'$1$2\').\'">Lien ICI</a>\' : \'<a class="bbcode_url" href="\'.url_rw(\'$1$2\').\'">$1$2</a>\'',
'url4' => '(strlen(\'$3\') > $Limit and \'$1$2\'==\'$3\') ?\'<a class="bbcode_url" href="\'.url_rw(\'$1$2\').\'">Lien ICI</a>\':\'<a class="bbcode_url" href="\'.url_rw(\'$1$2\').\'">$3</a>\'',
'url5' => 'strlen(\'$1$2\') > $Limit ? \'<a class="bbcode_url" href="$1$2" target="_blank">Lien ICI</a>\' : \'<a class="bbcode_url" href="$1$2" target="_blank">$1$2</a>\'',
'url6' => 'strlen(\'http://www$2\') > $Limit ? \'<a class="bbcode_url" href="http://www$1" target="_blank">Lien ICI</a>\':\'<a class="bbcode_url" href="http://www$1" target="_blank">http://www$1</a>\'',
'url7' => '(strlen(\'$1$2\') > $Limit and \'$1$2\'==\'$3\') ? \'<a class="bbcode_url" href="http://$1$2" target="_blank">Lien ICI</a>\':\'<a class="bbcode_url" href="http://$1$2" target="_blank">$3</a>\'',
'url8' => '(strlen(\'$2\') > $Limit and \'$1\'==\'$2\') ? \'<a class="bbcode_url" href="$2" target="_blank">Lien ICI</a>\':\'<a class="bbcode_url" href="$1" target="_blank">$2</a>\'',
'img1' => '\'<img style=" max-width:'.$K_OptionsBbcode['MaxSizeImgWidth'].'px;max-height:'.$K_OptionsBbcode['MaxSizeImgHeight'].'px;border:none;overflow:auto;" alt="\'.substr(strrchr(\'$1\',\'/\'),1).\'" title="\'.substr(strrchr(\'$1\',\'/\'),1).\'" src="http://www$1" />\'',
'img11' => '\'<img style=" max-width:'.$K_OptionsBbcode['MaxSizeImgWidth'].'px;max-height:'.$K_OptionsBbcode['MaxSizeImgHeight'].'px;border:none;overflow:auto;" alt="$1" title="$1" src="http://www$2" />\'',
'img2' => '\'<img style=" max-width:'.$K_OptionsBbcode['MaxSizeImgWidth'].'px;max-height:'.$K_OptionsBbcode['MaxSizeImgHeight'].'px;border:none;overflow:auto;" alt="\'.substr(strrchr(\'$1\',\'/\'),1).\'" title="\'.substr(strrchr(\'$1\',\'/\'),1).\'" src="$1" />\'',
'img22' => '\'<img style=" max-width:'.$K_OptionsBbcode['MaxSizeImgWidth'].'px;max-height:'.$K_OptionsBbcode['MaxSizeImgHeight'].'px;border:none;overflow:auto;" alt="$1" title="$1" src="$2" />\'',
'hr' => '<hr style="border:1px dotted" />',
'smil' => ' '
);
-
if (is_array($bbcode_noreplace))
{
foreach ($bbcode_noreplace as $BbcodeToDel)
{
unset($search[$BbcodeToDel]);
unset($SearchCode[$BbcodeToDel]);
unset($replace[$BbcodeToDel]);
unset($ReplaceCode[$BbcodeToDel]);
}
}
-
$texte = preg_replace_callback($search, $replace, ' '.$texte);
-
#####!!!#####
?>
Donc je ne coprend pas ce qu'il faut que je fasse avec toutes ces lignes. Je nage un peut.
Réponse ci-dessus postée le mardi 27 janvier 2015 : 08:13
Désolé de revenir à la charge, mais j'ai toujours mon problème et je suis complètement perdu pour le résoudre. C'est assez urgent SVP !!!!!!
Édité 5 fois - Dernière édition: 27/01/2015 à 08:23 Par freddy83170.