1

Topic: simple if statement not working.

Its displaying men online as it should but I tried a if statement below and its still showing the echo as well.

{members:limit=20,profile_gender1=1,photos=1,cache_time=0,cache_name="onlinemen",online="1",orderdir="desc"}

<!-- IF members_online == "0" -->

<?php
echo 'Sorry we have no Men online at the moment';
?>

<!-- ENDIF -->

vldPersonals 2.7 - Commercial license.

2

Re: simple if statement not working.

Even tried this,

<!-- IF members == "1" -->
{members:limit=20,profile_gender1=1,photos=1,cache_time=0,cache_name="onlinemen",online="1",orderdir="desc"}
<!-- ELSE -->
<b>Sorry we have no Men online at the moment</b>
<!-- ENDIF -->

Its just showing Sorry we have no Men online at the moment and no members at all.

vldPersonals 2.7 - Commercial license.

3

Re: simple if statement not working.

Stop thinking PHP. I'm not saying it can't be used, but in my 3 years using vldP I don't think I ever used php in a template. I use CSS and HTML.

<!-- IF ! top.loggedin == "" AND settings.show_online AND member_online -->

Message in HTML

<!-- ENDIF -->

I use the above code to display the Send Message to members online.  Again, this works for 2.5.3.

One NOTE: The <!-- IF ! top.loggedin may or may not be what you use. It depends where you put the code. If you put outside the loop you have to use top.loggedin. If it is within the loop than you only need it to be:

<!-- IF ! loggedin

Last edited by db3204 (2011-11-06 09:55:55)