Announcement

Collapse
No announcement yet.

Help with php code

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

  • Help with php code

    In one of my files I am using the following code:

    Code:
    if ($counter==1 and $pagenumber==1 and $thread[forumid]==7) {
    My question is how to I add more forumids to the "$thread[forumid]==7" area? The if statement will carry over 3 forums. I tried just adding a comma and then the other forum id's but I get a parse error. What is the correct way of adding more to it?

    Thank you!

  • #2
    i'm no expert but i would think...

    PHP Code:
    if ($counter==and $pagenumber==and ($thread[forumid]==|| $thread[forumid]==|| $thread[forumid]==9)) { 
    i think this if statement will evaluate to true if $thread[forumid]==7, 8 or 9. i think!
    Last edited by Jake Bunce; Tue 12 Feb '02, 12:41am.

    Comment


    • #3
      Thanks bro it worked beautifully!

      Comment


      • #4
        Originally posted by c-prompt
        Thanks bro it worked beautifully!


        wow, ok

        Comment


        • #5
          Surprised it worked? lol

          Comment


          • #6
            That could get long quick. If your adventurous, try this:
            PHP Code:
            $valid_forums = array(789);

            if (
            $counter==&& $pagenumber==&& in_array($thread[forumid], $valid_forums)) { 
            PHP Docs: in_array()

            Comment

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