View Full Version : Major Additions - Image/File Uploader
tnguy3n
09-03-2004, 10:00 PM
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:
<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>
tnguy3n
09-04-2004, 08:43 PM
here goo few screenshots
MiskaTorn
09-04-2004, 08:46 PM
Can you make it so that the pictures can only be posted on your domain or other selected ones as well? DOn't need people eaqting up my bandwidth again with this :(
Looks awesome though
tnguy3n
09-04-2004, 08:56 PM
Can you make it so that the pictures can only be posted on your domain or other selected ones as well? DOn't need people eaqting up my bandwidth again with this :(
Looks awesome though
how about disabling hotlink?
nexialys
09-04-2004, 09:10 PM
would be simply better if the attached files are included in the post, like when we add smilies in our posts... so users don't have to copy/paste the code...
Mr. HillBilly
09-04-2004, 09:42 PM
Where can users see what images they have uploaded?
Mephisteus
09-04-2004, 09:44 PM
omg omg omg omg omg omg omg omg omg ty :)
MindTrix
09-05-2004, 10:12 AM
Will this allow uploads more than say 3mb though or is it only for very small files.
nexialys
09-05-2004, 10:32 AM
@ Mindtrix : PHP upload is limited by your server, not by scripts...
ranger2kxlt
09-07-2004, 03:20 PM
can you limit the number of files uploaded in one post?
Thanks, I will try :D
While editing the showthread_quickreply template, I kinda lost it after this:
<!--######## 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:
tnguy3n
09-07-2004, 10:29 PM
Thanks, I will try :D
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:
<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:
<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>
Milorad
09-14-2004, 03:52 PM
what happens if a file already exists?
if its overwritten is there a way to make it generate an error instead?
tnguy3n
09-14-2004, 09:26 PM
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.
Natch
09-15-2004, 12:26 AM
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...
tnguy3n
09-15-2004, 03:47 PM
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
Natch
09-15-2004, 05:57 PM
Just checking that it will reject evilscript.jpg.php ?
tnguy3n
09-18-2004, 10:29 PM
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.
Natch
09-20-2004, 12:06 AM
I'll shaddup now then ;)
Ber|Art
10-18-2004, 02:11 PM
Thank, very nice addition :)
Snatch
11-16-2004, 08:56 AM
Great Hack, big ThX
but I have a question.
I would like that the hack for each day creat a folder into it upload the files
/04.10.2004/files
/05.10.2004/files
Greetz Snatch
Mickie D
11-16-2004, 09:00 AM
i would not use the OR conditionals in templates i would use ||
as i have many problems with that conditional
if you have problems with the image upload option change
OR
to
||
Snatch
11-17-2004, 11:12 AM
Hello ? canĀ“t no one help me ?
Hello ? can?t no one help me ?
Why would you want to do it?
tnguy3n
11-25-2004, 05:14 AM
Great Hack, big ThX
but I have a question.
I would like that the hack for each day creat a folder into it upload the files
/04.10.2004/files
/05.10.2004/files
Greetz Snatch
I'm releasing my Upload/Image Uploader v2 soon that will have all the functions/features request above. :)
SVTOA
11-25-2004, 03:53 PM
would be simply better if the attached files are included in the post, like when we add smilies in our posts... so users don't have to copy/paste the code...
I think that is certainly doable and will see if I can get that to work.
With regard to the template edits, for editor_smilebox this looks a little cleaner:
insert at the bottom of the template:
<!-- added uploader link here -->
<fieldset id="uploader" title="Image Uploader">
<legend>Image Uploader</legend>
<table cellpadding="4" cellspacing="0" border="0" align="center">
<tr>
<td class="smallfont" colspan="$vboptions[smcolumns]">[<a href="uploader.php" onClick="return popup(this, 'uploader'); return false" title="Image Uploader">Upload Image</a>]</td>
</tr>
</table>
</fieldset>
<!-- end uploader link -->
LoOnEyToOnZ
11-25-2004, 05:42 PM
Hi. Is it possible to add a watermark feature over uploaded images ?
we_scooter
12-03-2004, 09:41 AM
ok i done all the steps in ur instructions txt file , what comes after that ???
plz explain what else should be done to make it work..?
we_scooter
TrangNgoc
12-12-2004, 11:12 PM
Thanks tnguy3n *installed* :ermm:
what happen the pic is not show on the post (just red X)
thanks
tnguy3n
01-28-2005, 04:50 PM
right click on redX (broken image) to see where the image located on your server, then make proper adjustment.
hey thanks i solved them
it is my bad (typo url in the upload. file)
again, thanks
NuclioN
02-04-2005, 10:54 AM
It gives problems with the chmod. I'm sure this is set correct and all the paths are ok. It is showing other errors when the image is to large etc. but no upload possible.
CHIngs
05-15-2005, 06:30 PM
How can I change the FILENAME to the USERID so that each user can only upload 1 file?
HeloHi
05-18-2005, 06:30 AM
I'm releasing my Upload/Image Uploader v2 soon that will have all the functions/features request above. :)
I am subscribing to this thread in anticipation :)
This is exactly what I want when the daily folder creator is added :cool:
Great hack!
cdoyle
06-01-2005, 12:32 AM
This sounds like a great hack, we also have the webpage hack installed on our forum, and have been looking for way to give our users a way to upload images to use with it.
Is V2 close to being released? If it is, I'll wait til it's ready before installing.
So everyone seems to be pretty happy with this one? Any major problems they've noticed?
Chris.
cdoyle
06-08-2005, 09:02 PM
Anyword on the next version?
jsharper
07-02-2005, 07:36 PM
Is it me, or is www.all4actions.net down/dead?
sketch42
07-15-2005, 03:33 AM
heres some new installation instructions, that are much more clear i think.
wonderful hack all in all
esology
07-18-2005, 09:59 AM
It gives problems with the chmod. I'm sure this is set correct and all the paths are ok. It is showing other errors when the image is to large etc. but no upload possible.
Me too. I have tried numerous paths in the uploader.php file. I know my path is right.
sketch42
08-09-2005, 04:23 PM
Me too. I have tried numerous paths in the uploader.php file. I know my path is right.
is it possible that you can mak this have an extra button to make a thumbnail image? like after you upload you get this see attachment
and have a new bbcode for the image and thumbnail.. i think that would be an excellent addition
Hornstar
09-16-2005, 08:47 AM
Ok, this is looking, nice, Can a user view all images that s/he has posted, incase they forget the url?
esology
11-27-2005, 11:17 AM
Anyone try this with 3.5.1?
tnguy3n
11-27-2005, 03:19 PM
I've built a new version of this hack, but I don't have an ETA for the release.
esology
11-27-2005, 05:56 PM
Thanks for the reply. I was just about to start trying to make it work with the current version. Maybe I'll wait for the debut.
Tommy12345
12-24-2006, 02:36 PM
This skip works perfectly, the best out there. It is simple but very customizable. Found security problem u are not using move_uploaded_file and is_uploaded_file command.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.