Previous Thread
Next Thread
Print Thread
Rate Thread
#118718 05/07/2001 5:05 AM
Joined: May 2001
Posts: 14
Junior Member
Junior Member
Offline
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 !

Sponsored Links
#118719 05/11/2001 6:51 AM
Joined: May 2001
Posts: 14
Junior Member
Junior Member
Offline
Joined: May 2001
Posts: 14
Hum... no one knows it what files is the ubb code ?

Please help !

#118720 05/11/2001 7:51 AM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
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/(.+?)/
    $1
    /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 ]

  • #118721 05/11/2001 7:52 AM
    Joined: Feb 1999
    Posts: 1,379
    cal Offline
    Programmer
    Programmer
    Offline
    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 smile

    #118722 05/11/2001 7:55 AM
    Joined: Feb 1999
    Posts: 1,379
    cal Offline
    Programmer
    Programmer
    Offline
    Joined: Feb 1999
    Posts: 1,379
    You beat me to the post there LK, but here's a perl hint for speed. change
    Code
    code:
    to:
    Code
    code:
    Making perl capture all 3 parts slows the regexp down.

    Just a thought smile

    Sponsored Links
    #118723 05/11/2001 8:44 AM
    Joined: Mar 2001
    Posts: 7,394
    LK Offline
    Admin / Code Breaker
    Admin / Code Breaker
    Offline
    Joined: Mar 2001
    Posts: 7,394
    ok, changed it smile
    and it's supposed to be:
    Code
    code:
    right?

    #118724 05/11/2001 9:20 AM
    Joined: Feb 1999
    Posts: 1,379
    cal Offline
    Programmer
    Programmer
    Offline
    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 smile

    #118725 05/11/2001 9:27 AM
    Joined: Mar 2001
    Posts: 7,394
    LK Offline
    Admin / Code Breaker
    Admin / Code Breaker
    Offline
    Joined: Mar 2001
    Posts: 7,394
    Is it okay now? confused

    #118726 05/16/2001 4:20 AM
    Joined: May 2001
    Posts: 14
    Junior Member
    Junior Member
    Offline
    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...

    #118727 05/20/2001 5:40 AM
    Joined: May 2001
    Posts: 6
    Junior Member
    Junior Member
    Offline
    Joined: May 2001
    Posts: 6
    This is one I could definitely use smile

    But, after following these instructions I'm not getting the desired results frown

    When I attempt to use the spoiler code:
    Code
    code:
    the text appears as usual, but when I click to edit the post I see this:
    Code
    code:

    It seems I'm almost there, but not quite... any help is much appreciated smile

    Sponsored Links
    #118728 05/20/2001 5:42 PM
    Joined: May 2001
    Posts: 6
    Junior Member
    Junior Member
    Offline
    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 laugh

    This is how it looks:
    [Linked Image]
    (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:

    ?)(.+?)(


    )/
    $2
    /isg;

    Cheers! smile

    [ May 20, 2001 05:50 PM: Message edited by: MsLedd ]

    #118729 05/21/2001 3:41 AM
    Joined: May 2001
    Posts: 14
    Junior Member
    Junior Member
    Offline
    Joined: May 2001
    Posts: 14
    That's great !!

    This one is working perfectly !!


    Link Copied to Clipboard
    Donate Today!
    Donate via PayPal

    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.
    Recommended Hosts
    We have personally worked with and recommend the following Web Hosts:
    Stable Host
    bluehost
    InterServer
    Visit us on Facebook
    Member Spotlight
    JAISP
    JAISP
    PA
    Posts: 449
    Joined: February 2008
    Forum Statistics
    Forums63
    Topics37,573
    Posts293,925
    Members13,849
    Most Online5,166
    Sep 15th, 2019
    Today's Statistics
    Currently Online
    Topics Created
    Posts Made
    Users Online
    Birthdays
    Top Posters
    AllenAyres 21,079
    JoshPet 10,369
    LK 7,394
    Lord Dexter 6,708
    Gizmo 5,833
    Greg Hard 4,625
    Top Posters(30 Days)
    Top Likes Received
    isaac 82
    Gizmo 20
    Brett 7
    WebGuy 2
    Morgan 2
    Top Likes Received (30 Days)
    None yet
    The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

     
    Powered by UBB.threads™ PHP Forum Software 8.0.0
    (Preview build 20221218)