No announcement yet.

help with an if/else conditional for a post reply button

  • Filter
  • Time
  • Show
Clear All
new posts

  • help with an if/else conditional for a post reply button

    So I'm trying to change the post REPLY button for one particular forum to NOT show the reply button in that forum, but instead show a different link.

    This is the conditional I'm trying to use:

    <if condition="in_array($forumid, array(38,0,0))">
            <td><div id="buttons" align="right"><strong><a href="#respond">RESPOND</a></strong></div></td>
    and I know it should go in this area somewhere:

    <!-- controls below postbits -->
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr valign="top">
        <if condition="$show['largereplybutton']">
            <td><div id="buttons" align="right"><if condition="$show['closethread']"><strong>$vbphrase[reply]</strong><else /><strong>$vbphrase[closed_thread]</strong></if></a></div></td>
    But when I tried doing it with the forumid conditional before the first <td>, it still showed the REPLY button in that forum and didn't show the REPLY button in any other forum.

    It probably has to be just in the right spot (order), but I need some help figuring out how to place it.

  • #2
    If it is just one forum, try instead of this:

    <if condition="in_array($forumid, array(38,0,0))">


    <if condition="$foruminfo['forumid'] == '38'">

    also, instead of <else> use <else />


    • #3
      Thanks for the help:

      Is there the correct number of quote marks in your example?:

      <if condition="$foruminfo['forumid'] == '38'">

      Would using <else> instead of <else /> cause it not to work?



      • #4
        There is no quotemarks, you were looking for FORUM ID
        The id is therefor of the forum. It has nothing to do with posts.

        Yes, incorrect tags can cause functions to not work.

        Note: you also need to CLOSE your if conditional.

        <if condition="something"> (open)
        condition one
        <else />
        condition two
        </if> (close)

        More details about template conditionals can be found in our online manual and the resource site


        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.