Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Image/File Uploader Details »»
Image/File Uploader
Version: 1.00, by tnguy3n tnguy3n is offline
Developer Last Online: Sep 2010 Show Printable Version Email this Page

Category: Major Additions - Version: 3.0.3 Rating:
Released: 09-03-2004 Last Update: Never Installs: 38
 
No support by the author.

Coded by tnguy3n for http://www.all4actions.net
Live Demo: http://www.all4actions.net (create a thread or reply)

Well, I wrote this lil script for my board so that my member can upload images/pics since my board host lots of images of movie stars and all such, and database grows really fast if using Attachment Manager. It's been released at my forum for a while now, and didn't have time to post it here... it's fully tested, but maybe there'r still few bugs may be found.

What can you do with this script?
- Allow certain membergroups to access the script
- Upload img/banner in signature (sig hosting)
- You can set the max width & height, in case ppl upload huge image & break table cell of your forum
- You can set max filesize and allow certain extensions to be uploaded

lots more features will be added to v.2 of the script, admin can add file extensions, filesize and keep track on upload dir via Admin CP.

P.S. Due to mah busy schedule, support for this hack will be very limited ... You guys can find me on at my board sometimes, or post bugs in this thread: http://all4actions.net/forums/showthread.php?t=3389

------

If you want certain membergroups to see this File/Image Uploader option, you can use conditional in your template, i.e:
HTML Code:
<if condition="(is_member_of($bbuserinfo, 5)) OR (is_member_of($bbuserinfo, 6)) OR (is_member_of($bbuserinfo, 7)))">
	[<a href="uploader.php?$session[sessionurl]" onClick="return popup(this, 'uploader');">Image Uploader</a>]</if>

Show Your Support

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

Comments
  #12  
Old 09-07-2004, 03:27 PM
TCB's Avatar
TCB TCB is offline
 
Join Date: Jun 2004
Location: the Netherlands
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I will try


While editing the showthread_quickreply template, I kinda lost it after this:
Quote:
<!--######## Scroll down about 3/4 of the page, look for: ######## -->

Look for your signature fieldset, and ABOVE IT, ADD:
What is the exact line that I need to look for, so that I can put the next thing above it? Because after 'look for' there's nothing to look for :surprised:
Reply With Quote
  #13  
Old 09-07-2004, 10:29 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TCB
Thanks, I will try


While editing the showthread_quickreply template, I kinda lost it after this:


What is the exact line that I need to look for, so that I can put the next thing above it? Because after 'look for' there's nothing to look for :surprised:

in showthread_quickreply, find:
HTML Code:
			<tr>
				<td align="$stylevar[left]">
				
					<fieldset class="fieldset" style="margin:$stylevar[formspacer]px 0px 0px 0px">
						<legend>$vbphrase[options]</legend>
						<div>
							<if condition="$bbuserinfo['signature']">
								<div style="float:$stylevar[right]">
									<label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="5" checked="checked" />$vbphrase[show_your_signature]</label>
								</div>
							</if>
							<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" />$vbphrase[quote_message_in_reply]</label>
						</div>
					</fieldset>
				
				</td>
			</tr>
Above it, add:

HTML Code:
			<tr>
				<td align="$stylevar[left]">
				
					<fieldset class="fieldset" style="margin:$stylevar[formspacer]px 0px 0px 0px">
						<legend>Smilies & Image Uploader Option</legend>							
	<if condition="(is_member_of($bbuserinfo, 5)) OR (is_member_of($bbuserinfo, 6)) OR (is_member_of($bbuserinfo, 7)) OR (is_member_of($bbuserinfo, 8)) OR (is_member_of($bbuserinfo, 9)) OR (is_member_of($bbuserinfo, 11))">
	<div style="float:$stylevar[right]"><lable>[<a href="uploader.php?$session[sessionurl]" onClick="return popup(this, 'notes');">Image Uploader</a>]</lable></div></if>
					</fieldset>
				
				</td>
			</tr>
Reply With Quote
  #14  
Old 09-14-2004, 03:52 PM
Milorad Milorad is offline
 
Join Date: Mar 2003
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what happens if a file already exists?

if its overwritten is there a way to make it generate an error instead?
Reply With Quote
  #15  
Old 09-14-2004, 09:26 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Milorad
what happens if a file already exists?

if its overwritten is there a way to make it generate an error instead?
It won't overwrite, but to print an error message instead.
Reply With Quote
  #16  
Old 09-15-2004, 12:26 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What about security issues - will it test to see if the file is an image ?

Reason I ask, is that with a tool like this, someone could upload a FTP php script and then access your whole server with web-server privileges...
Reply With Quote
  #17  
Old 09-15-2004, 03:47 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Natch
What about security issues - will it test to see if the file is an image ?

Reason I ask, is that with a tool like this, someone could upload a FTP php script and then access your whole server with web-server privileges...
You can set certain file extensions to be uploaded. Default set: jpg, jpeg, gif, png
Reply With Quote
  #18  
Old 09-15-2004, 05:57 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just checking that it will reject evilscript.jpg.php ?
Reply With Quote
  #19  
Old 09-18-2004, 10:29 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Natch
Just checking that it will reject evilscript.jpg.php ?
I used strrchr() function which searches from the end of the filename; therefore, .php will match as in evilscript.jpg.php.
Reply With Quote
  #20  
Old 09-20-2004, 12:06 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll shaddup now then
Reply With Quote
  #21  
Old 10-18-2004, 02:11 PM
Ber|Art's Avatar
Ber|Art Ber|Art is offline
 
Join Date: Sep 2004
Location: the Netherlands
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank, very nice addition
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 01:43 AM.


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.04734 seconds
  • Memory Usage 2,321KB
  • 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
  • (3)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)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