|
Joined: Oct 2006
Posts: 37
newbie
|
newbie
Joined: Oct 2006
Posts: 37 |
I would like a gramelin code of "<><" but am unable to make this work. I imagine that these are changed to < and > before it gets to the gramelin check.
Last edited by Rick; 11/08/2006 3:02 PM.
|
|
|
|
Joined: Oct 2006
Posts: 37
newbie
|
newbie
Joined: Oct 2006
Posts: 37 |
Darn, can't just move the translation of < and > to after the gramelin code because the gramelin code inserts <img> tags. This works, however. Around line 923 of libs/ubbthreads.inc.php, translate the smiley code characters also. Now they'll match the text, if they occur. Change: if ($smiley) {
@eval("\$string = $code;"); To: if ($smiley) {
$smiley = str_replace( '&', '&', $smiley );
$smiley = str_replace( '<', '<', $smiley );
$smiley = str_replace( '>', '>', $smiley );
@eval("\$string = $code;"); This works on my system. Another advantage of this is you can now safely insert $smiley into the ALT of the image tags that follow a few lines down (the first two). I've also inserted TITLEs to help explain the gramelins to anyone that doesn't recognize them. OK, so this is the entire IF statement:
if ($smiley) {
$smiley = str_replace( '&', '&', $smiley );
$smiley = str_replace( '<', '<', $smiley );
$smiley = str_replace( '>', '>', $smiley );
@eval("\$string = $code;");
$string = preg_quote($string,'/');
$smiley = preg_quote($smiley,'/');
for($i = 0; $i< 2; $i++) {
$body = preg_replace("/( |\n|^|\r\])$smiley( |$|\n|\r|\[)/i","\\1<img src=\"{$config['BASE_URL']}/images/graemlins/default/$image\" alt=\"$smiley\" title=\"$string\" height=\"$height\" width=\"$width\" />\\2",$body);
}
$body = preg_replace("/(\[|:)$string(\]|:)/i","<img src=\"{$config['BASE_URL']}/images/graemlins/default/$image\" alt=\"$smiley\" title=\"$string\" height=\"$height\" width=\"$width\" />",$body);
} else {
@eval("\$string = $code;");
$string = preg_quote($string,'/');
$body = preg_replace("/(\[|:)$string(\]|:)/i","<img src=\"{$config['BASE_URL']}/images/graemlins/default/$image\" alt=\"\" title=\"$string\" height=\"$height\" width=\"$width\" />",$body);
} This also fulfills this suggestion.
Last edited by GregH; 11/06/2006 7:25 AM.
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
Thanks for the changes. Will get this implemented and do some testing with it.
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
I sense a future <3 gremlin lol
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
0 members (),
868
guests, and
467
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|