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.
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[/]
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...
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 :)
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...
$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)
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
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.
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.
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...
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 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.
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.