vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   ImageShack Like Multi Uploader for you vB (https://vborg.vbsupport.ru/showthread.php?t=199739)

flup 12-23-2008 10:00 PM

ImageShack Like Multi Uploader for you vB
 
For this modification I used the 'yet another vB Login on non-vB Page' by 'Calorie'.

What does it do
Well, it's pretty simple actually. I created a page which can be called from the navbar in a popup and will allow your users to upload up to 10 images at a time. Non logged-in users will be prompt with an error message.

It has no restriction on filesize and dimensions what so ever! But it does resize all images according to a 640*480 dimension with keeping the original aspect ratio.

What do you have to do?
1. Create a folder in your forum folder called 'uploaded' and CMODD it with 777

2. Add the following JS to your headinclude template BEFORE <!-- CSS Stylesheet -->:
Code:

<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 390,top = 150');");
}
</script>

3. Create a link in the navigation bar (either in navbar template or header template) with the following link:
Code:

<a href="javascript:popUp('uploader.php')">Image Uploader</a>
4. Change the configuration values at top of the upload.php file:
Code:

$maxwidth = 640;
$maxheight = 480;
## Location to your watermark.PNG file, default images/watermark.png
$watermark_resource = "images/watermark.png";
## Define watermark location, 1 = lefttop, 2 = righttop, 3 = leftbottom, 4 = rightbottom
$watermark_location = 4;

// set allowed usergroups - separate with a comma
define('UGS','6,7,2,5');

// set the full path to your main forum directory
define('FWD','/home/clubpunto/domains/clubpunto.nl/public_html');

// set vB version you are using - use 307 or 350
define('VBN','350');

// set the name of this script - no .php extension
define('THIS_SCRIPT','uploader');

5. Upload the file in the attachment to your forum root directory aswell as the watermark.png image

6. Finished!

Test Results
I tested the script by uploading this image:
File Dimensions: 2576 x 1920 pixels (7.1 Megapixels)
File Size: 2,14 MB (~ 2214 kb)

After uploading there was a file with these stats:
File Dimensions: 640 ? 477 pixels (notice the aspect ratio is kept original)
File Size: 278 kb (~ 0,2 MB)

Version Changes v1.3
- Added the option to choose where the watermark is placed (left/right-top, left/right-bottom)
Version Changes v1.3b
- This version is similar to v1.3, but instead of YOU having the option to select the position of the watermark, a user will be able to choose via a dropdown menu. (See screenshot)

Version Changes v1.2
- Support for PNG watermarks (I noticed that the PNG background is not made transparant, I have no time to look at this, cause of having to celebrate christmas, I'll look at it asap!) (See screenshot of the car (bottomright is the watermark))

Version Changes v1.1
- Support for image resize for .GIF and .PNG images aswell

Version 1.0
- Support for image uploads (gif/jpg/png)
- Support for image resize for jpg images
- Up to 10 files at a time

Forum Lover 12-25-2008 01:46 AM

SWEET.. :) any plan to have watermarking option?

dvbusuario 12-25-2008 02:59 AM

Error en las imágenes. Png

flup 12-25-2008 10:03 AM

Watermarking could be an option, im not sure what dvbusuario is referring to? Guess it had something to do with the resize function for PNG images.. that could be a problem yes.

flup 12-25-2008 10:18 AM

Script is updated, now also supports PNG and GIF resizing. Tested all filetypes with a 1024*768 document. The source files where roughly around 300 - 580kb, after resizing I had 122kb, 170kb and 194kb.

And support for a .PNG watermark, althoug transparancy isn't support yet I noticed (not sure why), so perhaps using a nice bar with a name/url of your site will do the trick aswell for now :)

Also added the date (dmY) in front of the image, this should make it easier to clean up the images folder once in a while when running near your upload limit :)

Forum Lover 12-25-2008 10:40 AM

Thanks for the update. I got another idea to consider, how bout usergroup permissions as well! :)

flup 12-25-2008 10:53 AM

There are usergroup permissions in the script allready, but that will only determine wether a user is able to use the uploader or not. Perhaps you are thinking of:

Admins: max. 10 per time
Mod: max. 5 per time
User: max. 2 per time

or something? If you only mean the access to the file per usergroup, use this at top of the script:

Code:

// set allowed usergroups - separate with a comma
define('UGS','6,7,2,5,9');

I added a functionality to set the place where the watermark will go.

flup 12-25-2008 11:01 AM

I added a second version (v1.3b) which allowes users to select the position of the watermark theirselfs, perhaps there is some text in the bottom right corner which they don't want to overwrite.

flup 12-25-2008 11:06 AM

I'm off to christmas diner, suggestions are welcome & enjoy using the script ;)

dvbusuario 12-25-2008 04:11 PM

add How to Copy image for a "url" directly


All times are GMT. The time now is 12:28 PM.

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.01058 seconds
  • Memory Usage 1,737KB
  • 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
  • (4)bbcode_code_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
  • (10)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