valkrider

Name_profile

Jun 30th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  
  5. * This is the template file for single posts. It is used by single posts of any post type.
  6.  
  7. *
  8.  
  9. */
  10.  
  11. get_header();
  12.  
  13. ?>
  14.  
  15. <div id="main-col">
  16.  
  17. <?php suffusion_before_begin_content(); ?>
  18.  
  19. <div id="content">
  20.  
  21. <?php
  22.  
  23. global $post, $suffusion_is_cpt;
  24.  
  25. if ($post->post_type != 'post') {
  26.  
  27. $suffusion_is_cpt = true;
  28.  
  29. add_filter('suffusion_byline_position', 'suffusion_single_cpt_byline_position');
  30.  
  31. add_action('suffusion_add_taxonomy_bylines_line', 'suffusion_cpt_line_taxonomies', 10, 2);
  32.  
  33. add_action('suffusion_add_taxonomy_bylines_pullout', 'suffusion_cpt_line_taxonomies', 10, 4);
  34.  
  35. global $suffusion_cpt_layouts, $suf_cpt_bylines_posted_by, $suf_cpt_bylines_comments, $suf_cpt_bylines_permalinks, $suf_cpt_bylines_post_date;
  36.  
  37. if (isset($suffusion_cpt_layouts[$post->post_type]) && isset($suffusion_cpt_layouts[$post->post_type]['byline-contents'])) {
  38.  
  39. $byline_contents = explode(',', $suffusion_cpt_layouts[$post->post_type]['byline-contents']);
  40.  
  41. $suf_cpt_bylines_posted_by = in_array('posted-by', $byline_contents) ? 'show' : 'hide';
  42.  
  43. $suf_cpt_bylines_comments = in_array('comments', $byline_contents) ? 'show' : 'hide';
  44.  
  45. $suf_cpt_bylines_permalinks = in_array('permalink', $byline_contents) ? 'show' : 'hide';
  46.  
  47. $suf_cpt_bylines_post_date = in_array('date', $byline_contents) ? 'show' : 'hide';
  48.  
  49. }
  50.  
  51. else {
  52.  
  53. $suf_cpt_bylines_posted_by = false;
  54.  
  55. $suf_cpt_bylines_comments = false;
  56.  
  57. $suf_cpt_bylines_permalinks = false;
  58.  
  59. $suf_cpt_bylines_post_date = false;
  60.  
  61. }
  62.  
  63. }
  64.  
  65.  
  66.  
  67. if (have_posts()) {
  68.  
  69. while (have_posts()) {
  70.  
  71. the_post();
  72.  
  73. global $suf_prev_next_above_below;
  74.  
  75. if ($suf_prev_next_above_below == 'above' || $suf_prev_next_above_below == 'above-below') {
  76.  
  77. get_template_part('custom/prev-next');
  78.  
  79. }
  80.  
  81. $original_post = $post;
  82.  
  83. do_action('suffusion_before_post', $post->ID, 'blog', 1);
  84.  
  85. ?>
  86.  
  87. <article <?php post_class();?> id="post-<?php the_ID(); ?>">
  88.  
  89. <?php
  90.  
  91. suffusion_after_begin_post();
  92. echo '<div class="cs_blue cs_widget" style="font-weight: 600">Study details</div>';
  93.  
  94. ?>
  95.  
  96. <div class="entry-container fix">
  97.  
  98. <div class="entry fix">
  99.  
  100. <?php
  101.  
  102. suffusion_content();
  103. echo '<div style="display:none">'.$post->ID.'</div>';
  104. $study_id = $post->ID;
  105.  
  106. $t = get_post_meta($study_id, 'study_image', true);
  107. if ($t == 0) {
  108. $t = 1046;
  109. }
  110. ?>
  111.  
  112. <div class="cs_detail_image">
  113. <?php
  114. echo wp_get_attachment_image($t)."<br>";
  115.  
  116. $t = get_post_meta($study_id, 'about', true);
  117. if (strlen($t)>= 1 ){
  118. edit_post_link(__('Edit'),'','',$study_id);
  119. }
  120. ?>
  121. </div>
  122. <?php
  123. $t = get_post_meta($study_id, 'about', true);
  124. if (strlen($t)>= 1 ){
  125. echo '<div class="cs_detail_header">About the study: </div><div class="cs_detail_content">'. $t.'</div>';
  126. }
  127. $t = get_post_meta($study_id, 'variants', true);
  128. if (strlen($t)>= 1 ){
  129. echo '<div class="cs_detail_header">Variant names: </div><div class="cs_detail_content">'. $t .'</div>';
  130. }
  131. $t = get_post_meta($study_id, 'origin', true);
  132. if (strlen($t)>= 1 ){
  133. echo '<div class="cs_detail_header">Name Origin: </div><div class="cs_detail_content">'. $t .'</div>';
  134. }
  135. $t = get_post_meta($study_id, 'history', true);
  136. if (strlen($t)>= 1 ){
  137. echo '<div class="cs_detail_header">History of the name: </div><div class="cs_detail_content">'. $t .'</div>';
  138. }
  139. $t = get_post_meta($study_id, 'frequency', true);
  140. if (strlen($t)>= 1 ){
  141. echo '<div class="cs_detail_header">Name frequency: </div><div class="cs_detail_content">'. $t .'</div>';
  142. }
  143. $t = get_post_meta($study_id, 'distribution', true);
  144. if (strlen($t)>= 1 ){
  145. echo '<div class="cs_detail_header">Distribution of the name: </div><div class="cs_detail_content">'. $t .'</div>';
  146. }
  147. $t = get_post_meta($study_id, 'data', true);
  148. if (strlen($t)>= 1 ){
  149. echo '<div class="cs_detail_header">Data: </div><div class="cs_detail_content">'. $t .'</div>';
  150. }
  151. $t = get_post_meta($study_id, 'dna', true);
  152. if (strlen($t)>= 1 ){
  153. echo '<div class="cs_detail_header">DNA: </div><div class="cs_detail_content">'. $t .'</div>';
  154. }
  155. $t = get_post_meta($study_id, 'links', true);
  156. if (strlen($t)>= 1 ){
  157. echo '<div class="cs_detail_header">Links: </div><div class="cs_detail_content">'. $t.'</div>';
  158. }
  159.  
  160.  
  161. $unam = get_the_author_meta ('display_name', $post->post_author );
  162. echo '<div style="display:none;">Name: '.$unam.'</div>';
  163. $unum = get_the_author_meta ('user_email', $post->post_author );
  164. echo '<div style="display:none;">Name: '.$unum.'</div>';
  165.  
  166. echo '<div class="cs_detail_header">Contact: </div><div class="cs_detail_content">'.$unam.'</div>';
  167. if ($unum =="[email protected]"){
  168. $unum = "none";
  169. echo '<div class="cs_detail_header">Email: </div><div class="cs_detail_content">No Email</div>';
  170. }
  171. else {
  172. echo '<div class="cs_detail_header">Email: </div><div class="cs_detail_content"><a href="mailto:"'.$unum.'>'.$unum.'</a></div>';
  173. }
  174. //Last modified
  175. $modd = get_the_modified_date();
  176. echo '<div class="cs_detail_header" style="font-size:0.7em;">Last updated: </div>';
  177. echo '<div class="cs_detail_content" style="font-size:0.7em;">'.$modd.'</div>';
  178. //Page views
  179. echo '<div class="cs_detail_header" style="font-size:0.7em;">This page has been visited: </div>';
  180. $views = wpp_get_views( get_the_ID() );
  181. echo '<div class="cs_detail_content" style="font-size:0.7em;">'.$views.' since 1st July 2014.</div>';
  182.  
  183.  
  184. ?>
  185.  
  186. </div><!--/entry -->
  187.  
  188. <?php
  189.  
  190. // Due to the inclusion of Ad Hoc Widgets the global variable $post might have got changed. We will reset it to the original value.
  191.  
  192. $post = $original_post;
  193.  
  194. suffusion_after_content();
  195.  
  196. ?>
  197.  
  198. </div><!-- .entry-container -->
  199.  
  200. <?php
  201.  
  202. suffusion_before_end_post();
  203.  
  204. comments_template();
  205.  
  206. ?>
  207.  
  208. </article><!--/post -->
  209.  
  210. <?php
  211.  
  212. do_action('suffusion_after_post', $post->ID, 'blog', 1);
  213.  
  214. /*if ($suf_prev_next_above_below == 'below' || $suf_prev_next_above_below == 'above-below') {
  215.  
  216. get_template_part('custom/prev-next');
  217.  
  218. }*/
  219.  
  220. }
  221.  
  222. }
  223.  
  224. else {
  225.  
  226. ?>
  227.  
  228. <article class="post fix">
  229.  
  230. <p><?php _e('Sorry, this name is not registered as a study.', 'suffusion'); ?></p>
  231.  
  232. </article><!--post -->
  233.  
  234.  
  235.  
  236. <?php
  237.  
  238. }
  239.  
  240. ?>
  241.  
  242. </div><!-- content -->
  243.  
  244. </div><!-- main col -->
  245.  
  246. <?php
  247.  
  248. get_footer();
  249.  
  250. ?>
Advertisement
Add Comment
Please, Sign In to add comment