The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
conditional won't work together but work's split up?
PHP Code:
|
#2
|
|||
|
|||
Should that OR be an AND?
|
#3
|
||||
|
||||
Quote:
and is he not missing a ( at the beginning. should be PHP Code:
|
#4
|
|||
|
|||
YEs you are right, he is also missing a leading (. He would get a syntax error on that.
|
#5
|
||||
|
||||
yeah that was a typo from where i reconstructed the two conditionals to make em once
but php PHP Code:
and PHP Code:
PHP Code:
|
#6
|
|||
|
|||
Like i said......change the OR to AND
|
#7
|
||||
|
||||
the OR is supposed to be an AND though
basically if the userid is not the same as your userid and you don't have the usergroup permission anyway then show no permission and the second bit is if you're not a moderator then show no permission, so both are independant. |
#8
|
|||
|
|||
Well if you combine 2 (or more) NOT '!' conditions they will get related.
Example of what you want: 1. If you are not the poster AND not have rights to edit (this will mean that if you are the poster, but don't have the right to edit (your own post) you still can edit): PHP Code:
- I am the poster, and i have rights to edit. The above is NOT true, so no error msg. - I am the poster, and i have NO rights to edit. The above is NOT true (the first part of the condition is false), so no error msg. - I am NOT the poster, and i have rights to edit. The above is NOT true, so no error msg. - I am the NOT poster, and i have NO rights to edit. The above is true, so i get a no permission page. Now the second part: PHP Code:
PHP Code:
PHP Code:
- User is same, C2 is TRUE (making the test false!!!), and C3 is FALSE(he is not a moderator, making this test true. So we have here a user, who made this post, have edit rights and is not a moderator, this would result in: 1. post_user != cur_user......FALSE (the user is the same) 2. !C2....FALSE (the user has permission to edit) 3. !C3....TRUE (the user is not a moderator) this will result in: Code:
((FALSE AND FALSE) OR (TRUE)) Code:
(FALSE OR TRUE) Code:
TRUE PHP Code:
|
#9
|
||||
|
||||
Let's see what can happen:
- I am the poster, and i have rights to edit. The above is NOT true, so no error msg. correct and working as intended - I am the poster, and i have NO rights to edit. The above is NOT true (the first part of the condition is false), so no error msg. incorrect should see error message - I am NOT the poster, and i have rights to edit. The above is NOT true, so no error msg. correct and working as intended - I am the NOT poster, and i have NO rights to edit. The above is true, so i get a no permission page. correct and working as intended I guess what we want here is that a moderator (spelling mistake in the permission??) can always edit, no matter if he made the post himself. If not combined with other conditions this would be ok. But now let's see what happens if we combine: correct so far PHP Code:
so bascially let me try and do this in conditionals to try and explain myself PHP Code:
PHP Code:
|
#10
|
|||
|
|||
What my code does is:
If they are NOT (poster AND have edit perms) AND are NOT a moderator: Error message Edit wrong! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|