Advertisement
jadejd

Untitled

Mar 16th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.00 KB | None | 0 0
  1. <?php $memorial_template = get_post_meta( get_the_ID(), 'memorial_template', true );
  2. $img = get_field('memorial_photo');
  3. if(!$img){
  4.  $img =$template_uri.'/images/placeholder.png';
  5. }
  6.  
  7.  
  8.  
  9.  
  10. $post_id = get_the_ID();
  11. $args = array(
  12.   'post_type' => 'tribute',
  13.   'meta_key' => 'memorial_id',
  14.   'meta_value' => (string)$post_id
  15. );
  16.  
  17. // get results
  18. $the_query = new WP_Query( $args );
  19.  
  20.  
  21. if ( isset( $_POST['html-upload'] ) && !empty( $_FILES ) ) {
  22.  
  23.     $type = $_FILES['async-upload']['type'];
  24.     if ( preg_match( '#^image#', $type ) || preg_match( '#^audio#', $type ) ) {
  25.       require_once(ABSPATH . 'wp-admin/includes/admin.php');
  26.       $id = media_handle_upload('async-upload', $post_id); //post id of Client Files page
  27.       unset($_FILES);
  28.       if ( is_wp_error($id) ) {
  29.           $errors['upload_error'] = $id;
  30.           $id = false;
  31.       }
  32.       add_post_meta(  $id , 'user_gallery', $post_id , true ) || update_post_meta(   $id , 'user_gallery', $post_id  );
  33.       if (@$errors) {
  34.           echo '<p>'.$errors['upload_error'].'</p>';
  35.       } else {
  36.          
  37.           wp_redirect( get_permalink($post_id) );
  38.           exit();
  39.       }
  40.     }else{
  41.       echo "<p>Only images are accepted.</p>";
  42.     }
  43. }
  44.  
  45. if ( isset( $_POST['embed-submit']) ) {
  46.  
  47. }
  48.  
  49. $galargs = array(
  50.   'post_parent' => $post_id,
  51.   'post_type' => 'attachment',
  52.   'post_mime_type' => 'image',  
  53.   'meta_key' => 'user_gallery',
  54.   'meta_value' => (string)$post_id,
  55.   'post_status' => 'inherit',
  56.   'orderby' => 'date',
  57.   'order' => 'ASC'
  58. );
  59.  
  60. // get results
  61. $the_galquery = new WP_Query( $galargs );
  62.  
  63.  
  64. $audioargs = array(
  65.   'post_parent' => $post_id,
  66.   'post_type' => 'attachment',
  67.   'post_mime_type' => 'audio',  
  68.   'meta_key' => 'user_gallery',
  69.   'meta_value' => (string)$post_id,
  70.   'post_status' => 'inherit',
  71.   'orderby' => 'date',
  72.   'order' => 'ASC'
  73. );
  74.  
  75. // get results
  76. $the_audioquery = new WP_Query( $audioargs );
  77.  
  78. $vidargs = array(
  79.   'post_type' => '_user_video',
  80.   'meta_key' => 'memorial_id',
  81.   'meta_value' => (string)$post_id,
  82.   'post_status' => 'publish'
  83. );
  84.  
  85. // get results
  86. $the_vidquery = new WP_Query( $vidargs );
  87.  
  88. ?>
  89. <!DOCTYPE html>
  90.  
  91. <html>
  92. <head>
  93.     <title><?php the_field('first_name'); ?> <?php the_field('last_name'); ?> memorial</title>
  94.     <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  95.     <link href="<?php echo $template_uri; ?>/css/template<?php echo (empty($memorial_template) ? '1' :$memorial_template)?>.css" rel="stylesheet" type="text/css">
  96.       <link href="<?php echo $template_uri; ?>/css/jquery.fancybox.css" rel="stylesheet"    type="text/css">
  97.      <link href="<?php echo $template_uri; ?>/skins/premium-pixels/premium-pixels.css" rel="stylesheet"    type="text/css">
  98.     <link rel="stylesheet" href="<?php echo $template_uri; ?>/css/flexslider.css" type="text/css">
  99.  
  100.       <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  101.       <script src="<?php echo $template_uri; ?>/js/jquery.fancybox.js"></script>
  102.       <script src="<?php echo $template_uri; ?>/js/helpers/jquery.fancybox-media.js"></script>
  103.       <script src="<?php echo $template_uri; ?>/js/jquery.fancybox.pack.js"></script>
  104.  
  105.       <script src="<?php echo $template_uri; ?>/js/jquery.flexslider-min.js"></script>
  106.       <script src="<?php echo $template_uri; ?>/js/jquery.jplayer.min.js"></script>
  107.       <script src="<?php echo $template_uri; ?>/js/jquery.jplayer.inspector.js"></script>
  108.       <script src="<?php echo $template_uri; ?>/js/jplayer.playlist.min.js"></script>
  109.        <script src="<?php echo $template_uri; ?>/js/demo.js"></script>
  110.            
  111.  
  112. </head>
  113.  
  114. <body>
  115.     <div id="wrapper">
  116.         <div id="memorialheader">
  117.              <div id="headmenu">
  118.  
  119.    
  120.             <a href="#" id="soundButton" onClick="toggleSound(this)" class="sound_on">Sound</a> | <a href='../../'>Home</a>|<a href='../../create-memorial/'>Edit Memorial</a>|<?php echo do_shortcode('[wp-modal-login login_text="login" logout_text="logout"]') ?>
  121.  
  122.             </div>
  123.              <div id="frame">
  124.               <div id="headimage">
  125.              <?php
  126.  
  127.               /*
  128.                *  Show selected image
  129.                *  Return value = URL
  130.                */
  131.  
  132.                ?>
  133.                 <img src='<?php echo $img ?>' alt="" width='150', height='150'/>
  134.             </div>
  135.             </div>
  136.            
  137.             <div id="temp_title">
  138.               <h1><p><?php the_field('first_name'); ?>
  139.               <?php the_field('last_name'); ?>
  140.               <br><br>
  141.               <?php $dateOfBirth  = DateTime::createFromFormat('Ymd', get_field('Date_of_Birth'));
  142.                 $dateOfPassing  = DateTime::createFromFormat('Ymd', get_field('date_of_passing'));?>
  143.               <?php echo $dateOfBirth->format('Y'); ?> to <?php echo $dateOfPassing->format('Y'); ?></p>
  144.              
  145.               </h1><!-- .header-->
  146.             </div>        
  147.         </div><!-- <div id="navigation">
  148.             <p>This is the Menu</p>
  149.         </div>-->
  150.  
  151.         <div id="contentwrapper">
  152.             <div id="contentliquid">
  153.                 <div id="content">
  154.                     <div class="container">
  155.                         <ul class="tabs">
  156.                             <li><a href="#tab1">About</a></li>
  157.  
  158.                             <li><a href="#tab2">Their Life</a></li>
  159.  
  160.                             <li><a href="#tab3">Gallery</a></li>
  161.  
  162.                             <li><a href="#tab4">Stories</a></li>
  163.                              
  164.                             <li><a href="#tab5">Music</a></li>
  165.                         </ul>
  166.  
  167.                         <div class="tab_container">
  168.                             <div class="tab_content" id="tab1">
  169.                                 <h3>About <?php the_field('first_name'); ?>
  170.                                 <?php the_field('last_name'); ?></h3>
  171.                                  
  172.                                   <?php $dateOfBirth  = DateTime::createFromFormat('Ymd', get_field('Date_of_Birth'));
  173.                                   $dateOfPassing  = DateTime::createFromFormat('Ymd', get_field('date_of_passing'));?>
  174.                                 <br/>
  175.                                 Born on <?php echo $dateOfBirth->format('d/m/Y'); ?>
  176.                                 <br/>
  177.                                 passed on <?php echo $dateOfPassing->format('d/m/Y'); ?>
  178.                                 <br/>
  179.                             <?php the_field('loved_one_details'); ?>
  180.  
  181.                                    <p><h2>Memorial Tributes</h2></p>
  182.        
  183.                              
  184.                          
  185.                             <?php if( $the_query->have_posts() ): ?>
  186.                      
  187.                               <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
  188.                                 <div style='background:#fff; margin-bottom:10px;'>
  189.                                     <div><?php the_time('F jS, Y') ?></div>
  190.                                     <div><?php the_content(); ?> <br/>from <?php the_author(); ?></div>
  191.                                    
  192.                                  </div>
  193.                               <?php endwhile; ?>
  194.                             <?php endif; ?>
  195.                              
  196.                             <?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>
  197.                            
  198.                          
  199.                           <?php if ( is_user_logged_in() ): ?>
  200.                           <h3>Add tribute</h3>
  201.                              <form method='post'>
  202.                                     <textarea name='copy' rows="4" cols="50"></textarea>
  203.                                     <input type='hidden' name='post_id' value='<?php echo get_the_ID()?>'/>
  204.                                     <input type='submit' name='submit_tribute' value='submit'/>
  205.                                    </form>
  206.                            
  207.                           <?php  endif ?>
  208.                           </div>
  209.                           <div class="tab_content" id="tab2">
  210.                                 <h2>Their Life</h2>
  211.  
  212.                                 <p><?php the_field('about_thier_life'); ?></p>
  213.                             </div>
  214.  
  215.                             <div class="tab_content" id="tab3">
  216.                                  <h2>Gallery</h2>
  217.                            
  218.                             <?php if(get_field('gallery')):
  219.                            
  220.                             $aimages= get_field('gallery');
  221.                              
  222.                        
  223.                            
  224.                              ?>
  225.                                 <?php foreach (get_field('gallery') as $gal ):
  226.                                
  227.                                 $a[] = array( 'image_url' => '<img width="150" height="150" src="'.$gal['url'].'">'   );
  228.                                 ?>
  229.                                     <a class="fancybox" rel="gallery1" href="<?php echo $gal['url']?>" title="<?php echo $gal['caption'] ?>"><img src="<?php  echo $gal['sizes']['thumbnail']?>" alt="" /></a>
  230.                            
  231.                                 <?php endforeach ?>
  232.                             <?php endif; ?>  
  233.                            
  234.                             <?php if( $the_galquery->have_posts() ): ?>
  235.                      
  236.                               <?php while ( $the_galquery->have_posts() ) : $the_galquery->the_post(); ?>
  237.                            
  238.                            
  239.                             <a class="fancybox" rel="gallery1" href="<?php echo wp_get_attachment_url( get_the_ID()); ?>" ><?php echo wp_get_attachment_image( get_the_ID(), 'thumbnail');
  240.                            
  241.                             $a[] = array( 'image_url' => wp_get_attachment_image( get_the_ID(), 'thumbnail'));
  242.                            
  243.                              ?></a>
  244.                            
  245.                               <?php endwhile; ?>
  246.                             <?php endif; ?>
  247.  
  248.                             <?php if ( !(get_field('gallery')) && !($the_galquery->have_posts() ) ):?>
  249.                             <p>No Gallery images added</p>
  250.                           <?php endif ?>
  251.                          
  252. <h2 style='clear:both'>Videos</h2>
  253.                           <!-- Video loop -->
  254.                          
  255.                            <?php if( $the_vidquery->have_posts() ): ?>
  256.                               <?php while ( $the_vidquery->have_posts() ) : $the_vidquery->the_post(); ?>
  257.                              
  258.                                <a class="fancybox-media" rel="gallery1" href="http://<?php echo get_post_meta( get_the_ID(), 'video' , 'true'); ?>" ><img width='150' src="<?php echo get_post_meta( get_the_ID(), 'image_url' , 'true'); ?>"></a>
  259.                               <?php endwhile; ?>
  260.                             <?php endif ?>
  261.                             <!-- end if -->
  262.                              <?php if ( is_user_logged_in() ): ?>
  263.                                 <form  style='clear:both' id="file-form" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
  264.                                   <p>Add image or mp3</p>
  265.                                   <p id="async-upload-wrap"><label for="async-upload">upload</label>
  266.                                   <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
  267.  
  268.                                   <p><input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id ?>" />
  269.                                   <?php wp_nonce_field('client-file-upload'); ?>
  270.                                   <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" /></p>
  271.  
  272.                                   <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
  273.                                 </form>
  274.                                
  275.                                 <form  style='clear:both' id="embed-form"  method="POST" enctype='multipart/form-data'>
  276.                                   <p>Add video to gallery</p>
  277.                                   <label for="embed">YouTube / vimeo url:</label>
  278.                                   <textarea id='embed' name="embed"></textarea>
  279.                                   <input name='submit_video' type="submit" value="submit" onclick="MakeLinkSafe()" >
  280.                                   <p>
  281.                                     <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id ?>" />
  282.                                   <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" /></p>
  283.                                 </form>
  284.                               <?php endif?>
  285.                              
  286.                            
  287.                                    
  288.                            
  289.                            
  290.                             </div>
  291.  
  292.                                      <div class="tab_content" id="tab4">
  293.                                 <h2>Stories</h2>
  294.  
  295.                                 <p><?php comments_template( '', true ); ?></p>
  296.                             </div>
  297.                            
  298.                                     <div class="tab_content" id="tab5">
  299.                                     <h2>Audio</h2>
  300.                                    
  301.                              <script type="text/javascript">
  302.                             //<![CDATA[
  303.                             $(document).ready(function(){
  304.                            
  305.                                 new jPlayerPlaylist({
  306.                                     jPlayer: "#jquery_jplayer_2",
  307.                                     cssSelectorAncestor: "#jp_container_2"
  308.                                 }, [
  309.                                 <?php
  310.                                 // Default Audio File
  311.                                
  312.                                
  313.                                 //$mp3daudio =  get_post_meta ($post_id);
  314.  
  315.                                
  316.                                 $uploads = wp_upload_dir();
  317.                            
  318.                                             if (get_post_meta ($post_id, 'audio_default')) {
  319.                                            
  320.                                                     $mp3daudio =    get_post_meta ($post_id,'audio_default');
  321.                                                     $mp3daudio_title  = str_replace('.mp3',' ',$mp3daudio[0]);
  322.                                                    
  323.                                                    
  324.                                             echo '{
  325.                                        
  326.                                               title:"'.$mp3daudio_title.'",
  327.                                               mp3:"'. get_option('siteurl').'/wp-content/uploads/audio/'.$mp3daudio[0].'"
  328.                                        
  329.                                        
  330.                                             },';
  331.                                             }
  332.  
  333.                                 ?>
  334.                                
  335.                                 <?php if( $the_audioquery->have_posts() ): ?>
  336.                                 <?php while ( $the_audioquery->have_posts() ) : $the_audioquery->the_post(); ?>
  337.                                
  338.                                
  339.                                 {
  340.                            
  341.                                   title:"<?php the_title()?>",
  342.                                   mp3:" <?php echo wp_get_attachment_url( $post->ID ); ?>"
  343.                            
  344.                            
  345.                                 },
  346.                                 <?php endwhile; ?>
  347.                                 <?php endif ?>
  348.                                 ], {
  349.                                 playlistOptions: {
  350.                                 autoPlay:true,
  351.                                 },
  352.                            
  353.                                     swfPath: "../js",
  354.                                     supplied: "mp3",
  355.                                     wmode: "window",
  356.                                     smoothPlayBar: true,
  357.                                     keyEnabled: true,      
  358.                                     autoPlay: true
  359.                                
  360.                                 });
  361.                            
  362.                                 // $("#jplayer_inspector_2").jPlayerInspector({jPlayer:$("#jquery_jplayer_2")});
  363.                             });
  364.                             //]]>
  365.                             </script>
  366.  
  367.  
  368.                                
  369.            
  370.                                 <div id="skin-loader"></div>
  371.  
  372.                                 <div id="skin-wrapper" data-skin-name="premium-pixels">
  373.  
  374.                                     <div id="jquery_jplayer_2" class="jp-jplayer" style="width:0px; height:0px"></div>
  375.                                    
  376.                                     <div id="jp_container_2" class="jp-audio" style="width:600px;">
  377.                                    
  378.                                                 <div class="jp-type-playlist" id="jp-type-playlist">
  379.                                                
  380.                                                     <div class="jp-gui jp-interface">
  381.                                                         <ul class="jp-controls">
  382.                                                             <li><a href="javascript:;" class="jp-previous" tabindex="1">previous</a></li>
  383.                                                             <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
  384.                                                             <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
  385.                                                             <li><a href="javascript:;" class="jp-next" tabindex="1">next</a></li>
  386.                                                             <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
  387.                                                              <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
  388.                                                             <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
  389.                                                             <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
  390.                                                         </ul>
  391.                                                         <div class="jp-progress">
  392.                                                             <div class="jp-seek-bar">
  393.                                                                 <div class="jp-play-bar"></div>
  394.                                                            </div>
  395.                                                       </div>
  396.                                                         <div class="jp-volume-bar">
  397.                                                             <div class="jp-volume-bar-value"></div>
  398.                                                         </div>
  399.                                                     </div>
  400.                                                    
  401.                                                     <div class="jp-playlist">
  402.                                                         <ul>
  403.                                                             <li></li>
  404.                                                         </ul>
  405.                                                     </div>
  406.                                                    
  407.                                                     <div class="jp-no-solution">
  408.                                                         <span>Update Required</span>
  409.                                                         To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
  410.                                                     </div>
  411.                                                    
  412.                                                 </div>
  413.                                      </div>
  414.                                    
  415.                                      <div id="jplayer_inspector_2"></div>
  416.                              </div>                                    
  417.                                
  418.                         </div>
  419.                            
  420.                            
  421.                            
  422.                         </div><br clear="left">
  423.                     </div>
  424.                 </div>
  425.             </div>
  426.            
  427.            
  428.    
  429.             <div id="rightcolumn1">
  430.              
  431.              <p>
  432.  
  433.                  <form method="post" action="<?php echo $template_uri; ?>">
  434.              <input type="text" name="mail" value="" placeholder="E-mail">
  435.              <br/><br/>
  436.              <input type="submit" class="subemail" name="iemail" value="Invite"></form>
  437.              <?php
  438.    if (isset($_POST["iemail"]))
  439.   {
  440.     $mail = $_POST['mail'];
  441.     $from = "PUC"; // sender
  442.     $subject = "Invitation";
  443.     $val= widget_text; //desired values to be fetched
  444.     $opt = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = '$val'");
  445.     $opts=$opt->option_value;
  446.     $array = unserialize($opts);
  447.     $msg = $array[2]['text'];
  448.     mail($mail,$subject,$msg,"From: $from\n");
  449.  
  450.   }
  451.  
  452.  
  453.        ?>
  454.              </p>
  455.                        
  456.         </div>
  457. <div id="rightcolumn2">
  458.  <!--slider starts-->
  459.              <!-- Start Photo Slider -->
  460.  
  461. <?php if ($a){ ?>
  462. <div id="carousel" class="flexslider">
  463.   <ul class="slides">
  464.    
  465.     <?php  
  466.    
  467.    
  468.     foreach ($a as $new_gal_image){ ?>
  469.  
  470.       <li>
  471.                    
  472.       <?php     echo $new_gal_image['image_url']; ?>
  473.  
  474.      </li>
  475.     <?php   }?>
  476.    
  477.      
  478.   </ul>
  479. </div>
  480. <?php }?>
  481.  
  482.  
  483.  
  484. <div id="single-gallery1">
  485.   <?php the_post_thumbnail('full'); ?>
  486. </div>
  487.  
  488. <!-- End Photo Slider -->
  489.  
  490.              </div>
  491.  
  492.  </div>
  493.         <div id="footer">
  494.             <div id="footerlogo">
  495.             <img height="50" src=
  496.             "<?php echo $template_uri; ?>/images/logo%20(1).png"
  497.             width="160">
  498.             </div>
  499.             <div id="footmenu">
  500.             <a href='../../'>Home</a>|<a href='../../create-memorial/'>Edit Memorial</a><a href='../../account-4/'>Edit account</a>|<?php echo do_shortcode('[wp-modal-login login_text="login" logout_text="logout"]') ?>
  501.             </div>
  502.         </div>
  503.     </div>
  504.  
  505.  
  506. <script type="text/javascript">
  507.   // var $f = jQuery.noConflict(true);
  508.     $(window).load(function() {
  509.       // The slider being synced must be initialized first
  510.       $('#carousel').flexslider({
  511.       animation: "slide",
  512.       controlNav: false,
  513.       animationLoop: true,
  514.       slideshow: true,
  515.       itemWidth: 75,
  516.       itemMargin: 5,
  517.       asNavFor: '#slider'
  518.       });
  519.        
  520.       $('#slider').flexslider({
  521.       animation: "slide",
  522.       controlNav: false,
  523.       animationLoop: false,
  524.       slideshow: false,
  525.       sync: "#carousel"
  526.       });
  527.     });
  528. </script>
  529.  
  530.  
  531.  
  532.  
  533.     <script type="text/javascript">
  534.  
  535.     $(document).ready(function() {
  536.  
  537.     $(".fancybox").fancybox({
  538.         openEffect  : 'none',
  539.         closeEffect : 'none'
  540.     });
  541.  
  542.  
  543.    
  544.  $("a.fancybox-media").click(function() {
  545.     $.fancybox({
  546.             'padding'       : 0,
  547.             'autoScale'     : false,
  548.             'transitionIn'  : 'none',
  549.             'transitionOut' : 'none',
  550.             'title'         : this.title,
  551.             'width'     : 680,
  552.             'height'        : 495,
  553.             'href'          : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
  554.             'type'          : 'swf',
  555.             'swf'           : {
  556.                  'wmode'        : 'transparent',
  557.                 'allowfullscreen'   : 'true'
  558.             }
  559.         });
  560.  
  561.     return false;
  562. });
  563.  
  564.  
  565.     //Default Action
  566.     $(".tab_content").hide(); //Hide all content
  567.     $("ul.tabs li:first").addClass("active").show(); //Activate first tab
  568.     $(".tab_content:first").show(); //Show first tab content
  569.      
  570.     //On Click Event
  571.     $("ul.tabs li").click(function() {
  572.         $("ul.tabs li").removeClass("active"); //Remove any "active" class
  573.         $(this).addClass("active"); //Add "active" class to selected tab
  574.         $(".tab_content").hide(); //Hide all tab content
  575.         var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  576.         $(activeTab).fadeIn(); //Fade in the active content
  577.         return false;
  578.     });
  579.  
  580.  
  581.     });
  582.  
  583.     function trim(str, chars) {  
  584.     return ltrim(rtrim(str, chars), chars);  
  585. }  
  586.  
  587. function ltrim(str, chars) {  
  588.     chars = chars || "\\s";  
  589.     return str.replace(new RegExp("^[" + chars + "]+", "g"), "");  
  590. }  
  591.  
  592. function rtrim(str, chars) {  
  593.     chars = chars || "\\s";  
  594.     return str.replace(new RegExp("[" + chars + "]+$", "g"), "");  
  595. }  
  596.  
  597. function MakeLinkSafe(){  
  598.     var e = document.getElementById('embed')  
  599.     str = trim(e.value);  
  600.     if(str.substr(0, 7) == 'http://'){  
  601.         e.value = str.substr(7);  
  602.     }  
  603.     return true;  
  604. }  
  605.  
  606.  
  607.         function toggleSound(data) {
  608.             var currentClass = data.getAttribute("class");
  609.  
  610.             if (currentClass == "sound_on") {
  611.                 $("#jquery_jplayer_2").jPlayer("mute");
  612.                 $("#soundButton").removeClass("sound_on");
  613.                 $("#soundButton").addClass("sound_off");
  614.             } else if (currentClass == "sound_off") {
  615.                 $("#jquery_jplayer_2").jPlayer("unmute");
  616.                 $("#soundButton").removeClass("sound_off");
  617.                 $("#soundButton").addClass("sound_on");
  618.             }
  619.         }
  620.  
  621.     </script>
  622.  
  623.  
  624.  
  625. </body>
  626. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement