Back to vBulletin 3.5 Add-ons

Playing Windows Media Files Inline Using Plugin
Mod Version: 1.00, by Moya

This modification is in the archives.
vB Version: 3.5.1 Rating: (0 vote - 0 average) Installs: 64
Released: 02 Nov 2005 Last Update: 09 Nov 2005 Downloads: 79
Not Supported Uses Plugins Template Edits  

This just an upgrade over from my existing hack HERE

Spoiler (click to open)


This just a port over from my existing hack for version 3.0.x

Playing Flash and Media Files Inline

What this hack does::

This hack allows your users to upload media files via your board file management and play the media fields within their post.. It is adivisable to have one inline per post.

Foreword:

This hack might not work on all system due to different configuration, platform, and such. I will try to help you all as much as I can.

This hack will use your board attachment system to run mp3, wma, wmv, flash files. It is a bit server intensive. So be warned

Security Risk:

It has been known that flash files can be used to exploit and compromise certain securities on user computer. You might want to verify your flash attachment before enable flash playing inline on your forum.

Files To edit: 1
Queries to run: 0
Uses Product: Yes
Template Edits: 2

File Edit

includes/class_postbit.php

Find
PHP Code:
function process_attachments()
    {
        global 
$stylevar$show$vbphrase
Add under

PHP Code:
// flash attachment
    
global $flashid,$flashfilename,$flashextension,$flashfilenameandlocation,$flashfilesize  ;

// wma attachment
    
global $wmaid,$wmafilename,$wmaextension,$wmafilenameandlocation,$wmafilesize;
    
// wmv attachment
    
global $wmvid,$wmvfilename,$wmvextension,$wmvfilenameandlocation,$wmvfilesize;    
    
// mp3 attachment
    
global $mp3id,$mp3filename,$mp3extension,$mp3filenameandlocation,$mp3filesize;
//default media tag 
    
$media_controller=  "attachment.php?"$this->registry->session->vars['sessionurl'] ."attachmentid="
Look for

PHP Code:

$attachment
['attachmentextension'] = strtolower(file_extension($attachment['filename']));
                
$attachment['filesize'] = vb_number_format($attachment['filesize'], 1true); 
Add Under

PHP Code:
//start Play inline
          //flash attachment
            
$flashfilename=$attachment['filename'];                            
            
$flashextension=$attachment['attachmentextension'];                            
            
$flashfilesize=$attachment['filesize'];                            
            
$flashid=$post['userid'];                            
            
$flashfilenameandlocation=$media_controller $attachmentid  ;
            
//wma attachment
            
$wmaid=$post['userid'];
            
$wmafilename=$attachment['filename'];
            
$wmaextension=$attachment['attachmentextension'];                                        
            
$wmafilenameandlocation=$media_controller $attachmentid  ;            
            
$wmafilesize=$attachment['filesize'];            
            
//wmv attachment
            
$wmvid=$post['userid'];
            
$wmvfilename=$attachment['filename'];
            
$wmvextension=$attachment['attachmentextension'];                            
            
$wmvfilenameandlocation=$media_controller $attachmentid  ;            
            
$wmvfilesize=$attachment['filesize'];            
            
//wmv attachment
            
$mp3id=$post['userid'];
            
$mp3filename=$attachment['filename'];
            
$mp3extension=$attachment['attachmentextension'];
            
$mp3filenameandlocation=$media_controller $attachmentid  ;
            
$mp3filesize=$attachment['filesize'];  
//end play inline 
PHP Code:
else
                            {
                                eval(
'$this->post[\'imageattachmentlinks\'] .= "' fetch_template('postbit_attachment') . '";');
                                
$show['imageattachmentlink'] = true;
                            }
                            break; 

Add Undder

PHP Code:

                           
case 'swf':
                            eval(
'$this->post[\'flashattachments\'] .= "' fetch_template('postbit_attachmentflash') . '";');                        
                            
$show['flashattachment'] = true;                        
                           break;    
                    
                        case 
'wma':
                            eval(
'$this->post[\'wmaattachments\'] .= "' fetch_template('postbit_attachmentwma') . '";');                        
                            
$show['wmaattachment'] = true;                        
                        break;    
                            
                        case 
'wmv':
                            eval(
'$this->post[\'wmvattachments\'] .= "' fetch_template('postbit_attachmentwmv') . '";');                        
                            
$show['wmvattachment'] = true;                        
                        break;    
                            
                        case 
'mp3':
                            eval(
'$this->post[\'mp3attachments\'] .= "' fetch_template('postbit_attachmentmp3') . '";');                        
                            
$show['mp3attachment'] = true;                        
                        break; 

Template Edit

Postbit template

Look for

HTML Code:
$post[imageattachments]
					</div>
				</fieldset>
			</if>

Add Under

HTML Code:
<if condition="$show[flashattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attached_flash] $flashfilename </legend>
<div style="padding:$stylevar[formspacer]px">
$post[flashattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmaattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wma] $wmafilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmaattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmvattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wmv] $wmvfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmvattachments]
</div>
</fieldset>
</if>
<if condition="$show[mp3attachment]">
<fieldset class="fieldset">
<legend>
$vbphrase[attach_mp3] $mp3filename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mp3attachments]
</div>
</fieldset>
</if>

Postbit legacy template

Look for

