Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 02 Dec 2011, 02:20
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Real name: Rick-owner, Kym-admin
Plugin based CKeditor friendly BBcode in vB4.1.8+ - howto

Plugin based CKeditor friendly BBcode in vB4.1.8+ - howto

I've put all the Ausphotography (AP) custom BBcodes into a plugin.
Here is a skeleton example (with detailed comments) of how to do it.

Skills needed: Intermediate PHP and vBulletin admin.

Tutorial
In the example the BBcode is 'w' which allows a warning to be posted in a thread.
Make sure you BBcode does not conflict with the standard BBcodes or
any other product BBcodes you have on your system.
You can add multiple BBcodes using one plugin, just code a call back function
for each and set the tags for each BBcode following the example.

The syntax is (no option and option to change the Warning text):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

ICON
If you want an icon for your BBcode create and copy a small icon
(say) APwarning.png (18x18) to your ./images/editor directory,
the record insert will need the icon path in the buttonimage field.
APwarning.png

Product xml file
Write a small product xml file that looks like the example below.
Name it 'product_my_bbcodes.xml'
You will need to write a call back function and set the tag list entries.
Install the product via AdminCP.

You will need to adjust the insert records.
The options are a bit field based on:
- strip_empty - 1
- stop_parse - 2
- disable_smilies - 4
- disable_wordwrap - 8
- disable_urlconversion - 16

Call back function
Each BBcode will require a call back function as shown in the example and the tag_list definitions.
The return function is what is put in the parsed post.
You can implement database accesses in the BBcode processor (you need global $vbulletin; enabled per normal.
Note this code is CKeditor friendly in that it tells CKeditor to ignore your BBcode in WYSIWYG mode.

Tag list
The tag list defines which options are active on the BBcode tag and should match the options of the insert record.



Enjoy!

Kym

__________________________________________________


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
www.AusPhotography.net.au a.k.a. AP is a photography forum where members share their photography, photo editing skills and techniques. We run regular photographic competitions; Rick (site owner) and Kym (site tech) using this account
*** Home of the AP fully comprehensive vb4 photographic competition management solution ***
Reply With Quote
  #2  
Old 02 Dec 2011, 02:21
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Real name: Rick-owner, Kym-admin
Sample...

sample.jpg
__________________
www.AusPhotography.net.au a.k.a. AP is a photography forum where members share their photography, photo editing skills and techniques. We run regular photographic competitions; Rick (site owner) and Kym (site tech) using this account
*** Home of the AP fully comprehensive vb4 photographic competition management solution ***
Reply With Quote
  #3  
Old 02 Dec 2011, 02:45
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Looks confusing, but good.
Reply With Quote
  #4  
Old 02 Dec 2011, 04:55
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Real name: Rick-owner, Kym-admin
Originally Posted by Boofo View Post
Looks confusing, but good.
Ha ha!

The main issues that you need to deal with are:
  1. Create a BBcode database record, optionally with an ICON path defined
  2. Have a plugin @ hook: bbcode_create that
    1. defines a handler function to parse the BBcode and return some HTML
    2. set the tag_list entries, pointing at the handler
__________________
www.AusPhotography.net.au a.k.a. AP is a photography forum where members share their photography, photo editing skills and techniques. We run regular photographic competitions; Rick (site owner) and Kym (site tech) using this account
*** Home of the AP fully comprehensive vb4 photographic competition management solution ***
Reply With Quote
  #5  
Old 08 Mar 2012, 14:52
miiax6 miiax6 is offline
 
Join Date: Aug 2006
Hello snoopytas
my join date is 12 Aug 2006
and it's first time to say thanks

thanks Very much

the most tip i searched for was
wysiwyg_no_parse

vbulletin api are sucks

--------------- Added 08 Mar 2012 at 15:21 ---------------

could you tell me how can i fin iformation like this wysiwyg_no_parse

--------------- Added 08 Mar 2012 at 15:23 ---------------

also how could i ask editor for coustome view for user but use the bbcode on save
Reply With Quote
  #6  
Old 05 Apr 2012, 03:38
AusPhotography's Avatar
AusPhotography AusPhotography is offline
 
Join Date: Nov 2007
Real name: Rick-owner, Kym-admin
@miiax6
-- I find the information by looking at the vB code.
The vB API etc. is very powerful, but there is not a lot of deep documentation.

>also how could i ask editor for coustome view for user but use the bbcode on save
This is very hard as you have to know the internals of CKeditor.
__________________
www.AusPhotography.net.au a.k.a. AP is a photography forum where members share their photography, photo editing skills and techniques. We run regular photographic competitions; Rick (site owner) and Kym (site tech) using this account
*** Home of the AP fully comprehensive vb4 photographic competition management solution ***
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:40.

Layout Options | Width: Wide Color: