Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
Ikhsan4488
Registered User
Posts: 63
Joined: Sun Nov 25, 2007 12:46 pm
Location: <REtN>
Contact:

Re: Custom BBCodes

Post by Ikhsan4488 »

hi, anyone can make download bbcode? just like this :

Image
Image

Usage :

Code: Select all

[download]link[/download]
User avatar
Celtic Minstrel
Registered User
Posts: 40
Joined: Mon Oct 06, 2008 1:31 am

Re: Custom BBCodes

Post by Celtic Minstrel »

Hippie459MN wrote:Try this. It will do 2 columns.
Thanks. Just two things. First, there's no way to use a single tag for a variable number of columns? And secondly, is there any way to do it without tables? Not that I really have anything against tables, but if there's another way it could be worth trying.
usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: Custom BBCodes

Post by usenet2you »

Here you have a nice NFO BBCode.

Examples:

Code: Select all

[nfo]{TEXT}[/nfo]
HTML Replacement:

Code: Select all

<smallfont><b>NFO:</b></smallfont><hr><pre style="font-size:10pt; font family: 'Terminal';">{TEXT}</font><hr></pre>
Help Line

Code: Select all

[nfo] text [/nfo]
Here is a screen:

ImageImage
User avatar
Celtic Minstrel
Registered User
Posts: 40
Joined: Mon Oct 06, 2008 1:31 am

Re: Custom BBCodes

Post by Celtic Minstrel »

I guarantee that won't work.

You see, "Terminal" (as well as "MS Linedraw") is a font that is only included on Windows. So, anyone viewing that page on any other operating system will not see it rendered correctly.

And no, there is no equivalent font for Mac or Linux. The proper way to do such things now would be to use Unicode, though that has the problem that you would need to find a Unicode fixed-width font that includes those characters, and then you'll run into the same problem again (because I'm pretty sure no such font is preinstalled on most operating systems, Windows included.)

