UBB.Dev
Posted By: poil Upload User Pic Hack - 04/03/2001 9:33 PM
This Hack allows users to upload there user image onto your server. This is usefull for many reasons that include, The user doesn't have to have web space, If the Users server
does go down or offline the picture is stored on your server, so the picture will be shown. The picture will not be shown unless your server goes down.

This hack uploads the image with there name, say i upload the file bleh.jpg, it will get renamed to poil.jpg. So the user can only upload one picture, if you upload an image again, it will just overwrite the first one.

Check the Attachment for instructions on how to do this. if you are on a windows using php, i don't know if it will work or not...because i use freebsd.

any problems post here, i just got from vication and i don't have dsl for the time being (north point), so i have to use my dialup.

[:red]--------------
http://extremeforums.org

Attached File
33501-Readme.txt  (46 downloads)
Posted By: caymuc Re: Upload User Pic Hack - 04/04/2001 2:22 AM
SOOO COOL thanks!!!!!!!!!!!

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')
Posted By: caymuc corrections for 5.3 - 04/04/2001 1:20 PM
Hi,

it would be good if you say with which W3T version the hack is compatible. :)

Since there were changes in 5.3. at least this
[:red] if ($theme[PictureView] == "on") {
needs to be replaced by this
[:red] if ($theme[PictureView]) {
in your hack.

Also I suggest to put the two paths into config.ini.php
Then a user can control the setting via the admin-interface afterwards.
That's at least how I am implementing the hack.

Oh yes, and the $picture is still using a hardcoded path,
and should use the $url3 variable instead...

And, last suggestion: If you name variables more unique than [:red]$path2 and [:red]$url3,
then the danger is not so big that SCREAM or maybe other users
might also use that variables for their purposes...
[:red]$userpicpath2 and [:red]$userpicurl3 instead?


I test this now thouroughly with 5.3 and let you know the results []/w3timages/icons/smile.gif[/]

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')

Edited by caymuc on 04/04/01 07:13 AM.

Posted By: poil Re: corrections for 5.3 - 04/04/2001 4:13 PM
ya i havn't gotten much sleep and all of this is helping me write better php.

i had no idea about w3t 5.3, i am comparing it to a version of 5.1.6. ahha, i thought that it was the latest. i just assumed that things didn't change much in that area between the versions cause nothing really goes on, and i forgot that scream changed that variable. sa'll good...

that never crossed my mind about the more unique variables.

i didn't want to put the configs into the config file cause it would mean less editing of files.

It is good that you know php pretty well can catch my mistakes. thanks...

[:red]--------------
http://extremeforums.org
Posted By: caymuc Re: corrections for 5.3 - 04/04/2001 5:07 PM
I |ove your script: I am new to php, and just learning it from reading and understanding SCREAMs scripts. So I could not write myself what you have done here. Critisising is always easier than doing..

I just think that your addition is so extremeley valuable to others, that I want to give some feedback from my testings...

And:
Appart from the new variable, it also works with 5.3, it looks like...

[]/w3timages/icons/smile.gif[/]

Some more i had with the testing:
there should be some code that changes the filename into all-small letters, because user CARL and carl are the same to w3t, but not to Unix. That should cause only a problem in rare cases :)

Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')

Edited by caymuc on 04/04/01 10:27 AM.

Posted By: poil Re: corrections for 5.3 - 04/04/2001 9:52 PM
in trying to apply hacks/mods i found out that many people here are perl only. so i learned quickly how to hack w3t to my needs. as you can see that i am pretty much the only person who does hacks, or puts em out for free. i might in the future for a fee apply hacks or make hack ideas for people. you should see my list that i have, it is quite extensive of stuff i would like to see in w3t and stuff that i am making... and when you guys come up with great ideas, i will write them down and depending on how hard it is to do, i will try to do it...

[:red]--------------
http://extremeforums.org
Posted By: caymuc Re: corrections for 5.3 - 04/05/2001 9:50 PM
One more thing for 5.3:

$Picture can have the value "http://" in 5.3
so we need to do 2 more checkings, otherwise people that didn't put a pic in, get the error "not GIF or JPG ending..."

In your hack, alter the checking line to :
[:red] if ( ( (!eregi("gif",$userfile_name)) && (!eregi("jpg",$userfile_name)) && (!eregi("http://",$userfile_name)) && ($userfile_name) ) ) {

(that should be also save with older w3t versions, so I recommend that)


Carl

----------
http://www.colour-ize.de/forum (test entry: user: 'test' pw: 'test')

Edited by caymuc on 04/05/01 02:51 PM.

Posted By: Eileen Re: corrections for 5.3 - 04/30/2001 1:52 PM
>>as you can see that i am pretty much the only person who does hacks, or puts em out for free.

Now that you've had some sleep I'm sure you'd also like to correct that outrageously inaccurate claim!

[]http://www.wopr.com/w3tuserpics/Eileen-sig.gif[/]
Posted By: poil Re: corrections for 5.3 - 04/30/2001 3:11 PM
in my statement i meant for the php version and a claim like that can be made very easily. pretty much doesn't mean only person, and okey most hacks i do are not free you got me. in the general term there are only about 7 people who at this day come out with hacks for either per or php. now i am going to start a php revolution, we must take over the perl people....j/k

[:red]--------------
http://extremeforums.org
Posted By: sixpack69 Re: corrections for 5.3 - 05/01/2001 4:05 AM
I have every intention of jumping into the php realm, so you soon may have some company. []/testimages/icons/laugh.gif[/]


[]/testimages/icons/smile.gif[/] 6 []/testimages/icons/frown.gif[/]
Screamers
Posted By: powerlord Re: corrections for 5.3 - 05/02/2001 6:09 AM
Perhaps we should have a php primer over here, and some common command conversions

For example:
perl:
$something =~ s/this/that/g;

php:
$something = ereg_replace("this", "that", $something);

and

perl:
$something =~ s/this/that/gi;

php:
$something = eregi_replace("this", "that", $something);

as well as

perl:
$something =~ s/this(.*)/that$1/gi;

php:
$something = eregi_replace("this(.*)", "that\\1", $something);

Administrator, Videogame Music Archive

Edited by Powerlord on 05/01/01 11:10 PM.

Posted By: sixpack69 Re: corrections for 5.3 - 05/02/2001 1:22 PM
Scream has a perl-to-php conversion script, I believe I saw it in the addons folder in the distro. You might take a look. I'll post it if I can find the one I saw.

[]/w3timages/icons/smile.gif[/] 6 []/w3timages/icons/frown.gif[/]
Screamers
Posted By: powerlord Re: corrections for 5.3 - 05/08/2001 3:41 AM
I meant basic stuffage to help people learn PHP. ;D

Administrator, Videogame Music Archive
Posted By: sixpack69 Re: corrections for 5.3 - 05/08/2001 3:46 AM
You'd asked for common command conversions, I'd assumed you knew perl. Looking at a perl-to-php conversion script seems like it would help quite a bit in this capacity.

[]/w3timages/icons/smile.gif[/] 6 []/w3timages/icons/frown.gif[/]
Screamers
Posted By: Gamejag Re: Upload User Pic Hack - 05/25/2001 4:40 PM
I went to the first line to edit and noticed that it's different than the directions would indicate. Is there an updated version of this hack?

I am using version 5.3

Thanks!

Posted By: MTO Re: Upload User Pic Hack - 09/07/2001 12:24 AM
Uff, I confess it! I got lost! []/testimages/icons/crazy.gif[/]
Could someone upload new instructions? Thanks, would be very welcome []/testimages/icons/wink.gif[/].


I am finally moving from the perl version into the php version...
Posted By: AllenAyres Re: Upload User Pic Hack - 11/15/2001 6:00 PM
Howdy Mateo, did you get the instructions for this?
Posted By: just4clicks Re: Upload User Pic Hack - 02/03/2002 5:53 PM
Sounds Interesting...got this for 5.5?
Posted By: XanthViper Re: Upload User Pic Hack - 02/04/2002 3:35 PM
the code was easy to implement, but haven't been able to get it to work for multiple overwrites of the file. I even set everythign to 777 and still wouldn't overwrite..anyone get this to work fully?
Posted By: AllenAyres Re: Upload User Pic Hack - 02/04/2002 4:30 PM
I believe poil updated it for 5.5. I'll look it up today. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
Posted By: XanthViper Re: Upload User Pic Hack - 02/04/2002 4:36 PM
Thank you very much..I appreciate it. This is a feature asked a lot of. Currently people just make a post and load the file as an attachment..
Posted By: ExcelsiorDDZ Re: Upload User Pic Hack - 02/06/2002 1:16 AM
add instruction to change the link for the picture to your web page link please. Or else everyone will be autolinked to ubbdev.com
Posted By: efnguy Re: corrections for 5.3 - 02/06/2002 3:46 PM
I tried it but it doesnt seem to work. I can upload pics when posting an msg but when I try to upload a user pic it doesnt upload it. Not sure what I did wrong.
Posted By: ExcelsiorDDZ Re: corrections for 5.3 - 02/06/2002 9:17 PM
Avatars should have a capital 'A' in it. I also had to CHMOD mine to 777.

Plus some files work, some don't. Try a smaller file with 16 colors and see if that works. I am still narrowing it down here.
© UBB.Developers