These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:24 pm Advanced search

Add a [ c ] tag to these forums?

If you are stuck or have questions regarding HTML or other Web technologies, ask your questions here. No question too dumb!

Add a [ c ] tag to these forums?

Postby Cerbera » Sat May 12, 2007 4:08 am

Many discussions here are about markup, scripting and styling. Members often make inline references to HTML elements, DOM functions and suchlike.

If it's not too hard, adding a [c] tag would allow these references to be marked as such. The forum software could translate [c] into <code>. These could be styled to visually distinguish them as computer code (such as using a 1em monospace font). This could make technical messages easier to follow.
Cerbera
<h4>
 
Posts: 34
Joined: Wed Feb 21, 2007 1:04 pm

Postby bfrohs » Wed May 16, 2007 8:59 pm

Code: Select all
<div>
<span>Hello</span>
</div>


Oh, you mean like that? 8) It's already implemented. But it isn't c. It is code.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby Cerbera » Wed May 16, 2007 9:41 pm

No, not like that. That's a block-level code sample, not an inline code sample.

Code: Select all
This is an <code>inline code sample</code>.
This is the HTML I would like, produced by a new [c] BBcode. [b] and [i] just aren't right for this! :)
Cerbera
<h4>
 
Posts: 34
Joined: Wed Feb 21, 2007 1:04 pm

Postby bfrohs » Wed May 16, 2007 11:07 pm

Ah, I see. I was thinking the same thing earlier, I just didn't understand what you meant when I read your post. I agree 100%. :P
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Wed May 16, 2007 11:31 pm

Someone will have to say exactly which changes need to be made to which source files in phpbb2 if this is going to be implemented, since the admin UI doesn't seem to provide a way to add tags.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Wed May 16, 2007 11:33 pm

I'll look into how to implement the new code right away.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby bfrohs » Wed May 16, 2007 11:37 pm

Can I add my own tags?
If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.


http://www.phpbb.com/community/faq.php?mode=bbcode#f60


I hope that helps. If not, I'll install PHPBB2 on my own site and research more in-depth.[/url]
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Wed May 16, 2007 11:49 pm

I can't find a "custom bbcodes" section anywhere. Perhaps it's not in phpbb 2.0.22?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Thu May 17, 2007 12:12 am

I downloaded 2.0.22 onto my server and looked for it. I couldn't find it either. I did, however, figure out how to get the desired effect.

Open the bbcode file

{PHPBB DIRECTORY}/includes/bbcode.php

Search for code($text

Code: Select all
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
$text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);
$text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);

// [code] and [/code] for posting inline code
$text = str_replace("[c]", "<code class=\"inlinecode\">", $text);
$text = str_replace("[/c]", "</code>", $text);


Fine the quote section and paste the 'code' section below it (provided above). As for the buttons, I don't see that in the files yet. I will continue to look for them.

Note: This is a quick way to do it. It shouldn't be too hard to actually insert the tag into the bbcode_tpl array.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby zcorpan » Thu May 17, 2007 12:20 am

Hmm, that doesn't seem very robust. Wouldn't it result in stray <code> or </code> tags if the input text wasn't ok? Also, we would have to change this every time we upgrade phpbb. It's probably better to upgrade to phpbb3 later on and see if it has a custom bbcodes section, I think...
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby bfrohs » Thu May 17, 2007 12:35 am

I researched it a little more in-depth. The only way I've found to add additional bbcode tags is to go into a few different files and add text. Similar to what I described, you would have to open a file, search for a string, and add text below it. The downside is that you would indeed have to update it each time you upgraded PHPBB (as far as I know).
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby Cerbera » Thu May 17, 2007 5:54 am

I doubt any forum system has a sane backend for adding tags. Literal string replacements using array entries is probably what they all do.
Cerbera
<h4>
 
Posts: 34
Joined: Wed Feb 21, 2007 1:04 pm

Postby bfrohs » Thu May 17, 2007 7:07 am

Personally, I would say to create (or have someone else create) a forum that fits your needs. I tried both PHPBB and Lussumo Vanilla, but neither fit all of my needs. Therefore, I wrote my own forum. It may not have the most in-depth back-end, but I don't really need a back-end when everything is already exactly how I want it. So, I guess if you don't want to worry about upgrading and such, writing your own program is the better solution.
bfrohs
<h4>
 
Posts: 28
Joined: Wed May 16, 2007 7:44 pm
Location: Kalkaska, Michigan, United States

Postby aristana » Thu Oct 29, 2009 9:56 am

How do you change BBcodes? I am trying to change a <> BBcode into an [IMG] as I need the IMG code, not hte <>. Is there any way I can do it? Help?
aristana
<h6>
 
Posts: 1
Joined: Sun Oct 25, 2009 7:33 am


Return to Help & Advice

Who is online

Users browsing this forum: No registered users and 0 guests