vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   template problem (https://vborg.vbsupport.ru/showthread.php?t=93614)

Gio~Logist 08-04-2005 05:35 PM

template problem
 
i have this code in my template memberinfo

HTML Code:

<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 05: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
HTML Code:

<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
HTML Code:

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


Gio~Logist 08-04-2005 05: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 05:49 PM

</else> should be <else />

Gio~Logist 08-04-2005 05:52 PM

HTML Code:

<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 06:10 PM

Quote:

Originally Posted by gio~logist
HTML Code:

<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 06:15 PM

Quote:

Originally Posted by Zachery

<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 06: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.


HTML Code:

<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 06:29 PM

HTML Code:

<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 09: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.


All times are GMT. The time now is 11:09 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03657 seconds
  • Memory Usage 1,783KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete