Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

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

Version: 3.0.9 Rating:
Released: 03-16-2005 Last Update: 03-16-2005 Installs: 21
 
No support by the author.

Is it possible? Is there any security issue? I am thinking of releasing this hack, but I am not sure about the demands and security issue on this.

History:

Originally, I have window media files played directly (inline) in phpbb. When I moved to vb, I tried to seek help from vb.com to modify their attachment system without success. I understand that Vb's attachment system for security purpose. Therefore, I have to find other means to achieve what I want. I come up with this hack when my board is at its infancy stage. It probably still is infancy because, it is used as a test and fun board when I am at work .


Requirement:

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.

Enut with the blah blah ??

Open your functions_showthread.php

Find

PHP Code:
function construct_postbit($post$maintemplatename 'postbit'$alternate '')

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"$vboptions[bburl]/attachment.php?attachmentid="

Find

PHP Code:
$attachment['filename'] = fetch_censored_text(htmlspecialchars_uni($attachment['filename']));
            
$attachment['attachmentextension'] = strtolower(file_extension($attachment['filename']));
            
$attachment['filesize'] = vb_number_format($attachment['filesize'], 1true); 

Add Under

PHP Code:
//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']; 

Find

PHP Code:

eval('$post[\'imageattachmentlinks\'] .= "' fetch_template('postbit_attachment') . '";');
                            
$show['imageattachmentlink'] = true;
                        }
                        break; 

Add Under

PHP Code:

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

Var: attach_wmv
Text: Window Media Video

Var: attach_mp3
Text: MPEG-1 layer 3 Audio Encoding :

Var: attached_flash
Text: Attached Flash File:

Var :attach_wma
Text : Window Media Audio :

Templates:

Go to your Postbit template

Find

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

Add Under

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>


Go to your board admin and add the templates under postbits.


The included templates file uses the existing templates on my board. Feel free to modified.


If you need help drop a line here or at www.aotrangmongmo.com

Show Your Support

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

Comments
  #12  
Old 03-17-2005, 05:52 AM
bold bold is offline
 
Join Date: Oct 2004
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #13  
Old 03-17-2005, 11:17 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

while i'm not sure about media files, flash files are a huge secruity risk i would suggest you note that in your initial post
Reply With Quote
  #14  
Old 03-17-2005, 11:28 AM
montda montda is offline
 
Join Date: May 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can i make it avelable to any usergroups i want?
it well be great
thx alot
Reply With Quote
  #15  
Old 03-17-2005, 11:48 AM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont get whats the difference from using just bbcodes for both instead of hacking the files
Reply With Quote
  #16  
Old 03-17-2005, 11:52 AM
Deaths Deaths is offline
 
Join Date: Oct 2004
Location: Europe, Belgium
Posts: 679
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, wrong forum.

Show thread modifications would be more appropriate.
Reply With Quote
  #17  
Old 03-17-2005, 01:09 PM
Mla7a6 Mla7a6 is offline
 
Join Date: Apr 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi..
It looks like a nice hack IF it will allow you to play ONLY media files (different formats: mp3, wav, wmv, au, rm, mov..etc.) because it is well known and tried before the security risk arising from playing flash files stored on your domain.. unless we can find a solution like to be able to store attachments on a different domain -or sub domain- and then try to call it from VB..
I am not a coder.. but I thaught 'll share my idea..
Reply With Quote
  #18  
Old 03-17-2005, 02:40 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by montda
can i make it avelable to any usergroups i want?
it well be great
thx alot

This hack uses attachment system on vb. You can set the permission there.
Reply With Quote
  #19  
Old 03-17-2005, 02:42 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mla7a6
Hi..
It looks like a nice hack IF it will allow you to play ONLY media files (different formats: mp3, wav, wmv, au, rm, mov..etc.) because it is well known and tried before the security risk arising from playing flash files stored on your domain.. unless we can find a solution like to be able to store attachments on a different domain -or sub domain- and then try to call it from VB..
I am not a coder.. but I thaught 'll share my idea..
Flash files are cached to member's computer. If you don't want flash files being played on your board, then disable that section.
Reply With Quote
  #20  
Old 03-17-2005, 02:49 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Johnny
i dont get whats the difference from using just bbcodes for both instead of hacking the files

With bbcode:

You have to upload the files on your forum thru certain means like ftp, or the like.

Then you have to use bbcode for the link

With this one:

You use the vb built in attachment system.
Reply With Quote
  #21  
Old 03-17-2005, 02:58 PM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stitch
With bbcode:

You have to upload the files on your forum thru certain means like ftp, or the like.

Then you have to use bbcode for the link

With this one:

You use the vb built in attachment system.
you dont have to upload the files threw ftp to use the bbcode for a video or flash file you can just upload it threw the attachment system and link the attachment in the bbcode. i know it works that way on my board. :ermm:
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 05:57 AM.


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.04552 seconds
  • Memory Usage 2,364KB
  • 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
  • (2)bbcode_code
  • (6)bbcode_php
  • (4)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