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
Multimedia Upload Details »»
Multimedia Upload
Version: 1.00, by Moya Moya is offline
Developer Last Online: Aug 2009 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 11-22-2004 Last Update: 04-21-2005 Installs: 19
 
No support by the author.

Hello all,

Awhile back, I post a a script that allow vb3 member to upload files like mp3, wma, etc. I have no idea that such upload is needed for our board I got a lot of request for instructions and direction on that script.

As a result, I put aside a little time from my working hour and work on this new upload script.

What this script does is:

- Allow members to select a file from their local computer.

-Upload to the board's predifined directory.

-Create a meta file that associated with the current uploaded file, and save to another directory. This meta will be used by the music bb code



The uploaded files are not managed by database.


############## File edit ##############


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open includes/adminfunctions_template.php
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Find

Code:
'subscription' => $vbphrase['group_paid_subscriptions'],
Below this add

Code:
'multimedia_management' => 'Multimedia Management',

############## Template Edit ##############

Insert at the end of headinclude

Code:
<SCRIPT TYPE="text/javascript">
<!--
function popup(url,songloadersforvb)
{
if (! window.focus)return true;
var href;
if (typeof(url) == 'string')
href=url;
else
href=url.href;
window.open(href, songloadersforvb, 'width=500,height=250,scrollbars=yes');
return false;
}
//-->
</SCRIPT>

Save

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open Editor Temlates >> editor_toolbar_standard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Find

Code:
<if condition="$smiliebox"><td class="controlbar">$smiliebox</td></if>
</tr>
Below add

Code:
<tr>
<td colspan ="5">
<a href="songloadersforvb.php" onClick="return popup(this, 'songloadersforvb'); return false" title="Multimedia Managment">Multimedia Managment</a>
</td>

</tr>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Open Editor Temlates >> editor_toolbar_wysiwyg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Find

Code:
<if condition="$smiliebox"><td class="controlbar">$smiliebox</td></if>
</tr>
Below add

Code:
<tr>
<td colspan ="5">
<a href="songloadersforvb.php" onClick="return popup(this, 'songloadersforvb'); return false" title="Multimedia Managment">Multimedia Managment</a>
</td>

</tr>
Save



Upload multimediamanagerinstall.php to your admincp directory

Run this installer from your admincp directory
Delete this file after you install



Open songloadersforvb.php and modify these lines



Upload songloadersforvb.php to your forum root

PHP Code:
//################### set usergroup can access this script  ############################
if (!in_array($bbuserinfo['usergroupid'], array(1,2,3,4,5,6)))
    { 
        
print_no_permission(); 
    }

//########################### settings  ############################################

$file_extension = array(".wma"".mp3"".rm"".ram"".wmv"); 
$filesizes "31457280"// max filesize allowed to upload (in KB)
$filesizemb number_format($filesizes/1024,1) . "MB"// convert to  mb

$completesitelocation "http://www.123.com/yourforum/musicdirectory/"// Full URL to upload dir
$physicallocation "/var/www/html/yourforum/musicdirectory";
$metaurl="http://www.123.com/yourforum/musicmetadirectory/" 
$metadir="/var/www/html/forum/musicmetadirectory/"


You will have to create the BB code for your music format. If you need the bb code, I will post it up here.

Thanks

Show Your Support

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

Comments
  #52  
Old 01-16-2005, 01:15 AM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The correct syntax should be
PHP Code:
 if (!in_array($bbuserinfo['usergroupid'], array(5,6,7,9))) 
Where 5,6,7,9 are your usergroup id. Keep $bbuserinfo['usergroupid'] the same
Reply With Quote
  #53  
Old 01-16-2005, 05:28 AM
pelican pelican is offline
 
Join Date: Sep 2004
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think this is a nice hack if the 2 upload/download are bundle together and the files are not stored in public directory that cannot be accessed directly except through vbulletin.
Reply With Quote
  #54  
Old 01-23-2005, 12:02 AM
Basit Basit is offline
 
Join Date: Apr 2004
Location: London
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Stitch,

I installed it successfully, but have some problems. When I upload any .mp3, ram, wmv or .wma file it get uploaded withtout any problem. when I try to uploda .rm , files it give me fillowing error message

Warning: fclose(): 19 is not a valid stream resource in /home/mysite/public_html/vbb/songloadersforvbnew.php on line 214

I have checked it does upload the actual file but no file generated under meta directory.. Any idea how can I solve this problem ?

In addition is it possible to to upload media files like .mpeg, .mov, wav, mpg etc.,

Regards,
Basit
Reply With Quote
  #55  
Old 04-22-2005, 03:36 AM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by frostr1
is there anyway someone can show me an example of what a real songloadersforvb.php looks like? I installed it and it does not work, plus what does this mean? "$metaurl="http://localhost/vbb/musicmeta/" ;
$metadir="c:/vbb/musicmeta/";"

