miniBB ®

miniBB

®
Support Forums
  
 · Start · Sign in · Register · Search · Statistics · File Bank · Manual ·
How To miniBB Support Forums / How To /  
 

Signature not displaying BBcode

 
Author elthane
Guest
#1 · Posted: 23 Nov 2005 23:37Reply Quote
Ok, what have I done wrong here in the plugins.php?
Here's what I have at the moment:

/* Signatures */

function parseUserInfo_user_custom2($av){

/* Default version - replacing only [br] to breakes, no BB codes */
//$sig=str_replace("\n",'<br>',$av);

/* Version with standard BB codes + [br] to breakes */
require_once($GLOBALS['pathToFiles'].'bb_codes.php');
$admin=($GLOBALS['cols'][0]
==1?1:0);
$sig=enCodeBB(str_replace("\n",'<br>','<img>','<a>','<p>','<i>','<b>', '<u>',$av),$admin);

return $sig;
}

/* --Signatures */

Author _Marco
Partaker
#2 · Posted: 23 Nov 2005 23:51Reply Quote
(responce to your message 23 Nov 2005 23:23)

Dunno what you've done, but I did a little test at the testforum, http://minibb.org/

[img]http://i8.photobucket.com/albums/a28/x_wolven_x/vforum/siggy.png[ /img]

works, no problemo (beware to remove the space in [ /img] !)

the [color=darkred]"We can't [i]all[/i] be lion tamers.."[/color] might be the problem, cause [color=] is only allowed for the admin, as I remember correctly.

_Marco

Author elthane
Guest
#3 · Posted: 24 Nov 2005 00:00Reply Quote
Ooh, it's working now, excellente!
I removed all the rubbish from the str_replace line.

Thanks for your help :D

One more question: is there any way of allowing [color] tags for all users?

Author _Marco
Partaker
#4 · Posted: 24 Nov 2005 00:10Reply Quote
sure,

search in bb_codes.php for:

if($admin==1) {
$pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";
$replacement[]='<font color="\\1">\\2</font>';
}


and remove line 1 and 4

Read more about the color-options in the manual (scroll down a little).

With a little tweaking you could make a [color] tag yourself :-)

_Marco

Author elthane
Guest
#5 · Posted: 24 Nov 2005 00:20Reply Quote
Ahh, brilliant - thank you!

As for making my own tag.. too much of a php newb for that, in case it wasn't already obvious, lol.

Thanks again for all your help - really appreciate it :D

Becky Lovell,
Voulez-Vous.

Author Stokoko
Guest
#6 · Posted: 5 Jun 2006 16:30Reply Quote
this code

$pattern[]="/\[red\](.+?)\[\/red\]/i";
$replacement[]='<font color=\"#FF0000\">\\1</font>';


work only for one line of text :S

ej:

[ red] hi [ /red] work Fine

but

[ red] hi

lol

hey

[ /red] not work :(

Author _Marco
Partaker
#7 · Posted: 5 Jun 2006 18:26Reply Quote
Stokoko
this code work only for one line of text :S

Just tested, you are right.
Let me check where the error is.

_Marco

Author _Marco
Partaker
#8 · Posted: 5 Jun 2006 19:24Reply Quote
Hmpf, a small error. Use /is at the end of the first line.

$pattern[]="/\[red\](.+?)\[\/red\]/is";
$replacement[]='<font color=\"#FF0000\">\\1</font>';

_Marco

Author Stokoko
Guest
#9 · Posted: 5 Jun 2006 19:49Reply Quote
wow thx u :)

Author USB2.0
Guest
#10 · Posted: 12 Jun 2007 11:40Reply Quote
if($admin==1) {
$pattern[]="/\[font(#[A-F0-9]{6})\](.+?)\[\/font\]/is";
$replacement[]='<font color="\\1">\\2</font>';
}

how I can use it for certain users
if($USERID==3 Or 5) {

:S maybe?

Author Paul
Lead Lead Developer
#11 · Posted: 12 Jun 2007 14:04Reply Quote
if($admin==1 or in_array($GLOBALS['user_id'], array(3,5,7,1001) ) ) {

...

where 3,5,7,1001 are user IDs separated by comma.

Author USB2.0
Guest
#12 · Posted: 12 Jun 2007 22:35Reply Quote
oh thx Paul ;) you are the best :D

How To miniBB Support Forums / How To /
 Signature not displaying BBcode
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

BB code for the Bold StyleBB code for the Italic StyleBB Code for the PictureBB code for the URLUpload a File

  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Get the File and Picture Attachments add-on: extend your miniBB-forums, attaching images and files.