Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
hershuk
Registered User
Posts: 39
Joined: Fri Jan 13, 2012 3:39 am

Re: Custom BBCodes

Post by hershuk »

Works for me if I paste the youtube URL into the reply box... highlight it and click on the youtube icon.
230sowhy
Registered User
Posts: 3
Joined: Sat Jan 28, 2012 5:27 pm

Re: Custom BBCodes

Post by 230sowhy »

Hello, I'm new here.

How can I embed tweets from Twitter on my PHPBB 3 forum?

With a BBCode like this:
[tweet]http://twitter.com/#!/9GAG/status/163308526175916032[/tweet]

More information about embedded tweets:
https://dev.twitter.com/docs/embedded-tweets

Who can help me?
wg.
Registered User
Posts: 63
Joined: Thu Jul 03, 2008 7:22 am
Location: Scotland

Re: Custom BBCodes

Post by wg. »

AmigoJack wrote:However, to have the post ID and/or user ID available in a custom BBCode there is a rather q+d approach. Open /includes/bbcode.php and find:

Code: Select all

                    if (sizeof($str['search']))
                    { 
After, add:

Code: Select all

                        /*** 2011-11-22 BEGIN AmigoJack
                            Provide post ID and user ID to custom BBCodes ***/
                        if( count( $str['replace']== 1 ) ) {  // Custom BBCodes only have one replacement
                            global $row;  // Obviously this only works for viewtopic.php

                            $str['replace'][0]= str_replace
                            ( array
                                ( '{POST}'  // Hardcoded tokens to be used in the BBCode replacement
                                , '{USER}'  // You could add more, of course...
                                )
                            , array
                                ( $row['post_id']  // ...replaced with the current value
                                , $row['user_id'] 
                                )
                            , $str['replace'][0] 
                            );
                        }
                        /*** 2011-11-22 END ***/ 
Q&D looks wonderful to me as I've wanted this for ages. I've done something wrong though and it isn't working (3.0.7-PL1). Edited bbcode.php around line 96 as follows - have refreshed prosilver templates and purged cache to no effect. Thanks in advance.

Code: Select all

					if (sizeof($str['search']))
					{
                                                /*** 2011-11-22 BEGIN AmigoJack 
                                                    Provide post ID and user ID to custom BBCodes ***/
                                                if( count( $str['replace']== 1 ) ) {  // Custom BBCodes only have one replacement
                                                    global $row;  // Obviously this only works for viewtopic.php
                    
                                                    $str['replace'][0]= str_replace
                                                    ( array
                                                        ( '{POST}'  // Hardcoded tokens to be used in the BBCode replacement
                                                        , '{USER}'  // You could add more, of course...
                                                        )
                                                    , array
                                                        ( $row['post_id']  // ...replaced with the current value
                                                        , $row['user_id'] 
                                                        )
                                                    , $str['replace'][0] 
                                                    );
                                                }
                                                /*** 2011-11-22 END ***/ 
						$message = str_replace($str['search'], $str['replace'], $message);
						$str = array('search' => array(), 'replace' => array());
					}
User avatar
AmigoJack
Registered User
Posts: 5795
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCodes

Post by AmigoJack »

wg. wrote:I've done something wrong
Please provide:
  1. a link to your board (board, not site),
  2. a test account, so I'm able to create a post and
  3. your BBCode definition, as I suspect that as culprit (but also to know what I have to use when trying to do a post).
  • The worst thing about censorship is ███████████
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
User avatar
AmigoJack
Registered User
Posts: 5795
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCodes

Post by AmigoJack »

Updated my post - undo the current modification and apply the new one.
  • The worst thing about censorship is ███████████
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
wg.
Registered User
Posts: 63
Joined: Thu Jul 03, 2008 7:22 am
Location: Scotland

Re: Custom BBCodes

Post by wg. »

AmigoJack wrote:Updated my post - undo the current modification and apply the new one.
That didn't work either but when I also inserted the new code in the "if (sizeof($preg['search']))" branch then it works perfectly.

Many many thanks for looking at this for me
User avatar
AmigoJack
Registered User
Posts: 5795
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Custom BBCodes

Post by AmigoJack »

AmigoJack wrote:Before, add
The code position has changed and I've tested it successfully, using an old case aswell as your BBCode.
  • The worst thing about censorship is ███████████
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
wg.
Registered User
Posts: 63
Joined: Thu Jul 03, 2008 7:22 am
Location: Scotland

Re: Custom BBCodes

Post by wg. »

Ah ha! I will go tidy it up now as my version does look messy. Thanks again.

Hopefully this'll be part of phpbb out of the box at some future version.
{POST_ID}
{POST_OWNER_ID}
{TOPIC_ID}
{FORUM_ID}
DrJanItor
Registered User
Posts: 1
Joined: Tue Jan 31, 2012 2:10 pm

Re: Custom BBCodes

Post by DrJanItor »

Hi,

is it possible to use this vBulletin Code in phphBB forum?

Code: Select all

[table="head;sortable=false"]{colsp=8}[center][size="3"][space]-[/space][/size][size="3"][b]Tabelle der Liga V.197 (6288)[/b][/size][space]-[/space][/center]

{colsp=8}

{colsp=1}[size="3"][space]-[/space][/size][b]#[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b][/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]Mannschaft[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]Spiele[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]T+[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]T-[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]T±[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]Punkte[/b][space]-[/space]

{colsp=8}

{colsp=1}[size="3"][space]-[/space][/size]1.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_equal.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]FC Thunderchunky[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]41[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]21[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]20[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]31[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]2.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_equal.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]VFV Fesselbeck[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]38[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]19[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]19[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]22[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]3.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_equal.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]FC Rakete Rauxel[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]31[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]26[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]5[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]21[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size][b]4.[/b][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_up.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][b]SpVgg Traktor Rausdorf[/b][space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size][b]13[/b][space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size][b]28[/b][space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size][b]30[/b][space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size][b]-2[/b][space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size][b]17[/b][space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]5.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_up.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]FC EXTREMO[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]24[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]31[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]-7[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]17[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]6.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_down.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]1. McD Hilden[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]34[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]34[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]0[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]16[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]7.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_equal.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]SV Hurschen 06[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]26[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]38[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]-12[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]15[space]-[/space][/right]

