Previous Thread
Next Thread
Print Thread
Rate Thread
#209689 04/03/2001 2:33 PM
Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
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
Attachments
33501-Readme.txt (0 Bytes, 46 downloads)

Sponsored Links
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
SOOO COOL thanks!!!!!!!!!!!

Carl

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

vent #209691 04/04/2001 6:20 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
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.


Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
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

vent #209693 04/04/2001 10:07 AM
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
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.


Sponsored Links
Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
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

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
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.


vent #209696 04/30/2001 6:52 AM
Joined: May 1999
Posts: 624
Master Hacker
Master Hacker
Offline
Joined: May 1999
Posts: 624
>>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[/]

Joined: Aug 2000
Posts: 262
Enthusiast
Enthusiast
Offline
Joined: Aug 2000
Posts: 262
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

vent #209698 04/30/2001 9:05 PM
Joined: May 1999
Posts: 242
Coder
Coder
Offline
Joined: May 1999
Posts: 242
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

Sponsored Links
Joined: Oct 2000
Posts: 60
Power User
Power User
Offline
Joined: Oct 2000
Posts: 60
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.


Joined: May 1999
Posts: 242
Coder
Coder
Offline
Joined: May 1999
Posts: 242
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

Joined: Oct 2000
Posts: 60
Power User
Power User
Offline
Joined: Oct 2000
Posts: 60
I meant basic stuffage to help people learn PHP. ;D

Administrator, Videogame Music Archive

Joined: May 1999
Posts: 242
Coder
Coder
Offline
Joined: May 1999
Posts: 242
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

Joined: May 2001
Posts: 13
Newbie
Newbie
Offline
Joined: May 2001
Posts: 13
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!


Joined: Jan 2000
Posts: 796
MTO Offline
Addict
Addict
Offline
Joined: Jan 2000
Posts: 796
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...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Howdy Mateo, did you get the instructions for this?


- Allen wavey
- What Drives You?
vent #209706 02/03/2002 10:53 AM
Joined: Feb 2002
Posts: 10
Newbie
Newbie
Offline
Joined: Feb 2002
Posts: 10
Sounds Interesting...got this for 5.5?


Thanks!
Scott Salvi
Just4Clicks
Joined: Apr 2000
Posts: 76
Journeyman
Journeyman
Joined: Apr 2000
Posts: 76
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?


i run sdstreetracing.com and streetracing.com
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I believe poil updated it for 5.5. I'll look it up today. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]


- Allen wavey
- What Drives You?
Joined: Apr 2000
Posts: 76
Journeyman
Journeyman
Joined: Apr 2000
Posts: 76
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..


i run sdstreetracing.com and streetracing.com
Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
add instruction to change the link for the picture to your web page link please. Or else everyone will be autolinked to ubbdev.com


Silly ricer.. Wings are for airplanes!
Joined: Feb 2002
Posts: 4
Lurker
Lurker
Offline
Joined: Feb 2002
Posts: 4
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.

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
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.


Silly ricer.. Wings are for airplanes!

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)