Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2014-08-25 02:59:58

Ratburntro44
Member
Registered: 2011-11-16
Posts: 26

[MOD] Custom BBCode

v2.0.4
Fixed error with index code in install_mod.php

Allows administrators to add BBCode tags to their forums. This is a complete rewrite of my (removed) previous Custom BBCode Mod which had many problems in it.

This mod provides a simple interface for adding BBCodes with either one or two values. It caches the custom tags to optimize performance.

Be careful when adding tags. It is advised that you do not add tags which may pose security threats when used by users; this mod does not protect against possible security threats posed by your tags.

All tag names may only contain alphanumeric characters with no spaces.

While it was built for and only tested on FluxBB 1.5.6, it may work on earlier versions as well.

This mod is fully translatable. Anyone is welcome to submit language files for this mod.

---------------------------------
CHANGELOG

v2.0.4
Fixed error with index code in install_mod.php

v2.0.3
Added tag overloading: Two tags can have the same name if one is of type 1 and the other is of type 2.

v2.0.2
Fixed version number and release date.

v2.0.1
Made more characters allowed in value after '=' to allow for colors and URLs.

v2.0
Initial Release

---------------------------------

If you find any problems or have any suggestions with this mod, please post them below.

Last edited by Ratburntro44 (2014-08-27 22:10:30)

Offline

#2 2014-08-27 21:04:57

Octaviansan
New member
Registered: 2014-08-27
Posts: 2

Re: [MOD] Custom BBCode

I have a problem. Please help
When i try to go to install_mod.php and press Install this is what happends

imagizer.imageshack.us/v2/150x100q90/661/v6M9DN.png

File: /home/www/static/octa.ro/forum.octa.ro/public_html/bb/install_mod.php
Line: 53

FluxBB reported: Unable to create table "new_table_name"

Database reported: Key column 'some_column' doesn't exist in table (Errno: 1072)

Last edited by Octaviansan (2014-08-27 21:06:53)

Offline

#3 2014-08-27 22:02:33

Ratburntro44
Member
Registered: 2011-11-16
Posts: 26

Re: [MOD] Custom BBCode

Your image is very small (150x16 pixels) and I can't make out anything it says, could you possibly upload a larger version?

I'm looking into the problem right now.

Edit: I made a mistake and left some sample code for an index in the table. Uploading fixed version right now.

Edit 2: Should be fixed in new version. Tell me if there are any more problems.

Last edited by Ratburntro44 (2014-08-27 22:10:57)

Offline

#4 2014-08-27 23:29:23

Octaviansan
New member
Registered: 2014-08-27
Posts: 2

Re: [MOD] Custom BBCode

Yeah its ok. Thx youre very fast.
Keep up the good work.

Offline

#5 2016-10-31 23:35:48

Gamer
Member
Registered: 2013-10-09
Posts: 68
Website

Re: [MOD] Custom BBCode

i think this is notworking on the last version,can anyone confirm?

#
#---------[ 13. FIND (line: 853) ]---------------------------------------------
#

	$pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';


#
#---------[ 14. AFTER, ADD ]-------------------------------------------------
#

	foreach($pun_bbcode as $custom_tag) { // Add the Custom BBCodes to the patterns array
		if($custom_tag['type'] == 1)
			$pattern[] = '%\['.$custom_tag['name'].'\](.*?)\[/'.$custom_tag['name'].'\]%ms';
		else
			$pattern[] = '%\['.$custom_tag['name'].'=([0-9a-zA-Z.\-_+\(\)#@:; /]{1,200})\](.*?)\[/'.$custom_tag['name'].'\]%ms';
	}


#
#---------[ 15. FIND (line: 883) ]---------------------------------------------
#

	$pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';


#
#---------[ 16. AFTER, ADD ]-------------------------------------------------
#

	foreach($pun_bbcode as $custom_tag) { // Add the Custom BBCodes to the replace array
		$replace[] = $custom_tag['output'];
	}

?????

Last edited by Gamer (2016-10-31 23:38:25)

Offline

#6 2016-11-01 08:29:24

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,475
Website

Re: [MOD] Custom BBCode

I think it's now line 780.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#7 2016-11-01 11:33:24

Gamer
Member
Registered: 2013-10-09
Posts: 68
Website

Re: [MOD] Custom BBCode

can you edit the parser.php file please? im confuse with the steps...

Last edited by Gamer (2016-11-01 11:33:43)

Offline

#8 2016-11-01 15:39:46

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,475
Website

Re: [MOD] Custom BBCode

What do you mean by "edit the parser.php file"? Or do you mean the README?


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#9 2016-11-01 22:25:26

Gamer
Member
Registered: 2013-10-09
Posts: 68
Website

Re: [MOD] Custom BBCode

the instructions i think are wrong, i edited but at one point im stuck because it says to edit the same line, and give errors

the readme is wrong i think:

#
#---------[ 13. FIND (line: 853) ]---------------------------------------------
#

    $pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';


#
#---------[ 14. AFTER, ADD ]-------------------------------------------------
#

    foreach($pun_bbcode as $custom_tag) { // Add the Custom BBCodes to the patterns array
        if($custom_tag['type'] == 1)
            $pattern[] = '%\['.$custom_tag['name'].'\](.*?)\[/'.$custom_tag['name'].'\]%ms';
        else
            $pattern[] = '%\['.$custom_tag['name'].'=([0-9a-zA-Z.\-_+\(\)#@:; /]{1,200})\](.*?)\[/'.$custom_tag['name'].'\]%ms';
    }


#
#---------[ 15. FIND (line: 883) ]---------------------------------------------
#

    $pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';


#
#---------[ 16. AFTER, ADD ]-------------------------------------------------
#

    foreach($pun_bbcode as $custom_tag) { // Add the Custom BBCodes to the replace array
        $replace[] = $custom_tag['output'];
    }

Last edited by Gamer (2016-11-02 10:04:03)

Offline

Board footer

Powered by FluxBB