-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpage-theater2.php
196 lines (196 loc) · 9.69 KB
/
page-theater2.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
/*
Template Name: Theater2 Page Template
*/
?>
<?php
$dkk_settings = get_option( 'dkk_options', $dkk_options );
?>
<?php get_header(); ?>
<div id="container">
<div class="info radius border">
<?php
$settings = get_option( 'dkk_options', $dkk_options );
$weekStart = date('F j, Y');
$n = 1;
$args = array( 'post_type' => 'movies', 'posts_per_page' => -1 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$theater = get_post_meta($post->ID, '_dkk_theater', $single = true);
if ($dkk_settings['theater2'] == urldecode($theater)) {
$movie_title = get_post_meta($post->ID, '_dkk_movie_title', $single = true);
$expiration = get_post_meta($post->ID, '_dkk_end_date', $single = true);
$threeD = get_post_meta($post->ID, '_dkk_3D', $single = true);
$image = get_post_meta($post->ID, '_dkk_movie_poster', $single = true);
$synopsis = get_post_meta($post->ID, '_dkk_movie_synopsis', $single = true);
$youtube = get_post_meta($post->ID, '_dkk_movie_url', $single = true);
$youtube = explode('=', $youtube);
$rating = get_post_meta($post->ID, '_dkk_select', $single = true);
$length = get_post_meta($post->ID, '_dkk_movie_length', $single = true);
$first_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart)), $single = true);
$first_times = explode(', ', $first_times);
$second_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 1 day')), $single = true);
$second_times = explode(', ', $second_times);
$third_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 2 day')), $single = true);
$third_times = explode(', ', $third_times);
$fourth_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 3 day')), $single = true);
$fourth_times = explode(', ', $fourth_times);
$fifth_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 4 day')), $single = true);
$fifth_times = explode(', ', $fifth_times);
$sixth_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 5 day')), $single = true);
$sixth_times = explode(', ', $sixth_times);
$seventh_times = get_post_meta($post->ID, '_dkk_'.date('l-M-j', strtotime($weekStart . '+ 6 day')), $single = true);
$seventh_times = explode(', ', $seventh_times);
$secondsbetween = strtotime($expiration) - time();
if($secondsbetween > 0) {
?>
<div class="col_lft">
<a href="#expanded<?php echo $n; ?>" rel="leanModal"><img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" width="134" height="193" /></a>
<?php if ($threeD == '3D') : ?>
<img src="<?php echo get_template_directory_uri(); ?>/images/3d.png" width="109" height="82" alt="Movie in 3D" class="coming-soon" />
<?php endif;
if ($threeD == '2D') : ?>
<img src="<?php echo get_template_directory_uri(); ?>/images/2d.png" width="109" height="82" alt="Movie in 2D" class="coming-soon" />
<?php endif; ?>
<p>Rated: <?php echo $rating; ?> <br />
Length: <?php echo $length; ?></p>
</div> <!-- end .col_lft -->
<div class="col_rt">
<h1><?php echo $movie_title; ?></h1>
<table>
<tr>
<td><?php echo date('D, M j', strtotime($weekStart)); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 1 day')); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 2 day')); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 3 day')); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 4 day')); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 5 day')); ?></td>
<td><?php echo date('D, M j', strtotime($weekStart . '+ 6 day')); ?></td>
</tr>
<tr>
<td>
<?php
$count = count($first_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $first_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($second_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $second_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($third_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $third_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($fourth_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $fourth_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($fifth_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $fifth_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($sixth_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $sixth_times[$i] . '</p>';
}
?>
</td>
<td>
<?php
$count = count($seventh_times);
$count = $count - 1;
for($i = 0; $i <= $count; $i++) {
echo '<p>' . $seventh_times[$i] . '</p>';
}
?>
</td>
</tr>
</table>
<div class="clear"></div>
<h2>Pricing</h2>
<?php if ($comments) { ?>
<p><?php echo $comments; ?></p>
<?php } ?>
<p class="pricing">
<?php if ($threeD == '3D') { ?>
Adults: $5.00 <br />
Children: $4.00 <br />
Seniors: $4.00 <br />
Matinees (Before 6:00 PM): $4.00 for all ages <br />
Tuesdays: $4.00 for all ages <br />
3D Prices are based on regular admission plus $2.00. Coupons are only valid for the regular admission portion unless specified otherwise.
<?php } ?>
<?php if($dkk_settings['theater2'] == urldecode($theater) && !$comments && $threeD != '3D') {
echo $dkk_settings['pricing2'];
}
?>
</p>
</div> <!-- end .col_rt -->
<div class="clear"></div>
<div id="expanded<?php echo $n; ?>" class="hidden">
<a class="close"></a>
<p>
<iframe width="640" height="390" src="http://www.youtube.com/embed/<?php echo $youtube[1]; ?>?rel=0" frameborder="0"></iframe>
</p>
<p style="text-align: left; padding: 15px; font-size: 14px;">
<strong>Synopis</strong><br />
<?php echo $synopsis; ?><br />
</p>
</div> <!-- end #expanded<?php echo $n; ?> -->
<?php }
} $n++;
endwhile; ?>
</div>
<div class="info radius border">
<h1>LOCATION</h1>
<?php if($dkk_settings['map_url2']) { ?>
<div class="lft_col">
<img src="<?php echo $dkk_settings['map_url2']; ?>" class="map" alt="Map to the <?php echo $dkk_settings['theater2'] ?>" />
</div> <!-- end .map -->
<?php } ?>
<?php if($dkk_settings['location2']) { ?>
<div class="rt_col location">
<p>
<?php echo $dkk_settings['location2']; ?>
</p>
</div>
<?php } ?>
<div class="clear"></div>
</div> <!-- end .info -->
<div class="info radius border">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<div class="clear"></div>
</div> <!-- end .info -->
</div> <!-- end #container -->
</div> <!-- end #main -->
</div> <!-- end #wrap -->
<?php get_footer(); ?>