fortunzfavor

Joined: 13 Jun 2007 Posts: 95
Digg It |
Posted: Sat Jul 14, 2007 4:15 pm Post subject: Embed youtube request |
|
|
The idea is to be able to wrap [youtube][/youtube] around a youtube id code or full url, and then have it playable from within a post. This would allow users to demonstrate stages of development, changes, scripts, etc more effectively and more smoothly within the forums.
This forum is ideal for this type of feature. It'd be great to be able to embed youtube videos directly into a post.
Here's a link describing how to create the tag. There are several options (including similar codes for other video sites like gametrailers), and there are apparently some bugs in phpbb, so there are workarounds posted. If this isn't effective, but you were still interested in adding support, I'd be happy to do the legwork to find code that does work.
I am copying the relevant portions for a phpbb rc2 board (that's what this is, right?) to wrap the tags around the full youtube url.
Leozak wrote:
Step 1:
Under BBCodes, in the ACP:
BBCode Usage, add:
| Code: | | [Youtube]{TEXT}[/Youtube] |
HTML Replacement, add:
| Code: |
<object width="425" height="350"><param name="movie" value="{TEXT}"></param><param name="wmode" value="transparent"></param><embed src="{TEXT}" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
|
Step 2:
Open viewtopic.php:
Look for:
| Code: | // Parse the message and subject
$message = censor_text($row['post_text']);
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = str_replace("\n", '<br />', $message);
|
ADD, AFTER:
| Code: |
$message = str_replace("watch?v=", 'v/', $message);
|
SAVE and REPLACE. (Make sure you have a backup of viewtopic.php ) |
|