vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Major Additions - Image/File Uploader (https://vborg.vbsupport.ru/showthread.php?t=69088)

tnguy3n 09-03-2004 10:00 PM

Image/File Uploader
 
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>


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

Quote:

Originally Posted by MiskaTorn
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?

TCB 09-07-2004 03:27 PM

Thanks, I will try :D


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:

tnguy3n 09-07-2004 10:29 PM

Quote:

Originally Posted by TCB
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:
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>


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

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.

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

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

Natch 09-15-2004 05:57 PM

Just checking that it will reject evilscript.jpg.php ?

tnguy3n 09-18-2004 10:29 PM

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.

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

Code:

OR
to

Code:

||

Snatch 11-17-2004 11:12 AM

Hello ? can“t no one help me ?

Moya 11-19-2004 12:29 AM

Quote:

Originally Posted by Snatch
Hello ? can?t no one help me ?


Why would you want to do it?

tnguy3n 11-25-2004 05:14 AM

Quote:

Originally Posted by Snatch
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

Quote:

Originally Posted by nexialys
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:
Code:

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

qhoa 01-28-2005 04:03 PM

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.

qhoa 01-28-2005 06:42 PM

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

Quote:

Originally Posted by tnguy3n
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

Quote:

Originally Posted by NuclioN
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.


All times are GMT. The time now is 05:24 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.01445 seconds
  • Memory Usage 1,835KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_html_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete