SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | /** | |
3 | * Template Name: Choose Template | |
4 | * | |
5 | * | |
6 | * | |
7 | * @package WooFramework | |
8 | * @subpackage Template | |
9 | */ | |
10 | ||
11 | ||
12 | ||
13 | get_header(); | |
14 | ||
15 | if(isset($_GET['post_id'])) { | |
16 | echo $value = get_post_meta( $_GET['post_id'], 'memorial_template', true ); | |
17 | } | |
18 | ||
19 | ||
20 | ||
21 | ?> | |
22 | ||
23 | ||
24 | ||
25 | <script src="http://code.jquery.com/jquery-latest.js"></script> | |
26 | <!-- #content Starts --> | |
27 | <?php woo_content_before(); ?> | |
28 | <div id="content" class="col-full"> | |
29 | ||
30 | <div id="main-sidebar-container"> | |
31 | ||
32 | <!-- #main Starts --> | |
33 | <?php woo_main_before(); ?> | |
34 | <section id="main"> | |
35 | ||
36 | <?php woo_loop_before(); ?> | |
37 | ||
38 | <!-- Post Starts --> | |
39 | <?php woo_post_before(); ?> | |
40 | <article class="post"> | |
41 | ||
42 | <?php woo_post_inside_before(); ?> | |
43 | ||
44 | <h1 class="title"><?php the_title(); | |
45 | ||
46 | ?></h1> | |
47 | <!-- JAIMIN - TEST CODE--> | |
48 | ||
49 | <!-- check script , load images first in var imgs , i have loaded a test form underneath it to display how it will work , please check --> | |
50 | ||
51 | ||
52 | ||
53 | <section class="entry"> | |
54 | ||
55 | ||
56 | ||
57 | <script> | |
58 | function check_value(fieldvalue) { | |
59 | var imgs = ['http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/10221384-website-template.jpg', 'http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/25-phoca-color-joomla-16-template.jpg', 'http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/bootstrap-website-template1.png']; | |
60 | ||
61 | switch (fieldvalue) { | |
62 | case 1: | |
63 | document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/10221384-website-template.jpg'>"; | |
64 | break; | |
65 | case 2: | |
66 | document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/25-phoca-color-joomla-16-template.jpg'>"; | |
67 | break; | |
68 | case 3: | |
69 | document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/bootstrap-website-template1.png'>"; | |
70 | break; | |
71 | } | |
72 | } | |
73 | </script> | |
74 | ||
75 | ||
76 | ||
77 | <style> | |
78 | ||
79 | #imco{width:150px;height:150px;} | |
80 | ||
81 | ||
82 | </style> | |
83 | ||
84 | <!--<form name="builder"> | |
85 | <input type="radio" name="field" value="one" onclick='check_value(1)'/> KAWASAKI KX 450F<br /> | |
86 | <input type="radio" name="field" value="two" onclick='check_value(2)'/> 2010 Yamaha Road Star S<br /> | |
87 | <input type="radio" name="field" value="three" onclick='check_value(3)'/> Aprilia RSV4<br /> | |
88 | </form>--> | |
89 | ||
90 | ||
91 | <div id="imagedest" style="float:right; margin-right: 94px;"></div> | |
92 | ||
93 | ||
94 | ||
95 | <!-- JAIMIN --> | |
96 | ||
97 | <!-- OLD CODE STARTS --> | |
98 | ||
99 | <div> | |
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | <div id="music"> | |
106 | <h2>Choose background music</h2> | |
107 | ||
108 | <div id="music1">You may select from several different songs this can not be altered latter<br> | |
109 | ||
110 | ||
111 | ||
112 | <form name="x" action="" method="GET"> | |
113 | ||
114 | <label> | |
115 | <select name="select_song" style="margin-top:10px;" onchange="this.form.submit();"> | |
116 | <option value="0">------- Select Song ---------</option> | |
117 | ||
118 | ||
119 | <?php | |
120 | ||
121 | ||
122 | ||
123 | $uploads = wp_upload_dir(); | |
124 | //$handle = $uploads['baseurl'].'/audio'; | |
125 | $defualt_audio = array (); | |
126 | ||
127 | if ($dir = opendir($uploads['basedir'].'/audio')) { | |
128 | $images = array(); | |
129 | while (false !== ($file = readdir($dir))) { | |
130 | if ($file != "." && $file != "..") { | |
131 | ||
132 | //preg_match('/[0-9]+\ /',$file,$ovalve); | |
133 | ||
134 | $file_name = str_replace('_',' ',$file); | |
135 | $file_name = str_replace('.mp3','',$file_name); | |
136 | ||
137 | //$defualt_audio[] = array( $file_name => $file); | |
138 | echo '<option value="'.$file.'" name="audio_default">'.ucwords(strtolower($file_name)).'</option>'."\n\r"; | |
139 | ||
140 | } | |
141 | } | |
142 | closedir($dir); | |
143 | } | |
144 | ||
145 | // up | |
146 | ||
147 | //function update_page_meta_id (){ | |
148 | ||
149 | if(isset($_GET['select_song'])){ | |
150 | ||
151 | - | $value = $_GET['select_song'] |
151 | + | $value = $_GET['select_song']; |
152 | ||
153 | update_post_meta($post_id,'audio_default',$value); | |
154 | ||
155 | $mp3daudio = get_post_meta ($post_id); | |
156 | ||
157 | print_r($mp3daudio); | |
158 | ||
159 | ||
160 | ||
161 | // } | |
162 | ?> | |
163 | ||
164 | ||
165 | ||
166 | </select> | |
167 | </label> | |
168 | </div> | |
169 | ||
170 | </div> | |
171 | ||
172 | ||
173 | ||
174 | ||
175 | </div> | |
176 | </form> | |
177 | ||
178 | <form name="myform" id="myform" action="http://dev.rgbdesignuk.com/choose-template/?updated=true&post_id=664" method="post"> | |
179 | ||
180 | ||
181 | <div style="float: left;height: 400px;overflow: auto;width: 600px;"> | |
182 | <div> | |
183 | <div class='chose-template-input'><input type='radio' name='template' value='1' onclick='check_value(1)' <?php echo ($value == '1'|| $value == '' ? 'checked="checked"' : '');?>> Template 1</div> | |
184 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg' width="150" height="150" ><br><br></div> | |
185 | </div> | |
186 | <div> | |
187 | <div class='chose-template-input'><input type='radio' name='template' onclick='check_value(2)' value='2' <?php echo ($value == '2' ? 'checked="checked"' : '');?>> Template 2</div> | |
188 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" /><br><br></div> | |
189 | </div> | |
190 | <div> | |
191 | <div class='chose-template-input'><input type='radio' name='template' onclick='check_value(3)' value='3' <?php echo ($value == '3' ? 'checked="checked"' : '');?>> Template 3</div> | |
192 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png' width="150" height="150" /><br><br></div> | |
193 | </div> | |
194 | <div> | |
195 | <div class='chose-template-input'><input type='radio' name='template' value='4' <?php echo ($value == '4' ? 'checked="checked"' : '');?>> Template 4</div> | |
196 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/free-website-template-IT-World.jpg' width="150" height="150" /><br><br></div> | |
197 | </div> | |
198 | <div> | |
199 | <div class='chose-template-input'><input type='radio' name='template' value='5' <?php echo ($value == '5' ? 'checked="checked"' : '');?>> Template 5</div> | |
200 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg' width="150" height="150" /><br><br></div> | |
201 | </div> | |
202 | <div> | |
203 | <div class='chose-template-input'><input type='radio' name='template' value='6' <?php echo ($value == '6' ? 'checked="checked"' : '');?>> Template 6</div> | |
204 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg' width="150" height="150"/><br><br></div> | |
205 | </div> | |
206 | <div> | |
207 | <div class='chose-template-input'><input type='radio' name='template' value='7' <?php echo ($value == '7' ? 'checked="checked"' : '');?>> Template 7</div> | |
208 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg' width="150" height="150"/><br><br></div> | |
209 | </div> | |
210 | <div> | |
211 | <div class='chose-template-input'><input type='radio' name='template' value='8' <?php echo ($value == '8' ? 'checked="checked"' : '');?>> Template 8</div> | |
212 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/templatemo_349_techno.jpg' width="150" height="150" /><br><br></div> | |
213 | </div> | |
214 | <div> | |
215 | <div class='chose-template-input'><input type='radio' name='template' value='9' <?php echo ($value == '9' ? 'checked="checked"' : '');?>> Template 9</div> | |
216 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/wedding-template.jpg' width="150" height="150" /><br><br></div> | |
217 | </div> | |
218 | <div> | |
219 | <div class='chose-template-input'><input type='radio' name='template' value='10' <?php echo ($value == '10' ? 'checked="checked"' : '');?>> Template 10</div> | |
220 | <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" /><br><br></div> | |
221 | </div> | |
222 | ||
223 | </div> | |
224 | <br/> | |
225 | <br/> | |
226 | <input type='submit' name='choose-template' value='submit' style="clear: both;float: left;margin-top: 10px;"> | |
227 | <input type='hidden' name='post_id' value='<?php echo @$_GET['post_id']?>'> | |
228 | </form> | |
229 | ||
230 | ||
231 | <?php /*?> | |
232 | /*$("input:radio[name=template]").change(function() { | |
233 | if (this.value == "2") { | |
234 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg'); | |
235 | $("img").attr('width', '150'); | |
236 | $("img").attr('hieght', '150'); | |
237 | } else if (this.value == "3") { | |
238 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg'); | |
239 | $("img").attr('width', '150'); | |
240 | $("img").attr('hieght', '150'); | |
241 | } else if(this.value == "4") { | |
242 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png'); | |
243 | $("img").attr('width', '150'); | |
244 | $("img").attr('hieght', '150'); | |
245 | } else if (this.value == "5") { | |
246 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg'); | |
247 | $("img").attr('width', '150'); | |
248 | $("img").attr('hieght', '150'); | |
249 | } else if(this.value == "6") { | |
250 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg'); | |
251 | $("img").attr('width', '150'); | |
252 | $("img").attr('hieght', '150'); | |
253 | } else if (this.value == "7") { | |
254 | $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg'); | |
255 | $("img").attr('width', '150'); | |
256 | $("img").attr('hieght', '150'); | |
257 | } else if(this.value == "8") { | |
258 | $("img").attr('src', 'android.jpg'); | |
259 | $("img").attr('width', '150'); | |
260 | $("img").attr('hieght', '150'); | |
261 | } else if (this.value == "9") { | |
262 | $("img").attr('src', 'php.jpg'); | |
263 | $("img").attr('width', '150'); | |
264 | $("img").attr('hieght', '150'); | |
265 | } else if(this.value == "10") { | |
266 | $("img").attr('src', 'android.jpg'); | |
267 | $("img").attr('width', '150'); | |
268 | $("img").attr('hieght', '150'); | |
269 | } | |
270 | ||
271 | }); | |
272 | */?> | |
273 | ||
274 | ||
275 | <?php /*?> <div style="left: 82px;position: relative; z-index:-999;"> | |
276 | ||
277 | ||
278 | <?php if($value == '1') { | |
279 | ?> | |
280 | <img src='<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg' width="150" height="150" /> | |
281 | <?php }elseif($value == '2') { | |
282 | ?> | |
283 | <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" /> | |
284 | <?php }elseif($value == '3') { | |
285 | ?> | |
286 | <img src='<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png' width="150" height="150" /> | |
287 | <?php }elseif($value == '4') { | |
288 | ?> | |
289 | <img src='<?php echo get_template_directory_uri()?>/images/templates/free-website-template-IT-World.jpg' width="150" height="150" /> | |
290 | <?php }elseif($value == '5') { | |
291 | ?> | |
292 | <img src='<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg' width="150" height="150" /> | |
293 | <?php }elseif($value == '6') { | |
294 | ?> | |
295 | <img src='<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg' width="150" height="150" /> | |
296 | <?php }elseif($value == '7') { | |
297 | ?> | |
298 | <img src='<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg' width="150" height="150" /> | |
299 | <?php }elseif($value == '8') { | |
300 | ?> | |
301 | <img src='<?php echo get_template_directory_uri()?>/images/templates/templatemo_349_techno.jpg' width="150" height="150" /> | |
302 | <?php }elseif($value == '9') { | |
303 | ?> | |
304 | <img src='<?php echo get_template_directory_uri()?>/images/templates/wedding-template.jpg' width="150" height="150" /> | |
305 | <?php }elseif($value == '10') { | |
306 | ?> | |
307 | <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" /> | |
308 | <?php } | |
309 | ?> | |
310 | ||
311 | </div> | |
312 | <?php */?> | |
313 | ||
314 | </section> | |
315 | ||
316 | <?php woo_post_inside_after(); ?> | |
317 | ||
318 | </article><!-- /.post --> | |
319 | <?php woo_post_after(); ?> | |
320 | <div class="fix"></div> | |
321 | ||
322 | </section><!-- /#main --> | |
323 | <?php woo_main_after(); ?> | |
324 | ||
325 | <?php get_sidebar(); ?> | |
326 | ||
327 | </div><!-- /#main-sidebar-container --> | |
328 | ||
329 | <?php get_sidebar( 'alt' ); ?> | |
330 | ||
331 | </div><!-- /#content --> | |
332 | <?php woo_content_after(); ?> | |
333 | ||
334 | <?php | |
335 | ||
336 | get_footer(); ?> |