Announcement

Collapse
No announcement yet.

Conditional for first post on a page

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

  • Conditional for first post on a page

    Code:
    <if condition="$post[postcount]==1">
    I'm using this conditional in the postbit to show something special in the first post, but I would like it to display on the first post of every page, not just the first page. It's based on information specific to that post, so it can't simply be in the showthread template.

    Any ideas?

  • #2
    Try this one... <if condition="$post[postcount] == ((($perpage - 1) * $postcount) + 1)">
    Last edited by fury; Tue 17 Jun '03, 8:58pm.

    Comment


    • #3
      I'm not sure that $perpage is a variable. For instance,
      Code:
      <if condition="($post[postcount]%$perpage)==1">
      doesn't work.

      Comment


      • #4
        Technically it should work.

        $postcount = ($pagenumber - 1 ) * $perpage;

        $post[postcount] is later set to ++$postcount, and the post counters seem to be working. Any vB team care to provide some insight? Are certain variables not allowed to be used in conditionals?

        Comment


        • #5
          Perhaps $perpage is out of scope or something.

          Comment


          • #6
            I'm sure $perpage and $pagenumber aren't global in the construct postbit function so you aren't able to use them.

            Comment

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