Picture in Profile (beta)
Posted by pat
Re: Picture in Profile dev June 11, 2004 10:54PM |
Registered: 16 years ago Posts: 683 |
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
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 |
Admin Registered: 18 years ago Posts: 9,239 |
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
$files[$key]["url"]
before its even created.
I guess you want to check something different.
Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de


Re: Picture in Profile dev June 12, 2004 11:10PM |
Registered: 16 years ago Posts: 683 |
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.
> 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.
Re: Picture in Profile dev June 13, 2004 03:55PM |
Registered: 16 years ago Posts: 683 |
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
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 |
Registered: 16 years ago Posts: 47 |
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.
Is there something else to do?
Regards,
#ayshe
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
Re: Picture in Profile (beta) June 25, 2004 07:55PM |
Registered: 16 years ago Posts: 683 |
Re: Picture in Profile (beta) June 25, 2004 10:14PM |
Registered: 16 years ago Posts: 47 |
bringing it up June 26, 2004 12:49AM |
Registered: 16 years ago Posts: 683 |
Re: bringing it up June 26, 2004 09:26AM |
Registered: 16 years ago Posts: 47 |
June 29, 2004 07:25PM |
Registered: 16 years ago Posts: 666 |
Sorry, only registered users may post in this forum.