I am so close! (And feeling a little more like a moron every minute. lol)
Okay, so I’ve got my main “updates” template here:
{exp:query sql="SELECT screen_name,join_date
FROM exp_members
order by 1"}
<?php
$joinDt = Date("m/d/Y", mktime(0, 0, 0, Date("m",{join_date}), Date("d",{join_date}), Date("Y",{join_date})));
$currDt = Date("m/d/Y", mktime(0, 0, 0, Date("m",time()), Date("d",time()), Date("Y",time())));
$start_ts = strtotime($joinDt);
$end_ts = strtotime($currDt);
$diff = $end_ts - $start_ts;
?>
{embed="group-tour/drip-updates" days-joined="<?php echo ".round($diff / 86400)."; ?>"}
{/exp:query}
I am totally not sure if that’s the right way to pass the days-joined parameter…I think there’s a glaring error there.
And then I have the embedded “drip-updates” template here:
{exp:query sql="SELECT ct.title
FROM exp_channels c, exp_channel_titles ct, exp_channel_data cd
where c.channel_name = 'destinations'
and ct.channel_id = c.channel_id
and ct.status = 'open'
and cd.channel_id = c.channel_id
and cd.field_id_23 <= {embed:days-joined}
order by ct.title asc"}
<div class="updates-icon">{updates-icon}</div>
<div class="main-content updates">
<h2 class="updates-title">{title}</h2>
<h3 class="sub-title">This destination's itinerary:</h3>
<ul>{summary}</ul>
<a href="http://tourdebliss.com/group-tour/{url_title}" class="updates-link">Go to this destination</a>
<div class="page-break"></div>
{paginate}
{if previous_page}
<a href="http://{auto_path}">Previous Page</a>
{/if}
{if next_page}
<a href="http://{auto_path}">Next Page</a>
{/if}
{/paginate}
</div><!-- .main-content-->
{if no_results}
No results found.
{/if}
{/exp:query}
Is that somewhere close to what you were suggesting? I’m sure I’ve done something wrong, because I’m getting a 502 Proxy Error that says:
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘
SELECT COUNT(*) AS count FROM (SELECT ct.title FROM exp_channels c, exp_channel_titles ct, exp_channel_data cd where c.channel_name = ‘destinations’ and ct.channel_id = c.channel_id and ct.status = ‘open’ and cd.channel_id = c.channel_id and cd.field_id_23 <=
Filename: modules/query/mod.query.php
Line Number: 96