Helpful Information
 
 
Category: General
Getting an attached image, have a thumbnail...

OK, I need help with two parts with this. First I have this code in the postbit_attachmentimage file.


<p><smallfont>$post[username] has attached this image:<br>
<A HREF="attachment.php?s=$session[sessionhash]&postid=$post[postid]" TARGET="_blank"><IMG SRC="attachment.php?s=$session[sessionhash]&postid=$post[postid]" WIDTH="245" BORDER="0"></a></smallfont>


But with that code, if somebody attaches an image that's smaller than what I readjust the image to be (245) then it actually enlarges the picture. This can be seen here:

http://www.theforumz.com/forumz/showthread.php?s=&threadid=21928

Is there a way to get it to run some sort of "if/than" statement where if it's smaller than the suggested thumbnail size that it wont try and make the thumbnail and it will just be displayed at its original size?

The second thing that I was hoping to get help on, was when people click the thumbnail, it just shows the default image size on a white page. I want to show it on a page with the same look as my forum. I put this code in a php page:

<IMG SRC="attachment.php?s=$session[sessionhash]&postid=$post[postid]">


but instead of showing the picture, it actually writes out the code instead. I am still a noob when it comes to php, but I think it's doing this because I haven't required the right files. Can somebody help me with which files I need to require in the php file, so that it will recognize who the user is and grab the right code?

If anybody can help me with either of these things, I would really appreciate it.

Thanks a bunch.