Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on September 14, 2014, 03:10:14 PM

Title: Custom BBCodes Manager
Post by: dougiefresh on September 14, 2014, 03:10:14 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3699)



CUSTOM BBCODE MANAGER v2.8
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3699)



Introduction
This modification adds the ability to create custom Bulletin Board Code (bbcode) for your forum.

Admin Settings
The settings are found in SMF 2.0.x at:
o Admin -> Forum -> Posts and Topics -> Custom BBcode without SMF 2.1-Style Admin Menu (http://custom.simplemachines.org/mods/index.php?mod=3907) mod installed.
o Admin -> Configuration -> Features and Options -> Custom BBcode with SMF 2.1-Style Admin Menu (http://custom.simplemachines.org/mods/index.php?mod=3907) mod installed.

The settings are found in SMF 2.1 at:
o Admin -> Configuration -> Features and Options -> Custom BBcode

To add a custom tag, click the "Create New Tag".  You submit both the tag and upload a button for your new tag.

Image Restrictions
SMF 2.0: The image should be a 23 x 22 GIF with transparent background and no larger than 10kb.

SMF 2.1: The image should be a 16 x 16 PNG with transparent background and no larger than 10kb.

Compatibility Notes
This mod was tested on SMF 2.0.11, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Translators
o Spanish Latin: Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)
o Dutch: Fixit @ XPtsp.com

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/custom-bbcodes-manager/).

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Custom BBCodes Manager
Post by: langel on September 15, 2014, 01:38:35 PM
Great mod! Thank you  :)
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 10:17:01 AM
Hello,

I started using this module: thank you very much!

It works but I believe I found a couple of small bugs:

1) I use a fairly complex "HTML used for the tag" expression and I noticed that every time I try to modify an existing tag, the "HTML used for the tag" is truncated after the "{content}" token (the rest of the code I had entered is gone). The issue probably happens when your module fetches the replacement code for the user to edit, since the full code is actually executed after properly entered (however, if you click modify then save, the truncated code is saved and the bbcode fails)

2) I coded a bbcode that could work as "unparsed content" however if I pick "unparsed content" the bbocde does not work. If I pick "unparsed equals" however the bbcode works (even if I never use the equal expression and use only the [tag] ... [/tag] expression)

3) when I pick "unparsed equals" the BBCode summary list shows my new bbcode with "Tag type" = "unparsed_equals" but with "BBCode Usage" = "[pgn=xyz]parsed content[/pgn]"; probably a typo somewhere?

Thanks for the very useful module!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 10:53:36 AM
Interesting bug reports.... Lemme investigate them....  Please tell me the HTML code and settings used with the attempted bbcode.  Thanks!
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 10:58:03 AM
Quote from: dougiefresh on September 29, 2014, 10:53:36 AM
Please tell me the HTML code and settings used with the attempted bbcode.
It's not a trivial BBCode :-(

The description how to create the BBCode using your module (I just updated it from a previous version using the old module for smf 1.1.x) is here:
https://code.google.com/p/pgn4web/wiki/User_Notes_simplemachines

Here is the proof that the whole machinery actually works:
http://pgn4web-test.casaschi.net/simplemachines/

Thanks!
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 11:09:44 AM
Also another small remark: it seems that when you use the "post preview" button while composing a post, the bbcode does not take effect in the preview.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 11:17:48 AM
Uploaded v1.1 - September 29th, 2014
o Fixed bugs that corrupted BBcode HTML codes upon modifying the BBcode.
o Fixed typo relating to BBCode usage in the Custom BBCodes UI page.
o Added English UTF8 language file.

This version does not cover point # 2 found in this post (http://www.simplemachines.org/community/index.php?topic=527734.msg3748653#msg3748653).  Mod is upgradable to v1.1 from v1.0.



Quote from: pgn4web on September 29, 2014, 10:17:01 AM
1) I use a fairly complex "HTML used for the tag" expression and I noticed that every time I try to modify an existing tag, the "HTML used for the tag" is truncated after the "{content}" token (the rest of the code I had entered is gone). The issue probably happens when your module fetches the replacement code for the user to edit, since the full code is actually executed after properly entered (however, if you click modify then save, the truncated code is saved and the bbcode fails)
Thank you for pointing this bug out.  It has been fixed.  Explanation removed due to security concerns....

Quote from: pgn4web on September 29, 2014, 10:17:01 AM
2) I coded a bbcode that could work as "unparsed content" however if I pick "unparsed content" the bbocde does not work. If I pick "unparsed equals" however the bbcode works (even if I never use the equal expression and use only the [tag] ... [/tag] expression)
I based the bbcode parsing method on the contents of Sources/Subs.php, because the parsing engine has to be able to parse what I send it.  I will try to build a help file explanation so that these are understood better, if possible....

Quote from: pgn4web on September 29, 2014, 10:17:01 AM
3) when I pick "unparsed equals" the BBCode summary list shows my new bbcode with "Tag type" = "unparsed_equals" but with "BBCode Usage" = "[pgn=xyz]parsed content[/pgn]"; probably a typo somewhere?
Typo has been fixed.  Thank you for pointing it out.

Quote from: pgn4web on September 29, 2014, 11:09:44 AM
Also another small remark: it seems that when you use the "post preview" button while composing a post, the bbcode does not take effect in the preview.
Lemme look into this one as well....
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 11:29:48 AM
Quote from: dougiefresh on September 29, 2014, 11:17:48 AM

Quote from: pgn4web on September 29, 2014, 10:17:01 AM
1) I use a fairly complex "HTML used for the tag" expression and I noticed that every time I try to modify an existing tag, the "HTML used for the tag" is truncated after the "{content}" token (the rest of the code I had entered is gone). The issue probably happens when your module fetches the replacement code for the user to edit, since the full code is actually executed after properly entered (however, if you click modify then save, the truncated code is saved and the bbcode fails)
Thank you for pointing this bug out.  It has been fixed.  Explanation removed due to security concerns....


I updated to v1.1 of your module but I still see the "HTML used for the tag" truncated every time I try to modify my bbcode. There might be something more to fix...
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 01:00:58 PM
One more bug report: if I click the "disable" link for a given tag in the custom bbcode list something weird happen: a "blank bbcode" gets added into the list and the intended bbcode does not get disabled.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 01:06:41 PM
Uploaded v1.2 - September 29th, 2014
o Added code so that "parsed content" tags are recognized properly by BBcode parser.
o Fixed bug so that Custom BBCode UI properly displays HTML that the bbcode will use.

Here's what was happening with the truncated HTML line: The code was outputting the HTML correctly to the browser, but the BROWSER was misinterpreting the block of code as stuff it should execute....  Converting the HTML line to html entities solved the problem.



Quote from: pgn4web on September 29, 2014, 01:00:58 PM
One more bug report: if I click the "disable" link for a given tag in the custom bbcode list something weird happen: a "blank bbcode" gets added into the list and the intended bbcode does not get disabled.
Dangit...  A few more minutes earlier and I wouldn't have uploaded this version  :-[  Oh well....  Confirmed.  Lemme look into it.
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 01:16:21 PM
Quote from: dougiefresh on September 29, 2014, 01:06:41 PM
Added code so that "parsed content" tags are recognized properly by BBcode parser.
I'm not sure about this one. It might be that I do not understand the difference between parsed content and unparsed content. I thought that the unparsed option would just take the input between the tags as-is without further manipulation while the parsed option might do some manipulation (processing other bbcodes for instance?).
Anyway, with your 1.2 my tag works if defined as "parsed content" and does not work as "unparsed content" (in this case the plain text inbetween tags is show). Not sure, this might actually be the correct behaviour...

Quote from: dougiefresh on September 29, 2014, 01:06:41 PM
Fixed bug so that Custom BBCode UI properly displays HTML that the bbcode will use.
OK, this is fixed now.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 01:26:29 PM
Well, the bbcode parser in Sources/Subs.php interprets an empty bbcode-type field as "parsed_content".  Having "parsed_content" in the bbcode type field does not default it to the proper handling as a "parsed content" type within the parser.  Only by removing the "ctype" field from the array if it contains "parsed_content" does it correctly interpret it as such.  Remember, we are trying to make the parser work for us, but we have to conform to it's expections....  (Plus I'm not rewriting nor altering that mess of a parser....  O:) )

I still need to do some research on how everything behaves (or doesn't :P )  Then maybe I can explain why it does what it does....

Hope this helps....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 02:59:04 PM
Quote from: pgn4web on September 29, 2014, 01:00:58 PM
One more bug report: if I click the "disable" link for a given tag in the custom bbcode list something weird happen: a "blank bbcode" gets added into the list and the intended bbcode does not get disabled.
The v1.3 update resolves this bug report.  Thank you for reporting it.

Quote from: pgn4web on September 29, 2014, 10:17:01 AM
2) I coded a bbcode that could work as "unparsed content" however if I pick "unparsed content" the bbocde does not work. If I pick "unparsed equals" however the bbcode works (even if I never use the equal expression and use only the [tag] ... [/tag] expression)
Version 1.3 does not resolve this "bug" yet.  Thank you for your patience....
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 02:59:45 PM
Quote from: dougiefresh on September 29, 2014, 01:26:29 PM
Well, the bbcode parser in Sources/Subs.php interprets an empty bbcode-type field as "parsed_content" .... Hope this helps....
I looked at the code but I'm a bit lost.
I could not find anywhere an explanation of what does "parsed content" means and what "unparsed content" means.

On another note, when adding the icon to the post editor, it always adds the equal sign after the tag [mynewtag=] ... [/mynewtag] even when type is "parsed content" then with the equal the bbcode does not work.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 03:07:39 PM
Quote from: pgn4web on September 29, 2014, 02:59:45 PM
I looked at the code but I'm a bit lost.
I could not find anywhere an explanation of what does "parsed content" means and what "unparsed content" means.
On both: You and me both....

