logical blocks
ez |
|
---|---|
Hi there,
I have problems with blocks... if MINIDIR_USERNAME is empty (i checked), then this div is shown anyway..
<!-- IF {MINIDIR_SHOWUSERNAME}=="1" AND {MINIDIR_USERNAME}!="" -->
==- I say: Keep it EZ -==
|
Alex300 |
|
---|---|
Use spaces In logical operations. Try this: <!-- IF {MINIDIR_SHOWUSERNAME} == "1" AND {MINIDIR_USERNAME} != "" --> <div id="mb_admin_user"> {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b> </div> <!-- ENDIF --> Есть миры, не здесь, там, где небеса горят, и моря засыпают, и реки дремлют; люди сделаны из дыма, а города – из песен. Где-то опасность, где-то несправедливость, даже где-то остыл чай. Идем Эйс, у нас много работы!...
...Sorry for my english... Бесплатные расширения для Cotonti: https://lily-software.com/free-scripts/ |
ez |
|
---|---|
Sorry, it didn't work... :( <!-- IF {MINIDIR_SHOWUSERNAME} == "1" AND {MINIDIR_USERNAME} != "" --> <div id="mb_admin_user"> {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b> </div> <!-- ENDIF --> With or without spaces... CoTemplate does not work the way i expect... and the vars i checked 200 times... I am depending on this to work bigtime... but for now i find the cotemplate buggy in logical blocks...
==- I say: Keep it EZ -==
|
|
This post was edited by ez (2011-12-29 16:35, 12 years ago) |
pieter |
|
---|---|
If you try only one variable and lateron the other one. At that moment you are sure the vars are OK. Is AND not &&? ... can we help you ...
|
ez |
|
---|---|
@Pieter: I looked inside Cotemplate code... and NO its "AND" To prove my point !!!
With the existing template: <div id="mb_foldererror" style="display:none; padding:10px; margin:10px 0; color:red; border:red solid 1px"></div> --{MINIDIR_SHOWUSERNAME}-- ||{MINIDIR_USERNAME}|| <!-- IF ({MINIDIR_SHOWUSERNAME} == "1" AND {MINIDIR_USERNAME} != "") --> <div id="mb_admin_user"> {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b> </div> <!-- ENDIF --> I hate buggy crap shit... you see in example above that the labels produce a 1 and a name.. still my div does not get printed.. (The check labels go fine). ALSO spaces between the elements do make a difference... thats shit to :( (NOT happy)
==- I say: Keep it EZ -==
|
GHengeveld |
|
---|---|
Try this: <!-- IF {MINIDIR_SHOWUSERNAME} AND {MINIDIR_USERNAME} --> |
ez |
|
---|---|
And the winner of today is Gert <!-- IF {MINIDIR_SHOWUSERNAME} == "1" AND {MINIDIR_USERNAME} --> <div id="mb_admin_user"> {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b> </div> <!-- ENDIF --> STILL i find it very strange to not be able to do != "" Thanks for the many responses... it was for Myfiles by the way
==- I say: Keep it EZ -==
|
GHengeveld |
|
---|---|
Maybe the username was never an empty string, but NULL ? I try to use PHP Type Juggling when it makes things more simple. This is one such scenario, in this case it's converting to boolean. |
|
This post was edited by GHengeveld (2011-12-29 20:39, 12 years ago) |
ez |
|
---|---|
Sorry Gert, in this case NULL had nothing to do with it. Look at example (post: 2011-12-29 19:09) there is clearly a string. I still think that this is weird logic, and should be looked at... we should be able to test empty strings with a [ != "" ] statement ==- I say: Keep it EZ -==
|
Trustmaster |
|
---|---|
I confirm this is a CoTemplate bug. If you try <!-- IF {MINIDIR_USERNAME} != "" --> <div id="mb_admin_user"> {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b> </div> <!-- ENDIF --> this works but if you put there AND condition, then != stops working. May the Source be with you!
|
ez |
|
---|---|
Is it in the Buglist allready... so that it get fixed ? ==- I say: Keep it EZ -==
|
Twiebie |
|
---|---|
ez |
|
---|---|
Hmmm.. I looked in the Genoa list.. (thats why i didnt see it) ==- I say: Keep it EZ -==
|
pieter |
|
---|---|
... can we help you ...
|