Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: Custom BBCodes

Post by leviatan21 » Fri Mar 13, 2009 4:57 pm

quahappy wrote:Hi all,

I'm about to do a test transfer of my phpBB2 forum to phpBB3 and have noticed a couple of things that I will need to alter especially when it comes to custom BBCodes. One MOD I have installed is Align MOD which features a drop-down list where I can choose Left, Right or Center. The actual BBCode tag displayed within a post in phpBB2 is:

[align=left] [/align]
[align=center] [/align]
[align=right] [/align]

But the custom phpBB3 BBCode uses this:

[left] [/left]
[right] [/right]
[center] [/center]

... which means hundreds of posts in my current phpBB2 forum where members has used Align in phpBB2 are not going to be displayed correctly in phpBB3. :(

Is there any code available to convert this so posts are displayed correctly once ported over to phpBB3? Or is this easily rectified?
Hi quahappy :

Your request is a very common problem for those who are updating from 2x...
I don't know if there is a mod to do what you need.
I think the only possible solution is running several special sql query before run the update from 2x to 3x, something like :
WARNING : I'm not expert in sql :oops:

Code: Select all

UPDATE phpbb_posts SET post_text = replace(post_text,'[align=left]','[left]');
UPDATE phpbb_posts SET post_text = replace(post_text,'[align=center]','[center]');
UPDATE phpbb_posts SET post_text = replace(post_text,'[align=right]','[right]');

UPDATE phpbb_posts SET post_text = replace(post_text,'[/align]','[/right]');
also you must add the new 3 custom bbcodes, after install your new phpbb3 and before running the update step
quahappy wrote:The other problem I have is I use HTML MOD in phpBB2 (which is set that only I, as board founder and knowing of security risks, can use it) to embed games and various other stuff into posts. It means numerous posts that my contain [html] [/html] BBCode will need to be removed? Is there an alternative?

Thanks in advance for any help! :D
Have a MOD to use HTML code in phpbb 3x, removed
The mod have a system permission. Allows authorized users to post full HTML.
Last edited by darcie on Fri Mar 13, 2009 7:33 pm, edited 1 time in total.
Reason: Please do not link to MODs that reduce the security of phpBB.
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Custom BBCodes

Post by quahappy » Fri Mar 13, 2009 6:51 pm

Thanks for your quick reply leviathan21!
leviatan21 wrote: Hi quahappy :

Your request is a very common problem for those who are updating from 2x...
I don't know if there is a mod to do what you need.
I think the only possible solution is running several special sql query before run the update from 2x to 3x, something like :
WARNING : I'm not expert in sql :oops:

Code: Select all

UPDATE phpbb_posts SET post_text = replace(post_text,'[align=left]','[left]');
UPDATE phpbb_posts SET post_text = replace(post_text,'[align=center]','[center]');
UPDATE phpbb_posts SET post_text = replace(post_text,'[align=right]','[right]');

UPDATE phpbb_posts SET post_text = replace(post_text,'[/align]','[/right]');
also you must add the new 3 custom bbcodes, after install your new phpbb3 and before running the update step
The problem is, after inspecting phpbb2 posts_text data, Align bbcode tags appears garbled - i.e .[align=center:56e8e90ec2], therefore making the whole process even harder to convert. Also, we also would need to ensure the present closed [/align] is replaced with the phpBB3 [/left], [/right] or [/center] to match the new opening tag. Your 4th line would, if the query run, convert all align closed tags to just: [/right]. Thanks for your honesty though in SQL. Fingers crossed someone has the full SQL query we need to convert Align bbcode from phpbb2 to phpbb3. Would make things easier instead of possibly having to edit every single post (after creating the required custom BBCode). ;)
leviatan21 wrote: Have a MOD to use HTML code in phpbb 3x, removed
The mod have a system permission. Allows authorized users to post full HTML.
Brilliant. That's the HTML BBCode taken care of then. Thanks for that. :D
Last edited by darcie on Fri Mar 13, 2009 7:34 pm, edited 1 time in total.
Reason: link removed
If you don't ask.....

User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: Custom BBCodes

Post by leviatan21 » Fri Mar 13, 2009 8:30 pm

quahappy wrote:Thanks for your quick reply leviathan21!
What happens if you make a new Custom bbcode like this :
BBCode usage :

Code: Select all

[align={SIMPLETEXT}]{TEXT}[/align]
HTML replacement :
( I imagine something like this )

Code: Select all

<div style="text-align:{SIMPLETEXT};">{TEXT}</div>
Help line :

Code: Select all

[align=(center|left|right)]TEXT[/align]
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 » Fri Mar 13, 2009 10:18 pm

Edit. I didn't see there had already been a couple of replies to your post. I'll leave what I originally posted anyway.
quahappy wrote:...Is there any code available to convert this so posts are displayed correctly once ported over to phpBB3? Or is this easily rectified?
No, but I'd encourage you to request it on the "MOD Requests" forum. I would imagine the "Reparse bbcodes" MOD could be edited to do that as well.
The other problem I have is I use HTML MOD in phpBB2 (which is set that only I, as board founder and knowing of security risks, can use it) to embed games and various other stuff into posts. It means numerous posts that my contain [html] [/html] BBCode will need to be removed? Is there an alternative?
You cannot avoid having to edit those posts, but you will be able to generate a custom bbcode for each one to output the relevant HTML.
Under no circumstances will the phpBB group add a feature to allow raw HTML in posts.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Custom BBCodes

Post by quahappy » Sat Mar 14, 2009 11:48 am

Thanks for the information ric323. :D

I've performed a test transfer from phpBB2 to phpBB3 and checked posts that previously used:

[align=left] [/align]
[align=center] [/align]
[align=right] [/align]

I then added a custom BBCode (just to check "center" tag for now):

BBCode usage: [align=center]{TEXT}[/align]

HTML replacement: <div style="text-align: center;">{TEXT}</div>

The BBCode tags still showed in a post but if I edit a post that contains the new custom BBCode and then simply click on "Submit" after, any text / images, etc are correctly centered!

Trouble is, this is going to be a long drawn out process finding every post that contains align (left, right, and center), editing and resubmitting! Must be a way to "refresh" all posts / database so it updates the new custom BBCode to remove the tag but display the BBCode contents (text, image, etc)?

There is another issue though if I had to perform the above. The new custom BBCode option in posting mode shows as: "align=" (minus the quotes). Not ideal as a member would have to type in center, (and left, right when these custom BBCodes are added) for text / images to be aligned correctly. So either way, I'm still kind of at square one. But you also mentioned about the Reparse BBCode MOD so will take a look at that too.
If you don't ask.....

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 » Sat Mar 14, 2009 11:55 am

quahappy wrote:The BBCode tags still showed in a post but if I edit a post that contains the new custom BBCode and then simply click on "Submit" after, any text / images, etc are correctly centered!

Trouble is, this is going to be a long drawn out process finding every post that contains align (left, right, and center), editing and resubmitting! Must be a way to "refresh" all posts / database so it updates the new custom BBCode to remove the tag but display the BBCode contents (text, image, etc)?
That is precisely what the "Reparse BBcode" MOD is designed to do for you.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
quahappy
Former Team Member
Posts: 1416
Joined: Tue Dec 12, 2006 8:19 pm
Location: South Yorkshire
Name: Andy Green

Re: Custom BBCodes

Post by quahappy » Sun Mar 15, 2009 4:08 pm

ric323 wrote:That is precisely what the "Reparse BBcode" MOD is designed to do for you.
It certainly did. All fixed. Cheers ric123. :D
If you don't ask.....

User avatar
bobocop
Registered User
Posts: 175
Joined: Wed May 19, 2004 10:46 pm
Contact:

Re: Custom BBCodes

Post by bobocop » Sun Mar 15, 2009 9:14 pm

Maybe it is time for the phpBB team to make an own BBCode section here on the forum.
Reading trough more than 1600 posts does take a long time.

Splitting this up, we could have one thread pr BBCode that is posted here. It would save time to find the best youtube BBCode etc.

Thanks
Jotne
This is more of a Youtube thread then anything else, it's hard to find anything either then video bbcodes here :D


Not sure if this has been asked (if it has can someone point me to where)
How can you put an icon instead of text for the bbcode
Like above the posting you have your bbcodes you can use such as "Img, url, code, etc", if you click on it, it
how can i change the "img" to an icon ?

it starts to get a bit over full using words, if i can switch them to icons it would look nicer and neat.

Calenulma
Registered User
Posts: 12
Joined: Wed Jan 03, 2007 6:33 pm

Re: Custom BBCodes

Post by Calenulma » Mon Mar 16, 2009 10:18 am

leviatan21 wrote:
Calenulma wrote:I've made a nice BBCode for HDShate.tv videos
Thanks for the info.... :D

I think your code has 2 problems :

