Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: Choose Template
- *
- *
- *
- * @package WooFramework
- * @subpackage Template
- */
- get_header();
- if(isset($_GET['post_id'])) {
- echo $value = get_post_meta( $_GET['post_id'], 'memorial_template', true );
- }
- ?>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <!-- #content Starts -->
- <?php woo_content_before(); ?>
- <div id="content" class="col-full">
- <div id="main-sidebar-container">
- <!-- #main Starts -->
- <?php woo_main_before(); ?>
- <section id="main">
- <?php woo_loop_before(); ?>
- <!-- Post Starts -->
- <?php woo_post_before(); ?>
- <article class="post">
- <?php woo_post_inside_before(); ?>
- <h1 class="title"><?php the_title();
- ?></h1>
- <!-- JAIMIN - TEST CODE-->
- <!-- check script , load images first in var imgs , i have loaded a test form underneath it to display how it will work , please check -->
- <section class="entry">
- <script>
- function check_value(fieldvalue) {
- 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'];
- switch (fieldvalue) {
- case 1:
- document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/10221384-website-template.jpg'>";
- break;
- case 2:
- 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'>";
- break;
- case 3:
- document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/bootstrap-website-template1.png'>";
- break;
- }
- }
- </script>
- <style>
- #imco{width:150px;height:150px;}
- </style>
- <!--<form name="builder">
- <input type="radio" name="field" value="one" onclick='check_value(1)'/> KAWASAKI KX 450F<br />
- <input type="radio" name="field" value="two" onclick='check_value(2)'/> 2010 Yamaha Road Star S<br />
- <input type="radio" name="field" value="three" onclick='check_value(3)'/> Aprilia RSV4<br />
- </form>-->
- <div id="imagedest" style="float:right; margin-right: 94px;"></div>
- <!-- JAIMIN -->
- <!-- OLD CODE STARTS -->
- <div>
- <div id="music">
- <h2>Choose background music</h2>
- <div id="music1">You may select from several different songs this can not be altered latter<br>
- <form name="x" action="" method="GET">
- <label>
- <select name="select_song" style="margin-top:10px;" onchange="this.form.submit();">
- <option value="0">------- Select Song ---------</option>
- <?php
- $uploads = wp_upload_dir();
- //$handle = $uploads['baseurl'].'/audio';
- $defualt_audio = array ();
- if ($dir = opendir($uploads['basedir'].'/audio')) {
- $images = array();
- while (false !== ($file = readdir($dir))) {
- if ($file != "." && $file != "..") {
- //preg_match('/[0-9]+\ /',$file,$ovalve);
- $file_name = str_replace('_',' ',$file);
- $file_name = str_replace('.mp3','',$file_name);
- //$defualt_audio[] = array( $file_name => $file);
- echo '<option value="'.$file.'" name="audio_default">'.ucwords(strtolower($file_name)).'</option>'."\n\r";
- }
- }
- closedir($dir);
- }
- // up
- //function update_page_meta_id (){
- if(isset($_GET['select_song'])){
- $value = $_GET['select_song'];
- update_post_meta($post_id,'audio_default',$value);
- $mp3daudio = get_post_meta ($post_id);
- print_r($mp3daudio);
- }
- ?>
- </select>
- </label>
- </div>
- </div>
- </div>
- </form>
- <form name="myform" id="myform" action="http://dev.rgbdesignuk.com/choose-template/?updated=true&post_id=664" method="post">
- <div style="float: left;height: 400px;overflow: auto;width: 600px;">
- <div>
- <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>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template1thumb.png' width="150" height="150" ><br><br></div>
- </div>
- <div>
- <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>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template2thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <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>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template3thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='4' <?php echo ($value == '4' ? 'checked="checked"' : '');?>> Template 4</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template4thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='5' <?php echo ($value == '5' ? 'checked="checked"' : '');?>> Template 5</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template5thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='6' <?php echo ($value == '6' ? 'checked="checked"' : '');?>> Template 6</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template6thumb.png' width="150" height="150"/><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='7' <?php echo ($value == '7' ? 'checked="checked"' : '');?>> Template 7</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template7thumb.png' width="150" height="150"/><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='8' <?php echo ($value == '8' ? 'checked="checked"' : '');?>> Template 8</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template8thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='9' <?php echo ($value == '9' ? 'checked="checked"' : '');?>> Template 9</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template9thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='10' <?php echo ($value == '10' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template10thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='11' <?php echo ($value == '11' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template11thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='12' <?php echo ($value == '12' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template12thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='13' <?php echo ($value == '13' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template10thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='14' <?php echo ($value == '14' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template10thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='15' <?php echo ($value == '15' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template10thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='16' <?php echo ($value == '16' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template16thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='17' <?php echo ($value == '17' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template17thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='18' <?php echo ($value == '18' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template18thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='19' <?php echo ($value == '19' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template19thumb.png' width="150" height="150" /><br><br></div>
- </div>
- <div>
- <div class='chose-template-input'><input type='radio' name='template' value='20' <?php echo ($value == '20' ? 'checked="checked"' : '');?>> Template 10</div>
- <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template20thumb.png' width="150" height="150" /><br><br></div>
- </div>
- </div>
- <br/>
- <br/>
- <input type='submit' name='choose-template' value='submit' style="clear: both;float: left;margin-top: 10px;">
- <input type='hidden' name='post_id' value='<?php echo @$_GET['post_id']?>'>
- </form>
- <?php /*?>
- /*$("input:radio[name=template]").change(function() {
- if (this.value == "2") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if (this.value == "3") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if(this.value == "4") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if (this.value == "5") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if(this.value == "6") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if (this.value == "7") {
- $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if(this.value == "8") {
- $("img").attr('src', 'android.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if (this.value == "9") {
- $("img").attr('src', 'php.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- } else if(this.value == "10") {
- $("img").attr('src', 'android.jpg');
- $("img").attr('width', '150');
- $("img").attr('hieght', '150');
- }
- });
- */?>
- <?php /*?> <div style="left: 82px;position: relative; z-index:-999;">
- <?php if($value == '1') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg' width="150" height="150" />
- <?php }elseif($value == '2') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
- <?php }elseif($value == '3') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png' width="150" height="150" />
- <?php }elseif($value == '4') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/free-website-template-IT-World.jpg' width="150" height="150" />
- <?php }elseif($value == '5') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg' width="150" height="150" />
- <?php }elseif($value == '6') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg' width="150" height="150" />
- <?php }elseif($value == '7') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg' width="150" height="150" />
- <?php }elseif($value == '8') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/templatemo_349_techno.jpg' width="150" height="150" />
- <?php }elseif($value == '9') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/wedding-template.jpg' width="150" height="150" />
- <?php }elseif($value == '10') {
- ?>
- <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
- <?php }
- ?>
- </div>
- <?php */?>
- </section>
- <?php woo_post_inside_after(); ?>
- </article><!-- /.post -->
- <?php woo_post_after(); ?>
- <div class="fix"></div>
- </section><!-- /#main -->
- <?php woo_main_after(); ?>
- <?php get_sidebar(); ?>
- </div><!-- /#main-sidebar-container -->
- <?php get_sidebar( 'alt' ); ?>
- </div><!-- /#content -->
- <?php woo_content_after(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement