Advertisement:

Author Topic: Custom BBCodes Manager  (Read 87302 times)

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,756
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk (drugs and users)
Re: Custom BBCodes Manager
« Reply #140 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 ?
The configuration of my Linux VPS (SMF 2.0 with 155+ 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

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,756
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk (drugs and users)
Re: Custom BBCodes Manager
« Reply #141 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.
The configuration of my Linux VPS (SMF 2.0 with 155+ 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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #142 on: September 27, 2016, 09:47:46 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....

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,756
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk (drugs and users)
Re: Custom BBCodes Manager
« Reply #143 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]
« Last Edit: September 28, 2016, 04:13:25 AM by aegersz »
The configuration of my Linux VPS (SMF 2.0 with 155+ 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

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,756
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk (drugs and users)
Re: Custom BBCodes Manager
« Reply #144 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:

Code: [Select]
<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 155+ 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

Offline Kissaki

  • Jr. Member
  • **
  • Posts: 119
  • Gender: Male
  • SMF German Translator
    • KCode
Re: Custom BBCodes Manager
« Reply #145 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…

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #146 on: October 13, 2016, 08:27:21 PM »
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

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,756
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk (drugs and users)
Re: Custom BBCodes Manager
« Reply #147 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
The configuration of my Linux VPS (SMF 2.0 with 155+ 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

Offline ariescapes

  • Semi-Newbie
  • *
  • Posts: 72
  • yarn, code & boyo's
Re: Custom BBCodes Manager
« Reply #148 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:

Quote
http://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.

Offline BK_123

  • Newbie
  • *
  • Posts: 3
Re: Custom BBCodes Manager
« Reply #149 on: November 29, 2016, 04:32:21 AM »
Hi, I am getting the error message below when trying to make a youtube button


Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #150 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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #151 on: December 01, 2016, 08:49:17 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])
Quote
A 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.....

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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #152 on: December 01, 2016, 09:55:16 PM »
Fresh site and all, BBCodes have all the images showing up in the admin panel, but in thread/message view they are broken.
Quote
http://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....

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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #153 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.

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Custom BBCodes Manager
« Reply #154 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

Offline Colin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,894
  • Gender: Male
  • SMF Developer
    • colinschoen on GitHub
Re: Custom BBCodes Manager
« Reply #155 on: December 26, 2016, 10:15:13 PM »
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

Offline Ghislain.Dejoie

  • Semi-Newbie
  • *
  • Posts: 18
Re: Custom BBCodes Manager
« Reply #156 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)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #157 on: December 27, 2016, 10:15:12 PM »
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....

Offline Melissa524

  • Jr. Member
  • **
  • Posts: 126
  • Gender: Female
  • It's me!
Re: Custom BBCodes Manager
« Reply #158 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.
In case, I forget to say.  I am using 2.0.2

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Custom BBCodes Manager
« Reply #159 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.