Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chen Zhen on June 03, 2014, 07:19:08 PM

Title: Personalized BBC
Post by: Chen Zhen on June 03, 2014, 07:19:08 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3864)

Personalized BBC

Purpose and/or usage of this software package:

The purpose of this application is to allow an administrator the option to add custom BBCs to a SMF forum installation. 
These BBC additions have individual permission settings to allow or restrict their usage and visibility.
The added BBCodes can be of general use if permission settings regarding viewing and usage are enabled for all membergroups.

Important Notation:
  This modification will only hide Personalized BBC content to specified membergroups when it is installed.
  Prior to using the SMF Large Upgrade Package it is advised to put your forum in maintenance mode
  until you are able to reinstall this modification.
  Failing to follow that procedure will allow all membergroups with appropriate board permissions
  to view all those BBC's that were normally hidden.
  The same applies when uninstalling this modification.




Recommended minimal requirements:

Server: PHP 5.3+
Database: MYSQL 5.0+ using MyISAM or InnoDB engine
Browser: HTML5 capability
SMF Version: 2.0.X - 2.1.X




Developed for SMF forums c/o Chen Zhen @ web-develop.ca (http://web-develop.ca)
Copyright 2014 - 2018 
Distributed under the CC BY-ND 4.0 License (http://creativecommons.org/licenses/by-nd/4.0/)

If you commend this software package and/or any other contributions that [email protected] develops for the SMF community, please feel free to make a donation to paypal using the image/link provided below.
Thank you for opting to use this software package.

(https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif) (http://web-develop.ca/index.php?page=underdog_donation)




Features:





Changelog:

[version 1.94.1]
! fixed/updated 3rd party Google jQuery link to https
! added return value to onload event anonymous function to thwart javascript warning/error in some browsers

[version 1.94]
! fixed/changed primary key for personalized_bbc table (now int auto increment)

[version 1.93]
! fixed javascript/DOM regarding addEventListener/attachEvent
! fixed improper filename for SMF 2.1 uninstall
! fixed variable variable ambiguity issue for saving BBCodes
! fixed display icons for admin list
? adjusted support website & copyright

[version 1.92]
! fixed IE compatibilty for DOM style elements
! changed window.onload to addEventListener/attachEvent

[version 1.91]
+ added javascript for optional BBCode parameters

[Version 1.9]
+ added option to enable external jQuery support (SMF 2.0.X only)

[Version 1.8]
+ added option to test bbcode within revision template
+ added onmouseover/onmouseout display events for icons in the bbcode list
+ js and css files added for use with the above additions
+ added option to enable/disable autolink
! added index.php files for the SMF 2.1 directories
! newly created bbcodes default to all allowed permissions
! disabled override for this version
! adjusted css within admin templates

[Version 1.7]
+ added option to upload images within tag settings
+ uploaded images resized to 20px x 20px dimensions
+ ../images/bbc/personalizedBBC folder not removed during uninstall to preserve uploaded images
! adjusted installer for minor issues/discrepancies
! fixed SMF 2.1 installation discrepancies

[Version 1.6]
+ mod now filters restricted bbcodes outside of posts/pm's
+ added option to allow filtering of Url entered within code input (option to conform to RFC 3986 (http://www.ietf.org/rfc/rfc3986.txt) standards)
+ added IMDb and TMDb icons
! clean_cache() function implemented for permission changes to immediately take affect
! use of un_htmlspecialchars() function for adding BBCode HTML (HTML within bbc will not function properly without this method being implemented)

[Version 1.5]
+ added SMF 2.1 support
+ includes png bbc icons for SMF 2.1 support
+ added override option for existing SMF default BBC tags
! fixed BBC button hook routine
! fixed BBC type setting for newly created tag
! various language and file changes for SMF 2.1 compatibility
! changed regex for closed tags regarding HTML5 compatibility

[Version 1.4]
+ added [Important Notation] to this readme
! changed routine for gathering SMF default BBC's
! changed routine for adjusting permissions
! max allowed BBC tag name length now 25 characters (due to display template)
! removed unnecessary filter_var() usage (regex sanitizes this variable)
! installer now includes admin icon for all custom themes
! fixed source filenames withing uninstall xml
! fixed editing of same BBC tag name from last update

[Version 1.3]
+ relays error message for characters not allowed in BBC names
! fixed existing bbc check to include BBC's not contained within $context['bbc_tags']

[Version 1.2]
! fixed images list within template and added natsort
! fixed issues regarding some inputs within templates
! fixed regex regarding permission disabled closed tags
! ensure bbc name variable(s) are lowercase
! max bbc name of 35 characters in length
! installer adjusts permission column within permissions table to 60 character max (mod-var_bbc-name_ilk)

[Version 1.1]
+ separate view & usage permission settings
! removed smcFunc escape/unescape
! natural sorting of Personalized BBC's for admin list and permissions
! checks against existing SMF default BBC's
! fixed deletion of first entry issue
! fixed check-all in admin template

[Version 1.0]
+ Initial release

Legend:
--------------------------------------------------------------------------------
! Minor change or bugfix. (don't bother to log typos except between releases.)
? Version and/or copyright changes including file comments
& Change that affects a language file. (make two if it affects templates too.)
+ Feature addition or improvement.
- Feature or option removal.

Disclaimers:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Title: Re: Personalized BBC
Post by: Chen Zhen on June 16, 2014, 07:27:26 PM

Mod has been updated to Version 1.4, it is advised to update the modification.
Please read the changelog for details.

Regards.
Title: Re: Personalized BBC
Post by: Chen Zhen on September 05, 2014, 11:58:20 PM
This mod has been updated to Version 1.6, it is advised to update the modification to implement an important fix.
Please read the changelog for details.

TMDb BBCode has been developed as an example.
If you wish to use the TMDb BBCode, you will need to register on the  TMDb (https://www.themoviedb.org/) website and apply for an API key.
The BBCodes use their TV and Movie ID's to gather the data which also references an IMDb link.
Their policy requires you to leave the TMDb logo (very small) in order to use their API service.
(IMDb link is the movie/show text and the TMDb logo is the TMDb link ~ both will forward to the respected show/movie being referenced)

Click Here (http://www.web-develop.ca/index.php?topic=108.0) for the TMDb BBCode

Regards.
Title: Re: Personalized BBC
Post by: Chen Zhen on September 28, 2014, 12:09:18 AM
Mod has been updated to version 1.7.
This version will now allow an admin to upload image icons.
Personalized BBC is compatible with SMF 2.0.X and SMF 2.1 installations.

Please see the change log for details.
Title: Re: Personalized BBC
Post by: Apllicmz on October 14, 2014, 08:12:21 AM
Nice work
when update dont forget portuguese files
Attach

Title: Re: Personalized BBC
Post by: Chen Zhen on October 21, 2014, 12:37:41 AM
Joomlamz,

  Thanks for your interest in this modification.
I appreciate your translation of the language files however the most recent update included many additional changes/additions to those files.
You are more than welcome to post additional updated translated language files to this board: Click Here (http://www.web-develop.ca/index.php?board=39.0)

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 23, 2014, 07:57:48 PM
The last update throws 2 modification parse error in the xml files that I wasn't able to spot. Version 1.7 installs with no issues. (damn I was still running 1.5! xD)
Title: Re: Personalized BBC
Post by: Chen Zhen on October 23, 2014, 08:20:17 PM
♦ Ninja ZX-10RR ♦ ,

  After your report I have tested v1.8 on a default installation of SMF 2.0.9 and receive no such issues.

Imo this may be caused by another mod that was previously installed and has edited SMF code in like areas. There is one additional edit added for the SMF 2.0.X branch within Subs.php for the purpose of adding BBCodes to the no link array. however this should not cause 2 errors as compared to v1.7 since it is only one additional edit.  Actually there is another difference in the installation part that executes actual SMF edits whereas 2 xml install files are executed, perhaps this is causing the issue (not for me while testing it though)?

What are the specific errors being flagged during the v1.8 installation?
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 23, 2014, 08:58:57 PM
Just "modification parse error" for the 2 latest xml files... No errors in the error log (since I am not going on with it) and nothing else, no clues, that's why I posted like that otherwise I would have provided more detail :(
Title: Re: Personalized BBC
Post by: Chen Zhen on October 23, 2014, 10:29:29 PM
 ♦ Ninja ZX-10RR ♦,

  Under closer inpection I noticed that I made a small error regarding the folder names within the installation whereas some should have been uppercase. In addition I also gave both SMF versions their own single install.xml file. If you are willing to help me out by testing the new installation I added to the download page (personalizedBBC_v1.8x) I would be very appreciative. If not and you are happy with v1.7 then that is fine.

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 24, 2014, 12:46:00 AM
You got it :D works! Btw I am always available to test things as long as they are not *terribly* time consuming ;) and this was definitely easy to test and report, works :) thank you for the fix!
Title: Re: Personalized BBC
Post by: Chen Zhen on October 24, 2014, 09:45:15 AM

♦ Ninja ZX-10RR ♦,

  Strangely, at the moment  the download count for that version still says 0 even though you say it was downloaded.  ???
Thank you for taking the time to test the modification and for the report.

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 24, 2014, 11:58:31 AM
Lol, I don't know about that but you can rest assured that I did download it and works :) a screenshot would be useless since my timezone is WAY different than the one of this forum :P
Title: Re: Personalized BBC
Post by: Chen Zhen on October 24, 2014, 01:42:29 PM
♦ Ninja ZX-10RR ♦,

  I will show you an example of its usage with the type of content you convey.

ie.
BBCode:

name: weapon
description: weapon display
type: [tag=option]content[/tag]
no parsing

code:
<img style="width: 600px; height: 200px;" src="http://oi57.tinypic.com/{option}.jpg" alt="" /><hr /><hr /><hr /><span style="font-size: 14pt;font-weight: bold;">{content} (more up to come)</span>

icon: .. upload & use a weapon icon

permissions: ... up to you. ie. viewing for all but possibly only admin/mod usage?

example bbcode usage for above:

[center][weapon=35ltbmf]1st Assault rifle[/weapon][/center]





Regards.
Title: Re: Personalized BBC
Post by: margarett on October 24, 2014, 02:00:40 PM
The modsite has some way of filtering downloads counter to prevent abuse. That's why you can download a mod multiple times and it won't get counted.
Unfortunately it seems not to differentiate versions...
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 24, 2014, 02:14:06 PM
Wew nice Chen Zhen that's complicated but I think I can do it with a bit of studying :) thank you very much for that anyway! I really appreciate some guidelines :D

@margarett tell the devs maybe? I'd call it a bug, or at least a misfunction that can lead to misunderstandings such as the one before since I had downloaded the mod and I looked like an idiot since the mod counter was still at 0 xD
P.s. Downloaded by proxy just to raise the counter and be fair :)
Title: Re: Personalized BBC
Post by: margarett on October 24, 2014, 02:16:31 PM
To be fixed only in the new Cust site. The current one will probably not have further development ;)
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on October 24, 2014, 02:29:33 PM
Quote from: margarett on October 24, 2014, 02:16:31 PM
new Cust site
Wooooooooooooooooot that's some spoiler XD Or well I guess you will update to 2.1 sooner or later and also the cust site will change... So yeah I should have known it. Too bad that I will just stop with 2.0.x instead, and not even posting anymore :/ but whatever thanks for telling me I will be looking forward to see it :) thank you as always your help and info is much appreciated.
Title: Re: Personalized BBC
Post by: NekoJonez on October 25, 2014, 08:50:09 AM
When I click on test, everything gets reset and the test results display. :/
Title: Re: Personalized BBC
Post by: Chen Zhen on October 25, 2014, 09:23:33 AM
NekoJonez,

  I do not seem to be able to duplicate your issue. When you use the test button the routine saves the tag's current settings, reverts back to the tag's settings template and displays the result at the bottom of the page.  Are you saying that you are experiencing it reverting all a tag's settings to default instead of what you enter for it?
Title: Re: Personalized BBC
Post by: NekoJonez on October 25, 2014, 10:28:05 AM
Yeah. I have that issue.
Title: Re: Personalized BBC
Post by: Chen Zhen on October 25, 2014, 11:36:40 AM
NekoJonez,

  When using the test what does the url show after ../index.php?
Are there any undefined errors in the log from the mod's admin template or source file?
Title: Re: Personalized BBC
Post by: snake_ripken on October 27, 2014, 08:48:36 PM
mod work good for me checn zhen
admin bbc testing work great with no problem
thank you for this mod
Title: Re: Personalized BBC
Post by: NekoJonez on November 17, 2014, 11:46:01 AM
Quote from: Chen Zhen on October 25, 2014, 11:36:40 AM
NekoJonez,

  When using the test what does the url show after ../index.php?
Are there any undefined errors in the log from the mod's admin template or source file?

No, it wasn't. And I didn't had errors that were related to your mod. I do have errors in my error log but I know that they are created by another mod. My mind would go BOOM if they were related. It's the Lazy Admin Menu mod ;)
Title: Re: Personalized BBC
Post by: NekoJonez on November 17, 2014, 11:46:45 AM
PS: Here is a tip... If you can pull this off, maybe add an option where you can select where the button should be placed. Eg: next to "Bold" button.
Title: Re: Personalized BBC
Post by: Chen Zhen on November 18, 2014, 12:31:35 AM
NekoJonez,

  I will look into your request for the next version.
Does the BBCode testing still not function for you?

Title: Re: Personalized BBC
Post by: NekoJonez on November 19, 2014, 02:10:44 PM
No, still the issue I talked about earlier.
Title: Re: Personalized BBC
Post by: Chen Zhen on November 23, 2014, 08:52:50 PM
NekoJonez,

  Atm I do not seem to be able to duplicate your issue. I have also asked others to test it on other environments and they report it to function properly.
The mod passes some minor data via the url which is why I previously asked you exactly what the url reads (ie. after index.php?) when you attempt to test a bbcode but you did not answer that question. Perhaps you could relay that info to me for problem solving purposes?

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 03:36:46 PM
After half an hour of testing and fails may I ask you wtf is wrong with this BBC? I'm a "little" bit upset. I want to do a quick color BBC because I have a *HUGE* page of colors that should be wrapped into BBC tags... The tag I would want to do would be [quick_color={option}]{content}[/quick_color] and despite I tried MANY configurations I can't seem to be able to do it. When I try to put the {content} within the span, after the style is being closed I always get the "Test" content written correctly but also a weird {content} text which is extra... I tried to put that everywhere and with any converter that I could find but at no avail. Could you kindly explain me how to configure this thing (and why you will set up in that way) before I go crazy once for all? Thanks in advance :)
Title: Re: Personalized BBC
Post by: Burke ♞ Knight on December 09, 2014, 03:49:31 PM
I noticed one thing off the bat. You said it would be: quick_color
Yet, your screenshot shows it as: colorquick
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 04:00:20 PM
Whatever. Doesn't matter, I tried to change it to see if that was being the problem.
Title: Re: Personalized BBC
Post by: Chen Zhen on December 09, 2014, 04:08:59 PM
♦ Ninja ZX-10RR ♦,

Can you please post the code you are using within code tags.
You posted the bbc type ( [quick_color={option}]{content}[/quick_color] ) but not the code.
I need to see the actual code in order to assist you.

Regards.

Title: Re: Personalized BBC
Post by: Chen Zhen on December 09, 2014, 04:21:37 PM
♦ Ninja ZX-10RR ♦,

  I am not positive if all you want is to adjust text color within the bbcode tag.
This is a basic example of accomplishing that.

name:
quick_color

type:
[tag=option]content[/tag]

HTML code:

<span style="color: {option};">{content}</span>





Then you use it as such:

[quick_color=blue]This is some blue text[/quick_color]


There is already an existing SMF built-in BBCode to do this example though.
It is named: color

Perhaps this will give you a good example of how to use the mod though.
This way you can add the effect you truly seek.

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 04:34:05 PM
Yeah sorry I had cut the image too much... How stupid :|

Anyway the purpose is that I have to wrap a whole page of codes into BBCodes and I don't feel like putting random colors and then deleting the color itself etc. I want a cool BBC to be used quickly that will save me an insane amount of time. (I kinda know how to use BBCode "color" tag btw...)

Chen Zhen, thanks, except that it doesn't work at all. See attached. :/
Title: Re: Personalized BBC
Post by: Chen Zhen on December 09, 2014, 04:52:17 PM
If you are going to use hex colour codes then you must use the pound prefex.

ie.

#cccccc


Also if this is an entire page you are wrapping then you will need to use a div and not span.

<div style="color: {option};">{content}</div>


Also note that if you intend the code to be viewed by all members including guests, you simply need to check mark all permission options for viewing.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 04:56:48 PM
No I have to wrap each code... And I don't see the prefex being the issue, the text is blue already (I tested it anyway and doesn't change a thing indeed). It's just that the test thingy is showing an extra {content} and I don't know why...
Changin the span into div didn't change anything, too. :/
Title: Re: Personalized BBC
Post by: Chen Zhen on December 09, 2014, 05:51:43 PM
 ♦ Ninja ZX-10RR ♦,

When using hex colour codes you must include the pound prefix as this is simply a css syntax.

I see now that there is an issue with the test process when parsing is selected. However this does not apply to actual usage within your forum.
You can select no parsing and test it again if you wish it to test properly without the {content} being displayed.
Thank you for the report and I will fix this for the next release.

Regards.
Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 06:13:29 PM
Well you are welcome but I have another one...
It just goes in a new line whenever I use one of those codes :| regardless of the trim whitespace option (which I thought was at fault at first)... So let's say I did something like this:
[quickcolor=colorcodehere]Content[/quickcolor]
Following content
And the following content was placed exactly after the last square bracket :/ I'm a little bit "what the..."
Title: Re: Personalized BBC
Post by: Chen Zhen on December 09, 2014, 06:21:06 PM
 ♦ Ninja ZX-10RR ♦,

  A HTML paragraph tag will do that so if you want the content of multiple bbcodes on the same line then omit the <p> tag from the code.


Title: Re: Personalized BBC
Post by: Ninja ZX-10RR on December 09, 2014, 06:28:16 PM
Oh, I had forgot that I was using a div, using a span cured it. Thanks for everything :D I think it works as I wanted it to work now. I'll post again in case I had further problems, waiting for the next release anyway.
Glad that I could help you too in finding that one. Thank you also for being always very polite and straight to the point, both here and on SP.net :)
Title: Re: Personalized BBC
Post by: fungolfer on February 24, 2015, 02:36:41 AM
Great mod, that is what I was looking for.

My problem: I have no idea how to use it, so the new BBCode is working. I need the following BBCodes: [th] and [smilie]. TH is needed to get table headers (wondering why this isn't standard). Smilie should add a smilie with a text [smilie]text[/smilie] should look like attached. I just don't know the code to add and I didn't find anything in the net how to manage that.

I hope someone can give a little help here, would be awesome :)
Title: Re: Personalized BBC
Post by: fungolfer on February 24, 2015, 09:24:56 AM
Never mind, I found what I needed, thx anyways :)
Title: Re: Personalized BBC
Post by: Chen Zhen on February 24, 2015, 06:53:15 PM
fungolfer,

  This mod does not come with any specific additional BBCodes as its purpose is to allow the ability to add your own HTML to create pretty much any BBCodes your imagination can conjure. It is fairly flexible although it requires some knowledge of HTML. The next version will also allow the ability to enable JQuery for the SMF 2.0.X branch (not necessary for the SMF 2.1.X branch) among some other fixes and additions. Unfortunately as of late I do not have a lot of free time therefore I am not positive regarding its release date.

  I am happy to hear that you have figured out how to use the modification.

Regards.
Title: Re: Personalized BBC
Post by: Tikkuy on May 24, 2015, 09:58:51 AM
I've just updated to the new 2.1 and I'm having an issue with this mod. As you can see here (http://pophatesfags.org/forum/index.php?topic=3462.msg45298;topicseen#msg45298), the code for YouTube works somewhat but you're unable to actually click on the video and the Soundcloud code does not show the song no matter what we try. Both these codes were working fine before I updated.

I think the problem may be that my Subs.php file doesn't have the required changes for the mod to work. However, when I make the required edits my forum is unusable and I get this error:

Fatal error: Call to undefined function PersonalizedBBC_AutoLinks() in /home/mogar/pophatesfags.org/forum/Sources/Subs.php on line 1713

Any ideas on what might be going wrong?

Thanks for an awesome mod!
Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2015, 10:05:15 PM
Tikkuy,

  The parsed edits shown on this forum are only for the SMF 2.0.X branch.
At this time this forum does not show the necessary edits for the SMF 2.1(.X) branch (currently there is not an option from the drop down).

There are only 2 short edits for the SMF 2.1(.X) branch.

file: ../Sources/Load.php

find:

static $censor_vulgar = null, $censor_proper;


add after above code:


// Remove any Personalized BBC where the user does not have permission to view it
$text = PersonalizedBBC_parser($text, 'view');





file: ../Sources/Subs-Post.php

find:

// You won't believe this - but too many periods upsets apache it seems!


add before above code:

// Remove any Personalized BBC where the user does not have permission to use it
$message = PersonalizedBBC_parser($message, 'use');



Both Youtube and SoundCloud codes work using this modification.
Some example codes including the 2 mentioned are on this page: Example BBCodes (http://web-develop.ca/index.php?board=13.0)





This mod has been updated to v1.9 for those using the SMF 2.0.X branch and require jQuery support.

Regards.
Title: Re: Personalized BBC
Post by: Tikkuy on May 25, 2015, 12:57:56 AM
Quote from: Chen Zhen on May 24, 2015, 10:05:15 PM
Tikkuy,

  The parsed edits shown on this forum are only for the SMF 2.0.X branch.
At this time this forum does not show the necessary edits for the SMF 2.1(.X) branch (currently there is not an option from the drop down).

There are only 2 short edits for the SMF 2.1(.X) branch.

file: ../Sources/Load.php

find:

static $censor_vulgar = null, $censor_proper;


add after above code:


// Remove any Personalized BBC where the user does not have permission to view it
$text = PersonalizedBBC_parser($text, 'view');





file: ../Sources/Subs-Post.php

find:

// You won't believe this - but too many periods upsets apache it seems!


add before above code:

// Remove any Personalized BBC where the user does not have permission to use it
$message = PersonalizedBBC_parser($message, 'use');



Both Youtube and SoundCloud codes work using this modification.
Some example codes including the 2 mentioned are on this page: Example BBCodes (http://web-develop.ca/index.php?board=13.0)





This mod has been updated to v1.9 for those using the SMF 2.0.X branch and require jQuery support.

Regards.

Thank you for that. The YouTube code is working great! Although I'm a bit apprehensive about changing the Soundcloud codes as all of my users posts are in this format:

[soundcloud]https://soundcloud.com/user/track[/soundcloud]

This was working for me before I updated to the new version of SMF. Is there any reason it may not be functioning now? Otherwise, is there any other way we can implement this kind of a code?
Title: Re: Personalized BBC
Post by: sangham.net on May 25, 2015, 05:38:12 AM
Seems to be great Mod! Congratulation Mr/Mrs Chen Zhen!

Thinking that Atma (me) had made some BBCs by hand yesterday the whole day... and today this.

A question, since I have add some BBC manually, would that be a problem if installed? How does this Mod handle existing codes?

I made changes and adds in subs and Subs-Post.php (SMF 2.0.10)

Althroug it is not so usual, Atma (I) would like to request the use of this modification for sangham.net and the Sangha.

Thanks a lot for your support!

Title: Re: Personalized BBC
Post by: Chen Zhen on May 25, 2015, 06:55:10 PM
Tikkuy,

  I updated the SoundCloud thread to include what you requested. It is shown as example #3.
Imo most likely the reason why your SoundCloud code no longer functions is due to SMF 2.1 using a more recent jQuery library (as opposed to what your plugin was written for). In that case it may require the migrate library to be loaded as shown in example #1.
If your code was an iframe that does not use jQuery then I suggest you attempt to use this mods trim options as it may simply be some sort of accidental white spaces added which it will automatically remove with those commands.





sangham.net,

  The license allows anyone to use this modification on their site and make changes to it for personal use.
However no one may redistribute this modification in any form as that right belongs to me.

Regards.
Title: Re: Personalized BBC
Post by: sangham.net on May 26, 2015, 06:23:51 AM
Valued Mr. Chen Zhen,

thanks for your quick reply and Atma (me) will handle it as given in that frame, of course, if that was right understood as consciously given personally (like to others if have contact, but here Mr. Chen Zhen would know the receiver personally).
In regard to the question, if certain manual additions of BBC-codes before installation or your mod, will have impact, it seems to me that you might have not seen this question. So Atma likes to ask once again. Would it cause troubles if there have been add some arrays for buttons and bbc-codes?

metta & mudita
Samana Johann
Title: Re: Personalized BBC
Post by: Chen Zhen on May 26, 2015, 04:20:02 PM
sangham.net,

  This mod uses the hook to add BBCodes which occurs after the BBCode array therefore I do not see why it should cause any issues.
Although I wonder why you would bother adding manual edits to files since this mods purpose is to allow adding BBCodes via your SMF admin section.
If you changed the behaviour of existing BBCodes then leave those changes in place as I have not enabled the override feature as of yet.

Regards.
Title: Re: Personalized BBC
Post by: sangham.net on May 27, 2015, 04:46:15 AM
Sadhu!

Well, Atma (me) did it one day before he saw your excellent mod. Thanks a lot for the patient support.
Title: Re: Personalized BBC
Post by: sangham.net on May 27, 2015, 06:34:54 AM
Valued Mr. Chen Zhen,

seems to work fine so far.

Short feedback:

Title: Re: Personalized BBC
Post by: sangham.net on May 27, 2015, 07:15:41 AM
Atma guesses he sees the problem.

If you make a new bbc, you are requested to submit it in the index. Now it seems that if not just now made new, all permissions are always toogled of and so the old one will also be over written with "empty" permission setting. Atma will try it by submitting the new exclusive as visible and useable.

The data under this BBCs was/is definitely deleted! So its a dangerous tool (for user like Atma) as it is very complex and focus on restrictions first and second on data it self, as it seems.

Data is self is fine, it was a parsing option issue.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 27, 2015, 05:45:12 PM

sangham.net,

  You seem to be using a translation script because I am having a difficult time understanding your 2 recent posts.
Atm the test only works for the no parsing option as this has been previously reported although all types will function properly when in use.
Testing a BBCode will also save any valid changes just as the (?) help text implies.

  All permissions are toggled by default when first creating a BBCode but they can be adjusted. It is set up like this because it makes more sense when some people do not use the permission option. It does allow you to change them immediately without issue.

  The language strings are located in the default theme's language folder as with most other modifications. Their file names should reveal which should be edited.

  There is no missing css as I have no idea to what you are exactly referring to. Opt an image for the bbcode and it will show if the user has permission to use it.

Title: Re: Personalized BBC
Post by: sangham.net on May 27, 2015, 11:59:41 PM
Valued Mr. Chen Zhen,

please don't misunderstand Atmas comments and effort. Atma is more then contend and has a lot of gratitude to be able to use the mode and it works perfect so fare. The small hints are merely hints of "users" which could give the developer some ideas of their ways of thinking, missunderstanding and "ignorant" usage. So all just tries to support the grow.

Quote from: Chen Zhen on May 27, 2015, 05:45:12 PM

sangham.net,

  You seem to be using a translation script because I am having a difficult time understanding your 2 recent posts.
Atma guess its merely the computerizing of programmer language. Thanks for your patient.
Quote
Atm the test only works for the no parsing option as this has been previously reported although all types will function properly when in use.
Ok, that Atma might have not seen.
QuoteTesting a BBCode will also save any valid changes just as the (?) help text implies.
That Atma had seen.

QuoteAll permissions are toggled by default when first creating a BBCode but they can be adjusted. It is set up like this because it makes more sense when some people do not use the permission option. It does allow you to change them immediately without issue.
There is no problem. Its just when you submit the list again, that certain BBC's are set with all permissions untoggled. If one does not submit at the list-page, everything is fine.

QuoteThe language strings are located in the default theme's language folder as with most other modifications. Their file names should reveal which should be edited.
Thanks, maybe you like to incl. it in the mod directly. How ever, when look into the Post.english.php, where the hover text should be, no text string for the certain BBC hover-text can be found here. Do not know where the title= content of the url is coming from. Of course it displays that which is given as imput (one language) in the settings of new BBCs

QuoteThere is no missing css as I have no idea to what you are exactly referring to. Opt an image for the bbcode and it will show if the user has permission to use it.
Atma has attached a screen shot, its about the frame which comes from the "default" css. Atma while rendering the German language file, came accross of $txt['PersonalizedBBC'] = 'personalized_bbc_'; and it could be that this is the reason, since such class, it it is a text used for class, will not be within the css automatically. Maybe ../images/bbc/bbc_bg.gif ?  ??? (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsangham.net%2FThemes%2Fsangham%2Fimages%2Fbbc%2Fbbc_bg.gif&hash=40e55d8e2c7aecd06cfad0e6713ca31bbceecfdd), within the htmls, all seems fine, but just not displayed

<img style="cursor: pointer; background-image: url(&quot;http://sangham.net/Themes/sangham/images/bbc/bbc_bg.gif&quot;);" id="BBCBox_message_button_2_0" src="http://sangham.net/Themes/sangham/images/bbc/personalizedBBC/lde.gif" alt="Markieren Sie Deutsche Textteile damit" title="Markieren Sie Deutsche Textteile damit" align="bottom" width="23" height="22">


A side question: Within the text.php, there is  {content} und {option}, changing it language specific to {Inhalt} und {Option} will be ok or is that not good because it is also programmed manual within the Modification? The same question for the Mode-Name within the '....'? Is it consistent so that a Change into "Individuelle BBC" for example would make no problems here. How ever, Atma (me) sticked with the original Mode Name "Personalized BBC" within the translation.

Here the German language.php (formal)
<?php
/*
<id>underdog:PersonalizedBBC</id>
<name>Personalized BBC</name>
<version>1.8</version>
<type>modification</type>
*/

/*
 * Personalized BBC was developed for SMF forums c/o Underdog @ http://web-develop.ca
 * Copyright 2014 [email protected]
 * Distributed under the CC BY-ND 4.0 License (http://creativecommons.org/licenses/by-nd/4.0/)
 * edited by sangham.net for the mod-developer and its user
*/
global $helptxt;

/* Personalized BBC general text variables */
$txt['PersonalizedBBC_tabtitle'] = 'Personalized BBC';
$txt['PersonalizedBBC_tabtitle_list'] = 'Liste der Personalized BBC';
$txt['PersonalizedBBC_tabtitle_rev'] = 'Personalized BBC Revision';
$txt['PersonalizedBBC_Settings'] = 'Personalized BBC Einstellungen';
$txt['PersonalizedBBC_AdminSettings'] = 'Einstellungen';
$txt['PersonalizedBBC_add'] = '<< Erzeugen eines neuen BBCode >>';
$txt['PersonalizedBBC'] = 'personalized_bbc_';
$txt['personalizedBBC_confirm'] = 'Sind Sie sicher, dass Sie die Änderungen speichern wollen?';
$txt['personalizedBBC_name'] = 'BBCode Name';
$txt['personalizedBBC_description'] = 'Beschreibung';
$txt['personalizedBBC_type'] = 'Art';
$txt['personalizedBBC_parse'] = 'Aufarbeiten (Parsing)';
$txt['personalizedBBC_trim'] = 'Whitespace trimmern';
$txt['personalizedBBC_blockLvl'] = 'Block Ebene';
$txt['personalizedBBC_code'] = 'BBC HTML';
$txt['personalizedBBC_bbc'] = 'BBCode Verwendung';
$txt['personalizedBBC_enable'] = 'Aktivieren';
$txt['personalizedBBC_display'] = 'Zeigen';
$txt['personalizedBBC_delete'] = 'Löschen';
$txt['personalizedBBC_allow'] = 'Erlauben';
$txt['personalizedBBC_deny'] = 'Ablehnen';
$txt['personalizedBBC_submit'] = 'Übermitteln';
$txt['personalizedBBC_image'] = 'BBC Icon';
$txt['personalizedBBC_imageUpload'] = 'Ein Bild hochladen';
$txt['personalizedBBC_membergroups'] = 'Mittgliedsgruppen Berechtigungen';
$txt['personalizedBBC_membergroups_view'] = 'Ansehen können';
$txt['personalizedBBC_membergroups_use'] = 'Benützen dürfen';
$txt['personalizedBBC_membergroups_check'] = 'alle/keine auswählen';
$txt['PersonalizedBBC_page'] = 'Seite';
$txt['PersonalizedBBC_Override'] = 'Überschreiben:';
$txt['personalizedBBC_viewSource'] = 'Autolink deaktivieren';
$txt['PersonalizedBBC_UrlCheck'] = 'Url einrichten';
$txt['PersonalizedBBC_UrlCheckDisable'] = 'offen';
$txt['PersonalizedBBC_UrlCheck3986x'] = 'RFC-3986-A';
$txt['PersonalizedBBC_UrlCheck3986'] = 'RFC-3986-B';
$txt['personalizedBBC_test_button'] = 'Test';
$txt['PersonalizedBBC_viewBBC'] = 'Icon anzeigen: *&#38;#@';
$txt['personalizedBBC_testBBC'] = 'BBCode Test';
$txt['personalizedBBC_test_content'] = 'Inhalt:';
$txt['personalizedBBC_test_option'] = 'Option:';
$txt['personalizedBBC_test_option1'] = 'Option1:';
$txt['personalizedBBC_test_option2'] = 'Option2:';
$txt['PersonalizedBBC_disabledFeature'] = 'Diese Funktion ist derzeit für diese Version deaktiviert.';
$txt['personalizedBBC_jQuery'] = 'Externe jQuery Unterstützung aktivieren?';

// drop-down options
$txt['personalizedBBC_type_options'] = array('[tag]Inhalt[/tag]''[tag=option]Inhalt[/tag]''[tag=option1,option2]Inhalt[/tag]''[tag]');
$txt['personalizedBBC_type_display'] = array('[#%^@!]Inhalt[/#%^@!]''[#%^@!=option]Inhalt[/#%^@!]''[#%^@!=Option1,Option2]Inhalt[/#%^@!]''[#%^@!]');
$txt['personalizedBBC_parse_options'] = array('kein Aufarbeiten (kein parsing)''nur {Inhalt}''{Inhalt} und {Option}');
$txt['personalizedBBC_trim_options'] = array('keines''Innen''Außen''beides');

// error message
$txt['PersonalizedBBC_ErrorMessage'] = 'Sie haben für die Personalized BBC Admin-Sektion keine Berechtigung .';
$txt['PersonalizedBBC_PHP_ErrorMessage'] = 'Ihre PHP Version ist zu alt, bitte erweitern Sie dies zu einer neueren Version.<br />Ihre aktuelle Version ist #@#$! , jedoch benötigt dieses Plugin zumindest die Version 5.3.0';
$txt['PersonalizedBBC_DuplicateErrorMessage'] = '<span class="error">Warnung:</span> Dieser BBC existiert bereits als SMF-Grundbaustein. Bitte verwenden Sie einen anderen BBC-tag.';
$txt['PersonalizedBBC_LengthErrorMessage'] = '<span class="error">Warnung:</span> Die maximale Länge eine BBC-tag-Namens darf 25 Zeichen nicht überschreiten.';
$txt['PersonalizedBBC_IllegalErrorMessage'] = '<span class="error">Warung:</span> Nur Buchstaben, nummern und das Untersteich-Zeichen sind innerhalb des BBC-tag-Namens erlaubt.';

// permissions
$txt['permissiongroup_PersonalizedBBC_perms'] = 'Personalized BBC';
$txt['permissiongroup_simple_PersonalizedBBC_perms'] = 'Personalized BBC';
$txt['permissionname_PersonalizedBBC_perm_view'] = 'BB Code ansehen: #@#$!';
$txt['permissionname_PersonalizedBBC_perm_use'] = 'BB Code nutzen: #@#$!';
$txt['permissionhelp_PersonalizedBBC_perm_view'] = 'Erlauben dieser Mitgliedgruppe den #@#$! BB Code zu sehen.';
$txt['permissionhelp_PersonalizedBBC_perm_use'] = 'Erlaube dieser Mitgliedsgruppe den #@#$! BB Code zu nutzen.';
$txt['PersonalizedBBC_perms'] = 'Personalized BB Codes';

// help text
$helptxt['personalizedBBC_tagHelp'] = 'Bezeichnung des BBC-tags. Diese Eingabe ist in soweit eingeschränkt, als nur Buchstaben, Zahlen und das Unterstreichungszeichen (underscores) verwendet werden dürfen. Leerzeichen, die eingegeben werden, werden in Untersteichungszeichen umgewandelt und der gesamte Text in Kleinbuchstaben konvertiert.<br /><br />Normalerweise, erhalten Sie, wenn ein BBC-tag-Name bereits in den Grundeinstellungen von SMF bereits existiert, eine Warnung und es ist Ihnen nicht möglich diese tag zu speichern. Eine Auswahlbox, die, wenn gewählt, die Wahrnung übergeht und erlaubt den tag zu speichern, ist vorgesehen. Ihr neuer BBC-tag wird dann jeglichen bestehenden SMF-Grundeinstellungs-tag überschreiben.<br /><br />Einen bestehenden BBC-tag-Name, der innerhalb der Liste der Personalized BBC besteht, einzugeben, wird stets den bestehenen überschrieben.';
$helptxt['personalizedBBC_tagDescription'] = 'Die Beschreibung des BBC tag. Diese wird Nutzern angezeigt, wenn sie mit der Maus über den BBC-Knopf gleiten.';
$helptxt['personalizedBBC_tagType'] = 'Wählt die Art des BBC-tags, wobei die Beschreibung der Art eigentlich selbsterklärend ist<br /><br />
Mehrfache Anführung von {Inhalt} in ihrem Code wird wahrscheinlich die "kein Aufarbeiten" Option erfordern.<br /><br />Zwischen  "Aufarbeiten (parsing)" und "kein Aufarbeiten (kein parsing)" hin und her schalten, mag unerwünschte Effekte auf den Code, der eingegeben wurde, haben. Deshalb sollte man nachsehen, ob der Code korrekt ist, wenn diese Option geändert wird.<hr /><hr />Geschlossene BBC-tags werden automatisch auf "kein Aufarbeiten (kein parsing) gesetzt.'
;
$helptxt['personalizedBBC_tagParse'] = 'Wählen Sie die Art des "Aufarbeiten parsing" die verwendet werden soll um das Verhalten des BBC-Codes  zu beeinflussen.<br /><br />"kein Aufarbeiten (kein parsing)": Die Nutzereingaben zwischen den tags werden ignoriert (Nur HTML das in den Code-Einstellungen eingegeben wurde, wird angezeigt).<br /><br />nur {Inhalt}: {Inhalt} wird mit dem ersetzt, was der Nutzer zwischen den BBC-tags eingesetzt hat.<br /><br />{Inhalt} und {Option}: {Inhalt} wird mit den ersetzt, was der Nutzer zwischen den tags angeführt hat. {Option} wird durch jenes ersetzt, was der Nutzer nach `=` innerhalb des BBC-tags eingegeben hat.';
$helptxt['personalizedBBC_tagTrim'] = 'Wählen Sie wie die "whitespace" vom der BBCode Ausgabe-Text getrimmt werden.<br /><br />Diese Option ändert ihren BBC-Code, wenn er innerhalb des Adminbereiches gespeichert wird.<br /><br />"kein": Wird Ihren Code nicht trimmen.<br /><br />"innerhalb": Trimmt jeglichen "whitespace" innerhalb des HTML-tags.<br /><br />"außerhalb": Trimmt jeglichen "whitespace" außerhalb des HTML-tags.<br /><br />"beides": Trimmt alle "whitespace".';
$helptxt['personalizedBBC_tagBlockLvl'] = 'Option, ob eine "Block Ebene" angezeigt werden soll.';
$helptxt['personalizedBBC_tagCode'] = 'Das HTML, welches für den BBC verwendet werden soll.<br />ie. &lt;tag&gt;{Inhalt}&lt;/tag&gt; or &lt;tag alt={Option}&gt;{Inhalt}&lt;/tag&gt;<br /><br /> Sie haben die Möglichkeit die Option [Url Einrichten]-Einstellungen zu aktivieren/a<br />Dieses wird geltend, wen eine Url in diese Eingabe gegeben wird und Sie es wünschen, das dessen Fragmente gefiltert werden um die <a href="http://tools.ietf.org/html/rfc1738">RFC 3986</a> Standards einzuhalten.<br />Dies sollte nur genutzt werden, wenn es notwendig/erforderlich ist, da es Ihre Url\' unnötig falsch umgestalten würde.<br />Diese Option ist standardgemäß ausgeschalten.';
$helptxt['personalizedBBC_tagImage'] = 'Wähle das Bild, welches für den BBC genutzt werden soll. Die standardgemäßen Bilder sind innerhalb der Modification inkludier, Sie können aber Anwender_bilder in folgendem Verzeichnis ergänzen: ../Themes/default/images/bbc/PersonalizedBBC. Nur &@!%@ File-Arten werden akzeptiert.';
$helptxt['personalizedBBC_tagImageUpload'] = 'Hochladen eines Bildes in das Personalized BBCode Bilderverzeichnis.';
$helptxt['personalizedBBC_membergroups'] = 'Die Mitgliedsgruppen-Berechtigungen erlauben die Kontrolle über das Ansehen und den Nutzen der BBCs<br /><br />[Ansehen können]<br />-Mitgliedergruppen, die aktiviert/ausgewählt sind, haben die Berechtigung die BBCodes innerhalb des Beitrages zu sehen. Das deaktivieren/nichtauswählen von Mitgliedergruppen, wird diesen nicht erlauben, den BB Code Inhalt einzusehen.<br /><br />[Benützen dürfen]<br />-Mitgliedergruppen die aktiviert/ausgewählt wurden, haben die Berechtigung diesen BBCode innerhalb von Beiträgen zu nutzen. Die deaktivierten/nichtausgewählten Mitgliedergruooen können diesen BBCode nicht nutzen und es wird von deren Post ge-parsed (entfernt), bevor der Beitrag in der Datenbank abgespeichert wird.';
$helptxt['personalizedBBC_tagViewSource'] = 'Option, ob der die Autoling-Möglichkeit deaktiviert wird, während dieser BBCcode genutzt wird. Dieses zu aktivieren, verweigert dem BBCode-parser ihren Links in in url- oder ftp-BBCodes umzuwandeln.<br /><br />Anmerkung: Autolinks sind automatisch deaktiviert, wenn "Aufarbeiten (parsing)" selbst deaktiviert ist und wiedersteht dieser Option nicht.';
$helptxt['personalizedBBC_testBBC'] = 'Geben Sie bestimmte Daten in dieses Feld ein und drücken Sie den [Test]-Knopf um Ihren BBCode zu testen.<br /><br />Das Ergebnis wird unter den Eingaben am Ende der Anzeige angezeigt.<br /><br />Bitte bemerken Sie, dass das Testen eines BBCoces diesen auch in die Datenbank speichert,<br /> deshalbt sollten Sie diesen, wenn Sie ihn nicht möchten, nach dem Testen anpassen oder innerhalb der BBCode-Liste löschen.';
?>

Also attached as file.

Language seems to be ok.

Last but not least: Would it be possible to let the mod display an alternative html for those who are not able to see (maybe later on) like "To view this content, the "certain membership" is required, please go to your membership opinions in your account setting" (link, link...) even automatically or as optional automatic/manual "hidden-waring display"

Sadhu!
Title: Re: Personalized BBC
Post by: sangham.net on May 29, 2015, 06:09:11 AM
Atma thought it would be fine to have a "share place" for codes and htmls:

Share and get code and html snipsl for "Personalized BBC" and similar modes (http://www.simplemachines.org/community/index.php?topic=536896.msg3815424#msg3815424) (topic not approved jet)

for the case it will be better places here: 

QuoteValued SMF-Supporters and Friends,

Atma (me) accidentally found two days ago this Mod "Personalized BBC (http://www.simplemachines.org/community/index.php?topic=523396.0)", made by Chen Zhen and found it wonderful while "playing around" to realize some open wishes.

While doing so, and as he is not really someone into the matter of programming and html, he thought that there would be others like him as well and it would be great to have a common share place  of ideas and solutions, so that one does not need to go far or take something from here and there which is not consciously given.

So this tread should be dedicated for BBCode solutions and short snipls and of course with no specific rights reserved.

Atma will also mention, that he is not so aware if there are similar mods like Personalized BBC and please don't feel that it's limited for it and maybe those who have shared similar tools, can also share the links to their modes.

Of course, critic and further hints and discussions should be welcome.

To get a little bit standard to it, it would be good if you design you post like this:

QuoteName: youtube
Description: Simple html to emed youtubes. You may change the layout within the div-style or use the id "youtubex" to style it in your index.css. to embed Youtube Videos by using the new BBCode (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsangham.net%2FThemes%2Fsangham%2Fimages%2Fbbc%2FpersonalizedBBC%2Fyoutube.gif&hash=63e5b5259897207eb201ebb227f413de21bb442a). Please just put the code of the video between this tags.

For example, you may have such urls:

https://www.youtube.com/watch?v=eiSez7NHRqc
https://youtu.be/eiSez7NHRqc


just use the bold marked code: [youtube]eiSez7NHRqc[/youtube] and you get something like this at the end of the post.

Reason for use: make it possible for certain groups to embed and/or see youtube clips
SMF Version: 2.0.10
Special requirements: none
Mod used: Personalized BBC
BBC Tag: [youtube]
Parsing: Yes content (No / Which)
BBC HTML: <div style="padding:1em 1em 1em 3em;" id="youtubex"><iframe width="360" height="240" src="https://www.youtube.com/embed/{content}" frameborder="0" seamless></iframe></div>
Picture: attached alternative youtoub.gif
Samlpe link: embed Youtube, new BBC (http://embed%20youtube,%20new%20bbc)

Much joy in working and sharing!

metta & Mudita
Samana Johann
Title: Re: Personalized BBC
Post by: sangham.net on May 31, 2015, 02:13:03 AM
Atma has seen, that the translation of {content} and {option} could cause easily "problems" also the mod is fantastic, because it refreshes even the content of the html-content in the settings. So he had changed to the original {content} and {option} in the german.language.php and attaches it here:


May it be of use.
Title: Re: Personalized BBC
Post by: Sigyn on June 21, 2015, 10:54:34 PM
Cheers! We use this mod frequently on our forum as a way to color the speech of our dragons.

I do have a small issue, perhaps a bug...
Occasionally, though no one has touched the edit for the code, the checkboxes will all unmark and the BBC code and wherever it has been used becomes invisible. I have to go back into the code again to check the boxes and fix it, but I am confused because no one has messed with the code to unmark them.

Is this something that happens often, or something that can be fixed? Does it perhaps interact at all with the Alphabetized BBC mod? Any support or fixes would be lovely, thank you!

Sigyn
Title: Re: Personalized BBC
Post by: sangham.net on June 21, 2015, 11:32:37 PM
Yes, such happens, Sigyn. Mostly if you modify BBCs or put new into it. No real reason found. It could be that it happens if you change some permissions within a group or add new groups. 
Title: Re: Personalized BBC
Post by: Sigyn on June 21, 2015, 11:37:47 PM
I haven't edited the codes that disappear, nor any groups - though I am hoping perhaps there's a solution for it :) It just happens randomly to many of the codes.
Title: Re: Personalized BBC
Post by: sangham.net on June 21, 2015, 11:54:10 PM
Double it, since it is a great mod. Now that what is given is all one is able. Maybe you have an idea how to honor such.
Title: Re: Personalized BBC
Post by: Stanyy on August 09, 2015, 02:32:08 PM
How do I set up a custom message for people who cannot see tags?
Title: Re: Personalized BBC
Post by: romanos8 on September 15, 2015, 02:51:41 AM
How can I add the following tags as a bbcode?.

<table align="center" border="8" cellspacing="0">

<tr>
<td align="center" bgcolor="yellow">
<font color="red" size="4">Happy</font>
</td>
</tr>

<tr>
<td align="center" bgcolor="aqua">
<font color="blue" size="4">Anniversary</font>
</td>
</tr>

</table>


I want to build advanced tables.


Thanks for your help.
Title: Re: Personalized BBC
Post by: Chen Zhen on September 22, 2015, 11:39:24 PM
Stanyy,

  Currently there is no option to display optional text although it is a good idea to add to a future release.
For version 1.9 you can edit 2 functions yourself and change the empty text replacements with something specific.
Edit file: ../Sources/PersonalizedBBC.php where you can edit the two functions named: PersonalizedBBC_parser  & PersonalizedBBC_redact.





romanos8,

  To add BBCode that requires no input from the user you create tag  ~ type: [tag] ~, enter the name, description, add the HTML, opt an icon and save it.
Some of the HTML you have shown is deprecated although it will still work.
However, you can use something like this in its stead:
<table style="border-spacing: 0px;border: 8px ridge;">
<tr style="height: 30px;">
<td style="text-align:center;color:red;background-color:yellow;font-size:1em;vertical-align: middle;width: 100px;">Happy</td>
</tr>
<tr style="height: 30px;">
<td style="text-align:center;background-color:aqua;color:blue;font-size: 1em;vertical-align: middle;width: 100px;">Anniversary</td>
</tr>
</table>


Regards.
Title: Re: Personalized BBC
Post by: Sigyn on November 12, 2015, 06:10:05 PM
Excuse me, I was wondering if it were possible to show more codes in the list per page... right now I have 6 pages and if possible I would like to show all of them on one scrolling page. Is this something easy to modify?
Title: Re: Personalized BBC
Post by: Chen Zhen on November 13, 2015, 02:06:03 PM
Sigyn,

File:
../Sources/PersonalizedBBC_AdminSettings.php

find:

$context['personalizedBBC'] = PersonalizedBBC_pagination($context['personalizedBBC_list'], $scripturl . '?action=admin;area=PersonalizedBBC;', 10);


.. change the number 10 to the amount of entries you would like displayed per page.
ie. if want them all & you have less than 100 then opt 100

Regards.
Title: Re: Personalized BBC
Post by: Sigyn on November 14, 2015, 12:39:32 AM
Thank you so very very much!!! :D
Title: Re: Personalized BBC
Post by: Sigyn on January 02, 2017, 06:57:02 PM
Where in the code might I set "Show" to be disabled after a new BBcode's creation? Specifically, I want it to not show by default.
Title: Re: Personalized BBC
Post by: Chen Zhen on January 10, 2017, 09:19:19 PM
Sigyn,


File: /Sources/PersonalizedBBC_AdminSettings.php


find:

array($name, '', '', '', '', '', 'rfc0', 0, 0, 0, 0, 1, 1, 0),


replace:

array($name, '', '', '', '', '', 'rfc0', 0, 0, 0, 0, 0, 1, 0),
Title: Re: Personalized BBC
Post by: Sigyn on January 10, 2017, 11:54:10 PM
Thank you so much!

*Edit* After editing the code I cleared the cache and tested it with a new BBCode and it still defaulted to Show on the checklist? However, Enable is now unchecked. I do want it enabled, I don't want it to show on the Post/Reply screen with the other BBCodes.
Title: Re: Personalized BBC
Post by: Chen Zhen on January 11, 2017, 09:37:40 PM


array($name, '', '', '', '', '', 'rfc0', 0, 0, 0, 0, 1, 0, 0),
Title: Re: Personalized BBC
Post by: Sigyn on January 11, 2017, 11:58:49 PM
Quote from: Chen Zhen on January 11, 2017, 09:37:40 PM


array($name, '', '', '', '', '', 'rfc0', 0, 0, 0, 0, 1, 0, 0),

That worked! Thank you very much :D
Title: Re: Personalized BBC
Post by: digger on March 29, 2017, 12:01:27 PM
This mod breaks SMF autosuggest feature.
<script type="text/javascript">window.onload = function() {pbbc_containers("iframe");};</script>';
This code drops any other window.onload registered events.
Title: Re: Personalized BBC
Post by: Chen Zhen on April 09, 2017, 12:19:44 PM

digger,

  Are you using IE or MS-Edge?
The script you referenced simply calls a function that adds id's and names to iframes that are void of those.
However there is another function that may be called that has some DOM attribute assignment script that is not compatible with IE or MS-Edge (I just noticed it).
I have a fix for it but I will have to test things first.
Thanks for the report.

Title: Re: Personalized BBC
Post by: Arantor on April 09, 2017, 12:23:21 PM
The issue is that something is already using window.onload - what you do in that assignment overwrites anything already on window.onload. You need to add it as an event listener on the onload event so it stacks on top of what is already there.
Title: Re: Personalized BBC
Post by: Chen Zhen on April 09, 2017, 02:28:58 PM

Yes I see that you are correct & thanks for the heads up.
I still have to rewrite it to be compatible with IE/MS-Edge & that includes attachEvent for older IE < 9 versions to add to what you just stated.
The addAttribute I had in the js file is also an issue with IE which is what I previously stated and needs to be changed to ie. :  > element.style.attibuteName = 'attr';
I rewrote some of it & just need to test it.
Title: Re: Personalized BBC
Post by: Arantor on April 09, 2017, 02:49:20 PM
SMF already has a function for that purpose, createEventListener, that is browser agnostic.
Title: Re: Personalized BBC
Post by: Chen Zhen on April 10, 2017, 12:32:43 AM
Released v1.92 which is available on GitHub & on the SMF modification section.

[version 1.92]
! fixed IE compatibilty for DOM style elements
! changed window.onload to addEventListener/attachEvent
Title: Re: Personalized BBC
Post by: drewactual on September 01, 2017, 09:48:30 AM
is the customization capable of handling a php call?  such as strip_tags?
Title: Re: Personalized BBC
Post by: Chen Zhen on September 05, 2017, 11:41:09 PM
No it does not use eval to execute any php code.
You can use jQuery/javascript to have a similar effect as this mod allows the output of HTML and/or Javascript from an added tag's settings.
Title: Re: Personalized BBC
Post by: ambre222 on January 29, 2018, 04:44:52 PM
Hello,
Thanks a lot for your mod. However I have an issue, it works but I have a lot of errors in the logs, all of the same kind "undefinded index"
8: Undefined index: board_name
/forum/Themes/default/languages/PersonalizedBBC.english.php (main sub template - eval?)
Ligne: 399
Or
8: Undefined index: member_name
or
8: Undefined index: topic
I have the version 1.93 (but with the version 1.92 it was the same) on smf SMF 2.0.15 for a french forum.
Thanks for your helop
Title: Re: Personalized BBC
Post by: njtweb on May 20, 2018, 01:09:54 PM
Did the type you chose include content & option, as shown above?

The mod has a handy test link. 

Again - we're now deep into how to use the mod - further discussion on how to use the mod should take place on the mod support thread - so other users of the mod (who will be much more familiar with it...) can help:

When I adjust by selecting content and option from the drop down nothing happens at all when I do the test.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 21, 2018, 11:15:12 AM

I haven't updated this mod in a long time.
With version 1.93 the test feature needs some tweaking/changes for it to work properly.
Any javascript within the bbcode will not work with the test button but they will work just fine in your forum portal pages & posts/topics.
Until I update the mod you will have to test bbcodes containing javascript on either portal (html) blocks or posts/topics (-< ie. recycle bin).

Thanks for the feedback.
Title: Re: Personalized BBC
Post by: -Rock Lee- on May 21, 2018, 07:55:36 PM
I leave the translation to Latin Spanish, anything you tell me (I think it serves you as much as 2.x as for 2.1 but let me know)!


Regards!
Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 22, 2018, 07:00:33 PM
I've upgraded a very old forum from 1.1.12 -> 2.0.15, it was running Custom BBCode (https://custom.simplemachines.org/mods/index.php?mod=621) mod.  Found the tag code in the database, two fields -



<a href="#" onmouseover="forumCardNum('$1');">
<a href="javascript:opencard('card$2')" onmouseover="forumCardNum('$2')" onmouseout="UnTip();">$1</a>



It pops up a window on mouseover that contains an image.  Trying to get it working with Personalized BBC, no luck.  The javascript functions opencard(number) and forumCardNum(number) are in forumCode.js, which is located in account root, above forum directory, don't know how it's called.  Any way to make this work?
Title: Re: Personalized BBC
Post by: Chen Zhen on May 23, 2018, 03:11:26 PM

The first hyperlink is not closed therefore the XHTML you posted is not complete.




try
type: [tag=option]content[/tag]
parsing: none

$1 will be entered as {content}
$2 will be entered as {option}




If you ever need to use 2 options
try
type: [tag=option1,option2]content[/tag]
parsing: none      

$1 will be entered as {content}
$2 will be entered as {option1}
$3 will be entered as {option2}                  




Multiple content and/or options always require parsing to be set to none.
In some cases further control over a bbcode may require javascript therefore it is not difficult to achieve the desired result.
I do not have a copy of the js file to test this.
If you can not get it to work then post the js file & try to show me an example of how it should function.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2018, 01:04:12 AM

ie. for this code (the hyperlink that is proper from your previous post):

<a href="javascript:opencard('card$2')" onmouseover="forumCardNum('$2')" onmouseout="UnTip();">$1</a>


.. the bbcode html should be entered like this:

<a href="javascript:opencard('card{option}')" onmouseover="forumCardNum('{option}')" onmouseout="UnTip();">{content}</a>
Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 24, 2018, 06:46:53 PM
If you go here (https://web.archive.org/web/20081229143948/http://swpocketmodels.com:80/forum/index.php?topic=2598.msg39141) and mouseover 'Jedi Valor' in first post, a window opens that should contain an image.  The archive doesn't have the image files, but production install does.  The js functions are in attached forumCode.js, which is one directory level above the forum.  Images are in /images directory off root (same level as /forum).  The code in your second post displays the link correctly, but nothing happens on mouseover.

These are the two tags I could find in the db -



variable value
customBBCode_tag_1 cardnum
customBBCode_before_1 <a href="#" onmouseover="forumCardNum('$1');">
customBBCode_text_1 <a href="javascript:opencard('card$2')" onmouseover="forumCardNum('$2')" onmouseout="UnTip();">$1</a>

customBBCode_tag_4 shipnum
customBBCode_text_4 <a href="javascript:openship('ship$2')" onmouseover="forumShipNum('$2')" onmouseout="UnTip();">$1</a>


Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2018, 10:05:19 PM
See this here...

customBBCode_before_1 <a href="#" onmouseover="forumCardNum('$1');">


It is incomplete because there is no closing tag for the hyperlink.
This is what I tried to tell you in my second last post.
Also show me the actual bbcode input in a code or quote.. I mean what is actually contained in a post using the tag.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2018, 10:38:45 PM

The mouseover is working just fine as I have tested it with an alert.
The problem is that you are missing other javascript file(s).
The file you posted has several function calls that do not exist.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2018, 11:32:37 PM
Alright after taking a look at things I can see you failed to include a file named wz_tooltip.js and this is why it also does not work on the forum link you provided.
That tooltip is available from the author here: Walter Zorn Tooltip (http://www.walterzorn.de/en/tooltip/tooltip_e.htm#download).
That zip archive includes 3 files whereas for this example I am only using 1 of them because I am not sure if the other 2 are necessary for the task at hand.
Also it seems it will not work properly unless the script is able to resolve full url paths.

Keep in mind all this stuff you are using is archaic.
There are updated javascript and/or jQuery equivalents but that's up to you to pursue & use those.

I rewrote some of the script you provided and am going to include the one file you need to use it.
wz_tooltip.js is written in such a way that it will not function properly unless you include it directly after the <body> tag of the document.

Download the 2 files (wz_tooltip.js & forumCode.js) & place both of them in: ../Themes/default/scripts
ie. for the default theme...
file: ../Themes/default/index.template.php
find:

</head>
<body>


replace with:

<script src="' . $settings['default_theme_url'] . '/scripts/forumCode.js?v193" type="text/javascript"></script>
</head>
<body>
<script src="' . $settings['default_theme_url'] . '/scripts/wz_tooltip.js?v2015" type="text/javascript"></script>


.. unless forumCode.js is added differently ie. via $context['html_headers'] .. if so then ignore the first script tag before </head>

Here is the BBCode:

<a href="javascript:opencard('{option}')" onmouseover="forumCardNum('{option}')" onmouseout="UnTip();">{content}</a>


The file has been adjusted assuming ships.php is located in your main forum directory.
Also it was written such that forumGallery.php is located in ../Themes/default/scripts even though that is supposed to be for js files.
I did not change where it attempts to use those files from those locations.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 24, 2018, 11:44:38 PM

Rock Lee,

Thank you for the translation files.
I will look them over and likely put them in the download section of my website.
Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 25, 2018, 12:37:54 PM
Thanks, Chen, I'll get to this tonight.  Still trying to figure out how it was working in original 1.1.12 install.  forumCode.js and ships.php are located one level above forum, they're not called in the forum code.  Don't see wz_tooltip.js or forumGallery.php anywhere, and there is no /Themes/default/scripts subdir.  The broken link is what's in the database for cardnum tag, and it was working that way.  I'm not attempting to rewrite the thing, just want to get it working in 2.0.15.  This was a disaster forum running on GoDaddy, they'd moved everything to different servers without advising owner, database was damaged, backups were lost.  I've recovered most of it, but there are a lot of really old customizations that were done by people who are no longer around.  Trying to fix as much as I can.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 25, 2018, 02:24:22 PM

forumCode.js and ships.php are located one level above forum


It accesses ships.php via the url and of course same with loading the js file.
Therefore to have a site use it like that, SMF has to be installed on a sub-directory.
Unless you change it around a bit like I did & place those files in the appropriate directories then you can access those files from the forum directory as a base.
I don't know what is to be displayed as far as clicking the link and having it use the ships.php file.
If you want to have all the user info & such plus show the forum header & footer then it would be best to relocate that file to ../Sources then edit the menu array in  Subs.php to load it via the index.

Either way some of my subtle path changes to forumCode.js likely have to be readjusted & you need wz_tooltip.js for sure.
Changing those paths shouldn't be difficult for you to figure out by editing the file although I do not know your experience with adjusting (paths in) script files.
Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 26, 2018, 12:51:48 AM
Ok, got some of it working.  Had to correct paths to images in forumCode.js.  If you go here (http://swpocketmodels.com/forum/index.php?topic=2254.msg34800#msg34800), the cardnums are working -



[cardnum=059]Lock it down[/cardnum]
[cardnum=088]C-3PO[/cardnum]
[cardnum=sv005]Fiesty R2-Unit[/cardnum]
[cardnum=081]2-1B[/cardnum]
[cardnum=065]Repair[/cardnum]
[cardnum=ga098]Rs-D2[/cardnum]
[cardnum=107]Genosis Droid factory[/cardnum]



but the shipnums are not -



[shipnum=o15]Tantive IV[/shipnum]
[shipnum=27]Redemption[/shipnum]



Tried this for shipnum, ng -



<a href="javascript:opencard('{option}')" onmouseover="forumShipNum('{option}')" onmouseout="UnTip();">{content}</a>



And if you go here (http://swpocketmodels.com/forum/index.php?topic=2598.msg39135#msg39135) and mouseover 'Jedi Valor', window opens but image is missing -



[cardnum=cwt26]Jedi Valor[/cardnum]



Haven't figured out what the prefixes before the numbers mean.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 26, 2018, 08:32:09 PM

The BBCode works fine but I was not given specifics regarding directories.
I will send you a PM regarding what you are attempting to do.

Title: Re: Personalized BBC
Post by: Chen Zhen on May 27, 2018, 01:28:35 AM
I attached a replacement file.
The paths have been adjusted and this time I included a function at the top to adjust those paths if need be.

The original script attempted to use a file which is throwing an error:
.../Script/forumGallery.php

Since you informed me that there is a similar filename located in the root directory, you can have it use that one in its stead:
.../gallery.php


If it is supposed to be using .../gallery.php then do the following edit:
find:

var galleryUrl = setCardPaths("openforumgallery", true);


replace:

var galleryUrl = setCardPaths("opengallery", true);


Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 27, 2018, 01:46:25 AM
Will try that.  Fixed some things in forumGallery.php, it loads part of the page now.  There's a problem in ships.php, it wants to connect to a nonexistent database.  There are 7 databases in the account, but not the one it wants.  Is that script used?
Title: Re: Personalized BBC
Post by: Chen Zhen on May 27, 2018, 01:48:28 AM
That file is called when one clicks on an image hyperlink.

BTW - I switched the argument within the file in the last post because you seem to be using ../Scripts/forumGallery.php

Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 29, 2018, 12:30:35 AM
FYI, got both the cardnum and shipnum tags working in Personalized BBC here (http://swpocketmodels.com/forum/index.php?topic=2254.msg34800#msg34800), file attached.

"Even a blind pig occasionally finds a mushroom." :P

Thanks.
Title: Re: Personalized BBC
Post by: Chen Zhen on May 29, 2018, 01:58:19 AM
openship is still not working but I assume that is because the data it needs is missing?

Plus it's throwing an error because it needs the updated mysqli database query syntax.
ref. http://php.net/manual/en/mysqli.construct.php
Title: Re: Personalized BBC
Post by: Sir Osis of Liver on May 29, 2018, 05:47:17 PM
Not sure what you're looking at, there are only two bbc tags in db, cardnum and shipnum, and both work except in posts where the linked image doesn't exist.  Been fixing php errors as they're reported, but some of them don't throw errors and don't show up in server log.  I did notice that if you click on the bbc links where mouseover works, you get these errors -



Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/content/08/11728508/html/forum/ships.php on line 29

Warning: mysql_connect(): Unknown MySQL server host 'DBPROD' (0) in /home/content/08/11728508/html/forum/ships.php on line 29
Connection Failed error.



First one I've fixed in several places, second one is caused by connection to nonexistent db.  This part of the code seems to have more to do with the gallery than bbc tags, don't know why it affects the tags.