((Of course, if you have a good reason to believe that 150% of the users of your forum use Windows, then there's nothing wrong with that code.))
usenet2you
Registered User
Posts: 407
Joined: Sat Mar 22, 2008 7:31 pm
Location: The Netherlands

Re: Custom BBCodes

Post by usenet2you »

Hmm, but how can I make an good one? Change font?
User avatar
Celtic Minstrel
Registered User
Posts: 40
Joined: Mon Oct 06, 2008 1:31 am

Re: Custom BBCodes

Post by Celtic Minstrel »

The one you posted will work, but only for people who have the Terminal font. I think even some Windows computers don't have that, oddly...

Unfortunately there's no way to guarantee that it works for all viewers. But there are a few things you can try to make it work for more viewers.

Firstly, it would help to add MS LineDraw as a fallback option.

It would also help if you could specify the appropriate character encoding. I can't seem to find any way to do that, but if there is a way, the the value you would want to assign to it is "cp437". There is a charset attribute, but it only applies to links and scripts.

Code: Select all

<smallfont><b>NFO:</b></smallfont><hr><pre style="font-size:10pt; font family: 'Terminal', 'MS Linedraw', monospace;">{TEXT}</pre><hr>
For your example, people without the font would probably see something like this (I'm just doing the bottom part that says "Groupnotes"):

Code: Select all

             ÛÛÛ   ÛÛÛ  ÛÛÛ  ²      ÛÛÛ  ÛÛÛ   ÛÛÛ  ²     ÛÛ   Û
            Û     Û  Û Û   Û ²   Û Û  Û Û   Û Û   Û ²ÛÛ  Û    Û
ÛÛÛÛÛÛÛÛÛÛÛ Û  Û² ÛÛ²  Û   ² Û   ² ÛÛÛ  Û   ² Û   ² Û    ²Û   ÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛÛÛ
            Û   ² Û ²  Û   ² Û   ² Û    Û   ² Û   ² Û  Û ²  Û    Û
             ÛÛÛ    Û   ÛÛÛ   ÛÛÛ  Û    Û      ÛÛÛ   ÛÛÛ ÛÛÛÛ  ÛÛ
                    Û
(Though I'm not 100% sure about the mapping for the Terminal font, so it may be slightly different.)


There may be other ways to make it work better. Unfortunately, the only foolproof way is to create a script that converts it to an image. But that would probably be a lot of work.

Maybe someone else will have more suggestions to try?
User avatar
Celtic Minstrel
Registered User
Posts: 40
Joined: Mon Oct 06, 2008 1:31 am

Re: Custom BBCodes

Post by Celtic Minstrel »

Ikhsan4488 wrote:hi, anyone can make download bbcode? just like this :

Image
Image

Usage :

Code: Select all

[download]link[/download]
So... assuming you only want a code to display a link in an edit box, this would be fairly simple. I will assume that the image containing the word "download" is stored in a file located in the images folder within your phpBB installation, and is called "download.png". I will also assume that the arrow image is stored in the same place, and is called "arrow.png". So you will have to replace the image links with your own links in order for this to work. And I don't know how to get the rounded corners.

BBCode:

Code: Select all

[download]{URL}[/download]
HTML Replacement:

Code: Select all

<div style="background-color: #bcdbfe; padding: 5px;">
<img src="images/download.png" alt="Download:" align="left">
<a href="{URL}"><img src="images/arrow.png" alt="(link)" title="Click here to download" align="right"></a><br>
<hr style="border: none; height: 1px">
<input value="{URL}" onfocus="select()" style="width: 100%;">
</div>
You may need to tweak this a little to get it to work exactly how you want, though, since you weren't very specific in your request.
Luxymouse
Registered User
Posts: 10
Joined: Thu Mar 27, 2008 10:25 pm

Re: Custom BBCodes

Post by Luxymouse »

Hello,
I tried the codes below but it didn't work. This is what I tried:

[youtube]http://www.youtube.com/watch?v={HPPj6viIBmU}[/youtube]

<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/{SIMPLETEXT}HP ... ram><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/HPPj6viIBmU&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
PCTalk
Registered User
Posts: 259
Joined: Mon Jul 29, 2002 5:17 pm
Location: MD, USA
Contact:

Re: Custom BBCodes

Post by PCTalk »

denuj wrote:... but it doesn't have a googlevideo equivalent. ...
Try the following for GoogleVideo ID only:

BBCode Usage:

Code: Select all

[googlevidid]{NUMBER}[/googlevidid]
HTML Replacement:

Code: Select all

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=-{NUMBER}&hl=en" flashvars=""></embed>
Help Line:

Code: Select all

Enter the video ID number -- the video ID, an 18 digit number, is after docid=- in the URL
That works for me anyway.
Visit PCTalk.info to see my teaching website.
Wildtangent has closed their forum. See my member created substitute at Wildtangent Fansite.
Support Request Template - Knowledge Base
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 »

Celtic Minstrel wrote:
Ikhsan4488 wrote:hi, anyone can make download bbcode? just like this :

Image
Image

Usage :

Code: Select all

[download]link[/download]
So... assuming you only want a code to display a link in an edit box, this would be fairly simple. I will assume that the image containing the word "download" is stored in a file located in the images folder within your phpBB installation, and is called "download.png". I will also assume that the arrow image is stored in the same place, and is called "arrow.png". So you will have to replace the image links with your own links in order for this to work. And I don't know how to get the rounded corners.

BBCode:

Code: Select all

[download]{URL}[/download]
HTML Replacement:

Code: Select all

<div style="background-color: #bcdbfe; padding: 5px;">
<img src="images/download.png" alt="Download:" align="left">
<a href="{URL}"><img src="images/arrow.png" alt="(link)" title="Click here to download" align="right"></a><br>
<hr style="border: none; height: 1px">
<input value="{URL}" onfocus="select()" style="width: 100%;">
</div>
You may need to tweak this a little to get it to work exactly how you want, though, since you weren't very specific in your request.
I might try that. With a few tweaks of course to suit my needs. :)
User avatar
OniTenshu
Registered User
Posts: 22
Joined: Thu Oct 23, 2008 7:27 pm
Location: Beverly
Contact:

Re: Custom BBCodes

Post by OniTenshu »

I've figured out a way to make a divx web player with BBCode it only works for videos with a divx Codec though.

BBCode usage

Code: Select all

[DivXStream]{URL}[/DivXStream]
HTML replacement

Code: Select all

<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="720" height="440" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">

<param name="custommode" value="none" />

<param name="previewImage" value="http://i164.photobucket.com/albums/u3/Demon-Of-The-Black-Flame/test-1.png" />
<param name="autoPlay" value="false" />
<param name="src" value="{URL}" />

<embed type="video/divx" src="{URL}" custommode="none" width="720" height="440" autoPlay="false" previewImage="http://i164.photobucket.com/albums/u3/Demon-Of-The-Black-Flame/test-1.png" pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>
<br>No video? Get the DivX Web Player for <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayerInstaller.exe">Windows</a> or <a style="text-decoration: underline;" href="http://download.divx.com/player/DivXWebPlayer.dmg">Mac</a>
User avatar
Celtic Minstrel
Registered User
Posts: 40
Joined: Mon Oct 06, 2008 1:31 am

Re: Custom BBCodes

Post by Celtic Minstrel »

Is there any way to include the ID of the current post in a BBCode definition? Or would a MOD be needed for that?
User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Re: Custom BBCodes

Post by beggers »

JohanG-NL wrote:I've actually created that BBcode, but it's OK Jim posts it

You can make it admin/moderator only by the following steps:

Code: Select all

# OPEN 
     includes/message_parser.php

# FIND
    global $config, $db, $user;
    # REPLACE WITH
    global $config, $db, $user, $auth, $forum_id;

# FIND
    // If false, then $this->message won't be altered, the text will be returned instead.
# BEFORE, ADD
            if ( $this->mode != 'post' || !isset($forum_id) )
            {
                $mod_bbcode_auth = $auth->acl_get('a_') ? TRUE : FALSE;
            }
            else
            {
                $mod_bbcode_auth = ( $auth->acl_get('a_') || $auth->acl_get('m_', $forum_id) ) ? TRUE : FALSE;
            }
            
            if ( !$mod_bbcode_auth )
            {
                $this->message = preg_replace("/\[mod=(.*?)\](.*?)\[\/mod\]/s", "", $this->message);
            }  
(By BetaDevil in this post)
In topic you referred to, is there a version of this code that inserts the moderator name automatically?
User avatar
Johan-NL
Registered User
Posts: 92
Joined: Thu Aug 07, 2008 8:37 am
Location: Netherlands

Re: Custom BBCodes

Post by Johan-NL »

No. But these are only the file-edits. You should now create an BBcode called [mod={TEXT1}]{TEXT2}[/mod] or something.

I guess you could install the [me] and [you] and [we] and [us] filter, and make a BBcode like: [mod=[me]]{TEXT}[/mod] :)

EDIT: Which means every moderator should add the '[me]' :(
Scotty501
Registered User
Posts: 89
Joined: Wed Mar 28, 2007 9:40 am
Location: London, UK
Contact:

League Republic

Post by Scotty501 »

Hi All,

Im sure this is simple - but so am I :) Its a league table from League Repbulic

I am trying to inlclude the follow code in a post - any pointers please to a BB code that would work?

Code: Select all

<div id="lrep1394512" style="width: 350px;">Data loading....<a href="http://2v2ladder.leaguerepublic.com/Index.do?divisionseason=8286248">click here for Divison 1 Prozone</a><br/><br/><a href="http://www.leaguerepublic.com">LeagueRepublic<a></div>
<script language="javascript" type="text/javascript">
<!--
var lrcode = '1394512'
-->
</script>
<script language="Javascript" type="text/javascript" src="http://api.leaguerepublic.com/client/api/cs1.js"></script>
Web Design http://www.ukushosting.com Web Hosting
Locked

Return to “Custom BBCode Development and Requests”