PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/wp-content/plugins/wptouch/themes/default/index.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 156 lines | 124 code | 30 blank | 2 comment | 60 complexity | 8a9f611d9be9f6be45d5c303eda39f05 MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php global $is_ajax; $is_ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']); if (!$is_ajax) get_header(); ?>
  2. <?php $wptouch_settings = bnc_wptouch_get_settings(); ?>
  3. <div class="content" id="content<?php echo md5($_SERVER['REQUEST_URI']); ?>">
  4. <div class="result-text"><?php wptouch_core_body_result_text(); ?></div>
  5. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  6. <div class="post" id="post-<?php the_ID(); ?>">
  7. <?php if ( is_home() && is_sticky() && $wptouch_settings['post-cal-thumb'] == 'nothing-shown' ) echo '<div class="sticky-icon-none"></div>'; ?>
  8. <?php if ( is_home() && is_sticky() && $wptouch_settings['post-cal-thumb'] != 'nothing-shown' ) echo '<div class="sticky-icon"></div>'; ?>
  9. <?php if (!function_exists('dsq_comments_template') && !function_exists('id_comments_template')) { ?>
  10. <?php if (wptouch_get_comment_count() && !is_archive() && !is_search() && bnc_can_show_comments() ) { ?>
  11. <div class="<?php if ($wptouch_settings['post-cal-thumb'] == 'nothing-shown') { echo 'nothing-shown ';} ?>comment-bubble<?php if ( wptouch_get_comment_count() > 99 ) echo '-big'; ?>">
  12. <?php comments_number('0','1','%'); ?>
  13. </div>
  14. <?php } ?>
  15. <?php } ?>
  16. <?php if (is_archive() || is_search()) { ?>
  17. <div class="archive-top">
  18. <div class="archive-top-right">
  19. <?php if (bnc_excerpt_enabled()) { ?>
  20. <a class="post-arrow" id="arrow-<?php the_ID(); ?>" href="javascript: return false;"></a>
  21. <?php } ?>
  22. </div>
  23. <div id="arc-top" class="archive-top-left month-<?php echo get_the_time('m') ?>">
  24. <?php echo get_the_time('M') ?> <?php echo get_the_time('j') ?>, <?php echo get_the_time('Y') ?>
  25. </div>
  26. </div>
  27. <?php } else { ?>
  28. <?php if (bnc_excerpt_enabled()) { ?>
  29. <a class="post-arrow" id="arrow-<?php the_ID(); ?>" href="javascript: return false;"></a>
  30. <?php } ?>
  31. <?php
  32. $version = bnc_get_wp_version();
  33. if ($version >= 2.9 && $wptouch_settings['post-cal-thumb'] != 'calendar-icons' && $wptouch_settings['post-cal-thumb'] != 'nothing-shown') { ?>
  34. <div class="wptouch-post-thumb-wrap">
  35. <div class="thumb-top-left"></div><div class="thumb-top-right"></div>
  36. <div class="wptouch-post-thumb">
  37. <?php
  38. if (function_exists('p75GetThumbnail')) {
  39. if ( p75HasThumbnail($post->ID) ) { ?>
  40. <img src="<?php echo p75GetThumbnail($post->ID); ?>" alt="post thumbnail" />
  41. <?php } else { ?>
  42. <?php
  43. $total = '24'; $file_type = '.jpg';
  44. // Change to the location of the folder containing the images
  45. $image_folder = '' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/';
  46. $start = '1'; $random = mt_rand($start, $total); $image_name = $random . $file_type;
  47. if ($wptouch_settings['post-cal-thumb'] == 'post-thumbnails-random') {
  48. echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
  49. } else {
  50. echo '<img src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/thumb-empty.jpg" alt="thumbnail" />';
  51. }
  52. ?>
  53. <?php } ?>
  54. <?php } elseif (get_post_custom_values('Thumbnail') == true || get_post_custom_values('thumbnail') == true) { ?>
  55. <img src="<?php $custom_fields = get_post_custom($post_ID); $my_custom_field = $custom_fields['Thumbnail']; foreach ( $my_custom_field as $key => $value ) echo "$value"; ?>" alt="custom-thumbnail" />
  56. <?php } elseif (function_exists('the_post_thumbnail') && !function_exists('p75GetThumbnail')) { ?>
  57. <?php if (has_post_thumbnail()) { ?>
  58. <?php the_post_thumbnail(); ?>
  59. <?php } else { ?>
  60. <?php
  61. $total = '24'; $file_type = '.jpg';
  62. // Change to the location of the folder containing the images
  63. $image_folder = '' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/';
  64. $start = '1'; $random = mt_rand($start, $total); $image_name = $random . $file_type;
  65. if ($wptouch_settings['post-cal-thumb'] == 'post-thumbnails-random') {
  66. echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
  67. } else {
  68. echo '<img src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/thumb-empty.jpg" alt="thumbnail" />';
  69. }
  70. ?>
  71. <?php } } ?>
  72. </div>
  73. <div class="thumb-bottom-left"></div><div class="thumb-bottom-right"></div>
  74. </div>
  75. <?php } elseif ($wptouch_settings['post-cal-thumb'] == 'calendar-icons') { ?>
  76. <div class="calendar">
  77. <div class="cal-month month-<?php echo get_the_time('m') ?>"><?php echo get_the_time('M') ?></div>
  78. <div class="cal-date"><?php echo get_the_time('j') ?></div>
  79. </div>
  80. <?php } elseif ($wptouch_settings['post-cal-thumb'] == 'nothing-shown') { } else { ?>
  81. <div class="calendar">
  82. <div class="cal-month month-<?php echo get_the_time('m') ?>"><?php echo get_the_time('M') ?></div>
  83. <div class="cal-date"><?php echo get_the_time('j') ?></div>
  84. </div>
  85. <?php } ?>
  86. <?php } ?>
  87. <a class="h2" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  88. <div class="post-author">
  89. <?php if ($wptouch_settings['post-cal-thumb'] != 'calendar-icons') { ?><span class="lead"><?php _e("Written on", "wptouch"); ?></span> <?php echo get_the_time('d.m.Y') ?> <?php _e("at", "wptouch"); ?> <?php echo get_the_time('G:i') ?><br /><?php if (!bnc_show_author()) { echo '<br />';} ?><?php } ?>
  90. <?php if (bnc_show_author()) { ?><span class="lead"><?php _e("By", "wptouch"); ?></span> <?php the_author(); ?><br /><?php } ?>
  91. <?php if (bnc_show_categories()) { echo('<span class="lead">' . __( 'Categories', 'wptouch' ) . ':</span> '); the_category(', '); echo('<br />'); } ?>
  92. <?php if (bnc_show_tags() && get_the_tags()) { the_tags('<span class="lead">' . __( 'Tags', 'wptouch' ) . ':</span> ', ', ', ''); } ?>
  93. </div>
  94. <div class="clearer"></div>
  95. <div id="entry-<?php the_ID(); ?>" <?php if (bnc_excerpt_enabled()) { ?>style="display:none"<?php } ?> class="mainentry <?php echo $wptouch_settings['style-text-justify']; ?>">
  96. <?php the_excerpt(); ?>
  97. <a class="read-more" href="<?php the_permalink() ?>"><?php _e( "Read This Post", "wptouch" ); ?></a>
  98. </div>
  99. </div>
  100. <?php endwhile; ?>
  101. <?php if (!function_exists('dsq_comments_template') && !function_exists('id_comments_template')) { ?>
  102. <div id="call<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="ajax-load-more">
  103. <div id="spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="spin" style="display:none"></div>
  104. <a class="ajax" href="javascript:return false;" onclick="$wpt('#spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeIn(200); $wpt('#ajaxentries<?php echo md5($_SERVER['REQUEST_URI']); ?>').load('<?php echo get_next_posts_page_link(); ?>', {}, function(){ $wpt('#call<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeOut();});">
  105. <?php _e( "Load more entries...", "wptouch" ); ?>
  106. </a>
  107. </div>
  108. <div id="ajaxentries<?php echo md5($_SERVER['REQUEST_URI']); ?>"></div>
  109. <?php } else { ?>
  110. <div class="main-navigation">
  111. <div class="alignleft">
  112. <?php previous_posts_link( __( 'Newer Entries', 'wptouch') ) ?>
  113. </div>
  114. <div class="alignright">
  115. <?php next_posts_link( __('Older Entries', 'wptouch')) ?>
  116. </div>
  117. </div>
  118. <?php } ?>
  119. </div><!-- #End post -->
  120. <?php else : ?>
  121. <div class="result-text-footer">
  122. <?php wptouch_core_else_text(); ?>
  123. </div>
  124. <?php endif; ?>
  125. <!-- Here we're establishing whether the page was loaded via Ajax or not, for dynamic purposes. If it's ajax, we're not bringing in footer.php -->
  126. <?php global $is_ajax; if (!$is_ajax) get_footer();