Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Learn XOOPS Core

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell chronolabs CHUNG Clicks content CĂN demo docek download Dresses evden eve facebook Fat floor Food for free Gateway Google Guide herre Home Honeypot HP Human HỘ IP iPhone jQuery Language List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon security Sentry site Smartphone Smoking Solution Spam stem Studio tdmcreate template The Theme themes web weight Wishcraft xoops Xortify XPayment ZendFramework

New Users

Registering user

# 137718

xxoopss

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 2007/5/7 20:27 uppercase BBcode doens't work?
Like the title says, why doesn't uppercase bbcode work and lowercase does? Is there any way I can fix this? I'm using newbb.

Top

Nakaka
Just popping in
Just popping in
Joined:
2007/5/6 22:00
Group:
Registered Users
Posts: 4
(Show More) (Show Less)


#2 Posted on: 2007/5/7 21:02 Re: uppercase BBcode doens't work?
BBCode is CaSe SeNsiTiVe. Unless you rewrite the class, you will need to use lowercase characters.

Top


Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.
JMorris
XOOPS is my life!
XOOPS is my life!
Joined:
2004/4/11 12:55
From 127.0.0.1
Group:
BANNED Users
Posts: 2557
(Show More) (Show Less)


#3 Posted on: 2007/5/7 21:08 Re: uppercase BBcode doenst work?
In most forums you can use uppercase, and it makes it very hard to copy and paste long tutorials.

Top

Nakaka
Just popping in
Just popping in
Joined:
2007/5/6 22:00
Group:
Registered Users
Posts: 4
(Show More) (Show Less)


#4 Posted on: 2007/5/7 21:17 Re: uppercase BBcode doenst work?
You can place a Feature Request at SF.net.

If you, or someone else has the skill to rewrite the class, you can submit your code at the Core Development Forums at SF.net for Core Dev review.

Top


Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.
JMorris
XOOPS is my life!
XOOPS is my life!
Joined:
2004/4/11 12:55
From 127.0.0.1
Group:
BANNED Users
Posts: 2557
(Show More) (Show Less)


#5 Posted on: 2007/5/8 0:57 Re: uppercase BBcode doenst work?
Its easier than it sounds..

you only have to open ../class/module.textsanitizer.php and add bbcodes, for example:

$patterns[] = "/[url=(['"]?)(http[s]?://[^"'<>]*)\1](.*)[/url]/sU";
        
$replacements[] = '<a href="\2" target="_blank">\3</a>';


just add after (or whereever you want)

$patterns[] = "/[URL=(['"]?)(http[s]?://[^"'<>]*)\1](.*)[/URL]/sU";
        
$replacements[] = '<a href="\2" target="_blank">\3</a>';


This made a new bbcode called URL in uppercases.

Works for all, just change to uppercase

If you want to add new bbcodes you can do it same way (dinamic sigs, etc..)

Top


Spanish Overclocking Community xoops based site : www.overclocking.es
3lr0n
Not too shy to talk
Not too shy to talk
Joined:
2004/3/13 12:38
Group:
Registered Users
Posts: 164
(Show More) (Show Less)


#6 Posted on: 2007/5/8 1:15 Re: uppercase BBcode doenst work?
here is something from my site . its basically does the same as above. but the example shown is the img tag.

Using Case Insensitive BBcodes In XooPS

Top


CBB / LatestNews / Publisher / XM-Spotlight
iHackCode
Module Developer
Module Developer
Joined:
2004/6/28 19:11
From Greater Seattle Area
Group:
Registered Users
Wiki Group
Posts: 993
(Show More) (Show Less)


#7 Posted on: 2007/5/8 10:54 Re: uppercase BBcode doenst work?
Here's some mods I've been using... Just replace the &xoopsCodeDecode function with this one in /class/module.textsanitizer.php
function &xoopsCodeDecode(&$text$allowimage 1)
{
    
// - added sub, sup, hr, ol (with list-style-type support), ul and made all bbcodes case insensitive
    // - changed [b],[i],[u] to use html styles instead of <b>,<i>,<u> respectively
    //   Notes:
    //     1) Default 2.0.16 theme style sheet defines <ul> and <li> list-styles which effect bullet types
    //     2) Supported <ol> list-style-type(s) vary by browser (e.g. IE supports lower-alpha, Firefox supports lower-latin)

    
$patterns = array();
    
$replacements = array();
    
//$patterns[] = "/[code](.*)[/code]/esU";
    //$replacements[] = "'<div class="xoopsCode"><code><pre>'.wordwrap(MyTextSanitizer::htmlSpecialChars('\1'), 100).'</pre></code></div>'";
    // RMV: added new markup for intrasite url (allows easier site moves)
    // TODO: automatically convert other URLs to this format if XOOPS_URL matches??
    
$patterns[] = "/[siteurl=(['"]?)([^"'<>]*)\1](.*)[/siteurl]/sUi";
    
$replacements[] = '<a href="'.XOOPS_URL.'/\2">\3</a>';
    
$patterns[] = "/[url=(['"]?)(http[s]?://[^"'<>]*)\1](.*)[/url]/sUi";
    
$replacements[] = '<a href="\2" target="_blank">\3</a>';
    
$patterns[] = "/[url=(['"]?)([Ff][Tt][Pp]?://[^"'<>]*)\1](.*)[/url]/sUi";
    
$replacements[] = '<a href="\2" target="_blank">\3</a>';
    
$patterns[] = "/[url=(['"]?)([^"'<>]*)\1](.*)[/url]/sU";
    
$replacements[] = '<a href="http://\2" target="_blank">\3</a>';
    
$patterns[] = "/[color=(['"]?)([a-zA-Z0-9]*)\1](.*)[/color]/sUi";
    