1)
<embed width="614" height="365" type="application/x-shockwave-flash" src="http://www.hdshare.tv/jwembed/player.swf" width="460" height="365" allowscriptaccess="always" allowfullscreen="true" flashvars="width=360&height=270&file={TEXT1}&sr=1">
all width and all height should have the same value ¿?

2)
e.g. [hdshare_4x3]http://www.hdshare.tv/videofiles/####.flv[/hdshare_4x3]
The video link isn't videofiles
the Video URL provided by hdshare is always :

Where do you get the video URL ??


:roll: :oops:
1) That doesn't change anything on the player. It works both on my forum and on my website changing only the first two size properties.

2) Yes it is. If you had tried the code, you should have seen that it works that way. I wouldn't have posted it if it didn't. Check it out!
Don't say it's wrong just because you don't understand it. ;)

3) Get the video URL on the Embed URL that hdshare gives you.

e-lemon-ators
Registered User
Posts: 228
Joined: Fri Apr 04, 2008 8:32 am
Location: Spain and UK
Name: Jen

Re: Custom BBCodes

Post by e-lemon-ators » Mon Mar 16, 2009 10:40 am

I've seached this thread and found two questions re bbcodes for .wav, but no answers.

Is it possible to create a bbcode for adding a .wav file. I've got loads of .wav files in Spanish (for just a single Spanish word). I want to be able to click on a Spanish word (which is a link to the .wav) and the .wav gets played.

Am I asking for something impossible?

Thanks for any help!

nadalbg
Registered User
Posts: 273
Joined: Wed Jul 16, 2008 12:58 pm
Contact:

Re: Custom BBCodes

Post by nadalbg » Mon Mar 16, 2009 12:03 pm

Does anyone know if its possible to add rel no follow tag by BB code ?
I want to make one thread with lots of links and I want it no follow.

Regards

robdocmagic
Registered User
Posts: 41
Joined: Sat Jan 14, 2006 4:07 pm

Re: Custom BBCodes

Post by robdocmagic » Mon Mar 16, 2009 7:58 pm

Hey All,

These are great. I have on question that you might know the answer to. I created a customer BBCODE and when I use it in the post, instead of the HTML displaying in the page, I just get the BBCODE dumped back in the posting.

Do you know what could cause this condition, or the code that does the rendering and I can check it out.

Thanks a bunch.

-Rob

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 » Mon Mar 16, 2009 9:52 pm

robdocmagic wrote:Hey All,

These are great. I have on question that you might know the answer to. I created a customer BBCODE and when I use it in the post, instead of the HTML displaying in the page, I just get the BBCODE dumped back in the posting.

Do you know what could cause this condition, or the code that does the rendering and I can check it out.

Thanks a bunch.

-Rob
You've made a mistake setting the code up. Please show us a screen capture of the screen where you enter the bbcode definition, and a link to a post on your board where you tried to use it.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

robdocmagic
Registered User
Posts: 41
Joined: Sat Jan 14, 2006 4:07 pm

Re: Custom BBCodes

Post by robdocmagic » Mon Mar 16, 2009 9:54 pm

It seems like when I do this:

Code: Select all

[flashplaylist={NUMBER1},{NUMBER2},{NUMBER3},{IDENTIFIER}]{URL}[/flashplaylist]
but this fails:

Code: Select all

[flashplaylist={NUMBER1},{NUMBER2},{NUMBER3},{IDENTIFIER},{URL1}]{URL}[/flashplaylist]
(Adding the extra {URL1} after the IDENTIFIER causes the system to just dump back the BBCODE).

I integrated a tricked out flash player with playlists and cool stuff. I wanted to add one more param to the list and it does not work. Here is the template of what does not work. By removing the URL1 from the BBCODE and Template it works like a charm.

Code: Select all

<script type='text/javascript' src='/javascript/swfobject.js'></script>

  <div id='mediaspace'>This code will be replaced{URL1}</div>

  <script type='text/javascript'>
  var s1 = new SWFObject('/player.swf','ply','{NUMBER1}','{NUMBER2}','9','#ffffff');
  s1.addParam('allowfullscreen','true');
  s1.addParam('allowscriptaccess','always');
  s1.addParam('wmode','opaque');
  s1.addParam('flashvars','file={URL1}&fullscreen=true&backcolor=000000&frontcolor=ffffff&playlist={IDENTIFIER}&playlistsize={NUMBER3}');
  s1.write('mediaspace');
</script>

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Custom BBCodes

Post by ric323 » Mon Mar 16, 2009 10:07 pm

Why do you have URL and URL1 in the definition? If there is more than one, you have to number them all.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

Locked

Return to “Custom BBCode Development and Requests”