PageRenderTime 42ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/blog/wp-content/themes/redoable-lite/theloop.php

https://bitbucket.org/sergiohzlz/reportaprod
PHP | 182 lines | 128 code | 42 blank | 12 comment | 37 complexity | f90e1ecd073b063bb611dc2e1c1b099e MD5 | raw file
Possible License(s): GPL-2.0, GPL-3.0, AGPL-1.0, LGPL-2.1
  1. <?php
  2. // This is the loop, which fetches entries from your database.
  3. // It is a very delicate piece of machinery. Be gentle!
  4. // Get core WP functions when loaded dynamically
  5. if (isset($_GET['rolling'])) {
  6. require (dirname(__FILE__).'/../../../wp-blog-header.php');
  7. }
  8. // Get the asides category
  9. $redo_asidescategory = 0;
  10. ?>
  11. <?php is_tag(); ?>
  12. <?php /* Headlines for archives */ if ((!is_single() and !is_home()) or is_paged()) { ?>
  13. <h2>
  14. <?php // Figure out what kind of page is being shown
  15. if (is_category()) {
  16. if ($cat != $redo_asidescategory) { printf(__('Archive for the \'%s\' Category','redo_domain'), single_cat_title('', false)); }
  17. else { single_cat_title(); } }
  18. elseif ( is_tag() ) {
  19. printf(__('Posts Tagged &#8216;'));
  20. single_tag_title();
  21. }
  22. elseif (is_day()) { printf(__('Archive for %s','redo_domain'), get_the_time(__('F jS, Y','redo_domain'))); }
  23. elseif (is_month()) { printf(__('Archive for %s','redo_domain'), get_the_time(__('F, Y','redo_domain'))); }
  24. elseif (is_year()) { printf(__('Archive for %s','redo_domain'), get_the_time(__('Y','redo_domain'))); }
  25. elseif (is_search()) { printf(__('Search Results for \'%s\'','redo_domain'), get_search_query()); }
  26. elseif (function_exists('is_tag') and is_tag()) { printf(__('Tag Archive for \'%s\'','redo_domain'), get_query_var('tag') ); }
  27. elseif (is_author()) {
  28. $post = $wp_query->post;
  29. $author = get_userdata( $post->post_author );
  30. printf(__('Author Archive for %s','redo_domain'), $author->first_name . ' ' . $author->last_name ); }
  31. elseif (is_paged() and ($paged > 1)) { printf(__('Archive Page %s','redo_domain'), $paged ); }
  32. ?>
  33. </h2>
  34. <?php } ?>
  35. <?php if (!is_single() and !is_home() and is_paged()) include (TEMPLATEPATH . '/navigation.php'); ?>
  36. <?php /* Check if there are posts */
  37. if ( have_posts() ) {
  38. /* It saves time to only perform the following if there are posts to show */
  39. // If there are 2+ users, this is a multiple-user blog
  40. // Alex: original does a count query to check this, we'll just assume yes
  41. $multiple_users = true;
  42. // Get the user information
  43. get_currentuserinfo();
  44. global $user_level;
  45. // Post index for semantic classes
  46. $post_index = 1;
  47. // Check if to display asides inline or not
  48. if(is_archive() or is_search() or is_single() or (function_exists('is_tag') and is_tag())) {
  49. $redo_asidescheck = '0';
  50. } else {
  51. $redo_asidescheck = get_option('redo_asidesposition');
  52. }
  53. ?>
  54. <?php /* Start the loop */
  55. while ( have_posts() ) {
  56. the_post();
  57. // Post is an aside
  58. $post_asides = in_category($redo_asidescategory);
  59. ?>
  60. <!-- Added to display wp-recent-links plugin -->
  61. <?php
  62. if( 'link' == $post->rp_entry_type && !is_single()) {
  63. if ($link_counter == 0) { ?>
  64. <div class="lentry <?php if ( is_home() and $redo_asidescategory != 0 ) { echo 'rightmargin'; } ?>">
  65. <?php } // recent links open <ul> ?>
  66. <div class="published_link"><?php echo date('d/m', strtotime($post->date_added)) ?></div>
  67. <div id="link-<?php the_ID(); ?>" class="link-title">
  68. <a href="<?php echo $post->link_url; ?>"><?php echo wptexturize($post->link_text); ?></a>
  69. <?php if ('' != $post->link_caption) { ?>&#8594;
  70. <?php echo wptexturize(convert_smilies($post->link_caption)); ?><?php } ?>
  71. <!-- a href="<?php echo $post->link_permalink; ?>" class="permalink">#</a -->
  72. </div>
  73. <?php $link_counter++; ?>
  74. <?php if( function_exists('rewind_post_count') ) {
  75. rewind_post_count();
  76. } ?>
  77. <?php } else {
  78. /* Standard Entries */
  79. if ($link_counter > 0) { $link_counter = 0; ?>
  80. <div class="link-header">LINK LOG</div>
  81. </div>
  82. <?php } // recent links close </ul> ?>
  83. <!-- end add for wp-recent-links plugin -->
  84. <?php /* Only display asides if sidebar asides are not active */ if(!$post_asides || $redo_asidescheck == '0') { ?>
  85. <div id="post-<?php the_ID(); ?>" class="<?php redo_post_class($post_index++, $post_asides); ?> <?php if ( is_home() and $redo_asidescategory != 0 ) { echo 'rightmargin'; } ?> ">
  86. <div class="entry-head">
  87. <?php printf( __('%1$s','redo_domain'),
  88. '<div class="published_sm" title="'. get_the_time('Y-m-d\TH:i:sO') . '">' .
  89. ( '<div class="day">' . get_the_time('d') . '</div><div class="month">' . get_the_time('M') . '</div><div class="year">' . get_the_time('y') . '</div>' )
  90. . '</div>'
  91. ); ?>
  92. <h3 class="entry-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php echo esc_attr( sprintf( __( 'Permanent link to %s', 'redo_domain' ), the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_title(); ?></a></h3>
  93. <?php /* Edit Link */ edit_post_link(__('Edit','redo_domain'), '<span class="editLink">','</span>'); ?>
  94. <div class="entry-meta">
  95. <div class="meta-row">
  96. <?php /* Date & Author */
  97. printf( __('%1$s','redo_domain'), sprintf(__('<span class="authordata">By %s</span>','redo_domain'), '<span class="vcard author"><a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) .'" class="url fn">' . get_the_author() . '</a></span>') );
  98. ?>
  99. <?php /* Comments */ comments_popup_link(__('Leave a&nbsp;').'<span>'.__('Comment','redo_domain').'</span>', '1&nbsp;<span>'.__('Comment','redo_domain').'</span>', '%&nbsp;<span>'.__('Comments','redo_domain').'</span>', 'commentslink', '<span>'.__('Closed','redo_domain').'</span>'); ?>
  100. </div>
  101. <div class="meta-row">
  102. <?php /* Categories */ printf(__('<span class="entry-category">Categories: %s</span>','redo_domain'), redo_nice_category(', ', ' '.__('and','redo_domain').' ') ); ?>
  103. <br />
  104. <?php the_tags('<span class="entry-category">Tags: ', ', ', '<br /></span>'); ?>
  105. </div>
  106. </div> <!-- .entry-meta -->
  107. </div> <!-- .entry-head -->
  108. <div class="entry-content">
  109. <!-- or (function_exists('is_tag') and is_tag()) -->
  110. <?php if (is_search()) {
  111. the_excerpt();
  112. } else {
  113. the_content(__('Continue reading','redo_domain') . " '" . the_title('', '', false) . "'");
  114. } ?>
  115. <?php if( get_bloginfo('version') < 2.1 ) { ?>
  116. <?php link_pages('<p><strong>'.__('Pages:','redo_domain').'</strong> ', '</p>','number'); ?>
  117. <?php } else { ?>
  118. <?php wp_link_pages('before=<p><strong>'.__('Pages:','redo_domain').'</strong>&after=</p>&next_or_number=number')?>
  119. <?php } ?>
  120. </div> <!-- .entry-content -->
  121. </div> <!-- #post-ID -->
  122. <?php } /* End sidebar asides test */ ?>
  123. <?php } // close if() for entry types ?> <!-- added for wp-recent-links plugin -->
  124. <?php } /* End The Loop */ ?>
  125. <!-- added for wp-recent-links plugin -->
  126. <?php if ($link_counter > 0) { $link_counter = 0; ?>
  127. </ul>
  128. <?php } // recent links close </ul> ?>
  129. <!-- end add -->
  130. <?php /* Insert Paged Navigation */ if (!is_single()) { include(TEMPLATEPATH . '/navigation.php'); } ?>
  131. <?php /* If there is nothing to loop */ } else { $notfound = '1'; ?>
  132. <div class="hentry four04">
  133. <div class="entry-head">
  134. <h3 class="center"><?php _e('Not Found','redo_domain'); ?></h2>
  135. </div>
  136. <div class="entry-content">
  137. <p><?php _e('Oh no! You\'re looking for something which just isn\'t here! Fear not however, errors are to be expected, and luckily there are tools on the sidebar for you to use in your search for what you need.','redo_domain'); ?></p>
  138. </div>
  139. </div> <!-- .hentry .four04 -->
  140. <?php } /* End Loop Init */ ?>