Variable News Blurb Using BBCodes


Topic author
Epochalepse
Active Member
Active Member
Posts: 1
Joined: 19. September 2010 08:15

Variable News Blurb Using BBCodes

Post by Epochalepse » 19. September 2010 09:19

I'm looking at Board3/phpbb3 as a possible replacement at my site. Consequently, I'm also looking at the portal for ease of modification.

One immediate shortcoming I found was that including pics or vids which have long URLs in the news summary/teaser/blurb is problematic when the embedding code exceeds the Board 3 news teaser character limit.

A simple solution is presented here which does not impact the character limit method.

STEP 1:

In the ACP, create a dummy BBCode with no replacement parameters in the form:

Code: Select all

[blurb][/blurb]
STEP 2:

Code: Select all

In portal/includes/functions.php
FIND

if (($text_length != 0) && (strlen($len_check) > $text_length))

REPLACE WITH:

		if ( $blurbpos = stripos  ( $len_check, '[blurb' )) {
			$row['post_text'] = substr  ( $len_check, 0, $blurbpos );
			$posts[$i]['striped'] = true;
		}

		if (($text_length != 0) && (strlen($len_check) > $text_length) && ($posts[$i]['striped'] != true) )
This will override the character count method (if the 'blurb' BBCode is present) and allow the news writer to choose where the summary/teaser/blurb ends by placing in the news post...

Code: Select all

[blurb][/blurb]
So you could do something like this:

Code: Select all

Rammstein singer Till Lindemann is reported to be in intensive care after attempts to remove a high-intensity LED from his mouth ran into complications.

[youtube]http://www.youtube.com/watch?v=YBcu8YWs7uM[/youtube]
[blurb][/blurb]
Doctors attending to his case said blah blah blah....
I've not thoroughly tested this. But it seems to work. I'm also new to Board 3 so I may have overlooked something.

Return to “Modification Requests”