Advertisement
jadejd

Untitled

Mar 13th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.04 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.       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'];
  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.                <form name="myform" id="myform" action="http://dev.rgbdesignuk.com/choose-template/?updated=true&post_id=664" method="post">
  178.                    
  179.                      
  180.                       <div style="float: left;height: 400px;overflow: auto;width: 600px;">
  181.                         <div>
  182.                             <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>
  183.                             <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>
  184.                         </div>
  185.                          <div>
  186.                             <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>
  187.                             <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>
  188.                         </div>
  189.                          <div>
  190.                             <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>
  191.                             <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>
  192.                         </div>
  193.                         <div>
  194.                             <div class='chose-template-input'><input type='radio' name='template'    value='4' <?php echo ($value  == '4' ? 'checked="checked"' : '');?>>  Template 4</div>
  195.                             <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>
  196.                         </div>
  197.                         <div>
  198.                             <div class='chose-template-input'><input type='radio' name='template'    value='5' <?php echo ($value  == '5' ? 'checked="checked"' : '');?>>  Template 5</div>
  199.                             <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>
  200.                         </div>
  201.                         <div>
  202.                             <div class='chose-template-input'><input type='radio' name='template'    value='6' <?php echo ($value  == '6' ? 'checked="checked"' : '');?>>  Template 6</div>
  203.                             <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>
  204.                         </div>
  205.                         <div>
  206.                             <div class='chose-template-input'><input type='radio' name='template'    value='7' <?php echo ($value  == '7' ? 'checked="checked"' : '');?>>  Template 7</div>
  207.                             <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>
  208.                         </div>
  209.                         <div>
  210.                             <div class='chose-template-input'><input type='radio' name='template'    value='8' <?php echo ($value  == '8' ? 'checked="checked"' : '');?>>  Template 8</div>
  211.                             <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>
  212.                         </div>
  213.                         <div>
  214.                             <div class='chose-template-input'><input type='radio' name='template'    value='9' <?php echo ($value  == '9' ? 'checked="checked"' : '');?>>  Template 9</div>
  215.                             <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>
  216.                         </div>
  217.                         <div>
  218.                             <div class='chose-template-input'><input type='radio' name='template'    value='10' <?php echo ($value  == '10' ? 'checked="checked"' : '');?>>  Template 10</div>
  219.                             <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>
  220.                         </div>
  221.                         <div>
  222.                             <div class='chose-template-input'><input type='radio' name='template'    value='11' <?php echo ($value  == '11' ? 'checked="checked"' : '');?>>  Template 10</div>
  223.                             <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>
  224.                         </div>
  225.                         <div>
  226.                             <div class='chose-template-input'><input type='radio' name='template'    value='12' <?php echo ($value  == '12' ? 'checked="checked"' : '');?>>  Template 10</div>
  227.                             <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>
  228.                         </div>
  229.                         <div>
  230.                             <div class='chose-template-input'><input type='radio' name='template'    value='13' <?php echo ($value  == '13' ? 'checked="checked"' : '');?>>  Template 10</div>
  231.                             <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>
  232.                         </div>
  233.                         <div>
  234.                             <div class='chose-template-input'><input type='radio' name='template'    value='14' <?php echo ($value  == '14' ? 'checked="checked"' : '');?>>  Template 10</div>
  235.                             <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>
  236.                         </div>
  237.                         <div>
  238.                             <div class='chose-template-input'><input type='radio' name='template'    value='15' <?php echo ($value  == '15' ? 'checked="checked"' : '');?>>  Template 10</div>
  239.                             <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>
  240.                         </div>
  241.                         <div>
  242.                             <div class='chose-template-input'><input type='radio' name='template'    value='16' <?php echo ($value  == '16' ? 'checked="checked"' : '');?>>  Template 10</div>
  243.                             <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>
  244.                         </div>
  245.                         <div>
  246.                             <div class='chose-template-input'><input type='radio' name='template'    value='17' <?php echo ($value  == '17' ? 'checked="checked"' : '');?>>  Template 10</div>
  247.                             <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>
  248.                         </div>
  249.                         <div>
  250.                             <div class='chose-template-input'><input type='radio' name='template'    value='18' <?php echo ($value  == '18' ? 'checked="checked"' : '');?>>  Template 10</div>
  251.                             <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>
  252.                         </div>
  253.                         <div>
  254.                             <div class='chose-template-input'><input type='radio' name='template'    value='19' <?php echo ($value  == '19' ? 'checked="checked"' : '');?>>  Template 10</div>
  255.                             <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>
  256.                         </div>
  257.                         <div>
  258.                             <div class='chose-template-input'><input type='radio' name='template'    value='20' <?php echo ($value  == '20' ? 'checked="checked"' : '');?>>  Template 10</div>
  259.                             <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>
  260.                         </div>
  261.  
  262.                  
  263.                </div>
  264.                <br/>
  265.                <br/>
  266.                        <input type='submit' name='choose-template' value='submit' style="clear: both;float: left;margin-top: 10px;">
  267.                                              <input type='hidden' name='post_id' value='<?php echo @$_GET['post_id']?>'>
  268.                       </form>  
  269.                            
  270.                    
  271. <?php /*?>                                    
  272. /*$("input:radio[name=template]").change(function() {
  273.             if (this.value == "2") {
  274.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg');
  275.                                             $("img").attr('width', '150');
  276.                                            $("img").attr('hieght', '150');
  277.             } else if (this.value == "3") {
  278.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg');
  279.                                         $("img").attr('width', '150');
  280.                                            $("img").attr('hieght', '150');
  281.                     } else if(this.value == "4") {
  282.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png');
  283.                                            $("img").attr('width', '150');
  284.                                            $("img").attr('hieght', '150');
  285.             } else if (this.value == "5") {
  286.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg');
  287.                                            $("img").attr('width', '150');
  288.                                            $("img").attr('hieght', '150');
  289.             } else if(this.value == "6") {
  290.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg');
  291.                                            $("img").attr('width', '150');
  292.                                            $("img").attr('hieght', '150');
  293.             } else if (this.value == "7") {
  294.                        $("img").attr('src', '<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg');
  295.                                            $("img").attr('width', '150');
  296.                                            $("img").attr('hieght', '150');
  297.             } else if(this.value == "8") {
  298.                        $("img").attr('src', 'android.jpg');
  299.                                            $("img").attr('width', '150');
  300.                                            $("img").attr('hieght', '150');
  301.             } else if (this.value == "9") {
  302.                        $("img").attr('src', 'php.jpg');
  303.                                            $("img").attr('width', '150');
  304.                                            $("img").attr('hieght', '150');
  305.             } else if(this.value == "10") {
  306.                        $("img").attr('src', 'android.jpg');
  307.                                            $("img").attr('width', '150');
  308.                                            $("img").attr('hieght', '150');
  309.             }
  310.            
  311. });
  312. */?>
  313.  
  314.    
  315.                              <?php /*?>   <div style="left: 82px;position: relative; z-index:-999;">
  316.                                                                
  317.                                                                                                                        
  318.                         <?php if($value == '1') {
  319.                                                 ?>
  320.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/10221384-website-template.jpg' width="150" height="150" />
  321.                                                 <?php }elseif($value == '2') {
  322.                                                 ?>
  323.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
  324.                                                 <?php }elseif($value == '3') {
  325.                                                 ?>
  326.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/bootstrap-website-template1.png' width="150" height="150" />
  327.                                                 <?php }elseif($value == '4') {
  328.                                                 ?>
  329.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/free-website-template-IT-World.jpg' width="150" height="150" />
  330.                                                 <?php }elseif($value == '5') {
  331.                                                 ?>
  332.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/recipetemplate.jpg' width="150" height="150" />
  333.                                                 <?php }elseif($value == '6') {
  334.                                                 ?>
  335.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/Sellya-Responsive-OpenCart-Bootstrap-template.jpg' width="150" height="150" />
  336.                                                 <?php }elseif($value == '7') {
  337.                                                 ?>
  338.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/template-front.jpg' width="150" height="150" />
  339.                                                 <?php }elseif($value == '8') {
  340.                                                 ?>
  341.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/templatemo_349_techno.jpg' width="150" height="150" />
  342.                                                 <?php }elseif($value == '9') {
  343.                                                 ?>
  344.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/wedding-template.jpg' width="150" height="150" />
  345.                                                 <?php }elseif($value == '10') {
  346.                                                 ?>
  347.                                 <img src='<?php echo get_template_directory_uri()?>/images/templates/25-phoca-color-joomla-16-template.jpg' width="150" height="150" />
  348.                                                 <?php }
  349.                                                 ?>
  350.                                                
  351.                         </div>                
  352. <?php */?>
  353.  
  354.         </section>
  355.                    
  356.                     <?php woo_post_inside_after(); ?>
  357.  
  358.                 </article><!-- /.post -->
  359.                 <?php woo_post_after(); ?>
  360.                 <div class="fix"></div>
  361.  
  362.             </section><!-- /#main -->
  363.             <?php woo_main_after(); ?>
  364.  
  365.             <?php get_sidebar(); ?>
  366.  
  367.         </div><!-- /#main-sidebar-container -->
  368.  
  369.         <?php get_sidebar( 'alt' ); ?>
  370.  
  371.     </div><!-- /#content -->
  372.     <?php woo_content_after(); ?>
  373.  
  374. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement