vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   First Post Conditional (https://vborg.vbsupport.ru/showthread.php?t=64770)

Boofo 05-05-2004 05:20 PM

Quote:

Originally Posted by the Sandman
I know - that smilie :rolleyes: is "Ponder", not "Rolleyes". I could give you some perks over at TAZ... no problem. :) In fact, I just did!

I want to know how you did those tabs at the top. I could use that idea real nice. ;)

I'll check out my perks. Thank you, sir. ;)

Andy 05-06-2004 01:35 PM

I tried to add that code to my editpost template, but it does not work. I still see the Title field in all the posts.

Code:

                <!-- subject field -->

<if condition="$post['postid'] == $thread['firstpostid']">

                <table cellpadding="0" cellspacing="0" border="0" style="margin-bottom:$stylevar[formspacer]px">
                <tr>
                        <td class="smallfont" colspan="3">$vbphrase[title]:</td>
                </tr>
                <tr>
                        <td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="85" tabindex="1" title="$vbphrase[optional]" /></td>
                        <td>&nbsp;&nbsp;</td>
                        <td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
                </tr>
                </table>

</if>

                <!-- / subject field -->


the Sandman 05-06-2004 01:51 PM

The conditional needs to be in the postbit and postbit_legacy templates.
Quote:

Originally Posted by Andy B
I tried to add that code to my editpost template, but it does not work. I still see the Title field in all the posts.


Boofo 05-06-2004 02:50 PM

Sandman is right because $thread['firstpostid'] isn't defined in the editpost.php, only in the functions_showthread.php.

Andy 05-07-2004 03:34 AM

I'm confused. What exactly do I have to do then to make it so the Title field only shows up when Editing the first post?

I assumed the editpost template needed to be modified only.

the Sandman 05-07-2004 02:51 PM

OK - I figured out how to modify the editpost template to remove the title field and message icon box when editing posts which are replies (not first posts). To do this simply use the conditional:
Code:

<if condition="$show['firstpostnote']">
I put it here:
Code:


<!-- subject field -->
<if condition="$show['firstpostnote']">
<table cellpadding="0" cellspacing="0" border="0" style="margin-bottom:$stylevar[formspacer]px">
<tr>
<td class="smallfont" colspan="3">$vbphrase[title]:</td>
</tr>
<tr><td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="85" tabindex="1" title="$vbphrase[optional]" /></td>
<td>&nbsp;&nbsp;</td>
<td><img id="display_posticon" src="$selectedicon[src]" alt="$selectedicon[alt]" /></td>
</tr>
</table>
</if>
<!-- / subject field -->

And here:
Code:


<if condition="$show['firstpostnote']">
$posticons
</if>

Works like a champ!

Andy 05-07-2004 05:46 PM

Thank you Sandman! Now it works perfect. :)

FragMasterB 08-09-2004 07:47 PM

Works like a charm fellas! Thanks. Exactly what I needed. I noticed that a "Preview" still has the Subject field in it tho... not a big deal... just thought I'd mention it.


All times are GMT. The time now is 05:31 PM.

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.02228 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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