News:

Join the Facebook Fan Page.

Main Menu

Custom BBCode

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

Previous topic - Next topic

mikerotch75

Hi, I'm wondering if this is capable of multiple option in the tag like this:

[tag=option1,option2,option3]content[/tag]

I use a three column table frequently and would like to automate the creation of each row, like so:
<tr>
<td>
{option1}</td>
<td>
{option2}</td>
<td>
{option3}</td>
</tr>


Is this possible?

orinjuce

#161
I've been trying to get Wowhead item links to work on my forum, I've added the Wowhead - Powered script to my forum, and set up a custom BBcode that works. My only problem so far is I don't know how to make another bbcode to change the item links color to the quality of the item.

For the HTML i used. I successfully got the color to change but the item link did not work alongside the [*item][/*item].

<a class="q{option}" href="http://www.wowhead.com/?item={number}">[{content}]</a>


For the BBcode I used

[item=19019][q=q5]ITEM NAME[/q][/item]


It seem I can only successfully have one and not the other.

I'm not really sure what else to do.

P.S. I've tried item stats and the script CraCkpot made, and both do not work.

BertiS

#162
This is an awseome mod! Good job!

But I have a small problem, I try to make a custom code to embed google maps into posts. I made this BBC:

<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="{content}"></iframe>

And the users must insert between the tag a piece o the link provided by Google, for example

http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=&amp;ie=UTF8&amp;t=h&amp;s=AARTsJod7oXNU7yzw2rY1LBQOsB66rbmwA&amp;ll=29.786653,31.207266&amp;spn=0.017878,0.027466&amp;z=15&amp;output=embed

The problem is, that SMF messes up the code, and in the post it looks like this:


<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;s=AARTsJod7oXNU7yzw2rY1LBQOsB66rbmwA&amp;amp;ll=29.786653,31.207266&amp;amp;spn=0.017878,0.027466&amp;amp;z=15&amp;amp;output=embed"></iframe>


Ofcourse, the embed is not displayed corectly, because the character &amp; is converted into &amp;amp;

How can I solve this issue? Thanks!

Basile Sebastiano

this mod work for SMF 2.0 RC1?
S. Basile

INCHIARO10

Hi guys you explain the problem I have, I hope to be quite clear
In practice while I was creating new BBC (via Custom mods BBC) from my SMF 1.1.7, I will
error in forum and gives me this error


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

[/ code]
1821-1835 and in the line of this file is subs.php

[code]
/ / Find all the tags.
$ Count = $ modSettings [ 'customBBCode_count'];
For ($ i = 1, $ count, $ i + +)
(
if (isset ($ modSettings [ 'customBBCode_tag_'. $ i]))
(
$ tags [$ i] = $ modSettings [ 'customBBCode_tag_'. $ i];
$ Count -;
)
)

Foreach ($ tags as $ i => $ tag)
(
if (! empty ($ tag) & &! empty ($ modSettings [ 'customBBCode_enable_'. $ i]))
(



In Annex I put the file Subs.php
then I turn off the BBC from database (using phpMyAdmin -> smf_settings -> enableBBC 0) and everything comes back ok, only problem is that
obviously not the BBC have more active, you can go and manually delete the last
I have added Custom with BBC for the BBC then resume database?

Maybe or lengthen the time instead 30 seconds (I assumed that maybe they need more to the question of subs.php file)
Or how can I solve?

Thanks



File Subs.php
http://www.mediafire.com/download.php?zzjmm4ygeiz [nofollow]

Eliana Tamerin

At my request, Dragooon updated this mod for SMF 2.0 RC1. No guarantees it'll work on an earlier version.

Attached to this post.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Angelina Belle

#166
I would like use the custom bbcode to allow embedding various types of documents -- pdf, msword, etc.  I can use javascript to generate the appropriate <object ... > tags.
[embed=word]http://ss.xx.org/docname.doc[/embed]

This requires a little bit of scripting to accomplish.  The problem is that every carriage-return gets turned into a <br />.  So, for example


<!--javatag-->
<script type="text/javascript">
document.write ('Hello');
</script>


Creates:

<!--javatag--><br /><script type="text/javascript"><br />document.write ('Hello');<br /></script>


And so the script does not work.  Does anyone know a way around this problem?
Other than of course, creating a separate custom bbcode tag for each type of document.

Thanks
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Indy74

Quote from: Eliana Tamerin on April 13, 2009, 02:37:10 PM
At my request, Dragooon updated this mod for SMF 2.0 RC1. No guarantees it'll work on an earlier version.

Attached to this post.

Great work!

There is a bug thou: the post can not contain only tags when you're embedding something - you must type something else along with it, otherwise it recognizes it as an empty post.
For example this won't work:
[b]embed_code_here[/b]
You have to type something else with it like this(dot or any symbol):
.[b]embed_code_here[/b]

Muldoon

Will this mod work for SMF 1.1.10?


Eliana Tamerin

Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Muldoon

Thank you Eliana...I'll give it a shot! :)

Muldoon

Hey it turned out great.  I was able to add a YouTube video button so now my members can embed youtube videos in their posts.  I tried for google videos and it didn't work so I'll have to figure that out still.  This mod is great! ;D

Eliana Tamerin

Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Muldoon

#174
Oh my gosh...

Well, I may have to go the YouTube mod.  There seems to be some kind of break showing in IE above the posted video, but not in Firefox...

EDIT: Ok, got it working :)  And Eliana, you had me cracking up...too funny :)

xPreatorianx

Keep getting this error please help :

8: Undefined index: session_var
File: /home/****/public_html/Sources/CustomBBCode.php
Line: 136

kanderson88

Quote from: Eliana Tamerin on April 13, 2009, 02:37:10 PM
At my request, Dragooon updated this mod for SMF 2.0 RC1. No guarantees it'll work on an earlier version.

Attached to this post.

just wanted to say this works pretty darn good, wish it would auto make a image for the bbcode button, but to use it took me a while to figure out..

GOTO
Configurations >> Modifications >> Custom BBC

THANKS SO MUCH

bobhughes

#177
Thanks for making this mod, it has really helped in making SMF forums easy for beginners to add features to.  I can't seem to get one to work though - I'm trying to make a classy [­spoiler] tag that will replace the tag's contents with the word "*spoiler*", which will then change to the original {content} when moused over, and return to say *spoiler* when the mouse is moved away.  I think the best plan of attack is to use two spans, and a function that determines which span will be shown, depending on whether the mouse has moved onto or off of the area.

When I copy my code into notepad (along with <html>, <body> obviously) and save as HTML, then it does exactly what I want it to.  But it's not working when used with custom BBC.  I see that the code must all be entered on the same line, but I don't think that's the problem - I believe I removed any carriage returns, and I see no <br>'s in the output page source. 

Here is my code (as entered into Custom BBC):
<script type="text/javascript"> function showSpan(bh) {if (bh == '1') { deftext.style.display='inline'; alttext.style.display='none'; } if (bh == '2') { deftext.style.display='none'; alttext.style.display='inline'; } } </script><span id="deftext" style="display:inline;" onMouseOver="showSpan('2');">*spoiler*</span><span id="alttext" style="display:none;" onMouseOut="showSpan('1');">{content}</span>


And the same code with breaks for better visibility:

<script type="text/javascript">
function showSpan(bh)
{
if (bh == '1')
{
deftext.style.display='inline';
alttext.style.display='none';
}
if (bh == '2')
{
deftext.style.display='none';
alttext.style.display='inline';
}
}
</script>

<span id="deftext" style="display:inline;" onMouseOver="showSpan('2');">
*spoiler*
</span>
<span id="alttext" style="display:none;" onMouseOut="showSpan('1');">
{content}
</span>


One thing i've noticed is that in custom BBC, I can't seem to access a span's attributes using span_id.style.display, though I can if I use this.style.display.  The thing is, I need to access a different span than the one containing the triggering event.  Is this normal of custom BBC, or am I doing something wrong?  I'm pretty new to CSS, JS... haven't messed with HTML much since like 1996  :-[

thx in advance for any help!

edit:  im attaching the html page that I got working (in FF 2.0.0.17 anyway) so you can see exactly what i'm trying to accomplish.  i don't see why this would't work when entered in custom bbc...

bobhughes

well nvm I used a much more optimized approach and got it to work. 
here's my <span onmouseover="this.innerHTML='{content}'" onmouseout="this.innerHTML='*spoiler*'">*spoiler*</span>

still kindof frustrated i couldnt get my other code to work in custombbc, even though it would work in a blank html file

arteknique

Simple and powerfull all we need, great works.

Advertisement: