Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Not possible in Twig --> <? $parties = array_merge($upcoming_local_parties, $upcoming_online_parties);?> <!-- Not possible in Twig -->
- <? if(!empty($parties)): ?>
- <? $i = 0; ?>
- <ul class="cardGrid">
- <? foreach ($parties as $party): ?>
- <li class="party<? if ($i % 4 == 0) echo " row" ?>"><a href="<?= url::site("parties/profile/{$party['event_id']}"); ?>">
- <img src="<?= url::site("{$party['avatar_photo_id']}") . "/100/150"; ?>" alt="<?= $party['name']; ?>" />
- <h3><?= $party['name']; ?></h3>
- <?
- $startTime = strtotime($party['event_start']);
- $currentTime = time();
- if ($startTime > $currentTime) {
- $timeString = 'Starts ';
- } else {
- $timeString = 'Started ';
- }
- ?>
- <p class="bottomStats"><?= $timeString . Toolbox::getTextDate($party['event_start']); ?><? if ($party['event_type'] == 'online') echo " online" ?></p>
- </a></li>
- <? $i++; endforeach; ?>
- </ul>
- <? else: ?>
- <div class="nothinghere">
- <h3>Sorry, there are no parties associated with this movie yet. But, you can <a href="<?= url::site('parties/create/' . $movie['lovecinema_key'])?>">create one!</a></h3>
- </div>
- <? endif; ?>
- ================================================================================================
- <!-- Not possible in Twig --> <? $parties = array_merge($upcoming_local_parties, $upcoming_online_parties);?> <!-- Not possible in Twig -->
- {% macro cardGridRow(number) %}
- {% if loop.index % number|default('4') == 4 %} row{% /if %}
- {% endmacro %}
- <ul class="cardGrid">
- {% for party in parties %}
- <li class="party{ cardGridRow }"><a href="{ url.site('parties/profile/' ~ party.event_id) }">
- <img src="{ url.site(party.avatar_photo_id ~ '/100/150') }" alt="{ party.name }" />
- <h3>{ party.name }</h3>
- <!-- Whole big chunk of non-display php in the view here. Could potentially do with twig, but probably shouldn't. -->
- <p class="bottomStats">{ party.event_start|textdate }{% if party.event_type == 'online' %}online{% /if %}</p>
- </a></li>
- {% else %}
- <li class="nothingHere">Sorry, there were no parties here. Create one!</li>
- {% endfor %}
- </ul>
Add Comment
Please, Sign In to add comment