vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Show Thread Enhancements - Play FLV/MP4 Attachments (https://vborg.vbsupport.ru/showthread.php?t=261707)

Frosty 04-08-2011 10:00 PM

Play FLV/MP4 Attachments
 
1 Attachment(s)
First of all, you will need to create a new BB Code.

Login to your Administration Panel, find "Custom BB Codes" in the sidebar, click it. And click add new BB Code:

Title: attachvideo
BB Code Tag Name: attachvideo
Replacement:
HTML Code:

<script type='text/javascript' src='http://yourdomain.com/flashplayer/jwplayer.js'></script>
<div id='mediaspace_$attachment[attachmentid]'>Loading the player...</div>
<script type='text/javascript'>
jwplayer('mediaspace_$attachment[attachmentid]').setup({
'flashplayer': 'http://yoursite.com/flashplayer/player.swf',
'file': 'http://yoursite.com/attachment.php?attachmentid=$attachment[attachmentid]',
'controlbar': 'bottom',
'width': '720',
'height': '480',
'type': 'video',
'provider': 'video'
});
</script>

Example:
[attachvideo]2322[/attachvideo]

Description:
With this BB Code you will be able to embed multiple videos that are uploaded as attachments.

Use {option}: No.

Remove Tag If Empty: Yes.
Disable BB Code Within This BB Code: Yes.
Disable Smilies Within This BB Code: Yes.


Save it...

Now, how to take out the attachment ID from the link?

Let's say that you uploaded some FLV file, when you hover over it, you'll see something similar to this:
http:// *yourdomain.com/attachment.php?attachmentid=2322&stc=1&d=130235881 1

Part that you need is "2322"

Simply wrap it in:

[attachvideo]2322[/attachvideo]

Obviously, you'll need JWPlayer for this, you can download JWPlayer from here:
http://www.longtailvideo.com/players/jw-flv-player/

After you've downloaded it, unzip it , and upload it on your server, make sure you enter the correct path of the .js and .swf file for the BBCode replacement.

If you want to make it easy, just create a directory called "flashplayer" in your root forum directory, and upload all JWPlayer files in it, replacement I've pasted in this will work with that path, otherwise, you'll have to set your own path.

p.s. If you can't upload .flv or .mp4 files as attachments, that means you don't have that extension set in the Attachments Manager.

Create them, and everything will work!

yahooooh 04-10-2011 06:19 AM

could you plz make it support mp3
and also update it for vb4

Frosty 04-10-2011 07:04 AM

@yahooooh
If you don't have the mp3 extension in Attachment Manager add it, pick the biggest size that should be allowed for mp3 files, and MIME Type you need to enter is "audio/mpeg".

Now, go to the creation of new BB Codes..

Title: mp3
BB Code Tag Name: mp3
Replacement:
HTML Code:

<script type='text/javascript' src='http://yoursite.com/flashplayer/jwplayer.js'></script>
<div id='mediaspace_$attachment[attachmentid]'>Loading the player...</div>
<script type='text/javascript'>
jwplayer('mediaspace_$attachment[attachmentid]').setup({
'flashplayer': 'http://yoursite.com/flashplayer/player.swf',
'file': 'http://yoursite.com/attachment.php?attachmentid=$attachment[attachmentid]',
'controlbar': 'bottom',
'width': '720',
'height': '24',
'type': 'sound'
});
</script>

Example: [mp3]2948[/mp3]
Description: Use this BB Code to play MP3 files that are uploaded as attachments.
Use {option} : No
Button Image: Optional
Remove Tag If Empty: Yes
Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes

Save...

About this BB Code for vBulletin 4, I'll install vb4 on localhost later, so I'll see what I can do, shouldn't be much different than this one.

8thos 05-14-2011 06:08 PM

Quote:

Originally Posted by FallenBeauties (Post 2182880)
@
About this BB Code for vBulletin 4, I'll install vb4 on localhost later, so I'll see what I can do, shouldn't be much different than this one.

Okay please do I really need this.

Frosty 05-20-2011 09:59 PM

@Octavius!
https://vborg.vbsupport.ru/showthread.php?t=263950

There you go. :)

8thos 05-21-2011 01:00 AM

Your awesome dude!


All times are GMT. The time now is 02:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01156 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete