cotonti.com : help with cotemplate https://www.cotonti.com Son konu mesajları Cotonti en Thu, 27 Nov 2025 22:33:22 -0000 pieter https://github.com/Cotonti/Cotonti/issues/791

]]>
Pzt, 02 Oca 2012 16:39:06 -0000
ez Hmmm.. I looked in the Genoa list..   (thats why i didnt see it)

Could this bug also be fixed in Genoa please...

]]>
Pzt, 02 Oca 2012 15:39:39 -0000
Twiebie https://github.com/Cotonti/Cotonti/issues/787

]]>
Cmt, 31 Ara 2011 15:34:31 -0000
ez Is it in the Buglist allready... so that it get fixed ?

]]>
Cmt, 31 Ara 2011 14:41:36 -0000
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.

]]>
Cum, 30 Ara 2011 10:08:09 -0000
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

]]>
Cum, 30 Ara 2011 08:33:05 -0000
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.

]]>
Per, 29 Ara 2011 20:33:11 -0000
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 smiley


ALSO this situation should be documented !!!!!

]]>
Per, 29 Ara 2011 20:10:23 -0000
GHengeveld Try this: 

<!-- IF {MINIDIR_SHOWUSERNAME} AND {MINIDIR_USERNAME} -->
]]>
Per, 29 Ara 2011 19:43:57 -0000
ez @Pieter: I looked inside Cotemplate code... and NO its "AND"

To prove my point !!!


 myfiles5_494.png

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)

 

]]>
Per, 29 Ara 2011 19:09:05 -0000
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 &&?

]]>
Per, 29 Ara 2011 18:01:41 -0000
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... no

 

]]>
Per, 29 Ara 2011 16:20:16 -0000
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 -->
]]>
Per, 29 Ara 2011 06:58:36 -0000
ez Hi there,

I have problems with blocks... if MINIDIR_USERNAME is empty (i checked), then this div is shown anyway..
Am I doing something wrong here ???  cot version 0.6.20

 

            <!-- IF {MINIDIR_SHOWUSERNAME}=="1" AND {MINIDIR_USERNAME}!="" -->
                <div id="mb_admin_user">
                    {PHP.L.Username} : <b>{MINIDIR_USERNAME}</b>
                </div>
            <!-- ENDIF -->
 

 

]]>
Çrş, 28 Ara 2011 22:10:49 -0000