Firefox PHP

Picture in Profile (beta)

Posted by pat 
pat
Re: Picture in Profile dev
June 11, 2004 10:54PM
OK,

this is what I've done in user.php to keep non-picture files out, but it doesn't work, I wonder why:


// generate users-file-list for pic in profile...
$files = phorum_db_get_user_file_list($PHORUM["user"]["user_id"]);
foreach($files as $key => $file) {

$imagedata = getimagesize($files[$key]["url"]);

if ($imagedata[2]< 4){

$files[$key]["url"]=phorum_get_url(PHORUM_FILE_URL, "file=$key");
}
}
//...and put it into array
$PHORUM["DATA"]["FILES"] = $files;


thanx
pat
Re: Picture in Profile dev
June 12, 2004 10:43PM
because you check
$files[$key]["url"]
before its even created.
I guess you want to check something different.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
pat
Re: Picture in Profile dev
June 12, 2004 11:10PM
Hi Thomas,

> because you check
> $files[$key]["url"]
> before its even created.
> I guess you want to check something different.

Oh, that's what I mean when I say I'm still a bit confused on how things go about in v5.

This is basicly what I want to do:

1. determine if file is pic and show only pics in pulldown.

2. determine what size of pic

3.resize with php-script if file exceeds a certain size and save resized pic for future use (if its a gif save as png).

4.reuse the size and is-image parts of the code to show popup's with the exact right size for all attachment-pics in read.php

I have a standalone script already that does part 1-3 but I find it hard to integrate, as there is no real url for the pics, and the code that handels files is still somewhat cryptic to me.

Any suggestions where I could start my attempts?

thanx
pat



Edited 1 time(s). Last edit at 06/12/2004 11:27PM by pat.
pat
Re: Picture in Profile dev
June 13, 2004 03:55PM
Ok,

a bit more concrete:

usually my standalone is called within the img-tag with somthing like this:

<img src="php/thumb.php?image=../pics/alfred.jpg&x=100&y=100">

and gives back a picture with a max dimension 0f 100px in eather dimension.

But with forum that doesn't work since the image has to be retrieved from the database first, but how do I pass that to the standalone afterwards?

Alternatively I could integrate the code of the standalone with file.php but I have no clue how to retrieve and return the pic the right way. As I am not familiar with handling base64 encoded files...

thanx
pat
Re: Picture in Profile (beta)
June 25, 2004 01:57PM
Hey,

how did you do it? I included this code into the profile.php (after adding the field pic_url in the admin), but nothing shows up.

Quote

<tr>
<td nowrap="nowrap" colspan="2"><img src="{PROFILE->pic_url}">

<form action="[localhost]; method="POST" enctype="multipart/form-data">
<input type="hidden" name="forum_id" value="0" />
<input type="hidden" name="panel" value="files" />

<div class="PhorumStdBlock PhorumFloatingText" style="text-align: left;">
<br />
<input type="file" name="pic_url" size="30" /><br /><br />
<input class="PhorumSubmit" type="submit" value="Abschicken" />
</div>
</form></td>

</tr>

Is there something else to do?

Regards,
#ayshe
pat
Re: Picture in Profile (beta)
June 25, 2004 07:55PM
Hi #ayshe,

you have to do a bit more just see my(the) first post in this thread.

pat






Edited 2 time(s). Last edit at 06/25/2004 07:56PM by pat.
Re: Picture in Profile (beta)
June 25, 2004 10:14PM
Hi Pat,

thanks for waking me up :-)
I must have been sleepy. It works now!

I'm now waiting for someone bringing up the hack to control the kind of data and it's size.

Regards,
#ayshe
pat
bringing it up
June 26, 2004 12:49AM
Hi #ayshe,

I'm almost done with it - will only be a metter of days maybe i'll be abel to finish this weekend...

pat
Re: bringing it up
June 26, 2004 09:26AM
Whohoo, go for it! :-)
Re: bringing it up
June 29, 2004 07:25PM
I had just put in the read and profile templates that width="100" and nothing for height, so that their picture wouldn't stretch or get scrunched up. It would be nice, though, to have what you're trying to do, since when users upload large pictures, it looks awful being a width of 100.
Sorry, only registered users may post in this forum.

Click here to login