Advertisement
jadejd

Untitled

Mar 14th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.26 KB | None | 0 0
  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.       $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/template1large.png', 'http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template2large.png', 'http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template3large.png', 'http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template4large.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/template1large.png'>";
  64.                 break;
  65.             case 2:
  66.                 document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template2large.png'>";
  67.                 break;
  68.             case 3:
  69.                 document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template3large.png'>";
  70.                 break;
  71.             case 4:
  72.                 document.getElementById("imagedest").innerHTML = "<img id='imco' src='http://dev.rgbdesignuk.com/wp-content/themes/canvas/images/templates/template4large.png'>";
  73.                 break;    
  74.             }
  75.         }
  76. </script>
  77.  
  78.  
  79.  
  80. <style>
  81.  
  82. #imco{width:150px;height:150px;}
  83.  
  84.  
  85. </style>              
  86.                                        
  87. <!--<form name="builder">
  88.   <input type="radio" name="field" value="one" onclick='check_value(1)'/> KAWASAKI KX 450F<br />
  89.   <input type="radio" name="field" value="two" onclick='check_value(2)'/> 2010 Yamaha Road Star S<br />
  90.   <input type="radio" name="field" value="three" onclick='check_value(3)'/> Aprilia RSV4<br />
  91. </form>-->
  92.  
  93.  
  94. <div id="imagedest" style="float:right; margin-right: 94px;"></div>
  95.                                        
  96.                                        
  97.                                        
  98. <!-- JAIMIN -->                                
  99.                                        
  100.                                         <!-- OLD CODE STARTS -->
  101.                                        
  102.                                         <div>
  103.                    
  104.  
  105.  
  106.                
  107.                
  108.                 <div id="music">
  109.                         <h2>Choose background music</h2>
  110.                        
  111.                         <div id="music1">You may select from several different songs this can not be altered latter<br>
  112.                        
  113.                      
  114.  
  115. <form name="x" action="" method="GET">
  116.  
  117.                           <label>
  118.                             <select name="select_song" style="margin-top:10px;" onchange="this.form.submit();">
  119.                                         <option value="0">------- Select Song ---------</option>
  120.                      
  121.  
  122. <?php
  123.  
  124.  
  125.  
  126. $uploads = wp_upload_dir();
  127. //$handle = $uploads['baseurl'].'/audio';
  128. $defualt_audio = array();
  129.  
  130. if ($dir = opendir($uploads['basedir'].'/audio')) {
  131.         $images = array();
  132.         while (false !== ($file = readdir($dir))) {
  133.                 if ($file != "." && $file != "..") {
  134.                        
  135.                         //preg_match('/[0-9]+\ /',$file,$ovalve);
  136.  
  137.                         $file_name  = str_replace('_',' ',$file);
  138.                         $file_name = str_replace('.mp3','',$file_name);
  139.                        
  140.                         //$defualt_audio[] = array( $file_name => $file);  
  141.                          echo '<option value="'.$file.'" name="audio_default">'.ucwords(strtolower($file_name)).'</option>'."\n\r";
  142.                        
  143.                 }
  144.         }
  145.         closedir($dir);
  146. }
  147.  
  148. // up
  149.  
  150. //function update_page_meta_id (){
  151.        
  152.         if(isset($_GET['select_song'])){
  153.  
  154. $value = $_GET['select_song'];
  155.        
  156.         update_post_meta($post_id,'audio_default',$value);
  157.        
  158.         $mp3daudio =    get_post_meta ($post_id);
  159.        
  160.         print_r($mp3daudio);
  161.        }
  162.  
  163.        
  164. //      }
  165. ?>
  166.  
  167.                                        
  168.                              
  169.                         </select>
  170.                           </label>
  171.                         </div>
  172.                      
  173.                 </div>
  174.                
  175.      
  176.                    
  177.                    
  178.                     </div>
  179. </form>
  180.                <form name="myform" id="myform" action="http://dev.rgbdesignuk.com/choose-template/?updated=true&post_id=664" method="post">
  181.                    
  182.                      
  183.                       <div style="float: left;height: 400px;overflow: auto;width: 600px;">
  184.                         <div>
  185.                             <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>
  186.                             <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>
  187.                         </div>
  188.                          <div>
  189.                             <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>
  190.                             <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>
  191.                         </div>
  192.                          <div>
  193.                             <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>
  194.                             <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>
  195.                         </div>
  196.                         <div>
  197.                             <div class='chose-template-input'><input type='radio' name='template'    value='4' <?php echo ($value  == '4' ? 'checked="checked"' : '');?>>  Template 4</div>
  198.                             <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>
  199.                         </div>
  200.                         <div>
  201.                             <div class='chose-template-input'><input type='radio' name='template'    value='5' <?php echo ($value  == '5' ? 'checked="checked"' : '');?>>  Template 5</div>
  202.                             <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>
  203.                         </div>
  204.                         <div>
  205.                             <div class='chose-template-input'><input type='radio' name='template'    value='6' <?php echo ($value  == '6' ? 'checked="checked"' : '');?>>  Template 6</div>
  206.                             <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>
  207.                         </div>
  208.                         <div>
  209.                             <div class='chose-template-input'><input type='radio' name='template'    value='7' <?php echo ($value  == '7' ? 'checked="checked"' : '');?>>  Template 7</div>
  210.                             <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>
  211.                         </div>
  212.                         <div>
  213.                             <div class='chose-template-input'><input type='radio' name='template'    value='8' <?php echo ($value  == '8' ? 'checked="checked"' : '');?>>  Template 8</div>
  214.                             <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>
  215.                         </div>
  216.                         <div>
  217.                             <div class='chose-template-input'><input type='radio' name='template'    value='9' <?php echo ($value  == '9' ? 'checked="checked"' : '');?>>  Template 9</div>
  218.                             <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>
  219.                         </div>
  220.                         <div>
  221.                             <div class='chose-template-input'><input type='radio' name='template'    value='10' <?php echo ($value  == '10' ? 'checked="checked"' : '');?>>  Template 10</div>
  222.                             <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>
  223.                         </div>
  224.                         <div>
  225.                             <div class='chose-template-input'><input type='radio' name='template'    value='11' <?php echo ($value  == '11' ? 'checked="checked"' : '');?>>  Template 11</div>
  226.                             <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>
  227.                         </div>
  228.                         <div>
  229.                             <div class='chose-template-input'><input type='radio' name='template'    value='12' <?php echo ($value  == '12' ? 'checked="checked"' : '');?>>  Template 12</div>
  230.                             <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>
  231.                         </div>
  232.                         <div>
  233.                             <div class='chose-template-input'><input type='radio' name='template'    value='13' <?php echo ($value  == '13' ? 'checked="checked"' : '');?>>  Template 13</div>
  234.                             <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template13thumb.png' width="150" height="150" /><br><br></div>
  235.                         </div>
  236.                         <div>
  237.                             <div class='chose-template-input'><input type='radio' name='template'    value='14' <?php echo ($value  == '14' ? 'checked="checked"' : '');?>>  Template 14</div>
  238.                             <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template14thumb.png' width="150" height="150" /><br><br></div>
  239.                         </div>
  240.                         <div>
  241.                             <div class='chose-template-input'><input type='radio' name='template'    value='15' <?php echo ($value  == '15' ? 'checked="checked"' : '');?>>  Template 15</div>
  242.                             <div class='chose-template-image'><br><img src='<?php echo get_template_directory_uri()?>/images/templates/template15thumb.png' width="150" height="150" /><br><br></div>
  243.                         </div>
  244.                         <div>
  245.                             <div class='chose-template-input'><input type='radio' name='template'    value='16' <?php echo ($value  == '16' ? 'checked="checked"' : '');?>>  Template 16</div>
  246.                             <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>
  247.                         </div>
  248.                         <div>
  249.                             <div class='chose-template-input'><input type='radio' name='template'    value='17' <?php echo ($value  == '17' ? 'checked="checked"' : '');?>>  Template 17</div>
  250.                             <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>
  251.                         </div>
  252.                         <div>
  253.                             <div class='chose-template-input'><input type='radio' name='template'    value='18' <?php echo ($value  == '18' ? 'checked="checked"' : '');?>>  Template 18</div>
  254.                             <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>
  255.                         </div>
  256.                         <div>
  257.                             <div class='chose-template-input'><input type='radio' name='template'    value='19' <?php echo ($value  == '19' ? 'checked="checked"' : '');?>>  Template 19</div>
  258.                             <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>
  259.                         </div>
  260.                         <div>
  261.                             <div class='chose-template-input'><input type='radio' name='template'    value='20' <?php echo ($value  == '20' ? 'checked="checked"' : '');?>>  Template 20</div>
  262.                             <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>
  263.                         </div>
  264.  
  265.                  
  266.                </div>
  267.                <br/>
  268.                <br/>
  269.                        <input type='submit' name='choose-template' value='submit' style="clear: both;float: left;margin-top: 10px;">
  270.                                              <input type='hidden' name='post_id' value='<?php echo @$_GET['post_id']?>'>
  271.                       </form>  
  272.                            
  273.                    
  274. <?php /*?>                                    
  275. /*$("input:radio[name=template]").change(function() {
  276.             if (this.value == "2") {
  277.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg');
  278.                                             $("img").attr('width', '150');
  279.                                            $("img").attr('hieght', '150');
  280.             } else if (this.value == "3") {
  281.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg');
  282.                                         $("img").attr('width', '150');
  283.                                            $("img").attr('hieght', '150');
  284.                     } else if(this.value == "4") {
  285.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png');
  286.                                            $("img").attr('width', '150');
  287.                                            $("img").attr('hieght', '150');
  288.             } else if (this.value == "5") {
  289.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg');
  290.                                            $("img").attr('width', '150');
  291.                                            $("img").attr('hieght', '150');
  292.             } else if(this.value == "6") {
  293.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg');
  294.                                            $("img").attr('width', '150');
  295.                                            $("img").attr('hieght', '150');
  296.             } else if (this.value == "7") {
  297.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg');
  298.                                            $("img").attr('width', '150');
  299.                                            $("img").attr('hieght', '150');
  300.             } else if(this.value == "8") {
  301.                        $("img").attr('src', 'android.jpg');
  302.                                            $("img").attr('width', '150');
  303.                                            $("img").attr('hieght', '150');
  304.             } else if (this.value == "9") {
  305.                        $("img").attr('src', 'php.jpg');
  306.                                            $("img").attr('width', '150');
  307.                                            $("img").attr('hieght', '150');
  308.             } else if(this.value == "10") {
  309.                        $("img").attr('src', 'android.jpg');
  310.                                            $("img").attr('width', '150');
  311.                                            $("img").attr('hieght', '150');
  312.             }
  313.            
  314. });
  315. */?>
  316.  
  317.    
  318.                              <?php /*?>   <div style="left: 82px;position: relative; z-index:-999;">
  319.                                                                
  320.                                                                                                                        
  321.                         <?php if($value == '1') {
  322.                                                 ?>
  323.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg' width="150" height="150" />
  324.                                                 <?php }elseif($value == '2') {
  325.                                                 ?>
  326.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
  327.                                                 <?php }elseif($value == '3') {
  328.                                                 ?>
  329.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png' width="150" height="150" />
  330.                                                 <?php }elseif($value == '4') {
  331.                                                 ?>
  332.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/free-website-template-IT-World.jpg' width="150" height="150" />
  333.                                                 <?php }elseif($value == '5') {
  334.                                                 ?>
  335.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg' width="150" height="150" />
  336.                                                 <?php }elseif($value == '6') {
  337.                                                 ?>
  338.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg' width="150" height="150" />
  339.                                                 <?php }elseif($value == '7') {
  340.                                                 ?>
  341.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg' width="150" height="150" />
  342.                                                 <?php }elseif($value == '8') {
  343.                                                 ?>
  344.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/templatemo_349_techno.jpg' width="150" height="150" />
  345.                                                 <?php }elseif($value == '9') {
  346.                                                 ?>
  347.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/wedding-template.jpg' width="150" height="150" />
  348.                                                 <?php }elseif($value == '10') {
  349.                                                 ?>
  350.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
  351.                                                 <?php }
  352.                                                 ?>
  353.                                                
  354.                         </div>                
  355. <?php */?>
  356.  
  357.         </section>
  358.                    
  359.                     <?php woo_post_inside_after(); ?>
  360.  
  361.                 </article><!-- /.post -->
  362.                 <?php woo_post_after(); ?>
  363.                 <div class="fix"></div>
  364.  
  365.             </section><!-- /#main -->
  366.             <?php woo_main_after(); ?>
  367.  
  368.             <?php get_sidebar(); ?>
  369.  
  370.         </div><!-- /#main-sidebar-container -->
  371.  
  372.         <?php get_sidebar( 'alt' ); ?>
  373.  
  374.     </div><!-- /#content -->
  375.     <?php woo_content_after(); ?>
  376.  
  377. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement