Custom BBCodes Manager

Started by dougiefresh, September 14, 2014, 03:10:14 PM

Previous topic - Next topic

aegersz

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 ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

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.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

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, but replace {TEXT} with $1, maybe?  I haven't had enough time to research this fully yet....

aegersz

#143
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]
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

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*
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Kissaki

Changelog is not accessible, linked to website is dead.
Not sure what to make of this mod now...

dougiefresh

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].

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

aegersz

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
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

ariescapes

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.

BK_123

Hi, I am getting the error message below when trying to make a youtube button


dougiefresh

I'm going to look into these bug reports, but I have to fix other mods first....

dougiefresh

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....

dougiefresh

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

Um....  Do you have a mod installed that makes a [youtube] tag?  If so, you can't redeclare it.....

dougiefresh

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.

Ghislain.Dejoie

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 [nofollow]
thank you in advance for your response

Colin

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?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Ghislain.Dejoie

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)

dougiefresh

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....

Melissa524

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.
In case, I forget to say.  I am using 2.0.2

dougiefresh

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.

Advertisement: