[PHP] bulletin board question...

2002-05-25 Thread Anthony Ritter

To all,
On a bulletin board (non-usenet) within a website, is it possible to change
the color or size of the type - or add a link from a word that the user has
posted?

For example, John Doe posts:

Man, it's hot out here today!

Where John changes the default font color - which is black - of the word
hot - *to red* - and then links today with a URL to another site like
weather.com

If so, how would this be accomplished?
Any thoughts?

Thank you.
Tony Ritter





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] bulletin board question...

2002-05-25 Thread Richard Baskett

Well with phpBB2 you can use html if the administrator allows it, if not you
can use phpBB tags.  Things like:

Man, it's [color=red]hot[/color] out here
[url=http://www.weather.com]today[/url]!

All boards are different though so you'll need to read your documentation on
that board to figure out how to do it.. If it supports stuff like that :)

Cheers!

Rick

Some people come into our lives and quickly go, others stay for awhile,
leaving foot-prints on our hearts and we are never quite the same - Unknown

 From: Anthony Ritter [EMAIL PROTECTED]
 Date: Sat, 25 May 2002 19:39:10 -0500
 To: [EMAIL PROTECTED]
 Subject: [PHP] bulletin board question...
 
 To all,
 On a bulletin board (non-usenet) within a website, is it possible to change
 the color or size of the type - or add a link from a word that the user has
 posted?
 
 For example, John Doe posts:
 
 Man, it's hot out here today!
 
 Where John changes the default font color - which is black - of the word
 hot - *to red* - and then links today with a URL to another site like
 weather.com
 
 If so, how would this be accomplished?
 Any thoughts?
 
 Thank you.
 Tony Ritter
 
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] bulletin board question...

2002-05-25 Thread John Holmes

Any number of ways you can do it. You can have the user enter in valid
HTML and just display it as such. Or you can use a markup language like
most BB. 

Something like [b] for bold, [color=red] text [/color] to change colors,
etc.

PHP then looks through the post and replaces those tags with the HTML
equivalent. 

---John Holmes...

 -Original Message-
 From: Anthony Ritter [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, May 25, 2002 8:39 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] bulletin board question...
 
 To all,
 On a bulletin board (non-usenet) within a website, is it possible to
 change
 the color or size of the type - or add a link from a word that the
user
 has
 posted?
 
 For example, John Doe posts:
 
 Man, it's hot out here today!
 
 Where John changes the default font color - which is black - of the
word
 hot - *to red* - and then links today with a URL to another site
like
 weather.com
 
 If so, how would this be accomplished?
 Any thoughts?
 
 Thank you.
 Tony Ritter
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] bulletin board question...

2002-05-25 Thread SP

You can make up your own tags by just adding more
things to be parsed.

EXAMPLE:

$text = Look at [b]this[/b] website ...;
echo $text;
custom_tags($text);
echo $text;

function custom_tags($text)
{
/* converts special tags into the html counterpart
 * [b]text[/b] - bold text
 * [i]text[/i] - italicise text
 * [EMAIL PROTECTED] - automatically converts to
mailto: link
 * [link=http://www.yahoo.com]text[/link]
 *
 * [list]
 *  [*] text
 *  [*] text
 * [/list]
 *
 * [color=value]text to colour[/color] - colourize
some text
 * [colour=value]text to colour[/colour] -
colourize some text
 * [font=value]text[/font] - value is a class
defined in css file*/

$text = htmlentities($text);
$text =
eregi_replace([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z](
[-.]?[0-9a-z])*\\.[a-z]{2,3}, a
href=\mailto:\\0\;\\0/a,$text);
$text =
preg_replace(/\[link=(\S+?)\](.*?)\[\/link\]/is,
a href=\\\1\\\2/a,$text);
$text = preg_replace(/\[i\](.*?)\[\/i\]/is,
i\\1/i,$text);
$text = preg_replace(/\[b\](.*?)\[\/b\]/is,
b\\1/b,$text);
$text =
preg_replace(/\[list\](\n)?/i,ul,$text);
$text =
preg_replace(/\[\/list\](\n)?/i,/ul,$text);
$text = preg_replace(/\[\*\](.*?)$/ism,
li\\1/li,$text);
$text =
preg_replace(/\[color=(.*?)\](.*?)\[\/color\]/is
, font color=\\\1\\\2/font,$text);
$text =
preg_replace(/\[colour=(.*?)\](.*?)\[\/colour\]/i
s, font color=\\\1\\\2/font,$text);
$text =
preg_replace(/\[font=(.*?)\](.*?)\[\/font\]/is,
font class=\\\1\\\2/font,$text);
return nl2br($text);
}


-Original Message-
From: Anthony Ritter
[mailto:[EMAIL PROTECTED]]
Sent: May 25, 2002 8:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] bulletin board question...


To all,
On a bulletin board (non-usenet) within a website,
is it possible to change
the color or size of the type - or add a link from
a word that the user has
posted?

For example, John Doe posts:

Man, it's hot out here today!

Where John changes the default font color - which
is black - of the word
hot - *to red* - and then links today with a
URL to another site like
weather.com

If so, how would this be accomplished?
Any thoughts?

Thank you.
Tony Ritter





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php