Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. <?php
  2. /**
  3. * @package CoursePress
  4. */
  5. ?>
  6. <?php
  7. $course = new Course( get_the_ID() );
  8.  
  9. $course_category_id = $course->details->course_category;
  10. $course_category = get_term_by( 'ID', $course_category_id, 'course_category' );
  11.  
  12. $course_language = $course->details->course_language;
  13. ?>
  14. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  15. <header class="entry-header">
  16. <h1 class="entry-title"><?php the_title(); ?></h1>
  17. <div class="instructors-content">
  18. <?php echo do_shortcode( '[course_instructors list="true" link="true"]' ); ?>
  19. </div>
  20. </header><!-- .entry-header -->
  21.  
  22. <section id="course-summary">
  23.  
  24.  
  25. <?php
  26. $course_media = do_shortcode( '[course_media]' );
  27. if ( $course_media !== '' ) {
  28. ?>
  29. <div class="course-video">
  30. <?php
  31. // Show course media
  32. echo $course_media;
  33. ?>
  34. </div>
  35. <?php } ?>
  36.  
  37. <div class="entry-content-excerpt <?php echo ($course_media == '' ? 'entry-content-excerpt-right' : '' ); ?>">
  38. <?php //the_excerpt(); ?>
  39. <div class="course-box">
  40. <?php echo do_shortcode( '[course_dates show_alt_display="yes"]' ); //change to yes for 'Open-ended' ?>
  41. <?php echo do_shortcode( '[course_enrollment_dates show_alt_display="no"]' ); //change to yes for 'Open-ended' ?>
  42. <?php echo do_shortcode( '[course_class_size]' ); ?>
  43. <?php echo do_shortcode( '[course_enrollment_type label="'.__('Who can Enroll: ', 'cp').'"]' ); ?>
  44. <?php echo do_shortcode( '[course_language]' ); ?>
  45. <?php echo do_shortcode( '[course_cost]' ); ?>
  46.  
  47. </div><!--course-box-->
  48. <div class="quick-course-info">
  49. <?php // echo do_shortcode('[course_details field="button"]'); ?>
  50. <?php echo do_shortcode( '[course_join_button]' ); ?>
  51. </div>
  52. </div>
  53. </section>
  54.  
  55. <section id="additional-summary">
  56. <div class="social-shares">
  57. <span><?php _e( 'SHARE', 'cp' ); ?></span>
  58. <a href="http://www.facebook.com/sharer/sharer.php?s=100&p[url]=<?php the_permalink(); ?>&p[images][0]=&p[title]=<?php the_title(); ?>&p[summary]=<?php echo urlencode( strip_tags( get_the_excerpt() ) ); ?>" class="facebook-share" target="_blank"></a>
  59. <a href="http://twitter.com/home?status=<?php the_title(); ?> <?php the_permalink(); ?>" class="twitter-share" target="_blank"></a>
  60. <a href="https://plus.google.com/share?url=<?php the_permalink(); ?>" class="google-share" target="_blank"></a>
  61. <a href="mailto:?subject=<?php the_title(); ?>&body=<?php echo strip_tags( get_the_excerpt() ); ?>" target="_top" class="email-share"></a>
  62. </div><!--social shares-->
  63. </section>
  64.  
  65. <br clear="all" />
  66.  
  67. <?php
  68. $instructors = Course::get_course_instructors( $course->details->ID );
  69. ?>
  70. <div class="entry-content <?php echo( count( $instructors ) > 0 ? 'left-content' : '' ); ?>">
  71. <h1 class="h1-about-course"><?php _e( 'About the Course', 'cp' ); ?></h1>
  72. <?php the_content(); ?>
  73. <?php if ( $course->details->course_structure_options == 'on' ) { ?>
  74. <h1 class = "h1-about-course"><?php
  75. _e( 'Course Structure', 'cp' );
  76. ?></h1>
  77. <?php
  78. // $course->course_structure_front();
  79. echo do_shortcode( '[course_structure label="" show_title="no" show_divider="yes"]' );
  80. }
  81. ?>
  82. <?php
  83. wp_link_pages( array(
  84. 'before' => '<div class="page-links">' . __( 'Pages:', 'cp' ),
  85. 'after' => '</div>',
  86. ) );
  87. ?>
  88. </div><!-- .entry-content -->
  89.  
  90. <?php if ( count( $instructors ) > 0 ) { ?>
  91. <div class="course-instructors right-content">
  92. <h1 class="h1-instructors"><?php _e( 'Instructors', 'cp' ); ?></h1>
  93. <script>
  94. jQuery( function() {
  95. jQuery( "#instructor-profiles" ).accordion( {
  96. heightStyle: "content"
  97. } );
  98. } );
  99. </script>
  100. <div id="instructor-profiles">
  101. <?php
  102. foreach ( $instructors as $instructor ) {
  103. ?>
  104.  
  105. <h3><?php echo $instructor->display_name; ?></h3>
  106.  
  107. <?php
  108. $doc = new DOMDocument();
  109. if(get_avatar( $instructor->ID, 235 ) != ''){
  110. $doc->loadHTML( get_avatar( $instructor->ID, 235 ) );
  111. $imageTags = $doc->getElementsByTagName( 'img' );
  112.  
  113.  
  114. foreach ( $imageTags as $tag ) {
  115. $avatar_url = $tag->getAttribute( 'src' );
  116. }
  117. }
  118. ?>
  119.  
  120. <div>
  121. <?php if(get_avatar( $instructor->ID, 235 ) != ''){ ?>
  122. <img src="<?php echo $avatar_url; ?>" />
  123. <?php } ?>
  124. <p>
  125. <?php echo author_description_excerpt( $instructor->ID, 50 ); ?>
  126. </p>
  127. <a href="<?php echo do_shortcode( '[instructor_profile_url instructor_id="' . $instructor->ID . '"]' ); ?>" class="full-instructor-profile"><?php _e( 'View Full Profile', 'cp' ); ?></a>
  128. </div>
  129. <?php } ?>
  130. </div>
  131.  
  132. </div><!--course-instructors right-content-->
  133. <?php } ?>
  134. <br clear="all" />
  135.  
  136. <footer class="entry-meta">
  137. <?php
  138. /* translators: used between list items, there is a space after the comma */
  139. $category_list = get_the_category_list( __( ', ', 'cp' ) );
  140.  
  141. /* translators: used between list items, there is a space after the comma */
  142. $tag_list = get_the_tag_list( '', __( ', ', 'cp' ) );
  143.  
  144. if ( !coursepress_categorized_blog() ) {
  145. // This blog only has 1 category so we just need to worry about tags in the meta text
  146. if ( '' != $tag_list ) {
  147. $meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', 'cp' );
  148. } else {
  149. //$meta_text = __( 'Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', 'cp' );
  150. $meta_text = '';
  151. }
  152. } else {
  153. // But this blog has loads of categories so we should probably display them here
  154. if ( '' != $tag_list ) {
  155. $meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', 'cp' );
  156. } else {
  157. $meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" rel="bookmark">permalink</a>.', 'cp' );
  158. }
  159. } // end check for categories on this blog
  160.  
  161. printf(
  162. $meta_text, $category_list, $tag_list, get_permalink()
  163. );
  164. ?>
  165.  
  166. <?php edit_post_link( __( 'Edit', 'cp' ), '<span class="edit-link">', '</span>' ); ?>
  167. </footer><!-- .entry-meta -->
  168. </article><!-- #post-## -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement