![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
If statement
Ok I have the following IF statement:
Now this is using vbulletin 3.0 but for some reason the eval is always ran and I always get the templeat even though I only want it in some forums. Is my IF statement incorrect? Note: In vbulletin 3.0 f is used to determine the forum id. No members have liked this post.
|
||||
|
#2
|
||||
|
||||
|
vB3 code/hacking isn't allowed to be discussed yet.
Also editing any main files is pretty dumb. It's not even RC yet and that means alot may still change. No members have liked this post.
|
|
#3
|
||||
|
||||
|
Personally I feel this is perfectly legit. I have asked questions before about vbulletin 3. I'm not asking how to do it just if someone would look at my if statement and see if there is anything wrong with it.
__________________
What could be better than a Bud and computers? No members have liked this post.
|
|
#4
|
||||
|
||||
|
No members have liked this post.
|
|
#5
|
||||
|
||||
|
I think you still need the ' ' around the 57 but it works thanks!
__________________
What could be better than a Bud and computers? No members have liked this post.
|
|
#6
|
|||
|
|||
|
PHP rarely cares about data types. The only time it definitely will is if you use the === operator which implicitly checks the type of the left and right values.
Also vB3 hacking discussion is not allowed as Steve said. No members have liked this post.
|
|
#7
|
||||
|
||||
If my question was stated was it was is it ok? I didn't really want to know how to do it in vb3 just if my if statement was correct or not which Steve correct for me. No members have liked this post.
|
|
#8
|
|||
|
|||
|
I'm just confirming what he said; I wasn't necessarily saying that your question was central to vB3.
![]() No members have liked this post.
|
|
#9
|
||||
|
||||
No members have liked this post.
|
|
#10
|
||||
|
||||
|
You need the ' ' when it's a string
![]()
__________________
Dean Clatworthy - Web Developer/Designer No members have liked this post.
|
|
#11
|
|||
|
|||
|
Yup - to keep with good coding practices Strings should be wrapped in either ' ... ' or " ..." and numbers can be left as is ![]()
__________________
Platinum-Central No members have liked this post.
|
|
#12
|
||||
|
||||
|
Should be '...' for stings and "..." for html or holding a variable togeather if you want to goto good codeing practices.
![]() No members have liked this post.
|
|
#13
|
|||
|
|||
|
' ... ' is a simple string which is not parsed by PHP for variables, etc.
" ... " is a complex string which is parsed (and is therefore slightly less efficient). $mystring = '<a href="'.$link.'">Test URL</a>'; $mystring = "<a href=\"$link\">Test URL</a>"; both produce the same result, however the first example is more efficiant and (IMO) easier to read and work with.
__________________
Platinum-Central No members have liked this post.
|
|
#14
|
||||
|
||||
|
$mystring = '<a href="$link">test url</a>';
Should work?
__________________
Dean Clatworthy - Web Developer/Designer No members have liked this post.
|
|
#15
|
|||
|
|||
|
in that case it will just print exactly that as php does not parse the string for variables
![]()
__________________
Platinum-Central 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 00:00.



Strings should be wrapped in either ' ... ' or " ..." and numbers can be left as is
