vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE vb2.0+] vB Photo Upload (https://vborg.vbsupport.ru/showthread.php?t=27475)

Neo 10-12-2001 05:05 PM

could someone help me. when i upload a picture. it says that it uploaded it but i cannot find the file. i have the upload path settings correct but it still wont work.. here is my code
Quote:

/* Folder variables */

/*-----------------------------------------------------------------*/

$path = "/home/username/public_html/images/uploaded";

/* this is the path to your uploaded */

/* image folder where the pictures */

/* are going to be stored. */

$cpurl = "http://animegathering.com/";

/* The path where your vb files are */

/* located at */

$shortpath = ""; /* folder where the file is located */

/* anything after the domain name */

/* like www.domain.com/vb/...file */

$imagepath = "/images/uploaded";

/* folder where the uploaded images */

/* are going to be stored. This will */

/* be used to pull the images up to */

/* show on this page. */


Neo 10-12-2001 05:30 PM

also it seems it wont let me upload .gif files.

Quote:

/* File Type Restrictions Variables */
/*-----------------------------------------------------------------*/
$max_height = "200"; /* Max Image Height */
$max_width = "200"; /* Max Image Width */
$Size_Restrictions = "2000000"; /* image size limit in bytes */
$Width_Restrictions = "200"; /* your width limit */
$Height_Restrictions = "200"; /* your height limit */
/*-----------------------------------------------------------------*/
/* If you want to have it chosen where you can enable users to be */
/* able to upload gif formated pictures to... then use this next */
/* line that is commented out, instead of the other one. */
$Type_Restrictions = "jpg,gif,jpeg"; /* your upload file types */
/* $Type_Restrictions = ""; /* your upload file types */
//*---------------------------------------------------------------*//
/* This is where you fill in your server information so that it */
/* knows where and what to connect to. */
i use this code but it does not work.

BradC 10-12-2001 10:24 PM

At first glance.. I cannot actually tell why it won't upload or it uploads but you can find it..

I take it your public_html folder is your root web folder, and inside that folder is some vb files, like index.php, member.php, register.php and that inside that is your admin, mod, images folder..

and inside the images folder is the uploaded folder.. which is set to chmod @ 777..

and you have your actual username.. or account name instead of username in this next lines username area..

$path = "/home/username/public_html/images/uploaded";


IF so.. then I am not for sure.. it does not show up at all anywhere on the server.. does the script find it? Like after it refreshes.. does it show the image, or a small box with a Red X in it?

Also on the second question you asked.. there is one more section.. that needs to be changed.. to be able to use gif... which is on line. 307.. that reads and looks like this.

PHP Code:

       /* again if you are giving the users the ability to upload gif formated pictures use the commented out line */
    /* else if (($picture_type != "image/pjpeg") && ($picture_type != "image/jpeg") && ($picture_type != "image/gif")) */
    
else if (($picture_type != "image/pjpeg") && ($picture_type != "image/jpeg")) 

hope that helps..

just reply either way.. so I know and if it does not.. we can take it another step :)

joergh 10-13-2001 11:50 AM

Hi,

i had problems with this hack. Upload went well but for heavens sake :) the photos weren?t shown in the profiles of my users.

After testing eveything (chmod, paths ..) teh solution for my problem was the following:

I took the second solution for the getinfo-template from the html-filechangesfile:

Edit to this template:
getinfo

And add these two variables:

Original (no Fotos):
PHP Code:

$picture_name 

$userinfo
[photodesc

My version (finally the Fotos work) :)

PHP Code:

$userinfo[picture_name]

$userinfo[photodesc

Of course its easy but it took my some evenings to find this :)

Hope it helps ...

but i have one last question for this hack:

Is it possible to define a standard-pic (f.e. nofoto.jpg) for users that havn?t uploaded their photo yet?

joergh

BradC 10-13-2001 03:11 PM

Glad that way works for ya... interesting... never really tried it that way. :)

and yes... I know a couple of people that added a no photo for those users that don't have a photo..

in your template named : photo_unknown


it says this

"Sorry, No Photo Available"

just change that to have an image instead of saying text..

like

<img src="images/nophoto.jpg">

or something like that..

Neo 10-13-2001 07:25 PM

thanks for the help. i am now able to show the image, which it only showed a box with a red x in it before. but i still cant get it to upload .gif files it gives me a erroe saying its not one of the correct files extensions.

BradC 10-14-2001 08:04 AM

Here is the code I have in my script..

PHP Code:

else if (($picture_type != "image/pjpeg") && ($picture_type != "image/jpeg") && ($picture_type != "image/gif")) 

now on my personal sites I don't allow gif's for my own personal reasons..

but maybe instead of being && .. && make it OR.. like this

PHP Code:

else if (($picture_type != "image/pjpeg") or ($picture_type != "image/jpeg") or ($picture_type != "image/gif")) 

and see if that fixes it or helps it.

Neo 10-14-2001 04:15 PM

umm ok i try that aswell and it still does not seems to want to wrok so i got the upload.php file and if you could take a quick look and see if their is anything wrond that would help out alot.

BradC 10-14-2001 05:37 PM

Yah forgot to change what I said above..

but that is ok..

you were suppose to uncomment this line:

PHP Code:

    else if (($picture_type != "image/pjpeg") && ($picture_type != "image/jpeg") && ($picture_type != "image/gif"))
    
/* else if (($picture_type != "image/pjpeg") && ($picture_type != "image/jpeg")) 

but ya left that commented and just changed it from && to or.. and left the other one uncommented..

but I attached it again so see if this new one works :)

Neo 10-14-2001 05:55 PM

thats alot this really help. to bad i cant think or i would have figured it out:rolleyes:


All times are GMT. The time now is 06:18 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.01317 seconds
  • Memory Usage 1,759KB
  • 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
  • (6)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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