|
Joined: May 2001
Posts: 14
Junior Member
|
Junior Member
Joined: May 2001
Posts: 14 |
Hello,
Does anybody know how to create some custom ubb code ?
For example, I would like a [spoiler] tag to change the color of the text as the same as the background one (so that it appears invisible and you have to highlight it to see what is written).
But I can't find in what file is the ubb code generated...
Thanks for your help !
|
|
|
|
Joined: May 2001
Posts: 14
Junior Member
|
Junior Member
Joined: May 2001
Posts: 14 |
Hum... no one knows it what files is the ubb code ?
Please help !
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
############## # OPEN ubb_lib.cgi # ############## FIND ==== $_[0] =~ s/([*])/ /isg;
ADD BELOW ========
$_[0] =~ s//$1/isg;
################### # OPEN ubb_lib_posting.cgi # ###################
FIND ====
$_[0] =~ s//[*]/isg;
ADD BELOW ======== $_[0] =~ s/(.+?)//isg;
########################### # Upload the file, clear your cache, etc.
If you want it to be a java icon when you post a new message, change public_common.pl, but I don't think it will look pretty nice. Also, you can change public_ubb_code.pl for ubb code help.
[ May 11, 2001 09:26 AM: Message edited by: LK ]
|
|
|
|
Joined: Feb 1999
Posts: 1,379
Programmer
|
Programmer
Joined: Feb 1999
Posts: 1,379 |
The code for ubb->html conversion is in the UBBCode sub of ubb_lib.cgi. The code for html->ubb conversion (for editing etc.) is in the reverse_ubb_code sub in ubb_lib_posting.cgi. Just a thought 
|
|
|
|
Joined: Feb 1999
Posts: 1,379
Programmer
|
Programmer
Joined: Feb 1999
Posts: 1,379 |
You beat me to the post there LK, but here's a perl hint for speed. change to: Making perl capture all 3 parts slows the regexp down. Just a thought 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
ok, changed it  and it's supposed to be: right?
|
|
|
|
Joined: Feb 1999
Posts: 1,379
Programmer
|
Programmer
Joined: Feb 1999
Posts: 1,379 |
right. you can optimize the first regexp in the same way too. just put brackets round the bit you want to preserve, ie (.+?) and then use $1 in the substitution. Just a thought 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Is it okay now? 
|
|
|
|
Joined: May 2001
Posts: 14
Junior Member
|
Junior Member
Joined: May 2001
Posts: 14 |
Hum... it is still not working... The spoiler tag seems not to change the font color to the background color...
|
|
|
|
Joined: May 2001
Posts: 6
Junior Member
|
Junior Member
Joined: May 2001
Posts: 6 |
This is one I could definitely use  But, after following these instructions I'm not getting the desired results When I attempt to use the spoiler code: the text appears as usual, but when I click to edit the post I see this: It seems I'm almost there, but not quite... any help is much appreciated 
|
|
|
|
Joined: May 2001
Posts: 6
Junior Member
|
Junior Member
Joined: May 2001
Posts: 6 |
Well, in case anyone is interested... I have managed to successfully create a UBB spoiler tag for use on our forums This is how it looks: (although I think we'll change the color) And this is what I did: ############### # Added to ubb_lib.cgi # ############### $_[0] =~ s,( ), Spoiler:
$2
,isg; #################### # Added to ubb_lib_posting.cgi # #################### $_[0] =~ s/( Spoiler:
?)(.+?)(
)/ /isg; Cheers! [ May 20, 2001 05:50 PM: Message edited by: MsLedd ]
|
|
|
|
Joined: May 2001
Posts: 14
Junior Member
|
Junior Member
Joined: May 2001
Posts: 14 |
That's great !!
This one is working perfectly !!
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,575
Posts293,932
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|