{colsp=1}[size="3"][space]-[/space][/size]8.[space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size][img]http://bbgen.ht-monster.org/img/arrow_equal.gif[/img][space]-[/space]|{colsp=1}[size="3"][space]-[/space][/size]RSV Kick'n rin[space]-[/space]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]13[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]36[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]-23[space]-[/space][/right]|{colsp=1}[right][size="3"][space]-[/space][/size]11[space]-[/space][/right][/table][size="1"]erstellt am 30.01.2012 um 23:09 von [url="http://bbgen.ht-monster.org"]bbCode-Generator[/url] Version 1.4.0[/size]
wg.
Registered User
Posts: 63
Joined: Thu Jul 03, 2008 7:22 am
Location: Scotland

Re: Custom BBCodes

Post by wg. »

I want to use PHP to set a cookie inside the the HTML expansion of a bbcode. This doesn't work

Code: Select all

<script language="php">
        setcookie( "myCookie", "{TEXT}" );
</script>
This does work but the value is only seen on next page refresh (presumably client/server are then synchronised)

Code: Select all

<SCRIPT LANGUAGE="javascript">
document.cookie="myCookie={TEXT}";
</script>
I need the cookie to be available to other PHP code on the same page. Any ideas greatly appreciated please as I really need this solved and I am stuck
User avatar
kmakoto
Registered User
Posts: 234
Joined: Mon Mar 01, 2010 11:35 pm

Re: Custom BBCodes

Post by kmakoto »

User avatar
Hippie459MN
Registered User
Posts: 948
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Custom BBCodes

Post by Hippie459MN »

kmakoto wrote:mmm please bbcode
I dont get what your trying to do here. I dont see any thing that would work for a bbcode on that page
User avatar
SeanFace101
Registered User
Posts: 14
Joined: Tue Feb 14, 2012 1:50 pm
Location: Scotland, UK
Name: Sean Quinn
Contact:

Re: Custom BBCodes

Post by SeanFace101 »

Just used the google video code.
Thanks :D
Great post
:D
TWEagle
Registered User
Posts: 304
Joined: Sat Dec 10, 2005 2:50 pm
Contact:

Re: Custom BBCodes

Post by TWEagle »

is there someting like an modx bb code so I can add the full install file off a mod or something like that in a post??
Image
Pony99CA
Registered User
Posts: 4783
Joined: Thu Sep 30, 2004 3:13 pm
Location: Hollister, CA
Name: Steve
Contact:

Re: Custom BBCodes

Post by Pony99CA »

The_White_Eagle wrote:is there someting like an modx bb code so I can add the full install file off a mod or something like that in a post??
I'm not quite sure what you're asking for. If you want to display a MODX file in a post, can't you just use the standard CODE tags?

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.
Locked

Return to “Custom BBCode Development and Requests”