vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   If No post... (https://vborg.vbsupport.ru/showthread.php?t=98220)

Blindchild02 10-12-2005 03:08 PM

If No post...
 
Im coding my own 'last post' box

and this is what i have..

Code:

<table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#d8e1e6">
      <tr>
        <td><font color="#5d6e76" size="1" face="Tahoma"><strong>Last Post:</strong>
          &nbsp;&nbsp;<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]">$lastpostinfo[lastthread]</a> @ $lastpostinfo[lastposttime]</font></td>
      </tr>
    </table>

and it works.

but when there isnt a post in that forum, the variables just dont show up.
whats the <if> statement for if there isnt a post.. it just says never?

nexialys 10-12-2005 03:37 PM

Code:

<if condition="$lastpostinfo[lastthreadid]"><table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#d8e1e6">
      <tr>
        <td><font color="#5d6e76" size="1" face="Tahoma"><strong>Last Post:</strong>
          &nbsp;&nbsp;<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]">$lastpostinfo[lastthread]</a> @ $lastpostinfo[lastposttime]</font></td>
      </tr>
    </table></if>

the element "$lastpostinfo[lastthreadid]" is supposed to be empty when there is no new post... so we display the block IF it is not empty!

Blindchild02 10-12-2005 04:40 PM

instead of hiding the table when there's no posts, could i get it to say never?

and thanks for the help

Chris M 10-12-2005 05:29 PM

Replace the above code with:
Code:

<if condition="$lastpostinfo[lastthreadid]"><table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#d8e1e6">
<tr>
<td><font color="#5d6e76" size="1" face="Tahoma"><strong>Last Post:</strong>
&nbsp;&nbsp;<a href="showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastpostinfo[lastthreadid]">$lastpostinfo[lastthread]</a> @ $lastpostinfo[lastposttime]</font></td>
</tr>
</table><else /><table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#d8e1e6">
<tr>
<td><font color="#5d6e76" size="1" face="Tahoma"><strong>Last Post:</strong>
&nbsp;&nbsp; Never</font></td>
</tr>
</table></if>

:)

Chris

Blindchild02 10-12-2005 05:30 PM

thanks to you both :D !!

Chris M 10-12-2005 05:31 PM

I just noticed a type error on my part :)

I've updated my post :)

Chris


All times are GMT. The time now is 08:14 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.01089 seconds
  • Memory Usage 1,721KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete