PDA

View Full Version : template problem


Gio~Logist
08-04-2005, 06:35 PM
i have this code in my template memberinfo


<td valign="top">
<if condition="$post['field1'] != '' ">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
About Me: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field1]</font>
</td>
</table>
<br>
</if>
<if condition="$post['field28'] != '' ">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
About Me: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field28]</font>
</td>
</table>
<br>
</if>
<!-- Start vBBuddies -->
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#6699CC" valign="top">
<tr>
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">$vbphrase[buddies]</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
$profilebuddylist
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<tr>
<td align="right"><font style="font-weight:bold; font-size:8pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;"><a href="buddies.php?u=$userinfo[userid]" class="onwhite">View All of $userinfo[username]'s Friends</a></td>
</tr>
</table>
<!-- End vBBuddies -->



If my field 1 and/or 28 are blank...... it doesnt show the VB BUDDIES for some reason.... anyone know why?

sabret00the
08-04-2005, 06:42 PM
you should really try and indent your code before you post it, reading long code is just tedious when it's all flat at the back as so.

anyway try
<td valign="top">
<if condition="!$post['field1']">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
About Me: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field1]</font>
</td>
</table>
<br>
</if>
<if condition="!$post['field28']">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
About Me: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field28]</font>
</td>
</table>
<br>
</if>
<!-- Start vBBuddies -->
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#6699CC" valign="top">
<tr>
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">$vbphrase[buddies]</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
$profilebuddylist
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<tr>
<td align="right"><font style="font-weight:bold; font-size:8pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;"><a href="buddies.php?u=$userinfo[userid]" class="onwhite">View All of $userinfo[username]'s Friends</a></td>
</tr>
</table>
<!-- End vBBuddies -->

you also might consider
<if condition="!$post['field1']">
<!-- do field 1 stuff -->
</else>
<if condition="!$post['field28']">
<!-- do field28 stuff -->
</if>
</if>

Gio~Logist
08-04-2005, 06:47 PM
The code you gave me still makes the ABout Me:'s show.. boht of them.. i dont want them to show unless the field mentioned in the <if condition> has something in it...

sabret00the
08-04-2005, 06:49 PM
</else> should be <else />

Gio~Logist
08-04-2005, 06:52 PM
<if condition="!$post['field1']">
<!-- do field 1 stuff -->
</else>
<if condition="!$post['field28']">
<!-- do field28 stuff -->
</if>
</if>


That makes it so that if there's nothing in field1 it shows field28... i dont want that.. i want if theres nothing in field 1 it doesnt show anything within THAT statement and if theres nothing in field 28 it doesnt show anything within THAT statement...

Zachery
08-04-2005, 07:10 PM
<if condition="!$post['field1']">
<!-- do field 1 stuff -->
</else>
<if condition="!$post['field28']">
<!-- do field28 stuff -->
</if>
</if>


That makes it so that if there's nothing in field1 it shows field28... i dont want that.. i want if theres nothing in field 1 it doesnt show anything within THAT statement and if theres nothing in field 28 it doesnt show anything within THAT statement...

<else /> << good

</else> << bad

sabret00the
08-04-2005, 07:15 PM
<else /> << good

</else> << bad

no it doesn't, it makes it so that if theirs nothing in field1 it checks to see if theirs anything in field 28 or it shows nothing.

Gio~Logist
08-04-2005, 07:18 PM
lol i dont think you guys understood the coding so let me repost it.. the thing is that i posted it with two About Me:'s so you guys thought that i WANTED an else... the truth is i dont. Take a look at the code now and see if you can understand it better.



<td valign="top">
<if condition="!$post['field1']">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
About Me: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field1]</font>
</td>
</table>
<br>
</if>
<if condition="!$post['field28']">
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">
Who I'd like to meet: </font>
<br>
<font color="#000000" style="font-weight:none; font-size:9pt; font-family: verdana;"> $post[field28]</font>
</td>
</table>
<br>
</if>
<!-- Start vBBuddies -->
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#6699CC" valign="top">
<tr>
<td width="100%"><font color="#023E7B" style="font-weight:bold; font-size:10pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;">$vbphrase[buddies]</td>
</tr>
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
$profilebuddylist
</table>
<table cellpadding="1" cellspacing="0" width="300" align="center" valign="top" border="0" bgcolor="#ffffff" valign="top">
<tr>
<td align="right"><font style="font-weight:bold; font-size:8pt; font-family:tahoma, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;"><a href="buddies.php?u=$userinfo[userid]" class="onwhite">View All of $userinfo[username]'s Friends</a></td>
</tr>
</table>
<!-- End vBBuddies -->

sabret00the
08-04-2005, 07:29 PM
<if condition="!$post['field1']">
<!-- do field 1 stuff -->
<else />
<if condition="!$post['field28']">
<!-- do field28 stuff -->
</if>
</if>
<!-- rest of the stuff you wanted -->


although why you're using so many tables i really don't know.

Gio~Logist
08-04-2005, 10:10 PM
Thanks to everyone who tried to help, however, i found the problem....

I had an <if> statement that shouldn't have been there, somewhere else in the template.

bigcurt
08-04-2005, 10:25 PM
Holy mother of tables!! 0_o.

~Curt

Gio~Logist
08-04-2005, 10:44 PM
<cockyness>
Yea i know, thank god i'm one of the best coders on vb.org and i know what i'm doing :-D
</cockyness>