PDA

View Full Version : more variable in my conditional


bartek24m
09-01-2015, 09:19 PM
i would like modyfy just one line of php code in my hook

$isforumid = 189 === $thread['forumid'];


It works when is written only one forum id.
i would like to add up more numbers to this conditional but i dont know how.


i tried change code in to this:
$isforumid = array(1,2,3,4,5,189) === $thread['forumid'];
but it doesnt work :(

any ideas?

Dave
09-01-2015, 09:22 PM
$isforumid is a boolean right? (true or false)


$isforumid = (in_array($thread['forumid'], array(1,2,3,4,5,189)));

bartek24m
09-01-2015, 09:28 PM
It works !
Thank you very much !! :)


I have another question:

If it's possible to use this condition in my custom template: zippyshare_player_user which is combined with hook located in bbcode_fetch_tags ?
When i try to use this code it didn't work :(

<if condition="in_array($forum['forumid'], array(1,2,3,4,5,189))">Special forum id</if>

In post: the code above causes :
https://vborg.vbsupport.ru/external/2015/09/19.jpg

TheLastSuperman
09-02-2015, 01:22 AM
$isforumid is a boolean right? (true or false)


$isforumid = (in_array($thread['forumid'], array(1,2,3,4,5,189)));


"You must 'Like' someone else's post before liking any more by Dave." So instead I shall comment and +1 you now ;).

It works !
Thank you very much !! :)


I have another question:

If it's possible to use this condition in my custom template: zippyshare_player_user which is combined with hook located in bbcode_fetch_tags ?
When i try to use this code it didn't work :(

<if condition="in_array($forum['forumid'], array(1,2,3,4,5,189))">Special forum id</if>

In post: the code above causes :
https://vborg.vbsupport.ru/external/2015/09/19.jpg

Is this conditional being used in the bbcode? You cannot use conditionals in BB Codes in such a way.... this one time... I swear there was a mod for that though allowing you to specify conditionals, if I recall and locate the link I will return, if not then I know its out there, might be vB4 though or I might be wrong and it could be for including something else in bbcodes its a long shot, ok ok shutting up now :p.