Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- if (!is_user_logged_in()) {
- wp_redirect( 'http://www.lovedforever.org.uk/');
- exit;
- } */
- /* varibles used in facbook shaRING */
- $t = 'Visit memorial of' . get_field('first_name')." ".get_field('last_name');
- $Path=$_SERVER['REQUEST_URI'];
- $URI='http://www.lovedforever.org.uk'.$Path;
- /****************************/
- $current_memorial_id = get_the_ID();
- $memorial_template = get_post_meta( get_the_ID(), 'memorial_template', true );
- $pre_img = get_field('memorial_photo');
- $img = $pre_img["sizes"]["thumbnail"];
- //print_r($pre_img);
- if(!$img){
- $img =$template_uri.'/images/placeholder.png';
- }
- $user_ID = get_current_user_id();
- $deceased_name = get_field('first_name') . " " . get_field('last_name');
- $deceased_memorial_link = get_permalink();
- $deceased_comment_args = array(
- 'post_id' => get_the_ID(), // use post_id, not post_ID
- );
- $deceased_comments = get_comments($deceased_comment_args);
- $post_id = get_the_ID();
- $posttypeattribute=$post_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/memgolbal.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">
- <link rel="stylesheet" id="wpml-styles-css" href="http://www.lovedforever.org.uk/wp-content/plugins/wp-modal-login/css/wp-modal-login.css?ver=2.0.6" type="text/css" media="screen">
- <link rel="stylesheet" id="wpml-default-theme-css" href="http://www.lovedforever.org.uk/wp-content/plugins/wp-modal-login/css/default.css?ver=2.0.6" type="text/css" media="screen">
- <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>
- <style>
- img.ssba{ width:30px !important; margin:5px !important}
- </style>
- <meta property="og:image" content="<?php echo $pre_img["url"]; ?>"/>
- </head>
- <body>
- <div id="fb-root"></div>
- <script>
- window.fbAsyncInit = function() {
- FB.init({appId: '756111577742257', status: true, cookie: true,
- xfbml: true});
- };
- (function() {
- var e = document.createElement('script'); e.async = true;
- e.src = document.location.protocol +
- '//connect.facebook.net/en_US/all.js';
- document.getElementById('fb-root').appendChild(e);
- }());
- </script>
- <script type="text/javascript">
- // jQuery(document).ready(function(){
- // jQuery('#shareb').click(function(e){
- // e.preventDefault();
- // FB.ui(
- // {
- // method: 'feed',
- // name: 'This is the content of the "name" field.',
- // link: ' http://www.lovedforever.org.uk/',
- // picture: 'http://www.lovedforever.org.uk/external-xfbml/share-image.gif',
- // caption: 'This is the content of the "caption" field.',
- // description: 'This is the content of the "description" field, below the caption.',
- // message: ''
- // });
- // });
- // });
- </script>
- <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">Tributes</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>
- <li><a href="#tab6">Memorial Flowers</a></li>
- </ul>
- <div class="tab_container">
- <div class="tab_content" id="tab1">
- <h2><?php the_field('first_name'); ?> <?php the_field('last_name'); ?></h2>
- <br>
- <?php $dateOfBirth = DateTime::createFromFormat('Ymd', get_field('Date_of_Birth'));
- $dateOfPassing = DateTime::createFromFormat('Ymd', get_field('date_of_passing'));?>
- <br/>
- <table style="width:300px">
- <tr>
- <td> Born</td>
- <td><?php echo $dateOfBirth->format('d/m/Y'); ?></td>
- </tr>
- <tr>
- <td>Passed Away</td>
- <td><?php echo $dateOfPassing->format('d/m/Y'); ?></td>
- </tr>
- </table>
- <div id="loveddets">
- <?php the_field('Leave_a_brief_tribute'); ?>
- </div>
- <br>
- <br>
- <div id="tribtext">
- <p><h2>Memorial Tributes</h2></p>
- <p>Leave Your Own Personal Tribute</p>
- <br>
- <?php if ( is_user_logged_in() ): ?>
- <form method='post'>
- <textarea name='copy' rows="12" style="width:95%; height: 70px;" ></textarea>
- <input type='hidden' name='post_id' value='<?php echo $posttypeattribute;?>'/>
- <input type='submit' name='submit_tribute' value='Add Tribute' class="" />
- </form>
- <?php else: ?>
- <form method='post' action="http://www.lovedforever.org.uk/register-your-self" >
- <textarea name='copy' rows="12" style="width:95%; height: 70px;" ></textarea>
- <input type='hidden' name='post_id' value='<?php echo $posttypeattribute;?>'/>
- <input type='hidden' name='targeturi' value='<?php echo $targeturi;?>'/>
- <input type='submit' name='submit' value='Add Tribute' class="" />
- </form>
- <?php endif ?>
- <br>
- <?php if( $the_query->have_posts() ): ?>
- <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
- <div style='background:rgba(250, 250, 250, 0.5); margin-bottom:10px; padding:20px; border-radius: 10px; '>
- <div> <img height="70" width="70" src="http://www.lovedforever.org.uk/wp-content/uploads/2014/03/candel3.png"><?php the_time('F jS, Y') ?></div>
- <div><?php the_content(); ?> <br/>from <?php the_author(); ?>
- <?php $sharecontent=get_the_content($post_id);?>
- <div style="height:40px ; margin:5px; padding:0px;" >
- <span style="float:right; overflow:hidden !important" >
- <?php //echo do_shortcode('[ssba]');?>
- <div class="ssba">
- <a class="ssba_twitter_share" href="http://twitter.com/share?url=http://www.lovedforever.org.uk/memorial/<?php echo get_the_title($post_id) ?>/&text=www.lovedforever.org.uk+%7C+www.lovedforever.org.uk/memorial/<?php echo get_the_title($post_id) ?>+<?php echo str_replace('</p>','',str_replace('<p>','',get_the_content())); ?>" target="_blank">
- <img title="Twitter" class="ssba" alt="Tweet about this on Twitter" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/twitter.png">
- </a>
- <a class="ssba_facebook_share" onclick="openFbPopUp('','<?php echo $URI; ?>','<?php echo $pre_img[url];?>','In memory of <?php echo get_the_title($post_id).' by '. get_the_author(); ?>','<?php echo strip_tags($sharecontent); ?>')" href="javascript:void(0)">
- <img title="Facebook" class="ssba" alt="Share on Facebook" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/facebook.png">
- </a>
- <a class="ssba_pinterest_share" href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());">
- <img title="Pinterest" class="ssba" alt="Pin on Pinterest" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/pinterest.png">
- </a>
- </div>
- <!-- <a target="_blank"
- href="https://www.facebook.com/dialog/feed?app_id=1407197776212391&display=popup&caption=In memory of <?php echo get_the_title($post_id).' by '. the_author(); ?>&link=http://www.lovedforever.org.uk/memorial/<?php echo get_the_title($post_id);?>&redirect_uri=http://www.lovedforever.org.uk/memorial/<?php echo get_the_title($post_id);?>&picture=<?php echo $pre_img[url];?>&description=<?php the_content(); ?>">
- <img src="<?Php echo $img;?>"/>
- </a>-->
- <?php // do_action( 'addthis_widget' ); ?>
- </span>
- <?php $summ = get_the_content();
- /*echo $t;
- echo "<br/> uri $URI";
- echo "<br/> img $image";
- echo "<br/> summ $summ";*/
- //$title=urlencode('Title of Your iFrame Tab');
- //$url=urlencode('http://www.facebook.com/wordpressdesign');
- //$summary=urlencode('Custom message that summarizes what your tab is about, or just a simple message to tell people to check out your tab.');
- //$image=urlencode('http://www.yourdomain.com/images/share-thumbnail.jpg');
- $title=urlencode( $t);
- $url=urlencode($URI);
- $summary="test" ;//urlencode($summ);
- $image=urlencode($img);
- $targeturi=urlencode($URI);
- ?>
- <?php /****
- <!--<a target="_blank"
- href="http://www.facebook.com/sharer/sharer.php?s=100&p[url]=<?php echo urlencode($URI); ?>&p[images][0]=<?php echo $img; ?>&p[title]=Creating Custom share buttons: Facebook, Twitter, Google+&p[summary]=<?php echo "visit this link to give tribute";?>>
- <img src="<?Php echo $img;?>"/>fb
- </a>-->
- */?>
- </div>
- </div>
- </div>
- <div id="#shareb"> <p></p> </div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
- </div>
- </div>
- <div class="tab_content" id="tab2" >
- <div id="life" >
- <h2>Their Life</h2>
- <p><?php the_field('about_thier_life'); ?></p>
- </div>
- </div>
- <div class="tab_content" id="tab3">
- <h2>Gallery</h2>
- <?php foreach (get_field('gallery') as $gallery_image) : ?>
- <?php $b[] = $gallery_image["sizes"]["thumbnail"]; ?>
- <a class="fancybox" rel="gallery1" href="<?php echo $gallery_image["sizes"]["medium"]; ?>" >
- <img width="150" height="150" class="attachment-thumbnail" src="<?php echo $gallery_image["sizes"]["thumbnail"]; ?>">
- </a>
- <?php endforeach; ?>
- <?php if( $the_galquery->have_posts() ): ?>
- <?php while ( $the_galquery->have_posts() ) : $the_galquery->the_post(); ?>
- <?php $pre_b = wp_get_attachment_image_src( get_the_ID(), 'thumbnail'); ?>
- <?php $b[] = $pre_b[0]; ?>
- <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 // var_dump($b); ?>
- <?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 (get_field('visitors_allowed_to_add_content') && ( is_user_logged_in() ))
- {
- echo '
- <br><br><br><br><br><br><br><br>
- <p><h2>Add to Gallery</h2></P>
- <form style="clear:both" id="file-form" enctype="multipart/form-data" action="'.$_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="'.$post_id.'" />
- '.wp_nonce_field('client-file-upload').'
- <input type="hidden" name="redirect_to" value="'.$_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>
- <p><label for="embed">YouTube / vimeo url:</label></p>
- <p><textarea id="embed" name="embed"></textarea></p>
- <p><input name="submit_video" type="submit" value="submit" onclick="MakeLinkSafe()" ><p>
- <p>
- <input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
- <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
- </form>';
- }
- ?>
- </div>
- <div class="tab_content" id="tab4">
- <h2>Stories</h2>
- <?php // comments_template(); ?>
- <pre>
- <?php // var_dump($deceased_comments); ?>
- </pre>
- <?php if(get_field('visitors_allowed_to_add_content') )
- {
- echo '
- <p>
- <form action="http://www.lovedforever.org.uk/wp-comments-post.php" method="post" id="commentform" class="comment-form">
- <p class="comment-form-comment">
- <label class="hide" for="comment">Add Story:</label><br><br>
- <textarea id="comment" name="comment" cols="50" rows="10" aria-required="true"></textarea>
- </p>
- <p class="form-submit">
- <input name="submit" type="submit" id="submit" value="Submit">
- <input type="hidden" name="comment_post_ID" value="<?php echo $post_id; ?>" id="comment_post_ID">
- <input type="hidden" name="comment_parent" id="comment_parent" value="0">
- </p>
- </form>
- </p>
- ';
- }?>
- <ul>
- <?php foreach($deceased_comments as $new_comment) : ?>
- <li style="height: auto; overflow: hidden; margin-bottom: 20px">
- <div class="comment-container" Style="background:rgba(250, 250, 250, 0.5); padding:20px; border-radius: 10px; ">
- <!--<div class="avatar"><?php echo get_avatar( $new_comment->user_id, 50 ); ?></div>-->
- <div style="font-size:11px">
- <span class="name">Written by: <?php echo($new_comment->comment_author); ?></span>
- <span class="date">on <?php echo date("jS F, Y", strtotime( $new_comment->comment_date_gmt )); ?> at <?php echo date("h:i a", strtotime( $new_comment->comment_date_gmt )); ?></span>
- <?php if ($user_ID == $new_comment->user_id && $new_comment->user_id != 0 ) : ?>
- <!--<span class="edit"><a class="comment-edit-link" href="<?php bloginfo('url'); ?>/wp-admin/comment.php?action=editcomment&c=<?php echo($new_comment->comment_ID); ?>">Edit your story</a></span>-->
- <?php endif; ?>
- </div>
- <p><?php echo($new_comment->comment_content); ?></p>
- </div>
- </li>
- <?php endforeach; ?>
- </ul>
- </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 class="tab_content" id="tab6">
- <p>
- <h2>Memorial Flowers</h2>
- </p>
- <p>Memorial flowers gives you the option to buy and send real flowers via our partners Interflora/ FlowerAid or purchase virtual flowers.<br>
- When sending real flowers 10% of your spend will go to your nominated charity at no extra cost to yourself.</p>
- <p>When choosing virtual flowers you also have the option of donating to a charity of your chose and the flowers you choose will appear our memorial garden!</p>
- <p>To view : <a href="http://www.lovedforever.org.uk/memorial-garden/" target="_blank">Memorial Garden</a></p>
- <p>To choose or send flower go to : <a href="http://www.lovedforever.org.uk/product/donate-flowers/" target="_blank"> Gift Shop</a></p>
- <?php
- global $woocommerce;
- $flower_url = plugins_url();
- $flower_url = $flower_url .'/nm-woocommerce-personalized-product-v3.6/images/flowers';
- $args = array('post_type' => 'shop_order',
- 'post_status' => 'publish',
- 'posts_per_page' => -1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'shop_order_status',
- 'field' => 'slug',
- 'terms' => array('processing')
- // 'terms' => array('completed')
- )
- )
- );
- $loop = new WP_Query( $args );
- while ( $loop->have_posts() ) :
- $loop->the_post();
- $order_id = $loop->post->ID;
- $order = new WC_Order($order_id);
- $items = $order -> get_items();
- $name = $order -> billing_first_name . " " . $order -> billing_last_name ;
- $flower = "";
- $country = "";
- $charity_home = "";
- $in_memory_of = "";
- $tribute = "";
- $postid = 0;
- foreach ( $items as $key => $item ){
- $flower = $item['item_meta']['Select flowers'][0];
- $country = $item['item_meta']['Select Country'][0];
- $in_memory_of = $item['item_meta']['In memory of'][0];
- $tribute = $item['item_meta']['Your Tribute'][0];
- $charity_home = $item['item_meta']['Select Charity Home'][0];
- $donation_amount = $item['item_meta']['donation-amount'][0];
- $postid = $in_memory_of;
- if ( $charity_home == 'others' )
- {
- $charity_home = $item['item_meta']['specify any other charity home (if any)'][0];
- }
- else
- {
- $charity_home = $item['item_meta']['Select Charity Home'][0];
- }
- if ( $debug)
- {
- echo '<pre>';
- print_r($item);
- echo '</pre>';
- }
- }
- // echo "flower is $flower";
- switch($flower ){
- case "Beautiful Pink":
- $img_flower = $flower_url. "/beautifulpink.png";
- break;
- case "BlueSky Sunflower":
- $img_flower = $flower_url. "/BlueSkySunflower.png";
- break;
- case "Bunch of PinkRose":
- $img_flower = $flower_url. "/BunchofPinkRose.png";
- break;
- case "Buttercups and Poppies":
- $img_flower = $flower_url. "/ButtercupsandPoppies.png";
- break;
- case "Heart of the Rose":
- $img_flower = $flower_url. "/HeartoftheRose.png";
- break;
- case "Little Blues":
- $img_flower = $flower_url. "/littleBlues.png";
- break;
- case "Pale Pink Roses":
- $img_flower = $flower_url. "/PalePinkRoses.png";
- break;
- case "Pink and White Rose":
- $img_flower = $flower_url. "/PinkandWhiteRose.png";
- break;
- case "Pink Buttercups":
- $img_flower = $flower_url. "/PinkButtercups.png";
- break;
- case "Pink Rose":
- $img_flower = $flower_url. "/PinkRose.png";
- break;
- case "Pink Roses":
- $img_flower = $flower_url. "/PinkRoses.png";
- break;
- case "Poopy":
- $img_flower = $flower_url. "/poopy.png";
- break;
- case "Purple Lights":
- $img_flower = $flower_url. "/PurpleLights.png";
- break;
- case "Rainbow":
- $img_flower = $flower_url. "/Rainbow.png";
- break;
- case "Red Roses":
- $img_flower = $flower_url. "/redroses.jpg";
- break;
- case "Rose Heart":
- $img_flower = $flower_url. "/roseheart.jpg";
- break;
- case "Single Pink":
- $img_flower = $flower_url. "/SinglePink.png";
- break;
- case "Single Red Tulips":
- $img_flower = $flower_url. "/SingleRedTulips.png";
- break;
- case "Sunflower Horizon":
- $img_flower = $flower_url. "/SunflowerHorizon.png";
- break;
- case "Twin Rose":
- $img_flower = $flower_url. "/TwinRose.png";
- break;
- case "White Lilies":
- $img_flower = $flower_url. "/WhiteLilies.png";
- break;
- case "white Orchid":
- $img_flower = $flower_url. "/whiteOrchid.png";
- break;
- case "White Rose":
- $img_flower = $flower_url. "/WhiteRose.png";
- break;
- case "White Trumphets":
- $img_flower = $flower_url. "/WhiteTrumphets.png";
- break;
- case "White Lilies":
- $img_flower = $flower_url. "/whitelilies.jpg";
- break;
- case "Yellow Red Tulips":
- $img_flower = $flower_url. "/YellowRedTulips.png";
- break;
- case "":
- $img_flower = $flower_url. "/";
- break;
- default:
- $img_flower = $flower_url."/default.jpg";
- break;
- }
- $template_uri = get_template_directory_uri();
- /*
- query_posts( array( 'post_type' => 'memorial' ,'p' => $postid ) );
- if ( have_posts()):
- while ( have_posts() ) : the_post();
- $pre_img = get_field('memorial_photo');
- $img = $pre_img["sizes"]["thumbnail"];
- if(!$img){ $img =$template_uri.'-child/memorials/images/placeholder.png';}
- endwhile; // end of the loop.
- endif ;*/
- if ( $in_memory_of == $current_memorial_id ) :
- ?>
- <div id="flower-box-memorial" >
- <div class="pic-memorial">
- <!--<h3> <?php echo get_the_title($postid); ?> </h3>-->
- <img src="<?php echo $img_flower; ?>" width="150" height="150" /><?php // echo "888".$img; ?>
- <?php// echo do_shortcode('[ssba]');?>
- </div><!-- pic ends -->
- <div class="description-memorial">
- <h5>Tribute</h5>
- <p><?php echo $tribute ?></p>
- <hr/>
- <p>£<?php echo $donation_amount ?> doneted by <?php echo $name ?> to <?php echo $charity_home ?>,
- <?php echo $country ?> in memory of <?php echo get_the_title($postid); ?>
- </p>
- <?php $share_content = "£".$donation_amount." donated by ".$name." to ". $charity_home ." ". $country ." in memory of ".get_the_title($postid); ?>
- <div class="ssba">
- <a class="ssba_twitter_share" href="http://twitter.com/share?url=http://www.lovedforever.org.uk/memorial/<?php echo get_the_title($post_id) ?>/&text=<?php echo $URI; ?>+%7C+<?php echo $share_content; ?>" target="_blank">
- <img title="Twitter" class="ssba" alt="Tweet about this on Twitter" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/twitter.png">
- </a>
- <a class="ssba_facebook_share" onclick='openFbPopUp("","<?php echo $URI; ?>","<?php echo $img_flower;?>","In memory of <?php echo get_the_title($post_id)." by ". get_the_author(); ?>","<?php echo $share_content; ?>");' href="javascript:void(0)">
- <img title="Facebook" class="ssba" alt="Share on Facebook" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/facebook.png">
- </a>
- <a class="ssba_pinterest_share" href="javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());">
- <img title="Pinterest" class="ssba" alt="Pin on Pinterest" src="http://www.lovedforever.org.uk/wp-content/plugins/simple-share-buttons-adder/buttons/simple/pinterest.png">
- </a>
- </div>
- <!--<?php echo $flower ?>-->
- </div><!-- discription ends -->
- </div><!-- flower-box ends -->
- <?php endif;
- ?>
- <?php endwhile; ?>
- </div>
- </div><br clear="left">
- </div>
- </div>
- </div>
- <div id="rightcolumn1">
- <h4>Invite <br>Friends and Family</h4>
- <?php
- if (isset($_POST["iemail"])) {
- if (filter_var($_POST["mail"], FILTER_VALIDATE_EMAIL)) {
- $headers = array(
- 'Content-type: text/html',
- 'From: LovedForever <no-reply@lovedforever.com>'
- );
- $msg = "<p>Hi</p>";
- $msg .= "<p>You've been invited to view " . $deceased_name . "'s memorial page<br />";
- $msg .= "Please view the link below:</p>";
- $msg .= "<p><a href='" . $deceased_memorial_link . "'>" . $deceased_memorial_link . "</a></p>";
- $msg .= "<p>Thank you</p>";
- wp_mail($_POST["mail"], "Invitation to " . $deceased_name . "'s memorial page", $msg, $headers);
- echo "Your invitation has been sent to ".$_POST["mail"];
- } else {
- echo "Your invitation was not sent as the email address is not valid.";
- }
- }
- ?>
- <p>
- <form method="post" action="#">
- <input type="text" name="mail" value="" placeholder="E-mail">
- <br/><br/>
- <input type="submit" class="" name="iemail" value="Invite" ></form>
- </p>
- </div>
- <div id="rightcolumn2">
- <!--slider starts-->
- <!-- Start Photo Slider -->
- <?php // var_dump($b); ?>
- <?php if ($b) : ?>
- <div id="carousel" class="flexslider">
- <ul class="slides">
- <?php foreach ($b as $slider_gallery_image) : ?>
- <li><img src="<?php echo $slider_gallery_image; ?>"></li>
- <?php endforeach; ?>
- </ul>
- </div>
- <?php endif; ?>
- <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=
- "http://www.lovedforever.org.uk/wp-content/uploads/2013/09/logo-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"]') ?> | <a href="http://www.lovedforever.org.uk/privacy-policy/">Privacy Policy</a> | <a href="http://www.lovedforever.org.uk/terms-and-conditions/">Terms and Conditions</a>
- <br><br><?php echo do_shortcode('[addthis_shortcode_tool]') ?>
- </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: 150,
- 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);
- } else if(str.substr(0, 8) == 'https://'){
- e.value = str.substr(8);
- }
- 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>
- <script type="text/javascript">
- jQuery(function($) {
- $('.tabs a').click(function() {
- location.hash = $(this).attr('href');
- });
- var _hash = location.hash;
- $('a[href='+_hash+']').trigger('click');
- });
- </script>
- <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=4c2a989ffc05cd7e78b3d938916ad03f"></script>
- <script type="text/javascript">
- var addthis_config = {"data_track_clickback":false,"data_track_addressbar":false,"data_track_textcopy":false,"ui_atversion":"300"};
- var addthis_product = 'wpp-3.5.9';
- </script>
- <script type="text/javascript" src="http://ct1.addthis.com/static/r07/core126.js"></script>
- <script type="text/javascript">addthis.layers({});</script>
- <script type="text/javascript" src="http://www.lovedforever.org.uk/wp-content/plugins/wp-modal-login/js/wp-modal-login.min.js?ver=2.0.6"></script>
- <script>
- function openFbPopUp(name,link,image,caption,description) {
- FB.ui(
- {
- method: 'feed',
- name: name,
- link: link,
- redirect_uri: link,
- picture: image,
- caption: caption,
- description: description
- },
- function(response) {
- }
- );
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement