miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
How To miniBB Support Forums / How To /   

Signature not displaying BBcode

Author elthane
Guest
#1 | Posted: 23 Nov 2005 23:37 
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
Registered
#2 | Posted: 23 Nov 2005 23:51 | Edited by: _Marco 
(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:00 
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
Registered
#4 | Posted: 24 Nov 2005 00:10 
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:20 
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:30 
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
Registered
#7 | Posted: 5 Jun 2006 18:26 
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
Registered
#8 | Posted: 5 Jun 2006 19:24 
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:49 
wow thx u :)

Author USB2.0
Guest
#10 | Posted: 12 Jun 2007 11:40 
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 Developer
#11 | Posted: 12 Jun 2007 14:04 | Edited by: Paul 
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:35 
oh thx Paul ;) you are the best :D

How To miniBB Support Forums / How To / Signature not displaying BBcode Top
Your Reply Click this icon to move up to the quoted message
 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
  Extend your miniBB-forums, attaching the images and files,
get the File and Picture Attachments add-on!
Galleries / Attachments Addon for miniBB