PDA

View Full Version : Flash in posts - I will pay for this hack!!


brianoneill
04-27-2002, 03:05 PM
I need a hack that enables me to upload flash movies into posts so that they are viewable in the message area.

We use our forum as a company intranet so I am not worried about the usual security issues with flash on open forums.

All I need is a way to upload the movies into a post so that the flash movies actually play in the post.

I searched the posts, I know you can do it by referencing a remote swf file but I want to be able to attached the file to the post.

Its for our designer who is not very technical so I need something easy to use. I know the method for referencing a remote flash file but I want to be able to upload and view the flash movies just like you would a gif/jpg

My boss is screaming for this feature, he is willing to pay for someone to do this hack, if you are interested post your details and how much you are looking for the job.

Once its created I have no problems with having it as a hack that everyone can download. This feature would be of great use to us so we have no problem paying someone for their hard work.

To conclude I need a hack that lets you upload a flash movie and have the movie playing in the actual post.

Thanks in advance.

Dean C
04-27-2002, 06:19 PM
surely if u add the *.swf extension into the allowed extensions list in the admin cp... and have it so images display in posts ... it wud work...

don't quote me on it .. as im not a very technical person..

Logician
04-27-2002, 07:01 PM
There is a very long and famous thread in vbulletin.com something like "share your vbcode" where many people contributed vbcode samples which you can enable inside your CP.

I may be wrong but I recall some vbcodes about Flash, may be you should check it out.

Regards,

Scott MacVicar
04-28-2002, 09:52 AM
the simpliest way is to modify the view image part of the post bit, this is the bit which automatically shows the image in the post if it attached.

You could modify this within functions.php in the getpostbit function.

Scott MacVicar
04-28-2002, 10:16 AM
actually heres the code, i've tested it on my development board and it works.
This is for shockwave movies i hope this is what you wanted if not tell me and i'll change it.

In your Admin Panel under General Options go to the Attachments section

Add swf to valid extensions
turn View Images to On

Add the following template
postbit_attachmentswf
<!--<p>--><smallfont>$post[username] has attached this movie:<br>
<embed src="attachment.php?s=$session[sessionhash]&postid=$post[postid]" width="400" height="200" type=application/x-shockwave-flash></embed>
</smallfont><!--</p>-->

Save template

Open /admin/functions.php

look for

if ($post[attachmentextension]=="gif" or $post[attachmentextension]=="jpg" or $post[attachmentextension]=="jpeg" or $post[attachmentextension]=="jpe" or $post[attachmentextension]=="png") {
if (($viewattachedimages) and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {
eval("\$post[attachment] = \"".gettemplate("postbit_attachmentimage")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}

change to

if ($post[attachmentextension]=="gif" or $post[attachmentextension]=="jpg" or $post[attachmentextension]=="jpeg" or $post[attachmentextension]=="jpe" or $post[attachmentextension]=="png") {
if (($viewattachedimages) and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {
eval("\$post[attachment] = \"".gettemplate("postbit_attachmentimage")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} elseif ($post[attachmentextension]=="swf") {
if (($viewattachedimages) and ($bbuserinfo[userid]==0 or $bbuserinfo[showimages])) {
eval("\$post[attachment] = \"".gettemplate("postbit_attachmentswf")."\";");
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}
} else {
eval("\$post[attachment] = \"".gettemplate("postbit_attachment")."\";");
}

thats it done.

Chris M
04-28-2002, 11:15 AM
Cool...

Satan

Intex
05-11-2002, 12:29 PM
Excellent hack m8.

Just installed it and works an absolute treat :) :cool:

brianoneill
05-11-2002, 05:03 PM
Thanks that works brilliant! But one query is there any way to control the size it displays the flash movie at?

I know I can change the width and height value in the template code, but is there any way to get it so that it matchs the size of the flash movie?

Eg if the movie is 200 wide by 150 tall it will display it 200 by 150 tall as opposed to just showing it based on the dimension values in the template?

I tried changing the values to 100% but the code did not work, any ideas?

Thanks in advance.

Brian

Scott MacVicar
05-12-2002, 10:21 AM
I had a look for something like this when trying to find the code but unforunately I couldn't find a function that would open the flash movie and get the width/height.

I'll try and find a way to do it if i get enough time between jobs and exams.

brianoneill
05-12-2002, 04:31 PM
Thanks I appreciate the help. Would there be some way to allow the user to manually input the width and height when uploading the file?

bpn
10-11-2002, 05:13 AM
Hi,
I have tried to do the same (make the template & insert the code in functions.php), but no matter what it's generating a link to download the .swf file.
It´s working just fine with my normal pictures.

I have VB 2.26 & I have installed your "attachments as files" hack, witch is working like a charm too.

Do you think the hack is why I can't show swf files on my site ?

Cheers,
Mik

Scott MacVicar
10-11-2002, 08:17 AM
Can you pm me the URL to your board, and a test account so I can look at it.

SaltedSlug
04-15-2004, 11:30 PM
Rexy.

TECK
04-17-2004, 07:19 PM
I would not enable flash onto my board, since I can simply do anything inside of a flash file, for example upping a nice worm... :)