Log in

View Full Version : Bored Typing Numbers


sweetguy2004
12-01-2008, 07:50 PM
<if condition="in_array($foruminfo['forumid'], array(1 , 2, 3, 4 ,5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190))">

is there another way to do like this

<if condition="in_array($foruminfo['forumid'], array(1to1000))">

<if condition="in_array($foruminfo['forumid'], array(1000to2000))">

<if condition="in_array($foruminfo['forumid'], array(2000to3000))">

Hope you understood any help would be greatfull

Lynne
12-01-2008, 08:05 PM
How about if NOT in_array instead? Wouldn't that be easier being as there are so many forumids?

ReCom
12-01-2008, 11:03 PM
<a href="http://www.php.net/range" target="_blank">http://www.php.net/range</a>

Guest190829
12-02-2008, 12:12 AM
I agree with Lynne, the comparison operators are your friend in this situation. :)

sweetguy2004
12-02-2008, 06:37 AM
I tried this 1

$numbers = range(1000, 2000);
echo "Numbers: ", implode(", ", $numbers);

to add in templates

The following template conditional expression contains function calls
With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

The following functions are allowed in template conditional expressions:
in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()

Digital Jedi
12-02-2008, 08:24 AM
Did you try the exclusion conditional yet, or do you have as many forums in as not in?