Announcement

Collapse
No announcement yet.

[HDI] Hide The Sub-Forum...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HDI] Hide The Sub-Forum...

    ...on the second page.

    For example, when you are in the forums, if you have a sub-forum, it will appear above the threads. I'd only like for the subforums to show on the first page. What would be the conditional for that?

    I tried:

    <if condition="$show['forumslist'] AND $page == 1 OR !empty($page)">
    show sub-forums
    </if>

    I figured the condition would know what $page was, but it doesn't. FYI, I got the variable $page from the URL that passed it:
    http://www.sohh.com/forums/forumdisp...0&daysprune=30

    Any ideas?

  • #2
    Try this:

    Code:
    <if condition="$show['forumslist'] AND ($_REQUEST[page] == 1 OR !$_REQUEST[page])">

    Comment


    • #3
      Ah! That did the trick. Thank you so much.

      Offhand, will vB ever do a tutorial on conditionals? I've searched for it, but nothing quite official.

      Comment


      • #4
        Maybe, but I don't know.

        The basic syntax is:

        Code:
        <if condition="SOME BOOLEAN EXPRESSION">
        	CODE TO DISPLAY IF TRUE
        [<else />
        	CODE TO DISPLAY IF FALSE]
        </if>
        The boolean expression can use any variables that are available to the calling script.

        Comment

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