windhamdavid 5 years ago
parent
commit
5ed61fac77
2 changed files with 164 additions and 0 deletions
  1. 84 0
      image.php
  2. 80 0
      page-store.php

+ 84 - 0
image.php

@@ -0,0 +1,84 @@
+<?php get_header();?>
+<div id="press-wrap">
+<div class="container">
+	<div class="row journal">
+		<div class="twelvecol">
+			<?php while ( have_posts() ) : the_post(); ?>
+				<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+					<header class="entry-header">
+						<h1 class="entry-title"><?php the_title(); ?></h1>
+						<div class="entry-meta">
+							<?php
+								$metadata = wp_get_attachment_metadata();
+								printf( __( 'Published <span class="entry-date"><time class="entry-date" datetime="%1$s" pubdate>%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>', '_ph' ),
+									esc_attr( get_the_date( 'c' ) ),
+									esc_html( get_the_date() ),
+									wp_get_attachment_url(),
+									$metadata['width'],
+									$metadata['height'],
+									get_permalink( $post->post_parent ),
+									get_the_title( $post->post_parent )
+								);
+							?>
+							<?php edit_post_link( __( 'Edit', '_ph' ), '<span class="sep">|</span> <span class="edit-link">', '</span>' ); ?>
+						</div>
+						<nav id="image-navigation">
+							<span class="previous-image"><?php previous_image_link( false, __( '&larr; Previous', '_s' ) ); ?></span>
+							<span class="next-image"><?php next_image_link( false, __( 'Next &rarr;', '_s' ) ); ?></span>
+						</nav>
+					</header>
+
+					<div class="entry-content">
+
+						<div class="entry-attachment">
+							<div class="attachment">
+								<?php
+									$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
+									foreach ( $attachments as $k => $attachment ) {
+										if ( $attachment->ID == $post->ID )
+											break;
+									}
+									$k++;
+									if ( count( $attachments ) > 1 ) {
+										if ( isset( $attachments[ $k ] ) )
+											$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
+										else
+											$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
+									} else {
+										$next_attachment_url = wp_get_attachment_url();
+									}
+								?>
+								<a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
+								$attachment_size = apply_filters( '_s_attachment_size', 1200 );
+								echo wp_get_attachment_image( $post->ID, array( $attachment_size, $attachment_size ) ); 
+								?></a>
+							</div>
+							<?php if ( ! empty( $post->post_excerpt ) ) : ?>
+							<div class="entry-caption">
+								<?php the_excerpt(); ?>
+							</div>
+							<?php endif; ?>
+						</div>
+						<?php the_content(); ?>
+						<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
+					</div>
+					<footer class="entry-meta">
+						<?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
+							<?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', '_s' ), get_trackback_url() ); ?>
+						<?php elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open ?>
+							<?php printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', '_s' ), get_trackback_url() ); ?>
+						<?php elseif ( comments_open() && ! pings_open() ) : // Only comments open ?>
+							<?php _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', '_s' ); ?>
+						<?php elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed ?>
+							<?php _e( 'Both comments and trackbacks are currently closed.', '_s' ); ?>
+						<?php endif; ?>
+						<?php edit_post_link( __( 'Edit', '_s' ), ' <span class="edit-link">', '</span>' ); ?>
+					</footer>
+				</article>
+				<?php comments_template(); ?>
+			<?php endwhile; ?>
+		</div>
+	</div>
+</div>
+</div>
+<?php get_footer(); ?>

+ 80 - 0
page-store.php

@@ -0,0 +1,80 @@
+<?php /* Template Name: Store */ ?>
+<?php get_header(); ?>
+<div id="store-wrap">
+<div class="container">
+	<div class="store-page">
+	<div class="row">
+		<div class="tencol">
+		</div>
+		<div class="twocol last">
+			<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="last buy-now"> 
+				<fieldset>
+					<input type="hidden" name="business" value="sales@phfilms.com" /> 
+					<input type="hidden" name="cmd" value="_cart" /> 
+					<input type="hidden" name="display" value="1" /> 
+					<input type="submit" name="submit" value="View Your Cart" class="button" />
+				</fieldset>
+			</form>
+		</div>
+	</div>
+	<div class="row">
+		<div class="twelvecol">
+			<?php
+			$args = array(
+				'post_type' => 'film',
+				'meta_query' => array(
+					array(
+						'key' => 'price',
+						'value' => '0',
+						'compare' => '>',
+						'type' => 'NUMERIC'
+					)
+				)
+			 );
+			$query = new WP_Query( $args ); query_posts($args); while (have_posts()) : the_post(); ?>
+
+				<div class="threecol">
+					<div class="store-item">
+						<?php if (class_exists('MultiPostThumbnails')
+						    && MultiPostThumbnails::has_post_thumbnail('film', 'secondary-image')) :
+						        MultiPostThumbnails::the_post_thumbnail('film', 'secondary-image'); endif; ?>
+					
+						<!--<h3 class="film-title"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>-->
+						
+						<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
+						<input type="hidden" name="on0" value="Format">
+						<select name="os0">
+							<?php $price = get_post_custom_values('price'); if (!empty($price[0])) { ?><option value="Personal DVD">Personal DVD <?php echo get_post_meta($post->ID, 'price', true) ?></option><?php } ?>
+							<?php $price2 = get_post_custom_values('price2'); if (!empty($price2[0])) { ?><option value="Library DVD">Library DVD <?php echo get_post_meta($post->ID, 'price2', true) ?></option><?php } ?>
+							<?php $price3 = get_post_custom_values('price3'); if (!empty($price3[0])) { ?><option value="University DVD">University DVD <?php echo get_post_meta($post->ID, 'price3', true) ?></option><?php } ?>
+						</select>
+						<input  class="buy-now" type="submit" value="Add to Cart" border="0" name="submit">							
+						<input type="hidden" name="add" value="1">
+						<input type="hidden" name="cmd" value="_cart">
+						<input type="hidden" name="business" value="sales@phfilms.com">
+						<input type="hidden" name="item_name" value="<?php the_title() ?>">
+						<input type="hidden" name="item_number" value="xxxx">
+						<input type="hidden" name="option_select0" value="Personal DVD">  
+						<input type="hidden" name="option_amount0" value="<?php echo get_post_meta($post->ID, 'price', true) ?>">
+						<input type="hidden" name="option_select1" value="Library DVD">  
+						<input type="hidden" name="option_amount1" value="<?php echo get_post_meta($post->ID, 'price2', true) ?>">
+						<input type="hidden" name="option_select2" value="University DVD">  
+						<input type="hidden" name="option_amount2" value="<?php echo get_post_meta($post->ID, 'price3', true) ?>">
+						<input type="hidden" name="return" value="http://www.phfilms.com/index.php/completedpayment/">
+						<input type="hidden" name="cancel_return" value="http://www.phfilms.com/index.php/cancelledpayment/">
+						<input type="hidden" name="currency_code" value="USD">
+						<input type="hidden" name="lc" value="US">
+						</form>
+					</div>
+				</div>
+
+			<?php endwhile; ?>
+		</div>
+		<div class="fourcol">
+			
+		</div>
+	</div>
+	</div>
+</div>
+</div>
+<?php get_footer(); ?>