$replacements[] = '<span style="color#\2;">\3</span>';
    
$patterns[] = "/[size=(['"]?)([a-z0-9-]*)\1](.*)[/size]/sUi";
    
$replacements[] = '<span style="font-size\2;">\3</span>';
    
$patterns[] = "/[font=(['"]?)([^;<>*()"']*)\1](.*)[/font]/sUi";
    
$replacements[] = '<span style="font-family\2;">\3</span>';
    
$patterns[] = "/[email]([^;<>*()"']*)[/email]/sU";
    
$replacements[] = '<a href="mailto:\1">\1</a>';
    
$patterns[] = "/[[Bb]](.*)[/[Bb]]/sU";
    
$replacements[] = '<span style="font-weight: bold;">\1</span>';
    
$patterns[] = "/[[Ii]](.*)[/[Ii]]/sU";
    
$replacements[] = '<span style="font-style: italic;">\1</span>';
    
$patterns[] = "/[[Uu]](.*)[/[Uu]]/sU";
    
$replacements[] = '<span style="text-decoration: underline;">\1</span>';
    
$patterns[] = "/[[Dd]](.*)[/[Dd]]/sU";
    
$replacements[] = '<del>\1</del>';

    
$patterns[] = "/[sub](.*)[/sub]/sUi";
    
$replacements[] = '<sub>\1</sub>';
    
$patterns[] = "/[sup](.*)[/sup]/sUi";
    
$replacements[] = '<sup>\1</sup>';
    
$patterns[] = "/[hr]/sUi";
    
$replacements[] = '<hr />';
    
$patterns[] = "/[hr=([0-9]+)(.*)]/sUi";
    
$replacements[] = '<hr style="width: \1\2;" />';
    
$patterns[] = "/[list](.*)[/list]/sUi";
    
$replacements[] = '<ul>\1</ul>';
    
$patterns[] = "/[list=(.*)](.*)[/list]/sUi";
    
$replacements[] = '<ol style="list-style-type: \1;">\2</ol>';
    
$patterns[] = "/[li](.*)[/li]/sUi";
    
$replacements[] = '<li>\1</li>';

    
//$patterns[] = "/[li](.*)[/li]/sU";
    //$replacements[] = '<li>\1</li>';
    
$patterns[] = "/[[Ii][Mm][Gg] [Aa][Ll][Ii][Gg][Nn]=(['"]?)([Ll][Ee][Ff][Tt]|[Cc][Ee][Nn][Tt][Ee][Rr]|[Rr][Ii][Gg][Hh][Tt])\1]([^"()?&'<>]*)[/[Ii][Mm][Gg]]/sU";
    
$patterns[] = "/[[Ii][Mm][Gg]]([^"()?&'<>]*)[/[Ii][Mm][Gg]]/sU";
    $patterns[] = "/[[Ii][Mm][Gg] [Aa][Ll][Ii][Gg][Nn]=(['"]?)([Ll][Ee][Ff][Tt]|[Cc][Ee][Nn][Tt][Ee][Rr]|[Rr][Ii][Gg][Hh][Tt])\1 [Ii][Dd]=(['"
]?)([0-9]*)\3]([^"()?&'<>]*)[/[Ii][Mm][Gg]]/sU";
    
$patterns[] = "/[[Ii][Mm][Gg] [Ii][Dd]=(['"]?)([0-9]*)\1]([^"()?&'<>]*)[/[Ii][Mm][Gg]]/sU";
    if (
$allowimage != 1) {
        
$replacements[] = '<a href="\3" target="_blank">\3</a>';
        
$replacements[] = '<a href="\1" target="_blank">\1</a>';
        
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\4" target="_blank">\4</a>';
        
$replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\2" target="_blank">\3</a>';
    } else {
        
$replacements[] = '<img src="\3" align="\2" alt="" />';
        
$replacements[] = '<img src="\1" alt="" />';
        
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\4" align="\2" alt="\4" />';
        
$replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\2" alt="\3" />';
    }
// REMOVE THE SPACE BEFORE the word quote in the next line...
    
$patterns[] = "/[ quote]/sUi";
    
$replacements[] = _QUOTEC.'<div class="xoopsQuote"><blockquote>';
    
//$replacements[] = 'Quote: <div class="xoopsQuote"><blockquote>';
    
$patterns[] = "/[/quote]/sUi";
    
$replacements[] = '</blockquote></div>';
    
$text str_replace"x00"""$text );
    
$c "[x01-x1f]*";
    
$patterns[] = "/j{$c}a{$c}v{$c}a{$c}s{$c}c{$c}r{$c}i{$c}p{$c}t{$c}:/si";
    
$replacements[] = "(script removed)";
    
$patterns[] = "/a{$c}b{$c}o{$c}u{$c}t{$c}:/si";
    
$replacements[] = "about :";
    
$text preg_replace($patterns$replacements$text);
    return 
$text;
}

NOTE: You must delete a space (x020) in the code above (about 1/3 of the way up from the bottom of the code) before you 'cut-n-paste' this into the file. I had to do this so it would show okay in the forum

You'll note I've also added support for:
- [sub] & [sup]
- [hr] & [hr=xx] (where xx is width - can use either % or px)
- [list] (unordered lists)
- [list=xyz] (ordered list with list-style-type support)
- changed [b],[i],[u] to use html styles

Top

zyspec
Module Developer
Module Developer
Joined:
2004/9/21 8:28
From USA
Group:
Registered Users
Posts: 876
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]