Quote from: pgn4web on September 29, 2014, 02:59:45 PM
On another note, when adding the icon to the post editor, it always adds the equal sign after the tag [mynewtag=] ... [/mynewtag] even when type is "parsed content" then with the equal the bbcode does not work.
Wow....  Another bug report....  :-[   Lemme look into it.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 03:18:22 PM
Uploaded v1.3 - September 29th, 2014
o Fixed bug that made empty bbcode entries when attempting to disable/enable bbcodes...
o Removed equal sign from bbcode in editor...

Mod is upgradable from v1.0 thru v1.2 to v1.3.
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 03:48:14 PM
Quote from: dougiefresh on September 29, 2014, 03:18:22 PM
Fixed bug that made empty bbcode entries when attempting to disable/enable bbcodes...
Removed equal sign from bbcode in editor...
Thanks, both issues are gone.
...and this time no new bugs few seconds after your release!

Thanks.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 29, 2014, 04:06:46 PM
LOL!  Thanks for both the feedback and the bug reports, pgn4web!
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 29, 2014, 04:10:00 PM
Quote from: dougiefresh on September 29, 2014, 04:06:46 PM
LOL!  Thanks for both the feedback and the bug reports, pgn4web!
Actually... if I modify a bbcode, it seems the value of "Tag Description for Button" is not saved and shows always as empty :-(
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 30, 2014, 12:48:53 PM
Uploaded v1.4 - September 30th, 2014
o Fixed several bugs in code involving removing buttons from bbcodes....
o Added code to preserve the bbcode description within the database.
o Added code to remove bbcode button image from server upon deleting bbcode.

Hopefully, this updates solves all reported issues, with exception of #2 in this post (http://www.simplemachines.org/community/index.php?topic=527734.msg3748653#msg3748653)....
Title: Re: Custom BBCodes Manager
Post by: pgn4web on September 30, 2014, 01:10:38 PM
Quote from: dougiefresh on September 30, 2014, 12:48:53 PM
Hopefully, this updates solves all reported issues, with exception of #2 in this post (http://www.simplemachines.org/community/index.php?topic=527734.msg3748653#msg3748653)....
You might have forgotten the remark about post previews not translating the custom bbcodes...
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 30, 2014, 07:18:15 PM
Quote from: pgn4web on September 30, 2014, 01:10:38 PM
You might have forgotten the remark about post previews not translating the custom bbcodes...
Yeah, you're right....  I forgot that one....  I've looked through the code today and I honestly don't understand why you don't see the preview for the bbcode you created....  Will look some more tomorrow, but I'm tired and it's almost bedtime....
Title: Re: Custom BBCodes Manager
Post by: gnowak on October 16, 2014, 07:12:04 AM
I am trying to use this for youtube integration as I have done in the earlier Custom BBCode mod.

My HTML is:
<iframe frameborder='0' height='315' src='{content}' width='420'></iframe>

The output is:
<iframe allowfullscreen='' frameborder='0' height='315' src='<a href="https://www.youtube.com/watch?v=_6LDxNyYfag" class="bbc_link" target="_blank">https://www.youtube.com/watch?v=_6LDxNyYfag</a>' width='420'></iframe>

This obviously fails because the {content} which in this case is an URL is translated by SMF to include <a href... am I doing something wrong?

Thanks!

In addition I found that if I use multiple {content} strings in the html code, only the first {content} is parsed.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 18, 2014, 02:41:48 PM
Sorry for taking so long to get back to you.  Things have been hectic around here.

Hmmm...  Lemme think on how to resolve this.
Title: Re: Custom BBCodes Manager
Post by: gnowak on October 20, 2014, 12:24:52 PM
Thanks for the answer and your time.

My current work around is:

Manage Posts and Topics -> Bulletin Board Code Settings -> deactivate Automatically link posted URLs

But this breaks all automatic links in the forums unfortunately.

Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 26, 2014, 07:30:20 PM
I've been thinking about this problem for the last few days and have come to the conclusion that the only way I'm going to get the multiple {content} thingys to work properly is to rewrite the mod.... and it'll be a big rewrite  :(
Title: Re: Custom BBCodes Manager
Post by: gnowak on October 27, 2014, 02:13:53 PM
:-(

What do you think about the automatic URL-handling?

Thanks for your time!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 28, 2014, 07:24:59 PM
I think automatic URL handling is a nice feature when it works properly..... and it obviously doesn't in this case....
Title: Re: Custom BBCodes Manager
Post by: Burke ♞ Knight on November 26, 2014, 02:18:32 AM
When trying to do a closed bbc, since there is no content being added in the post, am I right in assuming that we replace the {content} fully with what we want to show, when the tag is used?

If so, when save, does not work, and when go back in to edit it, the "The HTML used for the tag:" box is empty.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 13, 2014, 11:27:47 AM
Sorry to have responded so late to your reply....  This mod will be getting a redesign in the coming week or so in order to fix these problems....
Title: Re: Custom BBCodes Manager
Post by: pgn4web on December 15, 2014, 03:00:26 AM
Is the plugin supposed/expected to be compatibile with the upcoming smf 2.1 release?
The plugin info page only mentions 2.0.x
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 15, 2014, 04:06:40 AM
This mod should work on 2.1 without much, if any, modification as it relies on hooks to implement it.....  I will change all my mods to work with 2.1 eventually...
Title: Re: Custom BBCodes Manager
Post by: Arantor on December 15, 2014, 06:02:24 AM
Why are people so desperate for mods to work on 2.1?

It's a beta version and I would strongly caution mod authors against spending too much time making mods work on a beta version when major changes will likely occur before RC. It was bad enough during the 2.0 RC phase, speaking as someone who had to spend a number of hours every single RC making changes for each mod - even the ones that used hooks.
Title: Re: Custom BBCodes Manager
Post by: mark87 on December 26, 2014, 03:40:18 PM
Trying to make a highlight text bbc code but can't get it to work using this HTML <span style="background:yellow">{TEXT}</span>

However doing so creates the word text in yellow before the area I am trying to highlight..also tried <span style="background-color: #FFFF00">{TEXT}</span>

Tried it as parsed ..unparsed etc. Any suggestions would be great
Title: Re: Custom BBCodes Manager
Post by: mark87 on December 26, 2014, 03:55:23 PM
Quote from: mark87 on December 26, 2014, 03:40:18 PM
Trying to make a highlight text bbc code but can't get it to work using this HTML <span style="background:yellow">{TEXT}</span>

However doing so creates the word text in yellow before the area I am trying to highlight..also tried <span style="background-color: #FFFF00">{TEXT}</span>

Tried it as parsed ..unparsed etc. Any suggestions would be great
fixed it !!!  Thank you for the mod !
Title: Re: Custom BBCodes Manager
Post by: Steve on December 26, 2014, 04:50:25 PM
What was the solution?
Title: Re: Custom BBCodes Manager
Post by: br360 on December 26, 2014, 05:04:05 PM
Quote from: Steve on December 26, 2014, 04:50:25 PM
What was the solution?

My guess is that where the code said {TEXT}, he deleted that and added the {content} in its place.
Title: Re: Custom BBCodes Manager
Post by: Steve on December 26, 2014, 05:08:45 PM
Ah, that would make sense. :)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 26, 2014, 07:11:43 PM
To me, it sounds like people are using the syntax of phpBB's custom bbcode manager and expecting it to work here....  Sounds like I've got a job ahead of me to adapt it to a "more like phpBB"-style bbcode manager.....
Title: Re: Custom BBCodes Manager
Post by: mark87 on December 27, 2014, 09:52:32 AM
This is what worked
Quote<span style="background-color: #FFFF00">{content}</span>
Title: Re: Custom BBCodes Manager
Post by: pgn4web on January 16, 2015, 01:07:04 PM
Just updated to 1.5, looks good.

One of the old issues seems to be solved: now the preview button actually applies the custom bbcode. Well done!

I have an issue however: when trying to update an existing bbcode I get an error message warning that "The bbcode you are attempting to insert already exists." and changes are not saved.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 16, 2015, 07:24:56 PM
v1.5 - December 13th, 2014
o License change to Simplified BSD.
o Replaced the BBCode existance check using SMF's own code...
o Added Dutch translation to the mod, courtesy of Fixit...
Title: Re: Custom BBCodes Manager
Post by: pgn4web on January 18, 2015, 06:58:22 AM
Looked around a bit more and it seems that with the new 1.5 version, each time I try saving a new bbcode, I get the error message "The bbcode you are attempting to insert already exists."
Even tried removing the module and all its data and re-installing.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 19, 2015, 06:35:15 PM
Lemme look into this issue....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 01, 2015, 01:21:33 PM
Uploaded v1.6 - Febuary 1st, 2015
o Fixed a nasty bug where existing custom BBcodes weren't allowed to be edited.
o If SMF 2.1-Style Admin Menu (http://custom.simplemachines.org/mods/index.php?mod=3907) is installed, this mod is installed under Configuration => Feature Settings.
o Changed code so that CustomBBCode.php not loaded until actually needed....
Title: Re: Custom BBCodes Manager
Post by: konef on February 07, 2015, 06:32:05 AM
Confirm

Quotewhen trying to update an existing bbcode I get an error message warning that "The bbcode you are attempting to insert already exists." and changes are not saved.

smf 2.0.9
Custom BBCodes Manager 1.6   
Title: Re: Custom BBCodes Manager
Post by: pro-pumper on February 08, 2015, 12:49:19 PM
always send me the error: "The bbcode you are attempting to insert already exists." and no save
Title: Re: Custom BBCodes Manager
Post by: Paracelsus on February 10, 2015, 07:43:04 AM
Quote from: pro-pumper on February 08, 2015, 12:49:19 PM
always send me the error: "The bbcode you are attempting to insert already exists." and no save

Same issue here using the most updated version of this MOD.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 11, 2015, 03:06:23 PM
I will look into this issue.  One question, though: What bbcode are you trying to create?  If it is already defined by either Sources/Subs.php or a hook, then redefinition of a bbcode isn't possible at this time.  You can easily find out what bbcodes are defined by looking at Admin => Forum => Posts and Topics => Bulletin Board Code.
Title: Re: Custom BBCodes Manager
Post by: Paracelsus on February 11, 2015, 05:51:46 PM
Quote from: dougiefresh on February 11, 2015, 03:06:23 PM
I will look into this issue.  One question, though: What bbcode are you trying to create?  If it is already defined by either Sources/Subs.php or a hook, then redefinition of a bbcode isn't possible at this time.  You can easily find out what bbcodes are defined by looking at Admin => Forum => Posts and Topics => Bulletin Board Code.

No, it's not on that list, I've checked. I can't create any kind of BBCode, keep getting that error the whole time.

Here's what I'm trying and what I get:
Title: Re: Custom BBCodes Manager
Post by: Paracelsus on February 11, 2015, 06:08:13 PM
Btw, I also get 3 errors:

http://www.forumscp.com/index.php?action=admin;area=postsettings;sa=custombbc;edit=-1;sesc
8: Undefined index: after
Ficheiro: /var/www/html/Sources/CustomBBCodes.php
Linha: 279


http://www.forumscp.com/index.php?action=admin;area=postsettings;sa=custombbc;edit=-1;sesc
8: Undefined index: before
Ficheiro: /var/www/html/Sources/CustomBBCodes.php
Linha: 279


http://www.forumscp.com/index.php?action=admin;area=featuresettings
8: Undefined index: sa
Ficheiro: /var/www/html/Sources/Subs-CustomBBCodes.php
Linha: 32
Title: Re: Custom BBCodes Manager
Post by: pro-pumper on February 12, 2015, 12:19:12 AM
Quote from: Paracelsus on February 11, 2015, 05:51:46 PM
Quote from: dougiefresh on February 11, 2015, 03:06:23 PM
I will look into this issue.  One question, though: What bbcode are you trying to create?  If it is already defined by either Sources/Subs.php or a hook, then redefinition of a bbcode isn't possible at this time.  You can easily find out what bbcodes are defined by looking at Admin => Forum => Posts and Topics => Bulletin Board Code.

No, it's not on that list, I've checked. I can't create any kind of BBCode, keep getting that error the whole time.

Here's what I'm trying and what I get:

are exactly the same mistakes that I have, I tried reinstalling and nothing
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 13, 2015, 09:19:34 AM
Uploaded v1.7 - Febuary 13th, 2015
o Fixed undefined variable error in Subs-CustomBBCodes.php
o Fixed some undefined array elements in CustomBBcodes.php
o Fixed several issues inside the bbcode_exists function in Subs-CustomBBCodesAdmin.php




@Everybody: I am unable to edit the first post at this time.

Quote from: konef on February 07, 2015, 06:32:05 AM
when trying to update an existing bbcode I get an error message warning that "The bbcode you are attempting to insert already exists." and changes are not saved.
Quote from: pro-pumper on February 08, 2015, 12:49:19 PM
always send me the error: "The bbcode you are attempting to insert already exists." and no save
Quote from: Paracelsus on February 10, 2015, 07:43:04 AM
Same issue here using the most updated version of this MOD.
Thank you for your bug reports.  I apologize for my oversight that lead to these errors.  I've corrected the mod and have uploaded it....




Quote from: Paracelsus on February 11, 2015, 05:51:46 PM
No, it's not on that list, I've checked. I can't create any kind of BBCode, keep getting that error the whole time.

Here's what I'm trying and what I get:
Okay, I see a few things wrong with the bbcode you're trying to build.  The content specifies the HTML content of the bbcode....  In order for this bbcode to be displayed correctly, you would need something like:
<a href="http://www.forumscp.com/wiki/index.php?title={content}">{content}</a>
Title: Re: Custom BBCodes Manager
Post by: Paracelsus on February 13, 2015, 07:41:45 PM
Now I got it working, but I don't seem to be able to create an effective BBCode.

So, what I want is to write for example ABCD in between tags and get a link like this: http://www.forumscp.com/wiki/index.php?title=ABCD If I put this html code <a href="http://www.forumscp.com/wiki/index.php?title={content}">{content}</a> and choose parsed content then i get the right link but {content} as text (and I want ABCD as text).
Title: Re: Custom BBCodes Manager
Post by: danster on March 25, 2015, 10:44:04 PM
hello..!

please anyone knows how to add custom bb code in correct way cos i'm using Custom_BBCodes_Manager_v1.7 mod
but i try to add may custom bb code but it's didn't take effect cos i tried to disable some bbcodes to show for guests but it'd didn't works  so please if some one know how to proceed that tell me

I'm using mods 1. Custom_BBCodes_Manager_v1.7 mod and 2. show_bbcode_to_guests-0.1.7  both..

I attached one image for reference...

Thank you...
Brgds..!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 06, 2015, 04:42:39 PM
Uploaded v1.8 - April 4th, 2015
o Updated for SMF 2.1 Beta 1f
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 08, 2015, 07:27:11 PM
@Everybody:  I want to apologize.  I'm not trying to ignore messages and/or requests.  I've been working a lot of hours at my workplace lately and haven't had much time to deal with issues.  I spent most of my 4-day Easter weekend trying to make every mod work with SMF 2.1 Beta 1....  Maybe it's futile, maybe it's not.  Either way, some (if not all) of the work has been done....

That having been said, I'm going to work on rewriting this mod to be more "friendly" towards bbcode creation, cause it definitely ain't that way right now....




@Danster:  If you disable a built-in bbcode within SMF's admin interface, that does not delete the bbcode, nor will it remove the bbcode from the internal bbcode list.  The mod checks to make sure that the bbcode you are creating does not already exist....

The picture you included doesn't assist me with what the bbcode you are attempting to create....  The content of the picture makes it appears that you're trying to create a duplicate HTML tag, which is HUGE risk to your forum!  I would NOT advise the creation of such a bbcode!
Title: Re: Custom BBCodes Manager
Post by: danster on April 08, 2015, 10:27:56 PM
Thank you for respond..

yes sorry for lack of details of question..so i'm asking that i want to add custom bbcode for not allow to view for guests
so like this codes " donload " " url " like this..

i wanted to add that bbcode when guest logging to my forum for them shows this massage instead of this words..

" Sorry, you are not allowed to see this part of the text. Please login or register"

so that is i wanted to know how to to dot...

Thank you
Best regards..!!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 09, 2015, 04:17:00 AM
Okay, I understand now.  This mod is for the creation of "simple" HTML bbcodes.  What you are trying to create cannot be made as a "simple" HTML construct without using JavaScript, which would reveal what you're trying to hide from guests it during a source view.  You NEED a mod and/or custom code in order to accomplish this objective....
Title: Re: Custom BBCodes Manager
Post by: 420Connect.co.uk on April 23, 2015, 01:47:50 PM
I've got:

Undefined index: area
for this line in /Sources/Subs-CustomBBCodes.php

if (($_GET['area'] == 'featuresettings' || $_GET['area'] == 'postsettings') && (isset($_GET['sa']) && $_GET['sa'] == 'custombbc'))

???

Anything obvious?
Title: Re: Custom BBCodes Manager
Post by: 420Connect.co.uk on April 24, 2015, 01:19:51 PM
Just to update on that, I noticed I had 1.7 installed but after uninstalling & upon trying to install 1.8 I'm getting:

3.   Execute Modification   install.xml      Modification parse error
4.   Execute Modification   install.xml      Modification parse error

Also, manual parsing seems to be failing too?  ???
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 24, 2015, 02:52:49 PM
Quote from: 420connect.info on April 23, 2015, 01:47:50 PM
Undefined index: area
for this line in /Sources/Subs-CustomBBCodes.php

if (($_GET['area'] == 'featuresettings' || $_GET['area'] == 'postsettings') && (isset($_GET['sa']) && $_GET['sa'] == 'custombbc'))
This bug was actually fixed as of the version 1.8 mod release.

Quote from: 420connect.info on April 24, 2015, 01:19:51 PM
Just to update on that, I noticed I had 1.7 installed but after uninstalling & upon trying to install 1.8 I'm getting:

3.   Execute Modification   install.xml      Modification parse error
4.   Execute Modification   install.xml      Modification parse error

Also, manual parsing seems to be failing too?  ???
Oh, dear....  I apologize about that!  I must have missed the fact that I renamed the install.xml file to install_20x.xml, in light of the fact that SMF 2.1 doesn't need these changes....  I'll upload an updated mod in a few minutes.... 
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 24, 2015, 02:57:51 PM
Uploaded v1.9 - April 24th, 2015
o Fixed package-info.xml so that it refers to the install_20x.xml file, not install.xml.
Title: Re: Custom BBCodes Manager
Post by: 420Connect.co.uk on April 25, 2015, 09:51:36 AM
Much appreciated dougie,

Many Thanks! :)
Title: Re: Custom BBCodes Manager
Post by: Schachazubi on April 27, 2015, 05:33:43 PM
Thank you for your Great Mod, your hard Work to solve the Bugs and for your Time you spend on this Mod.

Thx 2 pgn4web, too, cause his PGN Viewer is simply the Best (thx!!!) - and on his Website, he gives the Advise to install this BBC-Manager.

That way, i got two very great Features at once, Hand in Hand.


Greetings, Schachazubi
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 27, 2015, 07:08:21 PM
You're both welcome!  I hope you find this mod very useful....
Title: Re: Custom BBCodes Manager
Post by: Schachazubi on April 28, 2015, 03:40:07 AM
Onle little question, ^^

I sorted my common BBC Bottons in Sub-Editor.php.

But how can i change the position of the Manager-Coded Buttons? I didn t find something in the Sub-Editor.php.
I know the BBC-Manager Buttons are generated from the MySQL-DB.

Greetings, Schachazubi
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 28, 2015, 04:00:29 AM
Currently, there is no method to customize where the custom bbcode buttons are placed.  Let me see what I can do.
Title: Re: Custom BBCodes Manager
Post by: Schachazubi on April 28, 2015, 04:28:41 AM
Thank you, but i dont want to steal your time.

I only wanted to know how to do. Actually, it s ok to me, the way it looks like:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.computer-schult.com%2Fforum%2Ffiles%2Fwmesp_01.png&hash=62adc67ac4c9aa617b78283ef00e709774aa13f5)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 28, 2015, 02:55:58 PM
It wouldn't be "stealing" my time.  My custom bbcode manage isn't exactly friendly, as it has a steep learning curve to it.  Documentation on the SMF bbcode parser is kinda scarce, so it's worth my time to rewrite the mod (obviously retaining compatibility with older versions of the mod) to make it more user-friendly.... 

One of the features I can definitely look into is how to rearrange the bbcode buttons.  While I haven't done something similar, surely it can't be that difficult.  But at the moment, it's not a "high-priority" mod to update until I get a few other mods updated for SMF 2.1 (which this mod currently will work with) and/or necessary features added...
Title: Re: Custom BBCodes Manager
Post by: Walks Tall on April 28, 2015, 05:01:12 PM
Sorry to be a nuisance, I am testing this with a test site running 2.1 Beta1 and cannot figure out what I may have done wrong.

I imported the package and the system seemed to be fine with it but when I navigate to Features and Options/Custom BBCodes I am just seeing a duplicate of the Features and Options/General page.

Is there something else I should have done for this to be working on 2.1 Beta1, I realise you have a lot on your hands and do thoroughly regret troubling you.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 28, 2015, 06:34:10 PM
Quote from: Stogie Dog on April 28, 2015, 05:01:12 PM
Sorry to be a nuisance, I am testing this with a test site running 2.1 Beta1 and cannot figure out what I may have done wrong.

I imported the package and the system seemed to be fine with it but when I navigate to Features and Options/Custom BBCodes I am just seeing a duplicate of the Features and Options/General page.

Is there something else I should have done for this to be working on 2.1 Beta1, I realise you have a lot on your hands and do thoroughly regret troubling you.
This is interesting....  I can confirm this bug report.  Let me look into this one, cause I thought I had it working right before I posted it....
Title: Re: Custom BBCodes Manager
Post by: Walks Tall on April 29, 2015, 06:43:00 AM
Quote from: dougiefresh on April 28, 2015, 06:34:10 PM
This is interesting....  I can confirm this bug report.  Let me look into this one, cause I thought I had it working right before I posted it....

Ah, so good and bad, good I'm not going completely bonkers but bad I have raised a problem, sorry for the inconvenience but thank you kindly for looking into this, very much appreciated.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 29, 2015, 04:28:52 PM
Uploaded v1.10 - April 28th, 2015
o Added online version check to the Custom BBCode settings page.
o Readded install operations for SMF 2.1 so that Custom BBCode area shows up.
Title: Re: Custom BBCodes Manager
Post by: Walks Tall on April 30, 2015, 06:56:35 AM
Good heavens, that was incredibly fast, absolutely stellar support for your mod's, I am very much impressed and thank you kindly for doing this.

May I trouble you with a question, I have installed your image float mod as you know, it would be more than a trifle of a boon if I were able to add a couple of additional BBCodes so installing this could very much be of benefit. Should I uninstall the image float mod first, bit of a mystery to me all this coding stuff, I'm pretty good with carving pipes but coding leaves me in the dark, I a guessing not installing the image float mod before installing this may cause problems, am I a mile off in my guess there.

Thank you once again for your excellent work.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 30, 2015, 08:50:52 AM
Both mods should work together without conflict.  If there is a conflict (which I can't imagine how they might conflict), then let me know what is happening and I'll see what I can do.  Be aware that the custum bbcodes manager cannot modify an existing bbcode....
Title: Re: Custom BBCodes Manager
Post by: Walks Tall on April 30, 2015, 02:04:14 PM
Quote from: dougiefresh on April 30, 2015, 08:50:52 AM
Both mods should work together without conflict.  If there is a conflict (which I can't imagine how they might conflict), then let me know what is happening and I'll see what I can do.  Be aware that the custum bbcodes manager cannot modify an existing bbcode....

I had no conflicts but for the interim I have uninstalled the Manager, oh my was I not prepared for the fantastic level of awesomeness found in your mod, did I mention I was kind of backwards when it comes to coding and computer stuff. I was kind of hoping for a simpleton mod like that found in the phpBB BBCode function, just a real simple name the BBCode add the replacement html and you're done. Totally not prepared for needing to understand what those options are all about, hmmm, I can see your mod is absolutely fantastic but a trifle more complicated than I was hoping for. I shall stick to the simple image float and your youtube BBCode mods for now, ah which reminds me, a little question on that one for which I shall run along now to the appropriate thread to address that.

Thank you once again for your time and patience, very much appreciated.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on May 01, 2015, 07:09:47 PM
Uploaded v1.11 - May 1st, 2015
o Modified code to correctly reflect custom bbcode icon requirements for SMF 2.1.
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 06, 2015, 12:14:21 AM
Hi! I want to make a button for Facebook. Here's the test script.

[html]
<div class="fb-post" data-href="http://www.facebook.com/FacebookDevelopers/posts/10152128760693553" data-width="500"></div>
[/html]

How to write it down by using the {content}?
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 06, 2015, 03:12:26 PM
I have one more question - how to manage the location of the new button?
Title: Re: Custom BBCodes Manager
Post by: Schachazubi on May 07, 2015, 02:18:17 AM
Quote from: dougiefresh on April 28, 2015, 04:00:29 AM
Currently, there is no method to customize where the custom bbcode buttons are placed.  Let me see what I can do.

Replace {Content} with your Code, for the Facebook-Button. Dont forget to upload it with a 23x22px Button.
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 07, 2015, 03:02:22 AM
Thanks  :'(
Title: Re: Custom BBCodes Manager
Post by: Schachazubi on May 07, 2015, 11:26:21 AM
np  ;)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on May 08, 2015, 07:47:10 AM
Quote from: gorbi on May 06, 2015, 12:14:21 AM
Hi! I want to make a button for Facebook. Here's the test script.

[html]
<div class="fb-post" data-href="http://www.facebook.com/FacebookDevelopers/posts/10152128760693553" data-width="500"></div>
[/html]

How to write it down by using the {content}?
I would use this html code:
<div class="fb-post" data-href="http://www.facebook.com/FacebookDevelopers/posts/{content}" data-width="500"></div>
where {content} is the Facebook post ID you want to include.

Quote from: gorbi on May 06, 2015, 03:12:26 PM
I have one more question - how to manage the location of the new button?
At this time, there is no way to manage where the button is placed by the mod.
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 08, 2015, 09:04:22 AM
I use for facebook
<div class="fb-post" data-href={content} data-width="500"></div>.
for twitter
<blockquote class="twitter-tweet" lang="ru"><p lang="en" dir="ltr"></p><a  href={content} ></a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on May 08, 2015, 09:44:15 AM
Quote from: gorbi on May 08, 2015, 09:04:22 AM
I use for facebook
<div class="fb-post" data-href={content} data-width="500"></div>.
for twitter
<blockquote class="twitter-tweet" lang="ru"><p lang="en" dir="ltr"></p><a  href={content} ></a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>.

Frankly, I wouldn't suggest using {content} in place of the URL.  It provides too many opportunities for users to abuse the forum for their own purpose and not as the bbcode was intended.  It would be less problematic to use this:
<div class="fb-post" data-href="http://www.facebook.com/FacebookDevelopers/posts/{content}" data-width="500"></div>
and use only the Facebook post ID as your bbcode content.  I would suggest the same for the Twitter post IDs.
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 08, 2015, 01:37:41 PM
Quote from: dougiefresh on May 08, 2015, 09:44:15 AM
Frankly, I wouldn't suggest using {content} in place of the URL.  It provides too many opportunities for users to abuse the forum for their own purpose and not as the bbcode was intended.  It would be less problematic to use this:
<div class="fb-post" data-href="http://www.facebook.com/FacebookDevelopers/posts/{content}" data-width="500"></div>
and use only the Facebook post ID as your bbcode content.  I would suggest the same for the Twitter post IDs.
Yes, it is true, but many users have a stereotype insert video service Urls
Title: Re: Custom BBCodes Manager
Post by: nomadikhan on May 24, 2015, 08:57:21 PM
I didn't see this particular error mentioned anywhere else in the thread.

Everything works fine with the mod with exception to deleting a tag...

Fatal error: Call to undefined function remove_gif_from_themes() in /home/content/63/11766663/html/Sources/Subs-CustomBBCodesAdmin.php on line 138


Is that something on my end or the mod's end?  When I installed every test was successful before installation.
Title: Re: Custom BBCodes Manager
Post by: nomadikhan on May 25, 2015, 07:23:17 AM
Quote from: nomadikhan on May 24, 2015, 08:57:21 PM
I didn't see this particular error mentioned anywhere else in the thread.

Everything works fine with the mod with exception to deleting a tag...

Fatal error: Call to undefined function remove_gif_from_themes() in /home/content/63/11766663/html/Sources/Subs-CustomBBCodesAdmin.php on line 138


Is that something on my end or the mod's end?  When I installed every test was successful before installation.

Since I cannot edit my first post for whatever reason... there's another bug in the mod.  Removing a button doesn't always remove the graphic.  Also, If I've uploaded (example names) Button A but decide I'd rather use Button B and so I upload Button B to replace it... no matter what it shows Button A.  Removing, eventually it works to remove, Button A then uploading Button B only shows Button A again.

Also, when deleting a bbcode via my php panel (as the delete button doesn't work, see error in post previous post above) I notice there's no field for what graphic the button is using... would be nice to have it there so I can manually edit the image location to display the correct image if I need to.
Title: Re: Custom BBCodes Manager
Post by: nomadikhan on May 25, 2015, 08:55:18 PM
In addition to my posts above lol, no matter what tag type I select, it will not parse anything except the default type.  Therefore, I cannot use any tags that are [tag=anything]..   the only tags that seem to work are plain [tag] types.
Title: Re: Custom BBCodes Manager
Post by: gorbi on May 30, 2015, 01:59:15 AM
Who have code to make a button for Instagram? Thanks
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on June 04, 2015, 07:39:33 PM
I'm sorry I haven't been able to get back to you lately, as I've been working somewhere around 100 hours in the last 10 days....  I'll look into the bug report(s) that y'all have reported....
Title: Re: Custom BBCodes Manager
Post by: nomadikhan on June 05, 2015, 07:30:58 PM
Quote from: dougiefresh on June 04, 2015, 07:39:33 PM
I'm sorry I haven't been able to get back to you lately, as I've been working somewhere around 100 hours in the last 10 days....  I'll look into the bug report(s) that y'all have reported....

Thanks so much!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on June 06, 2015, 09:42:29 AM
Quote from: gorbi on May 30, 2015, 01:59:15 AM
Who have code to make a button for Instagram? Thanks
Try this mod (http://www.xptsp.com/board/index.php?topic=544.0).  It hasn't been approved here at Simple Machines....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on June 06, 2015, 04:18:25 PM
Uploaded v1.12 - June 6th, 2015
o Fixed some issues with the code that adds and removes bbcode button images.

@nomadikhan:  Hopefully, this update will solve some of the problems you're experiencing.  I'm also going to start on a top-to-bottom rewrite of this mod, addressing the multiple complaints that this mod isn't "easy" to use....
Title: Re: Custom BBCodes Manager
Post by: nomadikhan on June 07, 2015, 08:52:30 AM
Quote from: dougiefresh on June 06, 2015, 04:18:25 PM
Uploaded v1.12 - June 6th, 2015
o Fixed some issues with the code that adds and removes bbcode button images.

@nomadikhan:  Hopefully, this update will solve some of the problems you're experiencing.  I'm also going to start on a top-to-bottom rewrite of this mod, addressing the multiple complaints that this mod isn't "easy" to use....

Thanks so much, will update and give it a try!
Title: Re: Custom BBCodes Manager
Post by: mm21xx on June 08, 2015, 02:22:56 AM
Heya!

Small issue up, I don't know if any of your have seen this?

I get an error like this when I try to access this specific mod:
Warning: Cannot modify header information - headers already sent

Any other portions of the boards works fine.

Any help appreciated!

Thanks!!
Title: Re: Custom BBCodes Manager
Post by: gorbi on June 08, 2015, 03:30:20 PM
Quote from: dougiefresh on June 06, 2015, 09:42:29 AM
Try this mod (http://www.xptsp.com/board/index.php?topic=544.0).  It hasn't been approved here at Simple Machines....
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on June 08, 2015, 07:02:16 PM
Quote from: gorbi on June 08, 2015, 03:30:20 PM
Quote from: dougiefresh on June 06, 2015, 09:42:29 AM
Try this mod (http://www.xptsp.com/board/index.php?topic=544.0).  It hasn't been approved here at Simple Machines....
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later
Attached is the mod.  Website is back up.  A fix is in the works for all mods that perform a version check in the event that this happens again....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 07, 2015, 11:58:37 AM
UPDATE:  :o You see, it's easier to fix other mods than it is to dive into the monster that is the SMF bbcode parser function....  But after much procrastination and the fixing of many other bug reports in other mods, the rewrite of this mod is finally beginning....
Title: Re: Custom BBCodes Manager
Post by: Yoss on September 18, 2015, 07:14:26 AM
Hi, i can't make a new bbcode tag with 2 variables :-[

I try, for example, a simple bbcode to open a URL in a new window by clicking on a text, and I am using this options in the mod:

  - BBCode: MYBBCODE
  - Tag type: Parsed Equals
  - Tag name: [tag=parsed content]parsed content[/tag]
  - Trim whitespace: (no trim)
  - Trim whitespace: unchecked
  - The HTML used for the tag:
<a href="{content}"onclick="window.open(this.href,'ventana_nueva','width=700,height=500,top=100,left=400'); return false;">{option2}</a>



But when I test the new tag witting in a message [MYBBCODE=Click here]http//:www.google.com[/MYBBCODE] it dosn't work properly

What am I doing wrong? Any idea? I test to change to all other Tag Types and with no results... :-\



Thank you very much

* PD. I know this feature automatically works with [URL] tag. This is only an example that shows I can't create a new bbcode tag with two variables :(




Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 18, 2015, 08:13:43 AM
I am in the process of rewwriting the mod to fix a few issu we and add many more.  I believe the issue you are having has been fixed for the upcoming version....
Title: Re: Custom BBCodes Manager
Post by: gorbi on September 18, 2015, 09:41:17 AM
Good news!!!!
Title: Re: Custom BBCodes Manager
Post by: Yoss on September 18, 2015, 02:17:07 PM
Thank you very much dougiefresh :)
Title: Re: Custom BBCodes Manager
Post by: Kissaki on September 26, 2015, 07:55:32 AM
So apparently, I can not use {content} twice in my template?
That really sucks ... :'(

And apparently, I can also not specify a template that does not contain {content}.
(I use "dead link" templates for embedded stuff where the service no longer exists)

I don't get this ...
Options don't seem to work either.

I thought I could migrate away from the SMF 1 mod customBBC, but this seems all too broken.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 26, 2015, 11:48:13 AM
Well, hopefully I'll get some time off soon to work on these things.  I'm so working something like 12 hour days lately....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 25, 2015, 07:01:19 PM
UPDATE:  I've almost got the VERSION 2.0 update completed.  It features AJAX for existing bbcode tag detection, AJAX for uploading and removing bbcode tag, added Help information for most of the fields, a new permission for managing custom bbcodes, and quite a few fixes for this mod!  I should be able to release it to the public in about a week, assuming my work schedule doesn't completely swamp me with multiple long shifts....

EDIT: I just wanted to say I'm sorry for the extremely long wait for some of these fixes to happen....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 26, 2015, 10:59:35 AM
Sorry for the long post, however, it is necessary to communicate about bug reports that have gone (possibly) unanswered.....

Quote from: nomadikhan on May 24, 2015, 08:57:21 PM
I didn't see this particular error mentioned anywhere else in the thread.

Everything works fine with the mod with exception to deleting a tag...

Fatal error: Call to undefined function remove_gif_from_themes() in /home/content/63/11766663/html/Sources/Subs-CustomBBCodesAdmin.php on line 138


Is that something on my end or the mod's end?  When I installed every test was successful before installation.
I believe this bug report was addressed in mod version 1.12, if I'm not mistaken....

Quote from: nomadikhan on May 25, 2015, 07:23:17 AM
Since I cannot edit my first post for whatever reason... there's another bug in the mod.  Removing a button doesn't always remove the graphic.  Also, If I've uploaded (example names) Button A but decide I'd rather use Button B and so I upload Button B to replace it... no matter what it shows Button A.  Removing, eventually it works to remove, Button A then uploading Button B only shows Button A again.

Also, when deleting a bbcode via my php panel (as the delete button doesn't work, see error in post previous post above) I notice there's no field for what graphic the button is using... would be nice to have it there so I can manually edit the image location to display the correct image if I need to.
I suspect it has something to do with your browser cache.  However, I'll address these bug report in Version 2.0.....




Quote from: Kissaki on September 26, 2015, 07:55:32 AM
So apparently, I can not use {content} twice in my template?
That really sucks ... :'(
It depends on which tag type you are using.  For example:
o With Unparsed Content, Unparsed Commas Content, and Unparsed Equals Content, you can because the HTML string is treated as a single string.
o With Parsed Equals, Unparsed Equals, Parsed Content, and Unparsed Commas, you cannot because the HTML string is seperated into two strings (before and after) that surround {content}.
o With Closed, you cannot because it is a single tag (aka [tag]) and cannot accept content parameters.

I do understand that the tag system was somehow broken in the version 1.x series of mods.  I have fixed it.

Quote from: Kissaki on September 26, 2015, 07:55:32 AM
And apparently, I can also not specify a template that does not contain {content}.
(I use "dead link" templates for embedded stuff where the service no longer exists)

I don't get this ...
Options don't seem to work either.

I thought I could migrate away from the SMF 1 mod customBBC, but this seems all too broken.
You are right.  A few things are broken within the version 1.x mod.  I'm trying to fix a lot of things....




Quote from: Yoss on September 18, 2015, 07:14:26 AM
Hi, i can't make a new bbcode tag with 2 variables :-[

I try, for example, a simple bbcode to open a URL in a new window by clicking on a text, and I am using this options in the mod:

  - BBCode: MYBBCODE
  - Tag type: Parsed Equals
  - Tag name: [tag=parsed content]parsed content[/tag]
  - Trim whitespace: (no trim)
  - Trim whitespace: unchecked
  - The HTML used for the tag:
<a href="{content}"onclick="window.open(this.href,'ventana_nueva','width=700,height=500,top=100,left=400'); return false;">{option2}</a>


But when I test the new tag witting in a message [MYBBCODE=Click here]http//:www.google.com[/MYBBCODE] it dosn't work properly

What am I doing wrong? Any idea? I test to change to all other Tag Types and with no results... :-\
Okay, I managed to get this bbcode working with mod Version 2.0.  I had to make two changes in order to get it working:
1) Changed {option2} to {option1}.
2) Changed Tag Type to Unparsed Commas Content.
For some reason, SMF screws up the URL within the content, so changing it to an unparsed content tag fixes it.  Why, I don't know...




Quote from: mm21xx on June 08, 2015, 02:22:56 AM
I get an error like this when I try to access this specific mod:
Warning: Cannot modify header information - headers already sent
This bug report has been addressed for Version 2.0!  I think it had something to do with my website being down at that time.

Quote from: nomadikhan on May 25, 2015, 08:55:18 PM
In addition to my posts above lol, no matter what tag type I select, it will not parse anything except the default type.  Therefore, I cannot use any tags that are [tag=anything]..   the only tags that seem to work are plain [tag] types.
This bug report has been addressed for Version 2.0!

Quote from: Walks Tall on April 30, 2015, 02:04:14 PM
I was kind of hoping for a simpleton mod like that found in the phpBB BBCode function, just a real simple name the BBCode add the replacement html and you're done.
Your wish for a "simple mode" will be granted in VERSION 2.0!  Woo-Hoo!  (I'll try to make it smart so it can guess the tag type....)
Title: Re: Custom BBCodes Manager
Post by: gorbi on November 26, 2015, 11:12:24 AM
when?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 26, 2015, 12:53:34 PM
Quote from: gorbi on November 26, 2015, 11:12:24 AM
when?
At this time, the button uploading stuff is broken, as well as the button preview code.  The button removal stuff hasn't been looked at yet.  The help system is almost done, although there are some gaps in the information....  Still want it now?

Quote from: dougiefresh on November 26, 2015, 10:59:35 AM
Quote from: Yoss on September 18, 2015, 07:14:26 AM
Hi, i can't make a new bbcode tag with 2 variables :-[

I try, for example, a simple bbcode to open a URL in a new window by clicking on a text, and I am using this options in the mod:

  - BBCode: MYBBCODE
  - Tag type: Parsed Equals
  - Tag name: [tag=parsed content]parsed content[/tag]
  - Trim whitespace: (no trim)
  - Trim whitespace: unchecked
  - The HTML used for the tag:
<a href="{content}"onclick="window.open(this.href,'ventana_nueva','width=700,height=500,top=100,left=400'); return false;">{option2}</a>


But when I test the new tag witting in a message [MYBBCODE=Click here]http//:www.google.com[/MYBBCODE] it dosn't work properly

What am I doing wrong? Any idea? I test to change to all other Tag Types and with no results... :-\
Okay, I managed to get this bbcode working with mod Version 2.0.  I had to make two changes in order to get it working:
1) Changed {option2} to {option1}.
2) Changed Tag Type to Unparsed Commas Content.
For some reason, SMF screws up the URL within the content, so changing it to an unparsed content tag fixes it.  Why, I don't know...
I missed one other thing.  Your link that you used in the post should read "http://www.google.com", not "http//:www.google.com".   Notice the LOCATION of the colon.....
Title: Re: Custom BBCodes Manager
Post by: ZweinsteinOnline Team on November 27, 2015, 08:32:33 AM
Hello,

I was just wondering, since I was trying to make my own color tags for my forum. Now we need to put in de right code [color=#code ] and end it with [/color ]

But my and my other admin would like to have tags that have the right color but that you only need to type [zwadderich ] your text [/zwadderich ]

And so on for the other hogwarts houses. I know the hexa codes, but I don't exactly know which tag type I need, and if it is really necessary to modify some thing in the Css sheets.

Could some-one please help me, or tell if it's more useful to wait for the next update of this mod.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 29, 2015, 06:39:00 PM
Uploaded v2.0 - November 29th, 2015
o Added "Create Simple Mode" to create new bbcodes using just tag, description and HTML.
o Added validation function to force content to start with "http://" or "https://" when option checked.
o Added membergroup permissions to control who can manage custom BBCodes.
o Added AJAX code to assist user in identifying pre-existing bbcode tags.
o Added AJAX code to upload or remove bbcode button images without saving the form.
o Added Javascript code so that file input box can easily be cleared.
o Added JavaScript code so that new bbcode tags with existing names cannot be submitted.
o Fixed "delete", "disable" and "modify" links on Custom BBCode list page.
o Fixed reversed image type detection based on whether mod is running under 2.0.x or 2.1.
o Fixed "bbcode_exists" function so that hook isn't removed for everybody during testing.
o Fixed image type and dimensions checking and made sure they are strictly enforced.
o Modified admin panel code so that bbcode tags are stored in lowercase letters.
o Modified button function so that button image not added to list if button image not present.
o All existing database tags are forced to lowercase.  For unknown reason, it is necessary.
o Added help language strings to clarify how the bbcode types are used.




@Everybody: I've been planning on writing some preview code and a few other features for v2.0, but work decided that I must work long hours right now....  So this update is MOST of what I had planned on giving you.....  Hope it helps someone!

Quote from: ZweinsteinOnline Team on November 27, 2015, 08:32:33 AM
But my and my other admin would like to have tags that have the right color but that you only need to type [zwadderich ] your text [/zwadderich ]
You would create a new tag called zwadderich, which whatever description you want, and a HTML replacement string like so:
<span style="color: $1;" class="bbc_color">{content}</span>
Make sure you replace $1 with your color code.
Title: Re: Custom BBCodes Manager
Post by: ZweinsteinOnline Team on November 30, 2015, 08:50:03 AM
Quote from: dougiefresh on November 29, 2015, 06:39:00 PM

You would create a new tag called zwadderich, which whatever description you want, and a HTML replacement string like so:
<span style="color: $1;" class="bbc_color">{content}</span>
Make sure you replace $1 with your color code.

Thank you so much for your help!
Title: Re: Custom BBCodes Manager
Post by: gorbi on November 30, 2015, 02:00:49 PM
2.0.11. It does not work, can not download the template
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 30, 2015, 04:03:13 PM
Quote from: gorbi on November 30, 2015, 02:00:49 PM
2.0.11. It does not work, can not download the template
I can't reproduce this report.  I installed the mod on a clean copy of 2.0.11 and have no problems accessing the template or new admin panel area.....
Title: Re: Custom BBCodes Manager
Post by: Kissaki on November 30, 2015, 06:22:52 PM
Thank you for your work despite your long working hours!
I appreciate it.

I did not update yet, but will probably do so at some point this week and take a look. :)
Again, thank you!
Title: Re: Custom BBCodes Manager
Post by: ariescapes on December 06, 2015, 04:28:31 AM
I'm having a small issue with the Mod. Over all it works great, but when I add an image for the BBCode, it doesn't show anywhere in the post edit/create view. It's not listed or shown anywhere. Is there a little code that will let me add it into the ~x.php file so they can populate?

(i'm going to do another re-read in case I missed this..)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 08, 2015, 04:04:09 AM
Is the button enabled in the modify bbcode screen?  If not, I will need to investigate this bug report.....
Title: Re: Custom BBCodes Manager
Post by: ariescapes on December 08, 2015, 04:21:27 AM
Unless I missed where it would be, all the BBCodes are "enabled", and those with buttons are just not showing up. :/
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 08, 2015, 07:47:04 PM
Uploaded v2.1 - December 8th, 2015
o Fixed issue where bbcode buttons do not show up on the post screen.




@ariescapes: The bug has been fixed.  Thank you for the bug report!
Title: Re: Custom BBCodes Manager
Post by: ariescapes on December 08, 2015, 07:51:29 PM
Excellent! What's the best quick edit for the fix so I don't have to re-install?
@dougiefresh
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 09, 2015, 08:49:16 AM
In Sources/Subs-CustomBBCodes.php, look for this line:
$tag = stripslashes($row['tag']);
and move it above this line:
if (!file_exists($boarddir . '/Themes/default/images/bbc/' . $tag . '.' . $ext))
Title: Re: Custom BBCodes Manager
Post by: ariescapes on December 09, 2015, 02:48:59 PM
Perfect! It works great! Thank you. :D
Title: Re: Custom BBCodes Manager
Post by: chrishicks on December 18, 2015, 09:16:55 PM
I was wondering if anyone had a code to create a [pdf] tag that I could use. I know there's a PDF mod but I'm hoping since I already have this installed I can do it here. Thanks in advance.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 22, 2015, 06:57:25 PM
Something like this should work for the HTML:
<iframe src="http://docs.google.com/gview?url={content}&embedded=true" width="500" height="600" frameborder="0"></iframe>
Can't give you the bbcode type, though....  Haven't had time to research it yet, as I'm working too many hours....
Title: Re: Custom BBCodes Manager
Post by: jfleming40 on January 06, 2016, 09:53:54 AM
Could someone help or point me in the right direction regarding creating a BBCode to embed clips from XboxClips.com or XboxDVR.com?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 06, 2016, 01:04:41 PM
Quote from: jfleming40 on January 06, 2016, 09:53:54 AM
Could someone help or point me in the right direction regarding creating a BBCode to embed clips from XboxClips.com or XboxDVR.com?
Based on what I can see at the XboxClips site, it looks like an iframe might work there....  You might be able to use this:
<iframe src="{content}/embed" width="800" height="600" frameborder="0"></iframe>
Where {content} is the XBoxClips or XBoxDVR URL....
Title: Re: Custom BBCodes Manager
Post by: jfleming40 on January 06, 2016, 02:02:01 PM
It's not working. This are my settings. Are these correct?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 06, 2016, 02:11:40 PM
No.  The first field is the NAME of the new tag you are creating.  In this case, it is xbox.  Nothing else goes on that first line.  Other than that, it looks right.....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 06, 2016, 05:18:56 PM
Quote from: jfleming40 on January 06, 2016, 09:53:54 AM
Could someone help or point me in the right direction regarding creating a BBCode to embed clips from XboxClips.com or XboxDVR.com?
Silly me...  Just created a bbcode mod to address this idea....  :P Embed XBox Video BBCode (http://www.xptsp.com/board/index.php?topic=608.0)
Title: Re: Custom BBCodes Manager
Post by: jfleming40 on January 06, 2016, 07:29:18 PM
Thank you!!
Title: Re: Custom BBCodes Manager
Post by: SirAlahn on May 09, 2016, 05:27:20 AM
Hey there, I recently installed this mod on my forum, which is running SMF 2.0.11. I'm having some trouble in that the tags I'm trying to make are saving as the improper tag type.

I'm trying to create a tag using the type Unparsed Equals -- (the [tag] format according to the mod). When I save the tag, however, the type is getting saved as Parsed Content ( [tag=xyz]parsed content[/tag] ) instead, and thus changing the output. This is occurring even though the Tag Type on the Custom BBcodes page is still listed as Unparsed Equals. Furthermore, the BBcode Usage on that same page is displaying the type as Unparsed Content. Since I'm not sure if this explanation is clear, I've also included a screenshot of the Custom BBCodes page for reference.

I would appreciate any potential assistance with this issue, since I'm not sure how to even approach fixing it.
Title: Re: Custom BBCodes Manager
Post by: -Rock Lee- on May 10, 2016, 05:19:04 PM
@dougiefresh He had a doubt whether the .xml file only do a whole or not what will decide as you see so you will leave the 2 versions of Latin Spanish ;D thanks for all that hard work 8)


Regards!
Title: Re: Custom BBCodes Manager
Post by: kherezae on May 24, 2016, 11:52:33 PM
Hello! This is a terrific mod, thank you so much for sharing it!

I seem to be having trouble getting a custom code to work correctly when the image bbcode is used within the content of the custom bbcode. I used the parsed equals tag type. It works perfectly for posts with bold, italics, font sizing, etc bbcode inside them, but if I try to put an image within the content, it just ends the tag above the image.

I'm sure this is probably just user error on my part, but do you have some idea what could be causing the problem or how I could fix it?

Thank you!
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on June 01, 2016, 03:31:27 PM
@Rock Lee: Your translations have been included for the next release!  Thank you!

@kherezae: Without knowing what bbcode you are trying to do, I cannot help you without more information....
Title: Re: Custom BBCodes Manager
Post by: nemwar on August 01, 2016, 10:28:19 AM
Hi Everybody,

i installed this mod to build an PokeDex for PokemonGO ...

As you can see in the attached picture i get it to work, so that the image is shown and is centered to the text.
But, there is something i don't understand i hope it can improve what i want.

Example BBCode:

[ABC=xyz][/ABC]   -   Can i use the xyz to add some more?

It would be fantastic if it would works nearly this:

[ABC=123,bug,attack25][/ABC]

And it brings up:

Picture of the Pokemon (this is working well) and then WP: 123, Type: Bug, Attack: 25

I hope it is understandable, because my englisch is not the best at all.

Thanks
NemWar
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on August 20, 2016, 06:18:29 PM
About a month ago, I've lost my job and have been severely depressed.  I need some help, so if you want to help, please do so!

I've uploaded this mod to GitHub here: https://github.com/douglasorend/Custom_BBCodes_Manager
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 26, 2016, 04:30:38 PM
Uploaded v2.2 - September 26th, 2016
o Added Spanish Latin translation by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee [BC]:  Thank you for the language files!  Sorry it took so long for me to include your language files into the mod...
Title: Re: Custom BBCodes Manager
Post by: aegersz on September 26, 2016, 09:06:25 PM
A SENSATIONAL idea for a mod ! ... and as it happens, I have been wanting a FLASH or BLINK BBCode for ages. Can you please supply your HTML code for this so i can try the mod out and implement your BLINK ?

i want to plug in the code as soon as you can furnish the details.

I have some javascript that works in a HTML page but don't know how to convert it into a BBCode. if your source works then i'd like to run it, please.
Title: Re: Custom BBCodes Manager
Post by: Arantor on September 27, 2016, 02:22:02 AM
There is a reason the blink HTML tag was removed by browsers, it's a horrible user experience.
Title: Re: Custom BBCodes Manager
Post by: aegersz on September 27, 2016, 05:38:57 AM
I thought it would be the best way to draw attention but if you think that its more annoying then perhaps I will drop it.

but for the sake of user education, is it still worth pursuing so I can get an idea of how BBCodes are built ?
Title: Re: Custom BBCodes Manager
Post by: aegersz on September 27, 2016, 10:01:42 AM
I think all I need is the code for the example in your image of how to build the BBCode.

I have been doing some research and each environment seems to have it's own special code to create the custom code, unless I am mistaken ... i am new to building them but do have a working example of a Javascript that uses the HTML div. function.

I think that by posting your code, us novices will gain a better insight as how to build the custom codes.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on September 27, 2016, 09:47:46 PM
Quote from: aegersz on September 26, 2016, 09:06:25 PM
A SENSATIONAL idea for a mod ! ... and as it happens, I have been wanting a FLASH or BLINK BBCode for ages. Can you please supply your HTML code for this so i can try the mod out and implement your BLINK ?
I found this little gem (https://www.phpbb.com/community/viewtopic.php?t=2383236&p=14499896#p14500191), but replace {TEXT} with $1, maybe?  I haven't had enough time to research this fully yet....
Title: Re: Custom BBCodes Manager
Post by: aegersz on September 28, 2016, 03:16:05 AM
THANKS ! but i tested the HTML with a SimplePortal HTML block and it's a nice soft blink however i can't get the BBCode to blink yet i can't see where an error was made.

i had to put "{content}" in where the "{TEXT}" was for it to parse properly but it doesn't blink, unfortunately.

what could i be doing wrong ? sorry to be a pain in the a...

my entry looks like this:

BBCode: blinkme
Descrition: blinkme
Tag type: Parsed Content
Block level:
Trim whitespace: notrim
Format bbcode will use: [blinkme=xyz]parsed content[/blinkme]

the saved entry: blinkme   parsed_content   [blinkme]parsed content[/blinkme]
Title: Re: Custom BBCodes Manager
Post by: aegersz on September 28, 2016, 04:23:46 AM
but i know that the mod works well as i did made a "test" BBCode that worked perfectly, as shown below:

<div style="border: 5px solid red;">{content}</div>

in fact, i tried some javascript code that works in a SP HTML block and it doesn't blink, either !

*confused*
Title: Re: Custom BBCodes Manager
Post by: Kissaki on October 13, 2016, 10:11:30 AM
Changelog is not accessible, linked to website is dead.
Not sure what to make of this mod now...
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 13, 2016, 08:27:21 PM
Quote from: Kissaki on October 13, 2016, 10:11:30 AM
Changelog is not accessible, linked to website is dead.
Not sure what to make of this mod now...
Sorry about that.  I'm working on getting my website back up and running..... Here it is:
Quote
v2.2 - September 26th, 2016
o Added Spanish Latin translation by Rock Lee [BC] (http://www.simplemachines.org/community/index.php?action=profile;u=322597).

v2.1 - December 8th, 2015
o Fixed issue where bbcode buttons do not show up on the post screen.

v2.0 - November 29th, 2015
o Added "Create Simple Mode" to create new bbcodes using just tag, description and HTML.
o Added validation function to force content to start with "http://" or "https://" when option checked.
o Added membergroup permissions to control who can manage custom BBCodes.
o Added AJAX code to assist user in identifying pre-existing bbcode tags.
o Added AJAX code to upload or remove bbcode button images without saving the form.
o Added Javascript code so that file input box can easily be cleared.
o Added JavaScript code so that new bbcode tags with existing names cannot be submitted.
o Fixed "delete", "disable" and "modify" links on Custom BBCode list page.
o Fixed reversed image type detection based on whether mod is running under 2.0.x or 2.1.
o Fixed "bbcode_exists" function so that hook isn't removed for everybody during testing.
o Fixed image type and dimensions checking and made sure they are strictly enforced.
o Modified admin panel code so that bbcode tags are stored in lowercase letters.
o Modified button function so that button image not added to list if button image not present.
o All existing database tags are forced to lowercase.  For unknown reason, it is necessary.
o Added help language strings to clarify how the bbcode types are used.

v1.12 - June 6th, 2015
o Fixed some issues with the code that adds and removes bbcode button images.

v1.11 - May 1st, 2015
o Modified code to correctly reflect custom bbcode icon requirements for SMF 2.1.

v1.10 - April 28th, 2015
o Added online version check to the Custom BBCode settings page.
o Readded install operations for SMF 2.1 so that Custom BBCode area shows up.

v1.9 - April 24th, 2015
o Fixed package-info.xml so that it refers to the install_20x.xml file, not install.xml.

v1.8 - April 4th, 2015
o Updated for SMF 2.1 Beta 1

v1.7 - Febuary 13th, 2015
o Fixed undefined variable error in Subs-CustomBBCodes.php
o Fixed some undefined array elements in CustomBBcodes.php
o Fixed several issues inside the bbcode_exists function in Subs-CustomBBCodesAdmin.php

v1.6 - Febuary 1st, 2015
o Fixed a nasty bug where existing custom BBcodes weren't allowed to be edited.
o If SMF 2.1-Style Admin Menu is installed, this mod is installed under Configuration => Feature Settings.
o Changed code so that CustomBBCode.php not loaded until actually needed....

v1.5 - December 13th, 2014
o License change to Simplified BSD.
o Replaced the BBCode existance check using SMF's own code...
o Added Dutch translation to the mod, courtesy of Fixit...

v1.4 - September 30th, 2014
o Fixed several bugs in code involving removing buttons from bbcodes....
o Added code to preserve the bbcode description within the database.
o Added code to remove bbcode button image from server upon deleting bbcode.

v1.3 - September 29th, 2014
o Fixed bug that made empty bbcode entries when attempting to disable/enable bbcodes...
o Removed equal sign from bbcode in editor...

v1.2 - September 29th, 2014
o Added code so that "parsed content" tags are recognized properly by BBcode parser.
o Fixed bug so that Custom BBCode UI properly displays HTML that the bbcode will use.

v1.1 - September 29th, 2014
o Fixed bugs that corrupted BBcode HTML codes upon modifying the BBcode.
o Fixed typo relating to BBCode usage in the Custom BBCodes UI page.
o Added English UTF8 language file.

v1.0 - September 13th, 2014
o Initial Release
Title: Re: Custom BBCodes Manager
Post by: aegersz on October 25, 2016, 06:13:45 PM
Hi, i thought that you would like to know that i amgetting these errors frequently:

http://forum.drugs-and-users.org/index.php?action=admin;area=permissions
2: Cannot use a scalar value as an arrayApply Filter:
File: /var/www/html/Sources/CustomBBCodesAdmin.php
Line: 41

http://forum.drugs-and-users.org/index.php?action=admin;area=permissions;sa=modify;group=17
8: Undefined index: permissionname_manage_custom_bbcodesApply
File: /var/www/html/Sources/ManagePermissions.php
Line: 1777

http://forum.drugs-and-users.org/index.php?action=admin;area=permissions;sa=modify;group=17
2: Cannot use a scalar value as an array
File: /var/www/html/Sources/CustomBBCodesAdmin.php
Line: 41

http://forum.drugs-and-users.org/index.php?action=admin;area=permissions;pid=0
8: Undefined index: permissionname_manage_custom_bbcodes
File: /var/www/html/Sources/ManagePermissions.php
Line: 1756
Title: Re: Custom BBCodes Manager
Post by: ariescapes on November 23, 2016, 03:43:09 AM
Here is an odd quirk..

Fresh site and all, BBCodes have all the images showing up in the admin panel, but in thread/message view they are broken.

Ei:

Quotehttp://www....../images/bbc/fancy_1479888763.gif
http://www....../images/bbc/fancy.gif

The red is where something is being added to the URL and breaking the link.
Title: Re: Custom BBCodes Manager
Post by: BK_123 on November 29, 2016, 04:32:21 AM
Hi, I am getting the error message below when trying to make a youtube button

(https://s22.postimg.org/78w45ft8h/Screenshot_16.png)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on November 29, 2016, 08:55:33 AM
I'm going to look into these bug reports, but I have to fix other mods first....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 01, 2016, 08:49:17 PM
Quote from: aegersz on October 25, 2016, 06:13:45 PM
http://forum.drugs-and-users.org/index.php?action=admin;area=permissions;sa=modify;group=17
2: Cannot use a scalar value as an array
File: /var/www/html/Sources/CustomBBCodesAdmin.php
Line: 41
I CANNOT fix this particular bug report, even though that is where the forum is saying the error is coming from.  The mod performs EXACTLY as the forum expects it to perform, and with a clean forum, going into the Admin permission area does not produce any errors. 

A "scalar value" is defined as this: (url=https://www.techopedia.com/definition/16441/scalar]Source[/url])
QuoteA scalar variable, or scalar field, is a variable that holds one value at a time. It is a single component that assumes a range of number or string values. A scalar value is associated with every point in a space.
What I suspect has happened is another mod has IMPROPERLY assigned a text string to $context['non_guest_permissions'], instead of inserting a new element into the array.  When my mod attempts to PROPERLY insert a new string into the array (which is not an array anymore), then that error is thrown by the forum.  Of course, my mod gets blamed because that is where the error OCCURRED, even though another mod screwed up the array that was passed to it.....

Quote from: aegersz on October 25, 2016, 06:13:45 PM
http://forum.drugs-and-users.org/index.php?action=admin;area=permissions;pid=0
8: Undefined index: permissionname_manage_custom_bbcodes
File: /var/www/html/Sources/ManagePermissions.php
Line: 1756
This I can fix....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 01, 2016, 09:55:16 PM
Quote from: ariescapes on November 23, 2016, 03:43:09 AM
Fresh site and all, BBCodes have all the images showing up in the admin panel, but in thread/message view they are broken.
Quotehttp://www....../images/bbc/fancy_1479888763.gif
http://www....../images/bbc/fancy.gif
The red is where something is being added to the URL and breaking the link.
Oddly enough, I was able to duplicate this bug report....  I had to fiddle with my Apache configuration file in order to get the .htaccess file working properly.  Once I got the configuration file fixed up, .htaccess rewrite rules started working....

So what I've done for the next version is added a check to settings_install.php to see if the modifications to the .htaccess file actually work and set a flag to that effect.  In Subs-CustomBBCodes.php, the code now appends the timestamp ONLY if the flag was set by settings_install.php....

Quote from: BK_123 on November 29, 2016, 04:32:21 AM
Hi, I am getting the error message below when trying to make a youtube button
(https://s22.postimg.org/78w45ft8h/Screenshot_16.png)
Um....  Do you have a mod installed that makes a [youtube] tag?  If so, you can't redeclare it.....
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 10, 2016, 09:25:00 AM
Uploaded v2.3 - December 10th, 2016
o Added some code to add timestamp ONLY if htaccess rewrite rule actually works....
o Fixed undefined index error regarding permission name found in Permissions area.
o Replaced BBCode string with Name of Tag for clarity in Edit screen.




@Everybody:  I apologize for the lateness of this update.  Hopefully, this update solves some of the issues reported.
Title: Re: Custom BBCodes Manager
Post by: Ghislain.Dejoie on December 26, 2016, 11:55:38 AM
Hello,
When I install the mod, a blank page appears and nothing.
I do a backspace and I get an error message "my SMF is in version 2.0.12 but your database is in 2.0.9, use the update ..."
To unlock the situation, I delete the Subs-CustomBBCodes.php file and then I delete the mod
But I would like to be able to make a mod to accept the videos coming from smule.com
thank you in advance for your response
Title: Re: Custom BBCodes Manager
Post by: Colin on December 26, 2016, 10:15:13 PM
Quote from: Ghislain.Dejoie on December 26, 2016, 11:55:38 AM
Hello,
When I install the mod, a blank page appears and nothing.
I do a backspace and I get an error message "my SMF is in version 2.0.12 but your database is in 2.0.9, use the update ..."
To unlock the situation, I delete the Subs-CustomBBCodes.php file and then I delete the mod
But I would like to be able to make a mod to accept the videos coming from smule.com
thank you in advance for your response

How have you updated SMF?
Title: Re: Custom BBCodes Manager
Post by: Ghislain.Dejoie on December 27, 2016, 04:20:47 AM
Thanks for answer
I did the updates by going through the administration of my site.
In addition, I spent all my database in UTF 8 (and I therefore installed the French translation in UTF 8)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on December 27, 2016, 10:15:12 PM
Quote from: Ghislain.Dejoie on December 26, 2016, 11:55:38 AM
Hello,
When I install the mod, a blank page appears and nothing.
I do a backspace and I get an error message "my SMF is in version 2.0.12 but your database is in 2.0.9, use the update ..."
To unlock the situation, I delete the Subs-CustomBBCodes.php file and then I delete the mod
But I would like to be able to make a mod to accept the videos coming from smule.com
thank you in advance for your response
I'll look into your bug report....
Title: Re: Custom BBCodes Manager
Post by: Melissa524 on January 03, 2017, 12:47:37 PM
If you are looking at adding a feature, I would love to have the ability to change the order that the images appear on the posting page.  If there is already a way to do this, let me know and I will just thank you instead.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 03, 2017, 02:39:06 PM
I'm sure there is, but it won't be implemented in this mod, simply because it is beyond declared scope of this mod.  I'll try to write up something soon, but I'm a bit overwhelmed right now.
Title: Re: Custom BBCodes Manager
Post by: samimikawi on January 29, 2017, 04:52:23 PM
hello guys

hug problem affect the whole forum i have after i install this mode . i received the below error and i m not able to uninstall it or do anything PLEASE HELP

Table 'newxbtit.newxbtitsmf_bbcodes' doesn't exist
File: C:\xampp\htdocs\web1\smf\Sources\Subs-CustomBBCodes.php
Line: 32

my database name is : newxbtitsmf

thanks and best regards
Title: Re: Custom BBCodes Manager
Post by: efimomax on January 30, 2017, 06:03:21 AM
Quote from: samimikawi on January 29, 2017, 04:52:23 PM
hello guys

hug problem affect the whole forum i have after i install this mode . i received the below error and i m not able to uninstall it or do anything PLEASE HELP

Table 'newxbtit.newxbtitsmf_bbcodes' doesn't exist
File: C:\xampp\htdocs\web1\smf\Sources\Subs-CustomBBCodes.php
Line: 32

my database name is : newxbtitsmf

thanks and best regards


The same ******!!! Can anybody give bbcodes table create SQL code?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 30, 2017, 09:03:34 AM
Copy the edit_db.php to the root of your forum, then run it.  For example, if the path to your forum is http://www.duh.com, then you would run http://www.duh.com/edit_db.php.  Let me know if that works for you (I don't understand why it wasn't run to begin with.....)
Title: Re: Custom BBCodes Manager
Post by: efimomax on January 30, 2017, 10:58:40 AM
It dos not work
Not any from 3 pho scripts
All show error that table dos not exist

That's why am asking to make create table script
Title: Re: Custom BBCodes Manager
Post by: efimomax on January 30, 2017, 01:04:12 PM
I am already try it (put all 3 scripts in forum root folder together with SSI.php)
it runs with errors that the file in forum database not exist.....

SMF 2.0.13
Title: Re: Custom BBCodes Manager
Post by: efimomax on January 30, 2017, 01:22:57 PM
Quote from: efimomax on January 30, 2017, 01:04:12 PM
I am already try it (put all 3 scripts in forum root folder together with SSI.php)
it runs with errors that the file in forum database not exist.....

SMF 2.0.13

i have create table by myself in mysql with fields like in edit_db.php

Title: Re: Custom BBCodes Manager
Post by: samimikawi on January 30, 2017, 11:43:41 PM
Dear Guys,

still same problem . any solution ?
Title: Re: Custom BBCodes Manager
Post by: phoenixphyre on February 05, 2017, 11:02:37 PM
Any fix for this yet? If not, is there anyway to get the 2.2 zip since it worked?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 06, 2017, 10:20:09 AM
Here ya go: Custom_BBCodes_Manager_v2.2.zip (http://www.xptsp.com/get.php?url=Custom_BBCodes_Manager_v2.2.zip)
Title: Re: Custom BBCodes Manager
Post by: phoenixphyre on February 06, 2017, 02:00:15 PM
Thanks so much!
Title: Re: Custom BBCodes Manager
Post by: kittypryde on February 21, 2017, 12:04:13 AM
Thank you for the plugin! Except I can't find the setting anywhere. I installed the latest version from a few replies ago. I have looked in Admin -> Configuration -> Features and Options -> Custom BBcode - No option there at all. Is it somewhere else now?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 21, 2017, 09:46:32 AM
Quote from: kittypryde on February 21, 2017, 12:04:13 AM
Thank you for the plugin! Except I can't find the setting anywhere. I installed the latest version from a few replies ago. I have looked in Admin -> Configuration -> Features and Options -> Custom BBcode - No option there at all. Is it somewhere else now?
What option are you looking for?
Title: Re: Custom BBCodes Manager
Post by: phoenixphyre on February 21, 2017, 08:59:37 PM
Ok so I'm having an issue with a bbcode I'm trying to create. I am trying to create a bbcode for a round image since the members of my site have requested it and I've chosen Unparsed Equals for the tag type, but its not returning correctly. The html used for the bbcode is:

<img src="{content}" class="roundimg" style="width: $1px;">

When I try to use it though, despite being an unparsed content it is still attempting to parse the link and as such, it doesn't work right. The bbcode looks like [roundimg=250]http://placehold.it/250[/roundimg] but its just doing

<img src="<a href=" http:="" placehold.it="" 250"="" class="bbc_link" target="_blank">http://placehold.it/250" class="roundimg" style="width: 250px;">

What am I doing wrong?
Title: Re: Custom BBCodes Manager
Post by: phoenixphyre on February 22, 2017, 08:06:28 AM
Sorry for the double post but I can't edit my previous post. I found a work-around for that issue by switching it from Unparsed Equals to Unparsed Commas Content, but I'm having another issue with the Unparsed Content setting. I'm trying to create another bbcode for an image that assigns a class and set width/height for a template that we use on the board. It has the following html:

<img src="{content}" class="customimg" style="height: 300px; width: 200px;">

When I set it to Unparsed Content, it returns the content as {content} instead of whatever is in between the bbcode tags ([rulerimg]http://placehold.it/200x300[/rulerimg]). When I set it to Parsed Content, it parses the link. Any thoughts on why its returning as {content} with unparsed content?
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 22, 2017, 09:35:54 PM
@phoenixphyre:  I'm sorry, I really don't understand the bbcode parsing code very well and don't understand why some things work just fine and others don't....  I've been considering doing a full rewrite of the mod, trying to make it dead simple (as opposed to the mess that it is now).....
Title: Re: Custom BBCodes Manager
Post by: gorbi on March 07, 2017, 11:22:16 AM
Who have code to make a button for Wikipedia? Thanks
Title: Re: Custom BBCodes Manager
Post by: Shambles on March 07, 2017, 04:48:12 PM
Quote from: gorbi
Who have code to make a button for Wikipedia? Thanks

The SMF "search" function has one:

http://custom.simplemachines.org/mods/index.php?mod=2969
Title: Re: Custom BBCodes Manager
Post by: gorbi on March 08, 2017, 07:22:07 AM
Quote from: Shambles on March 07, 2017, 04:48:12 PM
Quote from: gorbi
Who have code to make a button for Wikipedia? Thanks

The SMF "search" function has one:

http://custom.simplemachines.org/mods/index.php?mod=2969
It's not that, I need an instant view, as Facebook or Twitter
Title: Re: Custom BBCodes Manager
Post by: Shambles on March 08, 2017, 07:47:49 AM
So you don't actually want a button or a bbcode?
Title: Re: Custom BBCodes Manager
Post by: gorbi on March 08, 2017, 11:33:09 AM
Quote from: Shambles on March 08, 2017, 07:47:49 AM
So you don't actually want a button or a bbcode?
bbcode
Title: Re: Custom BBCodes Manager
Post by: Dreadaxe on March 12, 2017, 05:56:13 PM
Quote from: dougiefresh on January 30, 2017, 09:03:34 AM
Copy the edit_db.php to the root of your forum, then run it.  For example, if the path to your forum is http://www.duh.com, then you would run http://www.duh.com/edit_db.php.  Let me know if that works for you (I don't understand why it wasn't run to begin with.....)

Table 'assostonhng1.smf_bbcodes' doesn't exist
Fichier: /home/assoston/www/taverne/Sources/Subs-CustomBBCodes.php
Ligne: 32
Title: Re: Custom BBCodes Manager
Post by: Huckleberry on March 17, 2017, 01:02:02 PM
Quote from: Dreadaxe on March 12, 2017, 05:56:13 PM
Quote from: dougiefresh on January 30, 2017, 09:03:34 AM
Copy the edit_db.php to the root of your forum, then run it.  For example, if the path to your forum is http://www.duh.com, then you would run http://www.duh.com/edit_db.php.  Let me know if that works for you (I don't understand why it wasn't run to begin with.....)

Table 'assostonhng1.smf_bbcodes' doesn't exist
Fichier: /home/assoston/www/taverne/Sources/Subs-CustomBBCodes.php
Ligne: 32

Just a heads up, I was having this same problem, I had to make the following changes:

1. Modified the edit_db.php file by deleting this portion:

if ((SMF == 'SSI') && !$user_info['is_admin'])
   die('Admin priveleges required.');


The admin check was causing the edit_db.php script not to run for whatever reason. Once this change was made and then I rezipped the files, I was able to run the Install Mod command in Package Manager.

2. However, once it was installed I noticed that the Custom BB Codes page in the Admin section looked like it was there but the panel wasn't really showing up. I had to manually execute the changes in the install_20x.xml file because that didn't run for a reason I still don't know. I had to manually download my ManagePosts.php, ManageSettings.php, and Admin.template.php files from my server, make the modifications, then upload them back.

I still have some issues like the text

enctype="multipart/form-data"

appearing at the top of the admin pages, but it seems like it's functioning.
Title: Re: Custom BBCodes Manager
Post by: samimikawi on April 23, 2017, 02:53:24 AM
Table 'baramji.smf_bbcodes' doesn't exist
File: /home/toplinkuae/public_html/barameji.com/Sources/Subs-CustomBBCodes.php
Line: 30


same here how can i uninstall it now ? my website is not working because of this mod kindly help.

thanks & Best Regards
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 23, 2017, 09:17:02 AM
Quote from: samimikawi on April 23, 2017, 02:53:24 AM
same here how can i uninstall it now ? my website is not working because of this mod kindly help.
FTP into your site and delete Sources/Subs-CustomBBCodes.php.  You should have access to your website....
Title: Re: Custom BBCodes Manager
Post by: samimikawi on April 24, 2017, 12:42:49 AM
thanks yes now is working, is there no way to find a good way to install this mod.

and if not i only want to add text hyperlink to bbcode.

thanks & Best Regards
Title: Re: Custom BBCodes Manager
Post by: gorbi on April 27, 2017, 04:27:08 AM
Unable to load the 'CustomBBCode_Browse' template. ver. 2.2
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on April 27, 2017, 05:34:05 PM
UPDATE:  I'm sorry I've put off dealing with this mod for so long.  I've been trying to deal with life issues recently and haven't felt like trying to tackle this problematic mod....

I'm starting a top-to-bottom rewrite of this mod.  I will be taking a completely different approach to defining the custom bbcode tags, mandating a completely new table format for version 3.0.  It will be completely incompatible with version 1.x and 2.x tables, and you probably will have to redefine all of your custom bbcode tags. The database table for version 3.0 will be more flexible, so that further additions can be made without messing with the database table format.
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 01:10:14 PM
Is anyone around to assist me with something?

I have: Table 'friends6_smf341.smfcj_bbcodes' doesn't exist
File: /home/friends6/public_html/forum/Sources/Subs-CustomBBCodes.php
Line: 32

after I installed this mod, which said it was fine (there were NO errors whatsoever)
Title: Re: Custom BBCodes Manager
Post by: Shambles on May 24, 2017, 01:14:24 PM
As I mentioned elsewhere, read other posts in this topic - your issue has been covered before (with a work-around).
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 01:18:58 PM
applebogies, I will read through (I have aphasia so I struggle quite badly with language sometimes, sorry)
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 01:50:12 PM
The work-around does not work, copying edit_db.php into my forum root just gives another database error
Title: Re: Custom BBCodes Manager
Post by: Arantor on May 24, 2017, 01:54:24 PM
You copy it to your root and then run it.
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 01:58:38 PM
I did just say I copied it to forum root and it gave me another database error
Title: Re: Custom BBCodes Manager
Post by: Arantor on May 24, 2017, 02:00:16 PM
From your description it sounds like you copied it to the root and expected that to fix the problem.

So what error did it give you? Same error? Different error?
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 02:08:37 PM
I copied it to /forum (which is the root of the forum) and in the bar at the top on chrome I typed in *****/forum/edit_db.php and the first time I did it I got a white page flash up with database error, and when I tried again as my forum was not fixed by this.... I just get my front end telling me that page cannot be found.



Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 03:10:36 PM
Quote from: Shambles on May 24, 2017, 01:14:24 PM
As I mentioned elsewhere, read other posts in this topic - your issue has been covered before (with a work-around).

Thank you for your response, but it does not work for me. :(
Title: Re: Custom BBCodes Manager
Post by: Arantor on May 24, 2017, 03:40:04 PM
Would have been nice to know what the database error was...
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 03:41:48 PM
I apologise, it flashed up so fast I was not able to read it.


on my forum all I get (after my hosts trying to repair it)


is "Database error" Please try again, if you come back to this screen report to admin. I am fricken admin rofl :D
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on May 24, 2017, 04:31:52 PM
My server hosts said that the database will no longer connect to the forum, so I am just going to go back to this morning's (20 hours ago) backup.
Title: Re: Custom BBCodes Manager
Post by: Beowulf1976 on June 07, 2017, 07:47:12 PM
I can NEVER get this to work on my forum even using the work-around. I have had to get the host to restore my database twice because of it.

However, as I think the mod itself is a  ABSOLUTELY fantastic one, I will keep watch on your progress with perfecting this and will gladly install it as soon as  you have it working so it doesn't break peoples' forums. :)

If you'd like to come along to my forum, be admin, install it and fix it for me (because I'm a stupid noob) so you can see the issues first hand on a live forum, just pm me for details and I'll set you up with access.

Best wishes to you Dougie.
Title: Re: Custom BBCodes Manager
Post by: seremoni on July 31, 2017, 01:48:56 PM
Quote from: dougiefresh on April 27, 2017, 05:34:05 PM
UPDATE:  I'm sorry I've put off dealing with this mod for so long.  I've been trying to deal with life issues recently and haven't felt like trying to tackle this problematic mod....

I'm starting a top-to-bottom rewrite of this mod.  I will be taking a completely different approach to defining the custom bbcode tags, mandating a completely new table format for version 3.0.  It will be completely incompatible with version 1.x and 2.x tables, and you probably will have to redefine all of your custom bbcode tags. The database table for version 3.0 will be more flexible, so that further additions can be made without messing with the database table format.

Please update.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on July 31, 2017, 11:45:37 PM
Gee, let me just whip out my magic wand and BAM, omg, it's fixed.....  NOT!  :o
Title: Re: Custom BBCodes Manager
Post by: seremoni on August 02, 2017, 03:01:51 PM
Relax, my friend, we wait.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on August 06, 2017, 11:46:09 PM
UPDATE: I apologize for the unacceptably long wait.....  I've finally gotten through my massive list of mods, fixing everything possible as quickly as possible.  I'm going to start looking at this mod in the next few days (today is Sunday for me at 10:50pm - probably Tuesday, not Monday).  Please note that this won't be a simple fix, as I don't understand why the database isn't being created (or a hundred other different complaints --- sarcasm....  gotta love it!)

@seremoni:  I'm sorry for taking your comment the wrong way.  Was in a bad mood that day....   O:)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on August 07, 2017, 10:38:59 AM
Uploaded v2.4 - August 7th, 2017
o Fixed edit_db.php so that database creation can occur.




@Everybody:  This update SHOULD fix the blank screen and/or error that people are seeing after installing this mod.  By removing the error (redeclaration of a function), the database will be created and the mod will function without breaking the forum.

Future updates will address other issues as I can find them, but I felt it was important to release an update that didn't break forums as soon as possible.....
Title: Re: Custom BBCodes Manager
Post by: Bugo on August 08, 2017, 04:09:30 AM
It seems you forgot to add some columns:

Unknown column 'last_update' in 'field list'
File: Subs-CustomBBCodesAdmin.php
Line: 225

Unknown column 'accept_urls' in 'field list'
File: Subs-CustomBBCodesAdmin.php
Line: 225


These errors occur on creating new bbcode tags.
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on August 09, 2017, 10:25:12 AM
Uploaded v2.5 - August 9th, 2017
o Readded missing database fields removed by version 2.4 update.




@Bugo:  Thanks for the report!  It's been fixed....
Title: Re: Custom BBCodes Manager
Post by: drewactual on August 31, 2017, 11:38:48 AM
i don't know how you guys do what you do, but i can certainly tell you it's appreciated.  hugely appreciated.  thank you, @dougiefresh ...

this mod has my undivided attention.  i haven't implemented it but may attempt to do so tonight.  my site is college football centric and it is wide open right now with the season just underway.  i usually have between 500 and 700 people on it at any time.. i inherited a massive interwebz presence in July that went bankrupt last Feb.. i don't have the luxury right now of 'slapping this in there' and 'seeing if it sticks'. 

i do have confidence that it will work, though... just can't do it until the little hours. 

i seek this for one express purpose: to fix the copy&paste formatting issue my users are lighting me up about.  they copy from various sources across the web and share them on our site for discussion.  it happens all day every day.  the 'remove formatting' only works on the less sophisticated items they 'paste'. 

so... why I'm here and asking the community (and author) before i am knee deep and past the point of return is:

is it possible to use this mod to create a BBC that:
- uses a (beginning code) div:clear-both... div:border....div:background color... (open)table {may as well put whatever they paste in a table, and to assist in containing}
- uses a (ending code) div: clear both... table(close) {in case they opened a table} div(close)

and which basically encapsulates whatever users have pasted and w/o threat of 'breaking the forum's appearance'? 
Title: Re: Custom BBCodes Manager
Post by: NekoSensei on September 30, 2017, 08:46:18 PM
Quote from: Bugo on August 08, 2017, 04:09:30 AM
It seems you forgot to add some columns:

Unknown column 'last_update' in 'field list'
File: Subs-CustomBBCodesAdmin.php
Line: 225

Unknown column 'accept_urls' in 'field list'
File: Subs-CustomBBCodesAdmin.php
Line: 225


These errors occur on creating new bbcode tags.

i got same with Css ...  ::)
I added

209. 'css' => 'text',
225. isset($data['css']) ? addslashes($data['css']) : '',

i don't know if it's good , but no more error now :)


other problem, the preview button show me a broken picture... :)

Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 09, 2017, 09:32:28 AM
Uploaded v2.6 - October 9th, 2017
o Added missing fields in database call in Subs-CustomBBCodeAdmin.php, as mentioned by NekoSensei (https://www.simplemachines.org/community/index.php?action=profile;u=321042).




@NekoSensei:  The database fields you mentioned have been added to the code.  Thank you for the bug report!

Quote from: NekoSensei on September 30, 2017, 08:46:18 PM
other problem, the preview button show me a broken picture... :)
I'm looking into this bug report.  Seems some code may have gone missing (or never got implemented).....
Title: Re: Custom BBCodes Manager
Post by: mlemke on October 15, 2017, 06:36:43 AM
I am newbie to this Mod: I' sorry, but I can't read the whole thread searching an answere.

Are there some examples, how to code javascript in a custom BBCode? In the package were no examples included (Custom_BBCodes_Manager_v2.6.zip). (I know, Javascript is included since V 2.1 (https://www.simplemachines.org/community/index.php?topic=527734.msg3895102;topicseen#msg3895102)), but my javacript solution generates no output :-((

My bbcode should create a link, because the manager can not parse {content} twice:

<script type="text/javascript"><!--
function spec() {
var a="{content}"
document.write("<a href='https://wiki.arages.de/index.php?title="+a+"'><i>"+a+"</i></a>");}
spec()
-->
</script>


or simple:
<script type="text/javascript"><!--
var a="{content}"
document.write("<a href='https://wiki.arages.de/index.php?title="+a+"'><i>"+a+"</i></a>");
-->
</script>


My custom bbcode is named spec, but the output is empty.

Example: [spec]Linyphia triangularis[/spec]

I hope anyone can help me.

Thanks!

Martin
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 17, 2017, 12:53:31 PM
@mlemke:  You forgot a semicolon on the first line after the function declaration.  Instead of this:
Code (Find) Select
var a="{content}"
You need this:
Code (Replace) Select
var a="{content}";
Yeah, it's a small change, but you just found out how small changes can make a HUGE impact on code.....

You probably also need to change the actual link-building code to read:
document.write("<a href=" + encodeURI("https://wiki.arages.de/index.php?title="+a+"'>") + "<i>"+a+"</i></a>");}
Title: Re: Custom BBCodes Manager
Post by: hidaka on January 16, 2018, 03:06:24 PM
Hi,

I just started using SMF and would want to use the custom BBcodes manager but I'm quite confused as there is no exact installation manual for this. I'm not sure which file should I run first in able to install this (which of these: add_remove_hooks.php , settings_install.php , edit_db.php). Also I'm not sure if I should be moving the custom files to their respective folders before or after running an install.

The only thing that is clear to me is the instructions under the Files to Edit, the exact installation is like a black hole. :-\ :'(
Help, please?

And attached is what I always get after probably running the wrong file.

Many thanks in advance! :)
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on January 16, 2018, 04:27:15 PM
You really should use Packager Manager to install the mod.  You can install manually, but it's a lot easier to use Packager Manager.
Title: Re: Custom BBCodes Manager
Post by: hidaka on January 16, 2018, 10:25:36 PM
Quote from: dougiefresh on January 16, 2018, 04:27:15 PM
You really should use Packager Manager to install the mod.  You can install manually, but it's a lot easier to use Packager Manager.

Oh great, thanks! It's fine now.
Sorry, I'm really new to SMF so I didn't know it has this kind of feature. ;)
Title: Re: Custom BBCodes Manager
Post by: -Rock Lee- on February 12, 2018, 08:00:23 PM
I have to be attentive and go reviewing each mod to not skip any translation for confident is already done ... here I leave you with the latest translated line and some improvements!


Regards!

PD: Anything you tell me I've
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on February 13, 2018, 09:57:30 PM
Uploaded v2.7 - February 13th, 2018
o Updated Spanish Latin translation, courtsey of Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597).
o Added translators section to README.txt.
o Added LICENSE.txt to satisfy licensing concerns.




@Rock Lee:  Thank you for updating the Spanish Latin translations.  They have been included in this version!
Title: Re: Custom BBCodes Manager
Post by: aegersz on March 05, 2018, 09:13:36 PM
here's trouble (me, always bloody breaking the software)

i felt the need to make the following clumsy first shot of a BBCode for mixcloud:

<iframe width="100%" height="400" src="{option1}/widget/iframe/?feed=%2F{option2}%2F{option3}%2f" frameborder="0" ></iframe>{content}

note the superfluous {content}

[mixcloud=https://www.mixcloud.com, djjamestobin, dj-james-tobin-house-music-22022018][/mixcloud]

I picked up 2 minor bugs (i know that you have a love<>hate relationship with bugs ):

1. the keyword {content} is a constant, should not be there for unparsed_commas

2. i had to comment out the following following 2 lines that were causing the "missing column in DB error message" that is triggered when you try to save the BBCode.

3. NekoSensei added the 2 lines below a few posts back and it makes no sense to me yet it worked.

'css' => 'text',
isset($data['css']) ? addslashes($data['css']) : '',


apart from that she runs like a paid one  :laugh:
Title: Re: Custom BBCodes Manager
Post by: zushiba on April 10, 2018, 09:49:35 PM
I'm having difficulties with this mod.

Selecting a Tag Type in the Tag Type Combo box doesn't properly update the BBCode Format area. Changing the type doesn't update on the front end upon refresh meaning you have to delete the tag and start over from scratch if you want to change the type.

The Help Text for the HTML area is the same as the Tag Name area, which isn't helpful. I can't seem to get the actual BBCode to work. It's clickable on the post screen and does enter something into the box but it seems random if the options work or not.
Title: hover BBCode
Post by: aegersz on May 12, 2018, 05:53:49 AM
Introducing the (mouse) "hover" BBCode for non-touch screens

How to configure dougie's Custom BBCodes Manager (https://custom.simplemachines.org/mods/index.php?mod=3699) for "hover"

@dougie THANKS !

re: https://www.simplemachines.org/community/index.php?action=post;msg=3972209;topic=560278.0

How to configure dougie's Custom BBCodes Manager for "hover"

Choose the Create New Tag button >

Tag name = hover

Tag Description for Button = hover

Tag type = Parsed Equals

The HTML used for the tag:

<abbr title="{option1}">{content}</abbr>

Usage:

[hoverBBC=MESSAGE THAT POPS UP SO NO NEED FOR A LINK]hover over me[/hoverBBC]

Example:

https://forum.drugs-and-users.org/index.php/topic,4303
Title: Re: Custom BBCodes Manager
Post by: aegersz on May 13, 2018, 02:06:16 AM
oh, i just remembered, attached is the "hover" gif for the editor:
Title: Re: Custom BBCodes Manager
Post by: aegersz on June 28, 2018, 04:04:43 PM
@dougiefresh, a tiny bug causing many SMF "invalid index for vfunc" & "foreach() ..." errors as the field $tag was in fact empty on occasion ...
 
in Subs-CustomBBCodes.php, remove the "!" symbol in if (!empty($tag['vfunc'])) 

Title: Re: Custom BBCodes Manager
Post by: aegersz on July 25, 2018, 06:41:47 AM
another bug in Sources/Subs-CustomBBCodes.php that caused me 12 errors at a time because $data is an array.

I disabled the code as i didn't really see the need for it but you may want it and be able to come up with a better solution of course.

I needed to clear the file cache (Admin > Maintenance/Forum Maintenance > Routine > Empty the file cache) after the patch.

locate:
                        if (!empty($row['accept_urls']))
                                $row['vfunc'][] = 'CustomBBCodes_URL';


change to:
// disabled bug fix     if (!empty($row['accept_urls']))
// disabled bug fix             $row['vfunc'][] = 'CustomBBCodes_URL';
Title: Re: Custom BBCodes Manager
Post by: dougiefresh on October 11, 2018, 09:12:17 PM
Uploaded v2.8 - October 11th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Custom BBCodes Manager
Post by: gorbi on June 13, 2020, 07:11:16 AM
How to add buttons to an additional theme?
Title: Re: Custom BBCodes Manager
Post by: -Rock Lee- on June 13, 2020, 07:12:26 PM
Quote from: gorbi on June 13, 2020, 07:11:16 AM
How to add buttons to an additional theme?

You have to add the modifications manually in the custom theme you are using. You can do that by looking at the parse (https://custom.simplemachines.org/mods/index.php?action=parse;mod=3699;attach=259514;smf_version=2.0.15) where it explains that it should be modified.


Regards!
Title: Re: Custom BBCodes Manager
Post by: wernborg on March 21, 2021, 10:28:08 AM
Hi,

I use the mod to insert a button for creating the audio-tag.

I'm using the parsed_content for the button. Like this:

<br/><audio controls>
  <source src="{content}" type="audio/mpeg">
Your browser does not support the audio element.
</audio></br>


Unfortunatly it is generating broken code. This is what it looks like client-side:
<audio controls=""> &nbsp;
<source src="<a href=" https:="" www.soundhelix.com="" examples="" mp3="" soundhelix-song-1.mp3"="" class="bbc_link" target="_blank">https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" type="audio/mpeg"&gt;Your browser does not support the audio element.</audio>



Any idea on how I should write the code to get it to work?

Title: Re: Custom BBCodes Manager
Post by: wernborg on March 21, 2021, 10:46:01 AM
I found out it interfears with the automatically create links-setting.

Bug or feature?  :D
Title: Re: Custom BBCodes Manager
Post by: aegersz on April 20, 2021, 08:46:24 AM
(review) The ones I have added so far:

mixcloud (https://forum.drugs-and-users.org/index.php?topic=4217.0)

hover (https://forum.drugs-and-users.org/index.php?topic=4302.0)

audio (https://forum.drugs-and-users.org/index.php?topic=4581.0)

video (https://forum.drugs-and-users.org/index.php?topic=5423.0)
Title: Re: Custom BBCodes Manager
Post by: aegersz on April 20, 2021, 08:49:23 AM
see my previous post for my audio settings. The Custom BBCodes Manager, wonderful as it is, is buggy so I have taken a lot of time to find what fits best, not what I think it should be.

Quote from: wernborg on March 21, 2021, 10:28:08 AM
Hi,

I use the mod to insert a button for creating the audio-tag.

I'm using the parsed_content for the button. Like this:

<br/><audio controls>
  <source src="{content}" type="audio/mpeg">
Your browser does not support the audio element.
</audio></br>


Unfortunatly it is generating broken code. This is what it looks like client-side:
<audio controls=""> &nbsp;
<source src="<a href=" https:="" www.soundhelix.com="" examples="" mp3="" soundhelix-song-1.mp3"="" class="bbc_link" target="_blank">https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" type="audio/mpeg"&gt;Your browser does not support the audio element.</audio>



Any idea on how I should write the code to get it to work?

Title: Re: Custom BBCodes Manager
Post by: dodos26 on April 24, 2022, 09:46:06 AM
Php execution doesn't work here?

<!DOCTYPE html>
<html>
<body>

<?php
$txt 
"{content}";
echo 
"I love $txt!";
?>


</body>
</html>
Title: Re: Custom BBCodes Manager
Post by: Steve on November 08, 2022, 08:21:08 AM
Anybody willing (if they're allowed) to update this for 2.1.2?
Title: Re: Custom BBCodes Manager
Post by: Louis on March 01, 2023, 06:29:08 PM
The BSD-2-clause license (https://opensource.org/license/bsd-2-clause/) states
QuoteRedistribution and use in source and binary forms, with or without modification, are permitted[...]
so here's my take on it - only roughly tested on SMF 2.1.3 so YMMV...

(If only SMF would provide a nice "offtopic" BBC button...)
Title: Re: Custom BBCodes Manager
Post by: Louis on March 02, 2023, 05:20:32 AM
Oops. Some leftover typos in line 336 of Subs-CustomBBCodesAdmin.php...
updated package is attached
Title: Re: Custom BBCodes Manager
Post by: gorbi on March 02, 2023, 05:27:19 AM
@Ĺouis do this mod work with SMF2.0?
Title: Re: Custom BBCodes Manager
Post by: Louis on March 02, 2023, 07:20:16 AM
Nope, I removed all 2.0 code in my package to make it fully work with 2.1.x

For 2.0 compatibility use the original version 2.8 from the mod repository (https://custom.simplemachines.org/index.php?mod=3699)
Title: Re: Custom BBCodes Manager
Post by: Louis on March 03, 2023, 05:17:06 AM
Would anybody know how to put the custom BBC buttons into a separate group?
Something like the Indent BBC for SMF 2.1 (https://custom.simplemachines.org/index.php?mod=4343) mod would be nice, but I don't get my head around that right now....
Title: Re: Custom BBCodes Manager
Post by: dodos26 on March 03, 2023, 12:53:23 PM
In subs-edit for example  (for group)
$context['bbc_tags'][] = array(
            array(
                'image' => 'bold',
                'code' => 'b',
                'before' => '[b]',
                'after' => '[/b]',
                'description' => $txt['bold'],
            ),
            array(
                'image' => 'italicize',
                'code' => 'i',
                'before' => '[i]',
                'after' => '[/i]',
                'description' => $txt['italic'],
            ),
        );
Title: Re: Custom BBCodes Manager
Post by: ADRBossman on August 09, 2023, 03:14:18 PM
This mod works a treat for me in regard to displaying video files.  What I would like to do, though, is simplify the BBCode so a user doesn't receive a message regarding an empty message body if they don't enter some content between the embed tags.  This is what the BBCode button creates at the moment ...

[embed=Video Iframe URL][/embed]
The above will cause an error message, as above, unless some content is entered before the [/embed] tag.  What I will like to create is this kind of BBCode ...

[embed]Video Iframe URL[/embed]
I am using iframe html to create the necessary video display.  Anyone know how to go about this?






Title: Re: Custom BBCodes Manager
Post by: Steve on August 09, 2023, 03:53:10 PM
@ADRBossman - have you looked at this mod? No BBCode needed:

https://custom.simplemachines.org/index.php?mod=2681
Title: Re: Custom BBCodes Manager
Post by: ADRBossman on August 09, 2023, 04:09:24 PM
Quote from: Steve on August 09, 2023, 03:53:10 PM@ADRBossman - have you looked at this mod? No BBCode needed:

https://custom.simplemachines.org/index.php?mod=2681

I tried the above mod.  It does work... but, for one thing, the preview doesn't display the video (which is unsettling), and also the obscure sites I visit, such as ******ute, are not represented.  My simple BBCode works with any site as long as the user is able to acquire the iframe embed URL.