Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Cel PHP in Custom BBCode Details »
Cel PHP in Custom BBCode
Mod Version: 4.001, by cellarius (Coder) cellarius is offline
Developer Last Online: Nov 2017 I like it Show Printable Version Email this Page

vB Version: 4.x.x Rating: (4 votes - 5.00 average) Installs: 23
Released: 08 Jun 2011 Last Update: Never Downloads: 154
Not Supported Uses Plugins  

This addon allows for PHP-Code to be used in Custom BBCodes

It offers a framework for the easy integration and sharing of custom BBCodes that are based on PHP processing of the data entered by the user. It could, for example, be used to develop BBCodes that use multiple options or to poll database information. It does allow for the Admin to use PHP in the Backend - it does, of course, not allow this to forum visitors.

You need to know PHP to use this Addon to develop your own PHP based bbcodes, however it would be possible to share them as an extension to this addon.


Installation:
- install the product file - done.


Using PHP in Custom BBCodes:
Create your Custom BBCode as always, and just put your PHP into the Replacement box (where the HTML used to go).
Just remember two things:
  • Your code needs to start with <?php
  • You need to return the result of your code.
If you're unsure what that means, read the php manual on eval() and look at the evaltest example in the second post.


For coders: include instead of eval

If you'd rather store the PHP for your new BBCodes in the file system for ease of development, that's possible, too:
  • create a folder called "custombbcodes" in your forum root
  • in that folder, create a php file that copies your BBCode Tag Name (ie. if your tag name is "includetest", the file needs to be called "includetest.php"). That's where your PHP goes.
  • in the Replacement box in the Custom BBCode Dialog, just put the word "include", nothing else
  • Since there's no eval() here, no need to return the result. Instead, it needs to go into $parsed.There's also an includetest example in the second post.
No Support for your PHP-Code!

### See the example BBCodes in the second post (click)! ###


### Don't forget to click install! ###
(No support if you don't)

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	admincp_evaltest.PNG
Views:	415
Size:	53.5 KB
ID:	129861   Click image for larger version

Name:	admincp_includetest.PNG
Views:	274
Size:	42.4 KB
ID:	129862   Click image for larger version

Name:	editor_41.PNG
Views:	535
Size:	23.1 KB
ID:	129863   Click image for larger version

Name:	parsed_41.PNG
Views:	573
Size:	18.6 KB
ID:	129869  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Miscellaneous Hacks Cel Show Primary Usergroups Only on showgroups.php cellarius vBulletin 3.8 Add-ons 12 23 Mar 2010 21:54

Comments
  #2  
Old 08 Jun 2011, 15:59
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
PHP BBCode Examples:

To test them, go to AdminCP->Custom BB Codes->Add new BB Code and fill in the form:

--------------------------------------------------------------------
  • Title: evaltest
  • BBCode Tag Name: evaltest
  • Replacement:

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

  • Example: [evaltest]Hello World![/evaltest]
  • Use {option}: No
--------------------------------------------------------------------
  • Title: includetest
  • BBCode Tag Name: includetest
  • Replacement:
[code]include[code]
  • Example: [includetest="World!"]Hello![/includetest]
  • Use {option}: Yes
Additionally, you need to create a directory called custombbcodes, and in it create a file called includetest.php with the following code:

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

--------------------------------------------------------------------
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de

Last edited by cellarius; 09 Jun 2011 at 11:43.
Reply With Quote
  #3  
Old 09 Jun 2011, 11:21
AttalaEA AttalaEA is offline
 
Join Date: Apr 2011
Please I don't understand what this Mod is doing since I am a beginner can you please give us a simple clarification?

Thank You
Reply With Quote
  #4  
Old 09 Jun 2011, 11:31
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
If you're not familiar with PHP this addon probably is not for you. It allows you to use PHP code when processing BBCodes, so you are much more free when it comes to what you can do with BBCodes. You could do BBCodes with multiple options, for example, or poll your database for information. But you'd need to write the code for that yourself, this offers just the framework to run that code.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #5  
Old 12 Jul 2011, 01:03
radiofranky radiofranky is offline
 
Join Date: Jun 2011
this is what i'm looking for. T
Reply With Quote
  #6  
Old 12 Jul 2011, 05:59
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Then mark as installed
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #7  
Old 08 Nov 2011, 04:44
mishwar222 mishwar222 is offline
 
Join Date: May 2010
Nice work! thank you


I need a little help please. I am trying to make bbcode with three options. I need the pop up form for the option to have three text areas for three inputs. It is ok with me if the contents of those areas got in one string after submitting them. I can divide them in the php file. is this possible? if not is there anyway to make a pop up form of my own?
Reply With Quote
  #8  
Old 01 Dec 2011, 23:02
lemonadesoda lemonadesoda is offline
 
Join Date: Dec 2009
cellarius, this looks really useful! But could you kindly review your OP and possibly add more info, and clarify some potentially confusing language. Simplify your sentence construction so that someone who has english as a second language can understand 100%.

Same goes for your examples post. A more interesting third example would be great too! The magic is in the write up! Not just the code :-)
Reply With Quote
  #9  
Old 09 Jul 2012, 04:36
Kyojii Kyojii is offline
 
Join Date: Jun 2008
If you needed to do a query with the value is it already sanitized?
Reply With Quote
  #10  
Old 09 Jul 2012, 06:40
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Havn't checked that. Just give it a try.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #11  
Old 09 Jul 2012, 08:35
Kyojii Kyojii is offline
 
Join Date: Jun 2008
I checked it, and it appears it is.
Reply With Quote
  #12  
Old 30 Apr 2013, 20:07
Divvy Divvy is offline
 
Join Date: Nov 2008
Hello guys,

Can someone please help me?
I need to use this php code in my custom bbcode:


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

How to do it correctly?

Thanks!
Reply With Quote
  #13  
Old 30 Apr 2013, 21:13
tbworld tbworld is offline
 
Join Date: Oct 2008
I think you should be posting this in the programming forum. This post does not apply to Cel's MOD.

I am trying to help, but I need to see the other part of this JavaScript / jquery code you are working with. You did not post PHP. Unfortunately it doesn't look like valid JavaScript or jquery either. So I am at a little bit of a loss to assist you.

Re-post as a new thread in the programming forum and post your source references, including function 'sociallocker'. Once we see the full picture it should be easy enough to help you.
Reply With Quote
  #14  
Old 03 Apr 2016, 02:07
grey_goose grey_goose is offline
 
Join Date: Jun 2009
I'm a little late to the party, but finally ended up using this for a multi-variable bbcode.

Fantastic mod, it's got a lot more potential that has my imagination fired up
Reply With Quote
Reply


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

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
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 05:49.

Layout Options | Width: Wide Color: