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; ?>/css/jplayer.blue.monday.css" rel="stylesheet"
- type="text/css">
- </head>
- <body>
- <div id="wrapper">
- <div id="memorialheader">
- <div id="headmenu">
- <a href='../../'>Home</a>|<a href='../../create-memorial/'>Edit Memorial</a>|<?php echo do_shortcode('[wp-modal-login login_text="login" logout_text="logout"]') ?>
- <!--audio--><div id="audioplayer">
- <div id="jquery_jplayer_1" class="jp-jplayer"></div>
- <div id="jp_container_1" class="jp-audio" style='float:right'>
- <div class="jp-type-single">
- <div class="jp-gui jp-interface">
- <ul class="jp-controls">
- <!-- comment out any of the following <li>s to remove these buttons -->
- <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-stop" tabindex="1">stop</a></li>
- <li><a href="javascript:;" class="jp-next" tabindex="1">next</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>
- <!-- you can comment out any of the following <div>s too -->
- <div class="jp-progress">
- <div class="jp-seek-bar">
- <div class="jp-play-bar"></div>
- </div>
- </div>
- </div>
- <div class="jp-title"></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><!--audio-->
- </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>
- </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')):?>
- <?php foreach (get_field('gallery') as $gal ):?>
- <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>
- <?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="<?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><br clear="left">
- </div>
- </div>
- </div>
- <div id="rightcolumn">
- <p>Invite your family and friends
- to Visit This Memorial</p>
- invite_friends()
- <p>Recive email and notification
- when this memorial update</p>
- <!--slider starts-->
- <!-- Start Photo Slider -->
- <?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>
- <?php endwhile; ?>
- <?php endif; ?>
- <div id="slider" class="flexslider">
- <ul class="slides">
- <?php foreach( $gallery_images as $gallery_image ): ?>
- <li>
- <img src="<?php echo $gallery1_image['url']; ?>" alt="<?php echo $gallery1_image['alt']; ?>" />
- </li>
- <?php endforeach; ?>
- </ul>
- </div>
- <?php
- /*
- * The following code creates the thumbnail navigation
- */
- ?>
- <div id="carousel" class="flexslider">
- <ul class="slides">
- <?php foreach( $gallery_images as $gallery_image ): ?>
- <li>
- <img src="<?php echo $gallery1_image['sizes']['thumbnail']; ?>" alt="<?php echo $gallery1_image['alt']; ?>" />
- </li>
- <?php endforeach; ?>
- </ul>
- </div>
- <div id="single-gallery1-image">
- <?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 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.jplayer.min.js"></script>
- <script src="<?php echo $template_uri; ?>/js/jplayer.playlist.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".fancybox").fancybox({
- openEffect : 'none',
- closeEffect : 'none'
- });
- $('.fancybox-media').fancybox({
- openEffect : 'none',
- closeEffect : 'none',
- helpers : {
- media : {}
- }
- });
- //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;
- }
- </script>
- <script>
- playlist = new jPlayerPlaylist({
- jPlayer: "#jquery_jplayer_1",
- cssSelectorAncestor: "#jp_container_1"
- },
- {
- swfPath: "../js",
- supplied: "webmv, ogv, m4v",
- smoothPlayBar: true,
- keyEnabled: true
- });
- <?php if( $the_audioquery->have_posts() ): ?>
- <?php while ( $the_audioquery->have_posts() ) : $the_audioquery->the_post(); ?>
- playlist.add({
- title:"<?php the_title()?>",
- mp3:" <?php echo wp_get_attachment_url( $post->ID ); ?>"
- });
- <?php endwhile; ?>
- <?php endif ?>
- $("#jquery_jplayer_1").jPlayer("play");
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement