News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom BBCode

Started by Sarke, March 03, 2007, 02:40:26 PM

Previous topic - Next topic

devouk

Hi all

I am really struggling with BBCode .. mainly because i want to make quick button that use nested bbcodes

ie i have a mp3 bbcode called [mp3]http://somewhere.com/something.mp3 [nofollow][/mp3]  which converts to [mp3=200,20,1,center][/mp3] 

now lets say if i wanted to create my own bbcode to do this using which uses the mp3

i call it mp3play then entered the following in the code <tag>[mp3=200,20,1,center]{content}[/mp3]</tag> but it doesnt work, seem just to produce a hyperlink of [mp3=200,20,1,center]http://somewhere.com/something.mp3 [nofollow][/mp3] rather than initiating the embeded mp3 player

i think i tried all combinations and just cant seem to get it to work when using other bbcodes any ideas or advice to tell me what i am doing wrong

Mabry

I have a new board and this is the only mod I've installed so far. In spite of installing this mod 3 separate times I still cannot get anything new to show in the admin area. I'm using version 1.1.13 and, although I have several templates for the site, I am using the default template.

At this point in time the only bbcode I'm wanting to add is (web)(/web) (() => brackets ;)). Is there any way to simply hard code it in somewhere (file, database)?

WTIA for any and all help!

żεχเ๏ภ

#282
Hey folks, recently installed this mod on a SMF 1.1.xx forum.

Trying to get a custom tag a Non-SMF forum uses to work for SMF. This tag is called "[popup]".

Code (bbcode) Select
[popup={option1},{option2},{option3}]{option4}[/popup]

Code (html) Select
<a href="{option1}" onclick="popup(this.href, {option2}, {option3}, ''); return false;" title="{option1}"><strong>{option4}</strong></a>

Code (usage) Select
[popup=URL,WIDTH,HEIGHT]TEXT[/popup]

However, I can't get it to work. The mod has almost no instructions, but is the only one I could find. I put the HTML in the html box, and saved the bbcode tag, then I try the tag in a test post; The output is just "{option4}" as a link, but when clicked, it does nothing. Any help greatly appreciated. :(

Thanks,

Jason


P.S. Could this be because the mod only has support for one "{option}"?

żεχเ๏ภ

This mod is deader than Michael Jackson. Shame, it's a great concept.  :'(

Chen Zhen

#284
This mod only allows a single user input and within your html code it should be entered as {content}.

ie.

[popup={option}]{content}[/popup]
or
[popup={content}]...text...[/popup]
or
[popup]{content}[/popup]
or
[popup]{content}

depending on setup for the specific bb code.


example html:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/{content}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="344"></embed></object> 


The above example is for a youtube bb code where a user just enters the video number between the tags.
(  setup for
  [/color])
ie





My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

żεχเ๏ภ

Quote from: -Underdog- on June 03, 2011, 09:27:37 PM
This mod only allows a single user input and within your html code it should be entered as {content}.

ie.

[popup={option}]{content}[/popup]
or
[popup={content}]...text...[/popup]
or
[popup]{content}[/popup]
or
[popup]{content}

depending on setup for the specific bb code.


example html:

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/{content}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="344"></embed></object> 


The above example is for a youtube bb code where a user just enters the video number between the tags.
(  setup for
  [/color])
ie


I realised. Now if you could tell me how to modify it to add support for multiple options, we'd be in business.

Chen Zhen

Quote from: żεχเ๏ภ on June 03, 2011, 10:42:21 PM
I realised. Now if you could tell me how to modify it to add support for multiple options, we'd be in business.

Hmm.. one way to do it is to have it execute a php file and carry the needed multiple entries in the url (seperated by commas).
Then have your php file fetch the needed info from the url (using $_REQUEST) into an array by using preg_split.

If you want your php file to be secure you should have it executed as an action from the index using file and function.
... perhaps the custom action mod as well that is for this?! 

My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

żεχเ๏ภ

Quote from: -Underdog- on June 03, 2011, 10:58:47 PM
Quote from: żεχเ๏ภ on June 03, 2011, 10:42:21 PM
I realised. Now if you could tell me how to modify it to add support for multiple options, we'd be in business.

Hmm.. one way to do it is to have it execute a php file and carry the needed multiple entries in the url (seperated by commas).
Then have your php file fetch the needed info from the url (using $_REQUEST) into an array by using preg_split.

If you want your php file to be secure you should have it executed as an action from the index using file and function.
... perhaps the custom action mod as well that is for this?!

Whoa, mate. That's a little over my understanding.  :( Perhaps I should google "preg_split" since I have no idea what it is and get back to you...

Chen Zhen

#288
Quote from: żεχเ๏ภ on June 03, 2011, 11:06:09 PM
Whoa, mate. That's a little over my understanding.  :( Perhaps I should google "preg_split" since I have no idea what it is and get back to you...

Well.. that is one way to do it and I wasn't quite sure if you have any php coding experience.

Instead of manual edits it may be possible to also install this mod: http://custom.simplemachines.org/mods/index.php?mod=331
.. which has not been updated for RC5 or 1.1.13 but you can easily edit its package-info.xml file to install/uninstall for your smf version.

That mod should allow you to create an action that executes your own php code where you would use the commands I previously instructed.

ie.


$options = !empty($_REQUEST['myoptions']) ? $_REQUEST['myoptions'] : false;


The above code would gather anything you put for myoptions from the url. Let's say the url you have the bb code execute is like this:
http://your_site/index.php?action=mypopup;myoptions=my1stoption,my2ndoption,3rdoption

Then to put it into an array like this:

$opts = preg_split('/,/', $options, -1, null);


and then you create a for loop to query the array:

foreach ($opts as $myoption)
{
     /* each entry will cycle as $myoption */ 

}


The multiple entries are in the $opts array in the above example.
.. but I should also mention that you need to use javascript within the bbc to execute the action as a popup.. and I am not positive if this mod will allow the necessary input from where it requires your html entry.



My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

żεχเ๏ภ

#289
But wait.. That mod only makes pages right? I'm looking for a way to incorporate BBC tags into a post like [popup=URL,width,height]text[/popup]

URL = {option1}
width = {option2}
height = {option3}
Text = {content}

I don't see how creating a custom action url will help me achieve the popup bbc tag I want in posts? I am a php-idiot. So perhaps it's just above my IQ... Lol

Edit: Also, if you can tell me what edits I need to make to this Custom BBCode mod to allow for multiple options, please do. I can try it.

Chen Zhen

Quote from: żεχเ๏ภ on June 04, 2011, 01:36:03 AM
But wait.. That mod only makes pages right? I'm looking for a way to incorporate BBC tags into a post like [popup=URL,width,height]text[/popup]

URL = {option1}
width = {option2}
height = {option3}
Text = {content}

I don't see how creating a custom action url will help me achieve the popup bbc tag I want in posts? I am a php-idiot. So perhaps it's just above my IQ... Lol

Edit: Also, if you can tell me what edits I need to make to this Custom BBCode mod to allow for multiple options, please do. I can try it.

What I was getting at was possibly using both mods.. 1 for the bbcode that executes an action while passing info via the url and then use the action mod to request the needed info from the url.

Anyhow, I came up with something close to what you want using just this mod.
This mod does allow 2 inputs in the bbc and javascript for the popup seems to work.
What I suggest using the 2 inputs is a square popup of a url using a common link (can be an image or text for the link) and then you can put your text after the bbcode.

Navigate to the Custom BBC Admin menu and add a tag:

Tag Type: [tag=option]content[/tag]
No Parsing
No Trim

Put this into the html text area:

<a href="{content}" onclick="return reqWin(this.href, {option}, {option}, true);">Click Here</a>


Where it says Click Here you can change to the text you want or an image as this will be what is displayed for the user to click the link.
You can type whatever title text you want after the bbc.

ie.
Let's use a tag name of mypopup with popup dimensions of 300 x 300 (height x width)   
This would be an example of it in a post:



[mypopup=300]http://www.simplemachines.org[/mypopup]
My SMF Popup




My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

żεχเ๏ภ

Quote from: -Underdog- on June 04, 2011, 11:23:19 PM
Quote from: żεχเ๏ภ on June 04, 2011, 01:36:03 AM
But wait.. That mod only makes pages right? I'm looking for a way to incorporate BBC tags into a post like [popup=URL,width,height]text[/popup]

URL = {option1}
width = {option2}
height = {option3}
Text = {content}

I don't see how creating a custom action url will help me achieve the popup bbc tag I want in posts? I am a php-idiot. So perhaps it's just above my IQ... Lol

Edit: Also, if you can tell me what edits I need to make to this Custom BBCode mod to allow for multiple options, please do. I can try it.

What I was getting at was possibly using both mods.. 1 for the bbcode that executes an action while passing info via the url and then use the action mod to request the needed info from the url.

Anyhow, I came up with something close to what you want using just this mod.
This mod does allow 2 inputs in the bbc and javascript for the popup seems to work.
What I suggest using the 2 inputs is a square popup of a url using a common link (can be an image or text for the link) and then you can put your text after the bbcode.

Navigate to the Custom BBC Admin menu and add a tag:

Tag Type: [tag=option]content[/tag]
No Parsing
No Trim

Put this into the html text area:

<a href="{content}" onclick="return reqWin(this.href, {option}, {option}, true);">Click Here</a>


Where it says Click Here you can change to the text you want or an image as this will be what is displayed for the user to click the link.
You can type whatever title text you want after the bbc.

ie.
Let's use a tag name of mypopup with popup dimensions of 300 x 300 (height x width)   
This would be an example of it in a post:



[mypopup=300]http://www.simplemachines.org[/mypopup]
My SMF Popup



Thank you mate, I think you have solved my problem.  Kudos :)

Chen Zhen

Quote from: żεχเ๏ภ on June 05, 2011, 02:00:37 AM
Thank you mate, I think you have solved my problem.  Kudos :)

You're welcome and I am glad it is satisfactory.


My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

Jessica.

the only thing I don't like about this is that you have to find an image for every custom bbcode. isn't there some way that you don't need to do that, that it'll just list all custom made bbcodes in a drop down?
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

seek3r

OK so I have a problem...big one...
I installed the mod. Everything went OK until I moved to the Features panel...No button, I looked for a solution in this post, page, page, scroll, scroll, after a few tries and a few hours, using the information from here, I managed to get the "Custom BBC" tab into the Options and Features panel...
Moved on to the "Adding a custom code" part. All I'm trying to do is to embed the youtube links..I added the code (tried a few ones), but there was another problem. The area where the video should be is blank...I mean all I see is a big blank space, no video, no link...
I started again to scroll, scroll, scroll, page, page, but I cant seem to find a solution....Anyone a hint where I should look what I should change so the video will show up?
I did changed the Modification.English file. The forum is in Romanian language so I did changed the Modification.Romanian file too...Nothing seems to work...

Here is a screenshot about how it looks in Mozilla Firefox browser. Same look in Opera, but in IE it shows a white square with an X in the corner.

LegendaryPancake

Alright, so let's say I wanted to have a BBCode that bolded and underlined the included text, and then put it in a quote-like box. Can someone help me with the HTML code for that?

Shorti25

help please
i installed this manually and all seemed to be fine
but now i have a button in security & moderation between general and spam without letters inside and some like the picture in attachment

one click at [create new tag] nothing happens, but the next window show the button Custom BBC Code - by clicking it there´s nothing

how can i get the menu

using 2.0 final
thx

Transtar

To get to the Custom BBC panel goto Admin>Configuration>Modification Settings>Custom BBCode

Somehow the button is showing up as the second button in both the security center and the modification area....but looking through the install code I cannot see where it would generate a url of "area=securitysettings;sa=custombbc;"

:boggle"

Misa95

I have problem. This mod was worked on my forum, and when i want to change picture to show when click on button a forum will be show me this error:

Fatal error: Maximum execution time of 30 seconds exceeded in /home/ultrafor/public_html/Sources/Subs.php on line 1766

When i do parse deleting forum work. This mod very need me! Please help?

PS. Sorry for my bad english.

The Days

Hi there.
I would like to know who i can install that package in my smf 2.0 forum!
Thanks!

Advertisement: