Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $memorial_template = get_post_meta( get_the_ID(), 'memorial_template', true );
- $img = get_field('memorial_photo');
- if(!$img){
- $img =$template_uri.'/images/placeholder.png';
- }
- $post_id = get_the_ID();
- $args = array(
- 'post_type' => 'tribute',
- 'meta_key' => 'memorial_id',
- 'meta_value' => (string)$post_id
- );
- // get results
- $the_query = new WP_Query( $args );
- if ( isset( $_POST['html-upload'] ) && !empty( $_FILES ) ) {
- $type = $_FILES['async-upload']['type'];
- if ( preg_match( '#^image#', $type ) || preg_match( '#^audio#', $type ) ) {
- require_once(ABSPATH . 'wp-admin/includes/admin.php');
- $id = media_handle_upload('async-upload', $post_id); //post id of Client Files page
- unset($_FILES);
- if ( is_wp_error($id) ) {
- $errors['upload_error'] = $id;
- $id = false;
- }
- add_post_meta( $id , 'user_gallery', $post_id , true ) || update_post_meta( $id , 'user_gallery', $post_id );
- if (@$errors) {
- echo '<p>'.$errors['upload_error'].'</p>';
- } else {
- wp_redirect( get_permalink($post_id) );
- exit();
- }
- }else{
- echo "<p>Only images are accepted.</p>";
- }
- }
- if ( isset( $_POST['embed-submit']) ) {
- }
- $galargs = array(
- 'post_parent' => $post_id,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'meta_key' => 'user_gallery',
- 'meta_value' => (string)$post_id,
- 'post_status' => 'inherit',
- 'orderby' => 'date',
- 'order' => 'ASC'
- );
- // get results
- $the_galquery = new WP_Query( $galargs );
- $audioargs = array(
- 'post_parent' => $post_id,
- 'post_type' => 'attachment',
- 'post_mime_type' => 'audio',
- 'meta_key' => 'user_gallery',
- 'meta_value' => (string)$post_id,
- 'post_status' => 'inherit',
- 'orderby' => 'date',
- 'order' => 'ASC'
- );
- // get results
- $the_audioquery = new WP_Query( $audioargs );
- $vidargs = array(
- 'post_type' => '_user_video',
- 'meta_key' => 'memorial_id',
- 'meta_value' => (string)$post_id,
- 'post_status' => 'publish'
- );
- // get results
- $the_vidquery = new WP_Query( $vidargs );
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title><?php the_field('first_name'); ?> <?php the_field('last_name'); ?> memorial</title>
- <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
- <link href="<?php echo $template_uri; ?>/css/template<?php echo (empty($memorial_template) ? '1' :$memorial_template)?>.css" rel="stylesheet" type="text/css">
- <link href="<?php echo $template_uri; ?>/css/jquery.fancybox.css" rel="stylesheet" type="text/css">
- <link href="<?php echo $template_uri; ?>/skins/premium-pixels/premium-pixels.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" href="<?php echo $template_uri; ?>/css/flexslider.css" type="text/css">
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jquery.fancybox.js"></script>
- <script src="<?php echo $template_uri; ?>/js/helpers/jquery.fancybox-media.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jquery.fancybox.pack.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jquery.flexslider-min.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jquery.jplayer.min.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jquery.jplayer.inspector.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jplayer.playlist.min.js"></script>
- <script src="<?php echo $template_uri; ?>/js/demo.js"></script>
- </head>
- <body>
- <div id="wrapper">
- <div id="memorialheader">
- <div id="headmenu">
- <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"]') ?>
- </div>
- <div id="frame">
- <div id="headimage">
- <?php
- /*
- * Show selected image
- * Return value = URL
- */
- ?>
- <img src='<?php echo $img ?>' alt="" width='150', height='150'/>
- </div>
- </div>
- <div id="temp_title">
- <h1><p><?php the_field('first_name'); ?>
- <?php the_field('last_name'); ?>
- <br><br>
- <?php $dateOfBirth = DateTime::createFromFormat('Ymd', get_field('Date_of_Birth'));
- $dateOfPassing = DateTime::createFromFormat('Ymd', get_field('date_of_passing'));?>
- <?php echo $dateOfBirth->format('Y'); ?> to <?php echo $dateOfPassing->format('Y'); ?></p>
- </h1><!-- .header-->
- </div>
- </div><!-- <div id="navigation">
- <p>This is the Menu</p>
- </div>-->
- <div id="contentwrapper">
- <div id="contentliquid">
- <div id="content">
- <div class="container">
- <ul class="tabs">
- <li><a href="#tab1">About</a></li>
- <li><a href="#tab2">Their Life</a></li>
- <li><a href="#tab3">Gallery</a></li>
- <li><a href="#tab4">Stories</a></li>
- <li><a href="#tab5">Music</a></li>
- </ul>
- <div class="tab_container">
- <div class="tab_content" id="tab1">
- <h3>About <?php the_field('first_name'); ?>
- <?php the_field('last_name'); ?></h3>
- <?php $dateOfBirth = DateTime::createFromFormat('Ymd', get_field('Date_of_Birth'));
- $dateOfPassing = DateTime::createFromFormat('Ymd', get_field('date_of_passing'));?>
- <br/>
- Born on <?php echo $dateOfBirth->format('d/m/Y'); ?>
- <br/>
- passed on <?php echo $dateOfPassing->format('d/m/Y'); ?>
- <br/>
- <?php the_field('loved_one_details'); ?>
- <p><h2>Memorial Tributes</h2></p>
- <?php if( $the_query->have_posts() ): ?>
- <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div style='background:#fff; margin-bottom:10px;'>
- <div><?php the_time('F jS, Y') ?></div>
- <div><?php the_content(); ?> <br/>from <?php the_author(); ?></div>
- </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
- <?php if ( is_user_logged_in() ): ?>
- <h3>Add tribute</h3>
- <form method='post'>
- <textarea name='copy' rows="4" cols="50"></textarea>
- <input type='hidden' name='post_id' value='<?php echo get_the_ID()?>'/>
- <input type='submit' name='submit_tribute' value='submit'/>
- </form>
- <?php endif ?>
- </div>
- <div class="tab_content" id="tab2">
- <h2>Their Life</h2>
- <p><?php the_field('about_thier_life'); ?></p>
- </div>
- <div class="tab_content" id="tab3">
- <h2>Gallery</h2>
- <?php if(get_field('gallery')):
- $aimages= get_field('gallery');
- ?>
- <?php foreach (get_field('gallery') as $gal ):
- $a[] = array( 'image_url' => '<img width="150" height="150" src="'.$gal['url'].'">' );
- ?>
- <a class="fancybox" rel="gallery1" href="<?php echo $gal['url']?>" title="<?php echo $gal['caption'] ?>"><img src="<?php echo $gal['sizes']['thumbnail']?>" alt="" /></a>
- <?php endforeach ?>
- <?php endif; ?>
- <?php if( $the_galquery->have_posts() ): ?>
- <?php while ( $the_galquery->have_posts() ) : $the_galquery->the_post(); ?>
- <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');
- $a[] = array( 'image_url' => wp_get_attachment_image( get_the_ID(), 'thumbnail'));
- ?></a>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php if ( !(get_field('gallery')) && !($the_galquery->have_posts() ) ):?>
- <p>No Gallery images added</p>
- <?php endif ?>
- <h2 style='clear:both'>Videos</h2>
- <!-- Video loop -->
- <?php if( $the_vidquery->have_posts() ): ?>
- <?php while ( $the_vidquery->have_posts() ) : $the_vidquery->the_post(); ?>
- <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>
- <?php endwhile; ?>
- <?php endif ?>
- <!-- end if -->
- <?php if ( is_user_logged_in() ): ?>
- <form style='clear:both' id="file-form" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
- <p>Add image or mp3</p>
- <p id="async-upload-wrap"><label for="async-upload">upload</label>
- <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
- <p><input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id ?>" />
- <?php wp_nonce_field('client-file-upload'); ?>
- <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" /></p>
- <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
- </form>
- <form style='clear:both' id="embed-form" method="POST" enctype='multipart/form-data'>
- <p>Add video to gallery</p>
- <label for="embed">YouTube / vimeo url:</label>
- <textarea id='embed' name="embed"></textarea>
- <input name='submit_video' type="submit" value="submit" onclick="MakeLinkSafe()" >
- <p>
- <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id ?>" />
- <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" /></p>
- </form>
- <?php endif?>
- </div>
- <div class="tab_content" id="tab4">
- <h2>Stories</h2>
- <p><?php comments_template( '', true ); ?></p>
- </div>
- <div class="tab_content" id="tab5">
- <h2>Audio</h2>
- <script type="text/javascript">
- //<![CDATA[
- $(document).ready(function(){
- new jPlayerPlaylist({
- jPlayer: "#jquery_jplayer_2",
- cssSelectorAncestor: "#jp_container_2"
- }, [
- <?php
- // Default Audio File
- //$mp3daudio = get_post_meta ($post_id);
- $uploads = wp_upload_dir();
- if (get_post_meta ($post_id, 'audio_default')) {
- $mp3daudio = get_post_meta ($post_id,'audio_default');
- $mp3daudio_title = str_replace('.mp3',' ',$mp3daudio[0]);
- echo '{
- title:"'.$mp3daudio_title.'",
- mp3:"'. get_option('siteurl').'/wp-content/uploads/audio/'.$mp3daudio[0].'"
- },';
- }
- ?>
- <?php if( $the_audioquery->have_posts() ): ?>
- <?php while ( $the_audioquery->have_posts() ) : $the_audioquery->the_post(); ?>
- {
- title:"<?php the_title()?>",
- mp3:" <?php echo wp_get_attachment_url( $post->ID ); ?>"
- },
- <?php endwhile; ?>
- <?php endif ?>
- ], {
- playlistOptions: {
- autoPlay:true,
- },
- swfPath: "../js",
- supplied: "mp3",
- wmode: "window",
- smoothPlayBar: true,
- keyEnabled: true,
- autoPlay: true
- });
- // $("#jplayer_inspector_2").jPlayerInspector({jPlayer:$("#jquery_jplayer_2")});
- });
- //]]>
- </script>
- <div id="skin-loader"></div>
- <div id="skin-wrapper" data-skin-name="premium-pixels">
- <div id="jquery_jplayer_2" class="jp-jplayer" style="width:0px; height:0px"></div>
- <div id="jp_container_2" class="jp-audio" style="width:600px;">
- <div class="jp-type-playlist" id="jp-type-playlist">
- <div class="jp-gui jp-interface">
- <ul class="jp-controls">
- <li><a href="javascript:;" class="jp-previous" tabindex="1">previous</a></li>
- <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
- <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
- <li><a href="javascript:;" class="jp-next" tabindex="1">next</a></li>
- <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
- <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
- <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
- <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max volume</a></li>
- </ul>
- <div class="jp-progress">
- <div class="jp-seek-bar">
- <div class="jp-play-bar"></div>
- </div>
- </div>
- <div class="jp-volume-bar">
- <div class="jp-volume-bar-value"></div>
- </div>
- </div>
- <div class="jp-playlist">
- <ul>
- <li></li>
- </ul>
- </div>
- <div class="jp-no-solution">
- <span>Update Required</span>
- 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>.
- </div>
- </div>
- </div>
- <div id="jplayer_inspector_2"></div>
- </div>
- </div>
- </div><br clear="left">
- </div>
- </div>
- </div>
- <div id="rightcolumn1">
- <p>
- <form method="post" action="<?php echo $template_uri; ?>">
- <input type="text" name="mail" value="" placeholder="E-mail">
- <br/><br/>
- <input type="submit" class="subemail" name="iemail" value="Invite"></form>
- <?php
- if (isset($_POST["iemail"]))
- {
- $mail = $_POST['mail'];
- $from = "PUC"; // sender
- $subject = "Invitation";
- $val= widget_text; //desired values to be fetched
- $opt = $wpdb->get_row("SELECT * FROM $wpdb->options WHERE option_name = '$val'");
- $opts=$opt->option_value;
- $array = unserialize($opts);
- $msg = $array[2]['text'];
- mail($mail,$subject,$msg,"From: $from\n");
- }
- ?>
- </p>
- </div>
- <div id="rightcolumn2">
- <!--slider starts-->
- <!-- Start Photo Slider -->
- <?php if ($a){ ?>
- <div id="carousel" class="flexslider">
- <ul class="slides">
- <?php
- foreach ($a as $new_gal_image){ ?>
- <li>
- <?php echo $new_gal_image['image_url']; ?>
- </li>
- <?php }?>
- </ul>
- </div>
- <?php }?>
- <div id="single-gallery1">
- <?php the_post_thumbnail('full'); ?>
- </div>
- <!-- End Photo Slider -->
- </div>
- </div>
- <div id="footer">
- <div id="footerlogo">
- <img height="50" src=
- "<?php echo $template_uri; ?>/images/logo%20(1).png"
- width="160">
- </div>
- <div id="footmenu">
- <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"]') ?>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- // var $f = jQuery.noConflict(true);
- $(window).load(function() {
- // The slider being synced must be initialized first
- $('#carousel').flexslider({
- animation: "slide",
- controlNav: false,
- animationLoop: true,
- slideshow: true,
- itemWidth: 75,
- itemMargin: 5,
- asNavFor: '#slider'
- });
- $('#slider').flexslider({
- animation: "slide",
- controlNav: false,
- animationLoop: false,
- slideshow: false,
- sync: "#carousel"
- });
- });
- </script>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".fancybox").fancybox({
- openEffect : 'none',
- closeEffect : 'none'
- });
- $("a.fancybox-media").click(function() {
- $.fancybox({
- 'padding' : 0,
- 'autoScale' : false,
- 'transitionIn' : 'none',
- 'transitionOut' : 'none',
- 'title' : this.title,
- 'width' : 680,
- 'height' : 495,
- 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
- 'type' : 'swf',
- 'swf' : {
- 'wmode' : 'transparent',
- 'allowfullscreen' : 'true'
- }
- });
- return false;
- });
- //Default Action
- $(".tab_content").hide(); //Hide all content
- $("ul.tabs li:first").addClass("active").show(); //Activate first tab
- $(".tab_content:first").show(); //Show first tab content
- //On Click Event
- $("ul.tabs li").click(function() {
- $("ul.tabs li").removeClass("active"); //Remove any "active" class
- $(this).addClass("active"); //Add "active" class to selected tab
- $(".tab_content").hide(); //Hide all tab content
- var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
- $(activeTab).fadeIn(); //Fade in the active content
- return false;
- });
- });
- function trim(str, chars) {
- return ltrim(rtrim(str, chars), chars);
- }
- function ltrim(str, chars) {
- chars = chars || "\\s";
- return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
- }
- function rtrim(str, chars) {
- chars = chars || "\\s";
- return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
- }
- function MakeLinkSafe(){
- var e = document.getElementById('embed')
- str = trim(e.value);
- if(str.substr(0, 7) == 'http://'){
- e.value = str.substr(7);
- }
- return true;
- }
- function toggleSound(data) {
- var currentClass = data.getAttribute("class");
- if (currentClass == "sound_on") {
- $("#jquery_jplayer_2").jPlayer("mute");
- $("#soundButton").removeClass("sound_on");
- $("#soundButton").addClass("sound_off");
- } else if (currentClass == "sound_off") {
- $("#jquery_jplayer_2").jPlayer("unmute");
- $("#soundButton").removeClass("sound_off");
- $("#soundButton").addClass("sound_on");
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement