-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-agenda.php
executable file
·59 lines (57 loc) · 2.74 KB
/
page-agenda.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php theme_include("header"); ?>
<section role="content" class="content">
<p id="contactus">Envie de retrouver votre événement ici ?<br />
<a href="http://www.trancendances.fr/contact">Contactez-nous !</a></p>
<h2 class="events">Événements à venir »</h2>
<?php sort_posts_by_date(FALSE, FALSE);
while(posts()):?>
<?php
$party_time = article_custom_field('heure');
if(empty($party_time)) {
$party_time = "23:59";
}
$date = strtotime(article_custom_field('date')." ".$party_time);
if($date > time()): // Deux semaines de délai
if($party_time == "00:00") {
$date = $date - 86400;
}
?>
<article class="soiree-case">
<h4><a href="<?php echo article_url();?>"><?php echo article_title();?></h4>
<img src="<?php echo article_custom_field('soiree_affiche', '/themes/Trancendances/images/agenda-default.jpg'); ?>" /></a>
<p class="partytime">Le <?php echo date('d/m/Y', $date); ?> (début à <?php echo date('G\hi', $date); ?>)</p>
<p class="location">Lieu : <?php echo article_custom_field('soiree_place'); ?></p>
<p class="artists">Avec <?php echo article_custom_field('soiree_artistes'); ?></p>
<p class="link"><a href="<?php echo article_url();?>">Plus d'infos</a></p>
</article>
<?php endif; ?>
<?php endwhile;
sort_posts_by_date(true, true);?>
</section>
<section class="content">
<h2 class="events">Événements passés »</h2>
<?php sort_posts_by_date(TRUE, FALSE);
while(posts()):
$party_time = article_custom_field('heure');
if(empty($party_time)) {
$party_time = "23:59";
}
$date = strtotime(article_custom_field('date')." ".$party_time);
if($date < time()):
//if($date > (time() - (604800*4)) && $date < time()): // Un mois de délai
if($party_time == "00:00") {
$date = $date - 86400;
}
?>
<article class="soiree-case">
<h4><a href="<?php echo article_url();?>"><?php echo article_title();?></h4>
<img src="<?php echo article_custom_field('soiree_affiche', '/themes/Trancendances/images/agenda-default.jpg'); ?>" /></a>
<p class="partytime">Le <?php echo date('d/m/Y', $date); ?> (ouverture à <?php echo date('G\hi', $date); ?>)</p>
<p class="location">Lieu : <?php echo article_custom_field('soiree_place'); ?></p>
<p class="artists">Avec <?php echo article_custom_field('soiree_artistes'); ?></p>
<p class="link"><a href="<?php echo article_url();?>">Plus d'infos</a></p>
</article>
<?php endif; ?>
<?php endwhile; ?>
</section>
<?php theme_include("footer"); ?>