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
  #2  
Old 09-17-2005, 10:21 AM
lttcoder lttcoder is offline
 
Join Date: Jul 2005
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds great, but I won't install it since it requires template changes/file changes.
Reply With Quote
  #3  
Old 09-17-2005, 10:43 AM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

going to make some good use out of this one! Thank you pal.
Reply With Quote
  #4  
Old 09-17-2005, 02:27 PM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lttcoder
Sounds great, but I won't install it since it requires template changes/file changes.
Refusing to make template changes is a bit extreme... You're going to miss out on a lot of great hacks.

Anyway, can't this be done using BB Code?
Reply With Quote
  #5  
Old 09-17-2005, 02:28 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cant seem to get this working on rc2...

the product list doesnt show this as installed or active, when its been installed...and theres nothing in the postbit, or postbit legacy style to show its installed...
Reply With Quote
  #6  
Old 09-17-2005, 02:34 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FleaBag
Refusing to make template changes is a bit extreme... You're going to miss out on a lot of great hacks.

Anyway, can't this be done using BB Code?
if i remember right, this was done on 3.0.7 with BB code...

[media][/media] if i remember right...
Reply With Quote
  #7  
Old 09-17-2005, 02:58 PM
hydrostatic hydrostatic is offline
 
Join Date: Jun 2005
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FleaBag
Refusing to make template changes is a bit extreme... You're going to miss out on a lot of great hacks.

Anyway, can't this be done using BB Code?
It's just that I don't want to do file edits... I don't care about template edits because I don't have to reapply them every time.

Anyway, I'd love this hack if it can be done without file edits.
Reply With Quote
  #8  
Old 09-17-2005, 04:55 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FleaBag
Refusing to make template changes is a bit extreme... You're going to miss out on a lot of great hacks.
Not always true. If you look at some of my 3.5 hacks, you will see that i do the template edits during runtime. No manual editing needed.
Quote:
Originally Posted by hydrostatic
I don't care about template edits because I don't have to reapply them every time.
If you look at the 3.5 releases until now, you will see that most needed one or more templates to be reverted. With all the new AJAX this will only happen more.
Reply With Quote
  #9  
Old 09-17-2005, 05:33 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gizmo5h1t3
cant seem to get this working on rc2...

the product list doesnt show this as installed or active, when its been installed...and theres nothing in the postbit, or postbit legacy style to show its installed...
Hi Gizmo

I haven't test this out on RC2.
Reply With Quote
  #10  
Old 09-19-2005, 09:06 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's a bit tricky, but I think it would be possible to do this without File Edits.
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:41 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.09744 seconds
  • Memory Usage 2,364KB
  • Queries Executed 23 (?)
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
  • (6)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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