Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Template Name: My Gallery Images Page Template
- *
- * Description: A page template that provides a key component of WordPress as a CMS
- * by meeting the need for a carefully crafted introductory page. The front page template
- * in Twenty Twelve consists of a page content area for adding text, images, video --
- * anything you'd like -- followed by front-page-only widgets in one or two columns.
- *
- * @package WordPress
- * @subpackage Twenty_Twelve
- * @since Twenty Twelve 1.0
- */
- get_header(); ?>
- <?php if (is_page( 319)) : ?>
- <style>
- table.wpuf-table td a span {
- display: none;
- }
- </style>
- <?php elseif (is_page( 337)) : ?>
- <style>
- table.wpuf-table td a span {
- display: none;
- }
- </style>
- <?php endif; ?>
- <div class="site white clear">
- <?php
- /**
- * All Independent Artists
- */
- ?>
- <h1 class="home-title">Hello <?php global $current_user;
- get_currentuserinfo();
- echo $current_user->user_firstname;
- echo ' ' . $current_user->user_lastname;
- ?></h1>
- <?php $user = wp_get_current_user(); if ($user->ID); ?>
- <?php if (yoursite_user_has_independentartist_draft($user->ID)) : ?>
- <?php elseif (yoursite_user_has_representedartist_draft($user->ID)) : ?>
- <?php else : ?>
- <nav id="sub-navigation" class="clear">
- <div class="menu-artist-menu-container"><ul id="menu-artist-menu" class="nav-menu">
- <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>?page_id=28">Dashboard home</a></li>
- <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>?page_id=479">My Account details</a></li>
- <?php if (yoursite_user_has_independentartist($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=319">My Profile</a></li>';
- }; ?>
- <?php if (yoursite_user_has_representedartist($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=337">My Profile</a></li>';
- }; ?>
- <?php if (yoursite_user_has_artistimage($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=350">My Gallery</a></li>';
- }; ?>
- <?php if (yoursite_user_has_artistblog($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=246">My Blog Posts</a></li>';
- }; ?>
- <?php if (yoursite_user_has_artistcommission($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=251">My Commissions</a></li>';
- }; ?>
- <?php if (yoursite_user_has_artistvideo($user->ID)) {
- echo '<li><a href="';
- esc_url( home_url( '/' ) );
- echo '?page_id=254">My Videos</a></li>';
- }; ?>
- </ul>
- </div>
- </nav>
- <?php endif; ?>
- <?php if (current_user_can('independent_artist')) : ?>
- <?php if (yoursite_user_has_independentartist($user->ID)) : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=348">Add an image to your gallery</a> - Start building your online portfolio!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=45">Add a blog post</a> - Get blogging!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=142">Add a recent commission</a> - Start making the grade!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=39">Add a video</a> - Show us what your moving images!
- </div>
- <?php elseif (yoursite_user_has_independentartist_draft($user->ID)) : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=319">Personal Profile</a> - Please update the dates you are available on your profile and check all your information is correct in order to get your profile back online!
- </div>
- <?php else : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=33">Personal Profile</a> - Create your profile and start building your portfolio!
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <?php if (current_user_can('represented_artist')) : ?>
- <?php if (yoursite_user_has_representedartist($user->ID)) : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=348">Add an image to your gallery</a> - Start building your online portfolio!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=45">Add a blog post</a> - Get blogging!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=96">Add a recent commission</a> - Start making the grade!
- </div>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=39">Add a video</a> - Show us what your moving images!
- </div>
- <?php elseif (yoursite_user_has_representedartist_draft($user->ID)) : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=337">Personal Profile</a> - Please update the dates you are available on your profile and check all your information is correct in order to get your profile back online!
- </div>
- <?php else : ?>
- <div class="dash-add">
- <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=33">Personal Profile</a> - Create your profile and start building your portfolio!
- </div>
- <?php endif; ?>
- <?php endif; ?>
- <div class="extrapads2 clear">
- <h3>Click on a thumbnail to edit your images and change the order in which they appear</h3>
- </div>
- <div class="gallery-thumbs-wrap clear">
- <?php global $current_user; get_currentuserinfo(); $user_id = get_current_user_id();?>
- <?php $homequery = new WP_Query( array( 'author' => $user_id,
- 'posts_per_page' => 50,
- 'post_type' => 'artistimage',
- 'orderby' => 'meta_value_num',
- 'meta_key' => 'image_order',
- 'order' => 'ASC',
- 'meta_query' => array(
- array(
- 'key' => 'image_order',
- 'value' => '0',
- 'compare' => '>',
- ))) ); ?>
- <?php while ( $homequery->have_posts() ) : $homequery->the_post(); ?>
- <div class="gallery-thumb-sml"><img src="<?php $image_id = get_post_thumbnail_id();
- $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
- echo $image_url[0]; ?>" alt="<?php the_title(); ?>" />
- <div class="edit-wrap"><?php
- if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard' ) == 'yes' ) {
- $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
- $url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
- ?>
- <a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
- <?php } ?> | <?php
- if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
- $del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
- ?>
- <a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('Are you sure to delete?');"><?php _e( 'Delete', 'wpuf' ); ?></a>
- <?php } ?></div></div>
- <?php endwhile; wp_reset_postdata(); ?>
- <?php global $current_user; get_currentuserinfo(); $user_id = get_current_user_id();?>
- <?php $homequery = new WP_Query( array( 'author' => $user_id, 'post_type' => 'artistimage', 'showposts' => '50') ); ?>
- <?php while ( $homequery->have_posts() ) : $homequery->the_post(); ?>
- <?php $image_order = get_post_meta($post->ID, 'image_order', true); ?>
- <?php if (!empty($image_order)) : ?>
- <div class="gallery-thumb-sml" style="display:none;"><a href="<?php echo esc_url( home_url( '/' ) ); ?>edit/?pid=<?php the_ID(); ?>" title="<?php the_title(); ?>"><img src="<?php $image_id = get_post_thumbnail_id();
- $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
- echo $image_url[0]; ?>" alt="<?php the_title(); ?>" /></a></a></div>
- <?php else : ?>
- <div class="gallery-thumb-sml"><img src="<?php $image_id = get_post_thumbnail_id();
- $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
- echo $image_url[0]; ?>" alt="<?php the_title(); ?>" /><div class="edit-wrap"><?php
- if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard' ) == 'yes' ) {
- $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
- $url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
- ?>
- <a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
- <?php } ?> | <?php
- if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
- $del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
- ?>
- <a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('Are you sure to delete?');"><?php _e( 'Delete', 'wpuf' ); ?></a>
- <?php } ?></div></div>
- <?php endif; ?>
- <?php endwhile; wp_reset_postdata(); ?>
- </div><!-- .gallery-thumbs-wrap-->
- </div><!-- .site-->
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement