Show button once in a loop, regard of total records.

3 posts by 3 authors in: Forums > CMS Builder
Last Post: January 14, 2020   (RSS)

By Toledoh - January 14, 2020

There's probably a better way, but I would add a couple of variables: $available=0 and $move = 0.

Then in each if loop, and $available++ or $move++ (depending on which loop)

Then change the if statement to be if(strtotime($getDates) < $nowTime) AND !$available. (may have to play with that a bit).

Sound end result is that the if statement only runs if it hasn't run before....

Cheers,
Tim (toledoh.com.au)

By gkornbluth - January 14, 2020

Hey Zick,

Look at the 'groupBy function.

I used it (with lots of help from Greg and Daniel) to create a unique link to a map for groups of listings where the state (and country) were the same.

It might set you in the right direction.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!

Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php