TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 141
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 125
  • Total: 125

BBC Parsing in TP

Started by Omniverse, February 04, 2009, 06:41:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Omniverse

I am currently testing adding some new BBC code to one of my sites. This code is a seperate script the forum calls to execute. It's added to the display.php where the BBC code is called in a message.

It works great so far... except....

TP doesn't parse it. Forums posts on front page and articles will not parse it.

Could someone point me to where TP calls the BBC code to display in a post/article? Is it different than the normal BBC call from display.php?

bloc

TP actually just use the internal call of SMF to convert BBC code. So if you want to show own BBC code, use a PHP article and simply add a command in it like this:


$myBBCtext = 'This is a [i]test[/i] of the [color=red]BBC[/color] function!';
echo parse_bbc( $myBBCtext );

Omniverse

Ok, I'll have to test that in an article, thanks.

What about for a board that is set to show on the front page as news? In the post itself the bbc is parsed, but when viewing the front(portal) page, it is not, just show the [bbc] plain code.

Perhaps it would help if I showed you the code being used.
In display.php after this:

// Run BBC interpreter on the message.
$message['body'] = parse_bbc($message['body'], $message['smileysEnabled'], $message['ID_MSG']);


I have this to call the added bbc tags:

$message['body'] = whp_parse($message['body']);


Thanks for the help. :)

This website is proudly hosted on Crocweb Cloud Website Hosting.