vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Image Hosting Script (https://vborg.vbsupport.ru/showthread.php?t=74226)

phreak420 01-12-2005 01:00 AM

Image Hosting Script
 
Hello guys. I am still learning PHP but this is what I want someone to do for me:

I would like a script done in PHP that would tie along with my HTML script with the file form. A great example would be http://www.imageshack.us . I would like to allow anyone to visit my site and have them upload a jpg, gif, png, psd, and bmp image. And then in return give them the link to their picture, a forum link [IMG] [/IMG], and HTML link.

If someone could do that or at least help me code one over AOL Instant Messenger, that would be good.

If this type of request is not allowed on this board, please tell me for future reference.

Tekton 01-12-2005 01:23 AM

I haven't looked into image uploading yet (I'd be more interested in the thumbnail creation actually) so it would be great if anyone could post what they know about it. :)

phreak420 01-12-2005 06:14 PM

Quote:

Originally Posted by Tekton
I haven't looked into image uploading yet (I'd be more interested in the thumbnail creation actually) so it would be great if anyone could post what they know about it. :)

About thumbnail creation, hmm. I think you can get scripts at www.hotscripts.com and maybe learn from it.

I still want an Image Hosting script. Anyone?

rake 01-12-2005 06:32 PM

Like i said, before, you can't come here and expect someone to code an entire hack for you, well, unless one of the coders is willing to.. you should at the Modification Requests forum, or unless you are willing to pay, in which case, you should look at the Service Requests forum. However, you can always ask for advice around here. There are always people willing to help.

Here are my tips:
1. Look into file upload via PHP.
2. Tie your script with vBulletin for easy thumbnail creation, since the functionality is already there. You just need to tweak it to suit your needs. Check the includes/functions_image.php file.

Tekton 01-12-2005 06:35 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=69088" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=69088</a>

Doesn't contain the thumbnailing, but it has some pretty clean code that is easy to read if you're interested.

phreak420 01-12-2005 06:52 PM

Quote:

Originally Posted by rake
Like i said, before, you can't come here and expect someone to code an entire hack for you

The thing is, its not a hack for vB. Its a PHP script. I wrote some coding of this script (with not knowing much PHP), a friend of mine also helped write most of it.
PHP Code:

<?php 
if($Submit){ 

if (
$_FILES['imagefile']['type'] == "image/gif" OR $_FILES['imagefile']['type'] == "image/jpg" OR $_FILES['imagefile']['type'] == "image/psd" OR $_FILES['imagefile']['type'] == "image/png") {      
   
copy ($_FILES['imagefile']['tmp_name'], "www.3pic-designs.com/hosting/".$_FILES['imagefile']['name']) 
   or die (
"Could not copy"); 
}else{ 
   echo 
"Not an image file (".$_FILES['imagefile']['name'].")"


}else{ 

?>

And here is the error I get with a .gif: Warning: copy(www.3pic-designs.com/hosting/phreak.gif): failed to open stream: No such file or directory in /home/www/3pic-designs.com/hosting/upload.php on line 11
Could not copy

And here is the error I get with a .jpg: Not an image file (Divine.jpg)

Does anyone know how I could fix this? I wrote the image/jpg all the way to png myself from just looking at the code and changing the /gif to my desire.

EDIT: I dont want a vB hack. I am talking about a real script for a site. Not forums.

rake 01-12-2005 06:56 PM

make sure the folder exists and is world-writable (chmod 777). Also, use the move_uploaded_file function instead of copy.

phreak420 01-12-2005 07:18 PM

Quote:

Originally Posted by rake
Also, use the move_uploaded_file function instead of copy.

What does that part mean?...Sorry, still learning PHP.

Hornstar 09-16-2005 09:10 AM

my suggestion, use the search button, there has been some made already, if not what your looking for, then you will have to pay someone most likely


All times are GMT. The time now is 03:23 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.01148 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
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete