Log in

View Full Version : Assistance Hiding Gif


Bane
03-23-2001, 02:28 PM
Bear with me, as I sometimes don't make much sense.

I have created a custom field, settable by admin/mod only, and would like to have the Post and Member information show a .gif with the name of the field. I accomplised this by using

<img src="{ imagesfolder }/$post[field5].gif">

Now my problem is, if the field is blank, it shows a large red blank image x. Which I must say is quite counterproductive to my needs.

So what I need is a way to hide this if the field is blank. but I am not sure how to go about this. I'm guessing I need to edit the showthread.php and member.php files, but I'm not sure where or how. I tried a little tampering but was unsuccessful.

03-23-2001, 03:59 PM
if ($post[field5] != ""):
$customfield5 = "<img src='{ imagesfolder }/$post[field5].gif'>";
else:
$customfield5 = "";
endif;

In showthread.php, find
if ($post[yahoo]!="") {
eval("\$post[yahooicon] = \"".gettemplate("yahoo")."\";");
} else {
$post[yahoo]="";
}
and add my code directly below that.
In member.php, find
if ($userinfo[yahoo]!="") {
eval("\$userinfo[yahooicon] = \"".gettemplate("yahoo")."\";");
} else {
$userinfo[yahoo]="&nbsp;";
}

and add my code directly below that.

HTH :)

Edit: *smacking my head vigorously* I forgot. Add $customfield5 where you want it to appear in the showthread templates (postbit, etc.) and the member profile templates (getinfo, etc.).

03-24-2001, 09:16 AM
I get a parse error.. Is VB displaying something different in the code?

03-24-2001, 03:30 PM
I made another boo-boo. :) I changed the code in the post above - just replace what I had given you before with what's there now. Should work now. :D

03-24-2001, 05:33 PM
Appreciate the help tubedogg :) Thanks a bunch