Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

65 users online



If you'd like to have BBcode on your shoutbox.

If you'd like to have BBcode on your shoutbox.

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 3
CDude

CDude

nothing
Status: Offline!

bboard isn't that hard. Many people i know have wrote one for personal use. If you understand it, it's not that hard, just takes a long time because you don't have a team.

___________________

http://celerondude.com

bryan

bryan

Neversidian
Status: Offline!

Here's what I use on my shoutbox:

PHP:

<?
function shoutCode($text) {
$text preg_replace("#\[ b\ ](.+?)\[/b\]#si""<b>\\1 </b>"$text);
$text preg_replace("#\[ i\ ](.+?)\[/i\]#si""<i>\\1 </i>"$text);
$text preg_replace("#\[ u\ ](.+?)\[/u\]#si""<u>\\1 </u>"$text);
$text preg_replace("#\[ url\ ](.+?)\[/url\]#si""<a href=\"\\1\" target=\"_blank\">\\1 </a>"$text);
$text preg_replace("#\[ email\ ](.+?)\[/email\]#si""<a href=\"mailto:\\1\">\\1 </a>"$text);
$text preg_replace("#\[ url=(.+?)\ ](.+?)\[/url\]#si""<a href=\"\\1\" target=\"_blank\">\\2 </a>"$text);
$text preg_replace("#\[ email=(.+?)\ ](.+?)\[/email\]#si""<a href=\"mailto:\\1\">\\2 </a>"$text);
$text preg_replace("#\[ e-mail\ ](.+?)\[/e-mail\]#si""<a href=\"mailto:\\1\">\\1 </a>"$text);
$text preg_replace("#\[ e-mail=(.+?)\ ](.+?)\[/e-mail\]#si""<a href=\"mailto:\\1\">\\2 </a>"$text);
$text preg_replace("#\[ e-mail=\"(.+?)\"\ ](.+?)\[/e-mail\]#si""<a href=\"mailto:\\1\">\\2 </a>"$text);

return 
$text;
}
?>


I added spaces so they wouldn't be parsed. Stupid vB. Tongue

___________________

Mugging Scotty Good.
www.muggingscotty.com

Last edited by bryan, July 30th, 2002 05:28 PM (Edited 1 times)

Oxy

Oxy

Neverside Newbie
Status: Offline!

Yep, it's not hard to write a forum, it can be done with some basicPHP understanding, but extremely time consuming for one person to do.

___________________

RAAAH

CyberKill3r

CyberKill3r

Status: Offline!

Yeah, I see a simple forum like a guestbook and a shoutbox.
I hope soon when I finish my web make a forum with flat files and maybe mySQL.

++ckill3r

___________________

Grand Premier of CyberKill3r Episode I website on some time in the future. With a lot of tutorials and scripts free to download, and much more...
..::CyberKill3r.

bryan

bryan

Neversidian
Status: Offline!

I agree with Oxy... it's not hard at all if you know basic PHP, but very time consuming, just writing my shoutbox took days.

___________________

Mugging Scotty Good.
www.muggingscotty.com

Darker

Darker

Status: Offline!

hmmmmmmmmm, one question about this...

i convert BBcode like this:

PHP:


<?
###################### start BB code replace ################

$bbcode = array ("[ b]",
                                 
"[ /b]",
                                 
"[ i]",
                                 
"[ /i]",
                                 
"[ u]",
                                 
"[ /u]",
                                 
"[ list]",
                                 
"[ /list]");

$html = array ("<b>",
                             
"</b>",
                             
"<i>",
                             
"</i>",
                             
"<u>",
                             
"</u>",
                             
"<li>",
                             
"</li>");

$str str_replace($bbcode$html$str);

echo 
$str;
?>

now is that code no good compared to CDude's code up top? tho i know i need to use the preg_replace() method for things like urls and emails.

amplify

amplify

I'm a Neverside Newbie?
Status: Offline!

vBulletin and any of the other high-end BBs are actually VERY easy to code. A lot of people get discouraged because of the amount of time, and maybe one or two "bumps" along the way, which are actually very easy to sort out. For example, user online/offline script. Seriously, took me a minute to write mine. Figured out a simple equation in my head, then put it as PHP. But so many poeple have problems with them. bup

CONFIQ

CONFIQ

Status: Offline!

Re: If you'd like to have BBcode on your shoutbox.

[QUOTE][i]Originally posted by CDude [/i]
$bold = '/(\[B\])(.+)(\[\/B\])/';
$italic = '/(\[I\])(.+)(\[\/I\])/';

$str = preg_replace($bold,'<b>\\2</b>',$str);
$str = preg_replace($italic,'<i>\\2</i>',$str);
print $str;
[/QUOTE]


That's nice :) but what if i use newline? like
[ b] text text
text
text
[/b]

????

btw i've recode the code to this...

[php]$str = preg_replace("/(\[(b|B)\])(.+)(\[\/(b|B)\])/","<b>\\3</b>",$str);[/php]

Lane

Lane

Status: Offline!

Re: If you'd like to have BBcode on your shoutbox.

Quote:

Originally posted by CDude

$str = preg_replace($cemter,'<center>\\2</center>',$str);

you do mean $center right? Smile

CDude

CDude

nothing
Status: Offline!

yes

___________________

http://celerondude.com

Page 2 out of 3
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.019 seconds.