thanks
Yeah Im stuck on that also.

I have everything working except when I try to upload a file it says it cant do it. I think they may be the reason.

Please help.
Reply With Quote
  #56  
Old 04-22-2005, 06:09 AM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what is your platform?

If it is IIS then $metaurl="http://www.yourdomain.com/forum/musicmetadirectoryname/
$metadir="c:/forum/musicmetadirectoryname/"
Reply With Quote
  #57  
Old 04-22-2005, 06:17 AM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Basit
Hi Stitch,

I installed it successfully, but have some problems. When I upload any .mp3, ram, wmv or .wma file it get uploaded withtout any problem. when I try to uploda .rm , files it give me fillowing error message

Warning: fclose(): 19 is not a valid stream resource in /home/mysite/public_html/vbb/songloadersforvbnew.php on line 214

I have checked it does upload the actual file but no file generated under meta directory.. Any idea how can I solve this problem ?


In addition is it possible to to upload media files like .mpeg, .mov, wav, mpg etc.,


Regards,
Basit
Hi Basit

Please download the songloader file again. I fix the problem.

As for various file type, you can upload the file but I will have to do a research on the appropriate meta tag for each extension.

Can you list the media file type for me? I will get back to you on this one
Reply With Quote
  #58  
Old 04-22-2005, 12:01 PM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stitch
what is your platform?

If it is IIS then $metaurl="http://www.yourdomain.com/forum/musicmetadirectoryname/
$metadir="c:/forum/musicmetadirectoryname/"
It's Linux, Apache. I put your quick fix in that was in this thread also.

I get the pop up box and everything but it just says it couldn't upload.

It's got me so confused :ermm:

I think this is great and I really want it to work.

Thanks for the reply.
Reply With Quote
  #59  
Old 04-30-2005, 03:25 PM
Ghanem's Avatar
Ghanem Ghanem is offline
 
Join Date: Aug 2004
Location: Bahrain
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I have the same problem..

My uploadin folder www.la7odood.com/vb/upload/0405

I have apache, and have put:
/home/la7odood/public_html/vb/upload/0405

but still it did not work..
always get the error:
Couldn't Upload File.

any Idea what could be wrong?

Regards,
Reply With Quote
  #60  
Old 05-01-2005, 06:39 PM
Moya's Avatar
Moya Moya is offline
 
Join Date: May 2004
Posts: 356
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Kevin and unicorn,

I am a little bit rusty with apache. I will get back to you on this

thanks
Reply With Quote
  #61  
Old 05-01-2005, 07:40 PM
Ghanem's Avatar
Ghanem Ghanem is offline
 
Join Date: Aug 2004
Location: Bahrain
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you stitch..

I hope you can fix the next cos its working fine with other ext...
I am using the attached file code to upload other files and could not use it to upload ram, rm, wmv. mp3 extensions although I added the correct mime to the list $types..

I used this site to get the mime:
http://www.filext.com/

this is the code of uploader.php:

PHP Code:
 <?php 
require_once('./global.php'); 
//========================================
// | uploading center properties |
//========================================
$path "upload/0505"// uploading folder
$size "3000000"// file seize in byte
$types = array("application/x-zip-compressed""application/x-rar-compressed""application/x-shockwave-flash""text/plain""image/gif""image/jpeg""image/png""image/pjpeg"); // file ext
// <!-- .zip --> <!-- .rar --> <!-- .swf --> <!--.txt--> <!--.gif--> <!--.jpg--> <!--.png-->
//========================================
eval('$navbar = "' fetch_template('navbar') . '";');
 
if ( [
PH P]%4$s[/PH PREQUEST['do'] == "") {
eval(
'print_output("' fetch_template('uploader') . '");');
}
if ( [
PH P]%4$s[/PH PREQUEST['do'] == "doupload") {
 
if (
$file_name == "")
// file name check
$msg "you did not chose a file";
// file name check
elseif (file_exists("./$path/$file_name"))
// file exist check
$msg "file allready exist plz chahnge the name";
// file exist check
elseif (!in_array("$file_type"$types))
// file ext check
$msg "extention not allowed<br>your file extenstion : $file_type";
// file ext check
elseif ($file_size >$size)
// file size check
$msg "file is larger than allowed : $size بايت <br>file size you uploaded : $file_size";
// check file size
else
{
$msg "file uploaded sucsessfuly <br> <a href=\"$vboptions[bburl]/$path/$file_name\">$vboptions[bburl]/$path/$file_name</a>";
copy($file"$path/$file_name");
}
eval(
'print_output("' fetch_template('uploader_msg') . '");');
}
 
//############################################################################
//# uploader center #
//# fnan4arab #
//# : PHPvillage.com #
//############################################################################
?>
Regards
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:06 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.04696 seconds
  • Memory Usage 2,350KB
  • 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
  • (7)bbcode_code
  • (3)bbcode_php
  • (3)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