HTML Code:
$post[imageattachments]
					</div>
				</fieldset>
			</if>

Add Under

HTML Code:
<if condition="$show[flashattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attached_flash] $flashfilename </legend>
<div style="padding:$stylevar[formspacer]px">
$post[flashattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmaattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wma] $wmafilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmaattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmvattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wmv] $wmvfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmvattachments]
</div>
</fieldset>
</if>
<if condition="$show[mp3attachment]">
<fieldset class="fieldset">
<legend>
$vbphrase[attach_mp3] $mp3filename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mp3attachments]
</div>
</fieldset>
</if>

Upload the included XML as product.

Demo









If you use this hack please click install.
Attached Files
File Type: xml media-inline.xml (11.1 KB, 145 views)

Close

to use plugin system for vb3.5 gold

What this hack does::

This hack allows your users to upload media files via your board file management and play the media fields within their post.. It is adivisable to have one inline per post.

Foreword:

This hack might not work on all system due to different configuration, platform, and such. I will try to help you all as much as I can.

This hack will use your board attachment system to run mp3, wma, wmv, flash files. It is a bit server intensive. So be warned

Security Risk:

It has been known that flash files can be used to exploit and compromise certain securities on user computer. You might want to verify your flash attachment before enable flash playing inline on your forum.

Files To edit: 0
Queries to run: 0
Uses Product: Yes
Template Edits: 1

Template Edit

To remove previous version from Postbit template
Postbit template

Look for

HTML Code:
<if condition="$show[flashattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attached_flash] $flashfilename </legend>
<div style="padding:$stylevar[formspacer]px">
$post[flashattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmaattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wma] $wmafilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmaattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmvattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wmv] $wmvfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmvattachments]
</div>
</fieldset>
</if>
<if condition="$show[mp3attachment]">
<fieldset class="fieldset">
<legend>
$vbphrase[attach_mp3] $mp3filename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mp3attachments]
</div>
</fieldset>
</if>

Postbit legacy template

Look for

HTML Code:
<if condition="$show[flashattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attached_flash] $flashfilename </legend>
<div style="padding:$stylevar[formspacer]px">
$post[flashattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmaattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wma] $wmafilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmaattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmvattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wmv] $wmvfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmvattachments]
</div>
</fieldset>
</if>
<if condition="$show[mp3attachment]">
<fieldset class="fieldset">
<legend>
$vbphrase[attach_mp3] $mp3filename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mp3attachments]
</div>
</fieldset>
</if>

REMOVE THEM

SAVE

Open postbit_attachment and add to very top

HTML Code:
<tr>
<td width=450 colspan="2">
<if condition="$show[realattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_real] $realfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[realattachments]
</div>
</fieldset>
</if>
<if condition="$show[movattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_mov] $movfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[movattachments]
</div>
</fieldset>
</if>
<if condition="$show[flashattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attached_flash] $flashfilename </legend>
<div style="padding:$stylevar[formspacer]px">
$post[flashattachments]
</div>
</fieldset>
</if>
<if condition="$show[pdfattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_pdf] $pdffilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[pdfattachments]
</div>
</fieldset>
</if>
<if condition="$show[aviattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_avi] $avifilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[aviattachments]
</div>
</fieldset>
</if>
<if condition="$show[mpgattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_pdf] $mpgfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mpgattachments]
</div>
</fieldset>
</if>
<if condition="$show[mpegattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_pdf] $mepgfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mepgattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmaattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wma] $wmafilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmaattachments]
</div>
</fieldset>
</if>
<if condition="$show[wmvattachment]">
<fieldset class="fieldset">
<legend>$vbphrase[attach_wmv] $wmvfilename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[wmvattachments]
</div>
</fieldset>
</if>
<if condition="$show[mp3attachment]">
<fieldset class="fieldset">
<legend>
$vbphrase[attach_mp3] $mp3filename</legend>
<div style="padding:$stylevar[formspacer]px">
$post[mp3attachments]
</div>
</fieldset>
</if>
</td>
</tr>


Upload the included XML as product.

Demo









If you use this hack please click install.

As christianb mentioned in the other post, you might need to setup attachement types for your forum to play properly.

Use the following for your types

HTML Code:
WMA »  Content-type: audio/x-ms-wma
WMV »  Content-type: video/x-ms-wmv
MP3  »  Content-type: audio/x-mp3
SWF »  Content-type: application/x-shockwave-flash
AVI  »  Content-type: video/x-ms-avi
MOV »  Content-type: video/quicktime
MP4 » Content-type: video/quicktime
MPEG »  Content-type: video/mpeg
MPG »  Content-type: video/mpeg
RAM »  Content-type: audio/x-pn-realaudio
RM »  Content-type: audio/x-pn-realaudio
SWC »  Content-type: application/x-shockwave-flash

NOTE: This hack use your board attachment.php to play those specified media files. Therefore, you will have to set up user right to download attachement in under forum permissions.


Quote by Supported Codes
mov, mpeg, mpg, mp4, wma, real, wma, wmv, avi

Download

This modification is archived and cannot be downloaded.

Similar Mods

Show Thread Enhancements Playing Attached Media Files Inline Modification Graveyard
Playing Flash and Media Files Inline vBulletin 3.0 Full Releases
Playing Windows Media Files Inline vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024