Custom BBCodes [Deprecated]

Get help developing custom BBCodes or request one.
Dave-Eclipse
Registered User
Posts: 47
Joined: Sun Apr 17, 2005 6:49 am

Re: Custom BBCodes

Post by Dave-Eclipse » Mon Oct 20, 2008 4:33 am

Aha! Thank you thank you thank you! I just didn't realise which box I had to paste it in!
I can imagine an industrial system that runs and repairs itself without oil. Yet because of the Export Land Model, I wonder if we've left it too little, too late to avoid a Greater Depression? I hope I'm wrong.

Welcome to the End of the Oil Age!

-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- » Thu Oct 23, 2008 9:41 am

Hi,

I am searching for a bbcode in which you can put html.
Can you do that?
Or can't it be put on forums?

Bye,
Kenichi

User avatar
MartectX
Translator
Posts: 1324
Joined: Wed Dec 19, 2007 8:05 pm
Location: Marienplatz

Re: Custom BBCodes

Post by MartectX » Thu Oct 23, 2008 10:43 am

If I may... is this the first 100 pages thread? 8-)

*ducksasmoderatorstakeouttheirwhips*

-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- » Thu Oct 23, 2008 10:58 am


-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- » Thu Oct 23, 2008 11:06 am

And I am searching for a BB-code where you have a note like this:
Or a warning.

Image

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Custom BBCodes

Post by JimA » Thu Oct 23, 2008 11:57 am

It's funny to see a screenshot of your own website in this topic, but I'll give you the code of the BBCode we use. It's not a secret. :)

BBCode:

Code: Select all

[note={TEXT1}]{TEXT2}[/note]
HTML Replacement:

Code: Select all

<div style=" background-color: #FFFFFF; -moz-border-radius: 10px; -webkit-border-radius: 10px; border: 1px solid #000000; padding: 4px;" > <img src="http://beta-garden.com/images/smilies/warning.png" alt="" title="" />  <strong>{TEXT1}: </strong>{TEXT2}</div>
In this BBCode will be linked to an image on our server, please but that image on your own or use another one otherwise it will cost us bandwidth. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- » Thu Oct 23, 2008 12:05 pm

And how can you make it only work for mods and admins?
Because on your forum you have that I thought xD

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Custom BBCodes

Post by JimA » Thu Oct 23, 2008 12:11 pm

I've did that with the following code-change. :)

Open: includes/message_parser.php
Find:

Code: Select all

global $config, $db, $user; 
Replace with:

Code: Select all

global $config, $db, $user, $auth, $forum_id; 
Find:

Code: Select all

// If false, then $this->message won't be altered, the text will be returned instead.  
Add, before:

Code: Select all

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("/\[note=(.*?)\](.*?)\[\/note\]/s", "", $this->message);
        }  
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

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 » Thu Oct 23, 2008 12:13 pm

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)

-Kenichi-
Registered User
Posts: 20
Joined: Thu Oct 23, 2008 9:36 am

Re: Custom BBCodes

Post by -Kenichi- » Thu Oct 23, 2008 12:15 pm

Ok,
But I have a free forum so I can't use that :mrgreen:

mconheady
Registered User
Posts: 33
Joined: Mon Jul 30, 2007 4:47 pm
Location: Rochester, NY
Contact:

Re: Custom BBCodes

Post by mconheady » Thu Oct 23, 2008 2:03 pm

Moka2 wrote:
MartectX wrote:
mconheady wrote:Is it possible to create a bbcode for posting images that would help copy-protect them- at least not allow people to copy/save image as?
It is impossible to protect images. You will just seriously piss off your users with these tactics.
Not to mention anyone with a medium level of intelligence can use the print screen button.
Yeah yeah yeah- I know. But as a photographer that runs a photography community, I know that every bit counts when it comes to protecting images- and you would be surprised how many people don't know how to use printscreen or search the cache. That would be the overwhelming majority of users.

User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: Custom BBCodes

Post by A_O_C » Thu Oct 23, 2008 8:38 pm

JimA wrote:I've did that with the following code-change. :)

Open: includes/message_parser.php
Find:

Code: Select all

global $config, $db, $user; 
Replace with:

Code: Select all

global $config, $db, $user, $auth, $forum_id; 
Find:

Code: Select all

// If false, then $this->message won't be altered, the text will be returned instead.   
Add, before:

Code: Select all

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("/\[note=(.*?)\](.*?)\[\/note\]/s", "", $this->message);
        }  
so, if i understand you correctly, the modification above to your bbcode allows only admins/mods to use it? what happens if you use this in a users post and the user edits their post? will they be able to delete it?

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

Re: Custom BBCodes

Post by Celtic Minstrel » Thu Oct 23, 2008 11:47 pm

Is there any way to add a tag that creates columns, like this one?

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

Re: Custom BBCodes

Post by Hippie459MN » Fri Oct 24, 2008 3:49 am

Celtic Minstrel wrote:Is there any way to add a tag that creates columns, like this one?
Try this. It will do 2 columns.

BB Code:

Code: Select all

[col]{TEXT1}|{TEXT2}[/col]
HTML:

Code: Select all

<table width="100%"><tr><td><div style="width:48%; float:left;">{TEXT1}</div><div style="width:48%; float:left; margin-left:4%;">{TEXT2}</div> </td></tr></table>
Helpline:

Code: Select all

Column: [col]collumn1|collumn2[/col]

User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7663
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Custom BBCodes

Post by JimA » Fri Oct 24, 2008 7:51 am

A_O_C wrote:so, if i understand you correctly, the modification above to your bbcode allows only admins/mods to use it? what happens if you use this in a users post and the user edits their post? will they be able to delete it?
Yes, they will be able to delete the note, and if they don't delete it, it will disappear because they are not allowed to use the BBCode. So I always lock the post when I've added a note. :)
Image Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.

Locked

Return to “Custom BBCode Development and Requests”