![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
conditional query
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
|
#2
|
||||
|
||||
|
i think you forgot a { } pair
![]()
__________________
Unfortunatelly i am completely out of vbulletin buisness, so i won't upgrade any of my hacks anymore. Everyone who wants to upgrade my hacks or use part of my codes is allowed to do so, without needing any special permission by me anymore. You just have to mention my full name if you want to reuse some of my work, thats all i ask for. No members have liked this post.
|
||||
|
#3
|
||||
|
||||
|
but if i put them additionals curly brackets in, won't i close the conditionals? before it's acheive what i want it to?
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
|
#4
|
||||
|
||||
|
heres an example of the code i'm trying to ask if will work or not
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
Last edited by sabret00the : 24 May 2004 at 16:56. |
||||
|
#5
|
||||
|
||||
|
if you don't close the brackets, the else will be regarded to the inner if's and not to the outer if as you want to have
__________________
Unfortunatelly i am completely out of vbulletin buisness, so i won't upgrade any of my hacks anymore. Everyone who wants to upgrade my hacks or use part of my codes is allowed to do so, without needing any special permission by me anymore. You just have to mention my full name if you want to reuse some of my work, thats all i ask for. No members have liked this post.
|
|
#6
|
||||
|
||||
|
ok sorry to bother you but i don't get it, just edited my last post for a clarity, basically the conditional starts inside of the if/else and ends outside of it. yet if i close them, then it's not gonna perform what i'm asking it to do?
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
|
#7
|
||||
|
||||
|
now you have confused me.....
i don't get what you want, but from what you said before, that code is correct:
__________________
Unfortunatelly i am completely out of vbulletin buisness, so i won't upgrade any of my hacks anymore. Everyone who wants to upgrade my hacks or use part of my codes is allowed to do so, without needing any special permission by me anymore. You just have to mention my full name if you want to reuse some of my work, thats all i ask for. No members have liked this post.
|
||||
|
#8
|
||||
|
||||
|
I've clarified your code.
It's extremely recommended to put brackets for if, else, loops, and functions under the statement. Also, when verifying if a variable exists, use isset(). If you just want to see if a variable has a value, check with the ! (bang) operator in a boolean statement. For strings, use empty(). Here is your code. I'm not sure what you're trying to achieve with the empty IFs, but you were missing the last bracket.
__________________
My OpenSource (as in do with them what you want no need to ask for permission) Scripts: 7/25/04 » Article Bot 1.1, vB3 Member Album 2.0, BB Code Functions, Advanced Search w/Member Conditions, Eggdrop IRC Manager, IRC Manager for mIRC, Existing Topics Check http://www.mozilla.org/products/fire...efox_80x15.png No members have liked this post.
|
||||
|
#9
|
||||
|
||||
|
thank you all, it's very much appreciated, velo, what i was trying to acheive started with the $flood variable and ended with the "INSERT INTO confessions SET..." bit basically i was trying to find out if i needed to repeat the whole code or if i could just use the conditional based on an admin cp option of letting guests confess or not.
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
|
#10
|
||||||||
|
||||||||
|
Just a minor correction..
I had:
The ! (bang) operator, which could literally be translated to "not", is equivalent to empty(). Not using ! is equivalent to !empty(), or just placing a variable between the () in a statement. The code should have been:
__________________
My OpenSource (as in do with them what you want no need to ask for permission) Scripts: 7/25/04 » Article Bot 1.1, vB3 Member Album 2.0, BB Code Functions, Advanced Search w/Member Conditions, Eggdrop IRC Manager, IRC Manager for mIRC, Existing Topics Check http://www.mozilla.org/products/fire...efox_80x15.png No members have liked this post.
|
||||||||
|
#11
|
||||
|
||||
|
thanks
it's appreciated.not to be a pain but why do you recommend putting all curly brackets under the statement?
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
|
#12
|
||||
|
||||
|
Originally Posted by sabret00the
well, it's the vb3 coding standard, and also a well know coding standart in real programming languages like C++.
it makes the code better readable, and especially makes it easier to find if you have missed a bracket ![]()
__________________
Unfortunatelly i am completely out of vbulletin buisness, so i won't upgrade any of my hacks anymore. Everyone who wants to upgrade my hacks or use part of my codes is allowed to do so, without needing any special permission by me anymore. You just have to mention my full name if you want to reuse some of my work, thats all i ask for. No members have liked this post.
|
|
#13
|
||||||||
|
||||||||
|
i'll have to try and get used to it, it's just as i'm learning it, i'm being taught to do it
(which i find alot easier to read) rather than
arghh feels like such a waste of space.
__________________
UNDER CONSTRUCTION: Confessionary Hack Make me a Hack of The Month author: GRPS: Groups Commune make my hacks, they'll make you famous ![]() unless it's a security concern, please do not pm/im me for support unless you're willing to pay.
No members have liked this post.
|
||||||||
|
#14
|
||||
|
||||
|
The way I've always coded, I've done this:
Bit of both. No members have liked this post.
|
||||
|
#15
|
||||
|
||||
|
*gg*
everyone bringing in his own coding standards ![]()
__________________
Unfortunatelly i am completely out of vbulletin buisness, so i won't upgrade any of my hacks anymore. Everyone who wants to upgrade my hacks or use part of my codes is allowed to do so, without needing any special permission by me anymore. You just have to mention my full name if you want to reuse some of my work, thats all i ask for. No members have liked this post.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Thread Tools | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 08:28.




it's appreciated.
