PDA

View Full Version : Playing Windows Media Files Inline


Moya
17 Sep 2005, 10:53
This just a port over from my existing hack for version 3.0.x

http://www.vbulletin.org/forum/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


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Add under



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Look for



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Add Under



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Add Undder



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Template Edit

Postbit template

Look for



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Add Under



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Postbit legacy template

Look for



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Add Under



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Upload the included XML as product.



Demo

http://www.vbulletin.org/forum/attachment.php?attachmentid=24797

http://www.vbulletin.org/forum/attachment.php?attachmentid=24798

http://www.vbulletin.org/forum/attachment.php?attachmentid=24799

http://www.vbulletin.org/forum/attachment.php?attachmentid=24800



If you use this hack please click install.

lttcoder
17 Sep 2005, 12:21
Sounds great, but I won't install it since it requires template changes/file changes.

COBRAws
17 Sep 2005, 12:43
going to make some good use out of this one! Thank you pal.

FleaBag
17 Sep 2005, 16:27
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?

Gizmo5h1t3
17 Sep 2005, 16:28
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...

Gizmo5h1t3
17 Sep 2005, 16:34
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...

if i remember right...

hydrostatic
17 Sep 2005, 16:58
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.

Marco van Herwaarden
17 Sep 2005, 18:55
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.
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.

Moya
17 Sep 2005, 19:33
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.

Andreas
19 Sep 2005, 11:06
It's a bit tricky, but I think it would be possible to do this without File Edits.

Moya
19 Sep 2005, 21:32
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

jesus likes pie
19 Sep 2005, 22:23
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.

Gizmo5h1t3
02 Oct 2005, 15:36
getting this db error when i install the product...
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??

Gizmo5h1t3
16 Oct 2005, 12:21
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

turkboard
17 Oct 2005, 21:23
3.5 GOLD work ?

tamborinegal
20 Oct 2005, 04:32
Does this work for 3.5 Gold? Would love it if it did :)

Thanks

davidw
21 Oct 2005, 22:09
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 (http://www.christianboards.org/showthread.php?p=2000&posted=1#post2000)

davidw
21 Oct 2005, 23:01
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.

cbr929rrerion
31 Oct 2005, 20:04
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?

cbr929rrerion
31 Oct 2005, 21:44
I get this with, avi, mov, and mpg, all formats...

davidw
31 Oct 2005, 21:59
I'm working on it at the moment as I don't have avi set up yet - testing to make sure it works - did you edit the xml file? This launches the player.

cbr929rrerion
31 Oct 2005, 22:10
I am not very good at that..

If anyone can get avi and mpg and wvm to work I would love it..

davidw
31 Oct 2005, 22:19
Ok here's the sample: http://www.christianboards.org/showthread.php?p=2252#post2252

davidw
31 Oct 2005, 22:26
Here's the instructions on how I did it...

I'm using this loosely for avi as examples on how to edit; replace with the appropriate file type

In your class_postbit.php file

Find:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Add after:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

(replacing wma with avi in each)

Find:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




Add after:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

(replacing wma with avi in each)

Find:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Add after:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

(replacing wma with avi in each)

Postbit template edit (I use postbit legacy, you'll have to compare to postbit for the changes)

Find:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Add after:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

(replacing wma with avi in each)


ADMINCP - Attachments - Extensions & Sizes - Add New Extension

Extension: avi
Max Filesize(in bytes) 5000000 (or whatever you want
Mime Type: Content-type: video/x-ms-avi
Display thumbnail for this type? No
Open this attachment in a new browser window? No (Really this is your choice)
Enabled Yes

XML edit

Add this after one of your templates: (It will end in </template>)


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Don't forget to update your phrase manager:

Add New Phrase

Phrase Type: Global
Varname: attach_avi
Text: AVI (doesn't really matter - shows up in your legend)

AdamMarrer
01 Nov 2005, 06:04
After making these changes I can't upload these two file formats, after upload is done it just rests the screen never showing the attachments. Any ideas?

davidw
01 Nov 2005, 11:39
wmv was part of the default code, you shouldn't have had to change anything for that file format.

cbr929rrerion
01 Nov 2005, 13:59
th default code did not work.. all that was displayed was a ling to it, still had to click and download it.. any ideas where its wrong?

davidw
01 Nov 2005, 14:37
Have you checked your message attachment options in AdminCP?

vBulletin Options -> Message Attachment Options

View Attached Images Inline - Yes or Yes, if post has only one attachment



Also, are your attachments currently being stored in the filesystem or database? Not sure, but this might make a difference.

cbr929rrerion
01 Nov 2005, 15:51
yes show attachements and file system..

davidw
01 Nov 2005, 18:04
The only thing I can think of is to uninstall it - make the changes - reinstall it.
I don't understand why it wouldn't work on your site, as it does work on mine - unless there's another setting I've overlooked.

Moya
02 Nov 2005, 00:29
Hello All,

Since we move to VB3.5 Gold, I moved this hack to use Plugin. You don't have to do file editing anymore.

I will stop supporting this version. Please come Come To This Hack In Plug In Here (http://www.vbulletin.org/forum/showthread.php?t=99871)


Thanks