vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Flash in posts - I will pay for this hack!! (https://vborg.vbsupport.ru/showthread.php?t=37940)

brianoneill 04-27-2002 03:05 PM

Flash in posts - I will pay for this hack!!
 
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
Code:

<!--<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

PHP Code:

                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]==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

PHP Code:

                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]==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]==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... :)


All times are GMT. The time now is 06:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01123 seconds
  • Memory Usage 1,769KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete