Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Playing Windows Media Files Inline Details »»
Playing Windows Media Files Inline
Version: 1.0.0, by Moya Moya is offline
Developer Last Online: Aug 2009 Show Printable Version Email this Page

Version: 3.5.0 RC3 Rating:
Released: 09-16-2005 Last Update: Never Installs: 18
Uses Plugins Template Edits
Code Changes  
No support by the author.

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

https://vborg.vbsupport.ru/showthread.php?t=78235


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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-19-2005, 07:32 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
It's a bit tricky, but I think it would be possible to do this without File Edits.

I always wonder about this new feature of VB3.5, but I don't know where to begin. It would be good if we can have certain guide line
Reply With Quote
  #13  
Old 09-19-2005, 08:23 PM
jesus likes pie jesus likes pie is offline
 
Join Date: Apr 2005
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

LOVE IT....but file edits

If only you could make it use plugins....I might still consider it once we go 3.5 gold....or 3.5.1.
Reply With Quote
  #14  
Old 10-02-2005, 01:36 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

getting this db error when i install the product...
Quote:
Database error in vBulletin 3.5.0:

Invalid SQL:

INSERT INTO product
(productid, title, description, version, active, apm_releasedate, apm_author, apm_relatedurl, apm_extrainfo, apm_extraedit)
VALUES
('media_inline',
'Playing Media Files Inline',
'Display media files within posts and threads',
'1.0.1',
1,
'',
'',
'',
'',
''
);

MySQL Error : Unknown column 'apm_releasedate' in 'field list'
Error Number : 1054
Date : Sunday, October 2nd 2005 @ 03:33:38 PM
any ideas guys??
Reply With Quote
  #15  
Old 10-16-2005, 10:21 AM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just as an addition to this, the sql error was sorted, it was my fault...lol

BUT....nothing shows up on the board saying its working...

where are you supposed to look, or is there something that has to be activated for it to work at all?
im using 3.5 GOLD btw
Reply With Quote
  #16  
Old 10-17-2005, 07:23 PM
turkboard's Avatar
turkboard turkboard is offline
 
Join Date: Jul 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

3.5 GOLD work ?
Reply With Quote
  #17  
Old 10-20-2005, 02:32 AM
tamborinegal's Avatar
tamborinegal tamborinegal is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for 3.5 Gold? Would love it if it did

Thanks
Reply With Quote
  #18  
Old 10-21-2005, 08:09 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just installed this, and I have 3.5.0 Gold.
However, it needs to be mentioned that as it is, it will NOT work, without one more modification which was not mentioned.

In ACP, go to Extensions & Sizes. Click Add New Attachment Type.
(you must do this for each file type - mp3 is given as an example)
************************************************** **********
Extension: mp3
Max Filesize(in bytes) 5000000
Mime Type: Content-type: audio/mp3
Display thumbnail for this type? No
Open this attachment in a new browser window? No (Really this is your choice)
Enabled Yes
************************************************** **********
For a temporary demo, click here
Reply With Quote
  #19  
Old 10-21-2005, 09:01 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've also made edits to include wav if anyone is interested.

http://www.christianboards.org/showthread.php?t=409
For a limited time only.
Reply With Quote
  #20  
Old 10-31-2005, 06:04 PM
cbr929rrerion cbr929rrerion is offline
 
Join Date: Oct 2005
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want this to play avi, mva, mpeg, basic video files, I have 3.5, I tried it and all I get is a link.... any suggestions?
Reply With Quote
  #21  
Old 10-31-2005, 07:44 PM
cbr929rrerion cbr929rrerion is offline
 
Join Date: Oct 2005
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get this with, avi, mov, and mpg, all formats...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09199 seconds
  • Memory Usage 2,373KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_html
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete