Advertisement
Guest User

docandtee2

a guest
Jan 23rd, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.23 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: My Gallery Images Page Template
  4. *
  5. * Description: A page template that provides a key component of WordPress as a CMS
  6. * by meeting the need for a carefully crafted introductory page. The front page template
  7. * in Twenty Twelve consists of a page content area for adding text, images, video --
  8. * anything you'd like -- followed by front-page-only widgets in one or two columns.
  9. *
  10. * @package WordPress
  11. * @subpackage Twenty_Twelve
  12. * @since Twenty Twelve 1.0
  13. */
  14.  
  15. get_header(); ?>
  16.  
  17. <?php if (is_page( 319)) : ?>
  18. <style>
  19. table.wpuf-table td a span {
  20. display: none;
  21. }
  22. </style>
  23. <?php elseif (is_page( 337)) : ?>
  24. <style>
  25. table.wpuf-table td a span {
  26. display: none;
  27. }
  28. </style>
  29. <?php endif; ?>
  30.  
  31.  
  32.  
  33. <div class="site white clear">
  34.  
  35. <?php
  36. /**
  37. * All Independent Artists
  38. */
  39. ?>
  40.  
  41.  
  42. <h1 class="home-title">Hello <?php global $current_user;
  43. get_currentuserinfo();
  44. echo $current_user->user_firstname;
  45. echo ' ' . $current_user->user_lastname;
  46. ?></h1>
  47.  
  48. <?php $user = wp_get_current_user(); if ($user->ID); ?>
  49.  
  50. <?php if (yoursite_user_has_independentartist_draft($user->ID)) : ?>
  51.  
  52. <?php elseif (yoursite_user_has_representedartist_draft($user->ID)) : ?>
  53.  
  54. <?php else : ?>
  55. <nav id="sub-navigation" class="clear">
  56. <div class="menu-artist-menu-container"><ul id="menu-artist-menu" class="nav-menu">
  57. <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>?page_id=28">Dashboard home</a></li>
  58. <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>?page_id=479">My Account details</a></li>
  59.  
  60. <?php if (yoursite_user_has_independentartist($user->ID)) {
  61. echo '<li><a href="';
  62. esc_url( home_url( '/' ) );
  63. echo '?page_id=319">My Profile</a></li>';
  64. }; ?>
  65.  
  66. <?php if (yoursite_user_has_representedartist($user->ID)) {
  67. echo '<li><a href="';
  68. esc_url( home_url( '/' ) );
  69. echo '?page_id=337">My Profile</a></li>';
  70. }; ?>
  71.  
  72. <?php if (yoursite_user_has_artistimage($user->ID)) {
  73. echo '<li><a href="';
  74. esc_url( home_url( '/' ) );
  75. echo '?page_id=350">My Gallery</a></li>';
  76. }; ?>
  77.  
  78. <?php if (yoursite_user_has_artistblog($user->ID)) {
  79. echo '<li><a href="';
  80. esc_url( home_url( '/' ) );
  81. echo '?page_id=246">My Blog Posts</a></li>';
  82. }; ?>
  83.  
  84. <?php if (yoursite_user_has_artistcommission($user->ID)) {
  85. echo '<li><a href="';
  86. esc_url( home_url( '/' ) );
  87. echo '?page_id=251">My Commissions</a></li>';
  88. }; ?>
  89.  
  90. <?php if (yoursite_user_has_artistvideo($user->ID)) {
  91. echo '<li><a href="';
  92. esc_url( home_url( '/' ) );
  93. echo '?page_id=254">My Videos</a></li>';
  94. }; ?>
  95. </ul>
  96. </div>
  97. </nav>
  98. <?php endif; ?>
  99.  
  100. <?php if (current_user_can('independent_artist')) : ?>
  101.  
  102. <?php if (yoursite_user_has_independentartist($user->ID)) : ?>
  103. <div class="dash-add">
  104. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=348">Add an image to your gallery</a> - Start building your online portfolio!
  105. </div>
  106.  
  107. <div class="dash-add">
  108. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=45">Add a blog post</a> - Get blogging!
  109. </div>
  110.  
  111. <div class="dash-add">
  112. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=142">Add a recent commission</a> - Start making the grade!
  113. </div>
  114.  
  115. <div class="dash-add">
  116. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=39">Add a video</a> - Show us what your moving images!
  117. </div>
  118. <?php elseif (yoursite_user_has_independentartist_draft($user->ID)) : ?>
  119. <div class="dash-add">
  120. <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!
  121. </div>
  122. <?php else : ?>
  123. <div class="dash-add">
  124. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=33">Personal Profile</a> - Create your profile and start building your portfolio!
  125. </div>
  126. <?php endif; ?>
  127.  
  128. <?php endif; ?>
  129.  
  130.  
  131. <?php if (current_user_can('represented_artist')) : ?>
  132.  
  133. <?php if (yoursite_user_has_representedartist($user->ID)) : ?>
  134. <div class="dash-add">
  135. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=348">Add an image to your gallery</a> - Start building your online portfolio!
  136. </div>
  137.  
  138. <div class="dash-add">
  139. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=45">Add a blog post</a> - Get blogging!
  140. </div>
  141.  
  142. <div class="dash-add">
  143. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=96">Add a recent commission</a> - Start making the grade!
  144. </div>
  145.  
  146. <div class="dash-add">
  147. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=39">Add a video</a> - Show us what your moving images!
  148. </div>
  149. <?php elseif (yoursite_user_has_representedartist_draft($user->ID)) : ?>
  150. <div class="dash-add">
  151. <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!
  152. </div>
  153. <?php else : ?>
  154. <div class="dash-add">
  155. <a href="<?php esc_url( home_url( '/' ) ); ?>?page_id=33">Personal Profile</a> - Create your profile and start building your portfolio!
  156. </div>
  157. <?php endif; ?>
  158.  
  159. <?php endif; ?>
  160.  
  161.  
  162. <div class="extrapads2 clear">
  163. <h3>Click on a thumbnail to edit your images and change the order in which they appear</h3>
  164. </div>
  165.  
  166. <div class="gallery-thumbs-wrap clear">
  167.  
  168. <?php global $current_user; get_currentuserinfo(); $user_id = get_current_user_id();?>
  169. <?php $homequery = new WP_Query( array( 'author' => $user_id,
  170. 'posts_per_page' => 50,
  171. 'post_type' => 'artistimage',
  172. 'orderby' => 'meta_value_num',
  173. 'meta_key' => 'image_order',
  174. 'order' => 'ASC',
  175. 'meta_query' => array(
  176. array(
  177. 'key' => 'image_order',
  178. 'value' => '0',
  179. 'compare' => '>',
  180. ))) ); ?>
  181.  
  182.  
  183.  
  184. <?php while ( $homequery->have_posts() ) : $homequery->the_post(); ?>
  185. <div class="gallery-thumb-sml"><img src="<?php $image_id = get_post_thumbnail_id();
  186. $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
  187. echo $image_url[0]; ?>" alt="<?php the_title(); ?>" />
  188. <div class="edit-wrap"><?php
  189. if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard' ) == 'yes' ) {
  190. $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
  191. $url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
  192. ?>
  193. <a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
  194. <?php } ?> | <?php
  195. if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
  196. $del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
  197. ?>
  198. <a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('Are you sure to delete?');"><?php _e( 'Delete', 'wpuf' ); ?></a>
  199. <?php } ?></div></div>
  200. <?php endwhile; wp_reset_postdata(); ?>
  201.  
  202.  
  203.  
  204.  
  205.  
  206. <?php global $current_user; get_currentuserinfo(); $user_id = get_current_user_id();?>
  207. <?php $homequery = new WP_Query( array( 'author' => $user_id, 'post_type' => 'artistimage', 'showposts' => '50') ); ?>
  208. <?php while ( $homequery->have_posts() ) : $homequery->the_post(); ?>
  209. <?php $image_order = get_post_meta($post->ID, 'image_order', true); ?>
  210. <?php if (!empty($image_order)) : ?>
  211. <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();
  212. $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
  213. echo $image_url[0]; ?>" alt="<?php the_title(); ?>" /></a></a></div>
  214. <?php else : ?>
  215. <div class="gallery-thumb-sml"><img src="<?php $image_id = get_post_thumbnail_id();
  216. $image_url = wp_get_attachment_image_src($image_id,'blog-feature-sml', true);
  217. echo $image_url[0]; ?>" alt="<?php the_title(); ?>" /><div class="edit-wrap"><?php
  218. if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard' ) == 'yes' ) {
  219. $edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_general' );
  220. $url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
  221. ?>
  222. <a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wpuf' ); ?></a>
  223. <?php } ?> | <?php
  224. if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
  225. $del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
  226. ?>
  227. <a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('Are you sure to delete?');"><?php _e( 'Delete', 'wpuf' ); ?></a>
  228. <?php } ?></div></div>
  229. <?php endif; ?>
  230. <?php endwhile; wp_reset_postdata(); ?>
  231.  
  232.  
  233.  
  234. </div><!-- .gallery-thumbs-wrap-->
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244. </div><!-- .site-->
  245.  
  246.  
  247. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement