PageRenderTime 57ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://github.com/alx/SimplePress
PHP | 170 lines | 138 code | 30 blank | 2 comment | 49 complexity | 7297c3cf05b021175047c5abf253e958 MD5 | raw file
  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 (!function_exists('dsq_comments_template') && !function_exists('id_comments_template')) { ?>
  8. <?php if (wp_touch_get_comment_count() > 0 && !is_archive() && !is_search()) { ?>
  9. <div <?php if ($wptouch_settings['post-cal-thumb'] == 'nothing-shown') { echo 'id="nothing-shown" ';} ?>class="comment-bubble<?php if (wp_touch_get_comment_count() > 99) echo('-big'); ?>">
  10. <?php comments_number('0','1','%'); ?>
  11. </div>
  12. <?php } ?>
  13. <?php } ?>
  14. <?php if (is_archive() || is_search()) { ?>
  15. <div class="archive-top">
  16. <div class="archive-top-right">
  17. <?php if (bnc_excerpt_enabled()) { ?>
  18. <script type="text/javascript">
  19. $wptouch(document).ready(function(){
  20. $wptouch("a#arrow-<?php the_ID(); ?>").click(function(event) {
  21. $wptouch(this).toggleClass("post-arrow-down");
  22. $wptouch('#entry-<?php the_ID(); ?>').fadeToggle(500);
  23. });
  24. });
  25. </script>
  26. <a class="post-arrow" id="arrow-<?php the_ID(); ?>" href="javascript:void(0);"></a>
  27. <?php } ?>
  28. </div>
  29. <div id="arc-top" class="archive-top-left month-<?php echo get_the_time('m') ?>">
  30. <?php echo get_the_time('M') ?> <?php echo get_the_time('j') ?>, <?php echo get_the_time('Y') ?>
  31. </div>
  32. </div>
  33. <?php } else { ?>
  34. <?php if (bnc_excerpt_enabled()) { ?>
  35. <script type="text/javascript">
  36. $wptouch(document).ready(function(){
  37. $wptouch("a#arrow-<?php the_ID(); ?>").click(function(event) {
  38. $wptouch(this).toggleClass("post-arrow-down");
  39. $wptouch('#entry-<?php the_ID(); ?>').fadeToggle(500);
  40. });
  41. });
  42. </script>
  43. <a class="post-arrow" id="arrow-<?php the_ID(); ?>" href="javascript:void(0);"></a>
  44. <?php } ?>
  45. <?php
  46. $version = bnc_get_wp_version();
  47. if ($version >= 2.9 && $wptouch_settings['post-cal-thumb'] != 'calendar-icons' && $wptouch_settings['post-cal-thumb'] != 'nothing-shown') { ?>
  48. <div class="wptouch-post-thumb-wrap">
  49. <div class="thumb-top-left"></div><div class="thumb-top-right"></div>
  50. <div class="wptouch-post-thumb">
  51. <?php
  52. if (function_exists('p75GetThumbnail')) {
  53. if ( p75HasThumbnail($post->ID) ) { ?>
  54. <img src="<?php echo p75GetThumbnail($post->ID); ?>" alt="post thumbnail" />
  55. <?php } else { ?>
  56. <?php
  57. $total = '24'; $file_type = '.jpg';
  58. // Change to the location of the folder containing the images
  59. $image_folder = '' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/';
  60. $start = '1'; $random = mt_rand($start, $total); $image_name = $random . $file_type;
  61. if ($wptouch_settings['post-cal-thumb'] == 'post-thumbnails-random') {
  62. echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
  63. } else {
  64. echo '<img src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/thumb-empty.jpg" alt="thumbnail" />';
  65. }
  66. ?>
  67. <?php } ?>
  68. <?php } elseif (get_post_custom_values('Thumbnail') == true) { ?>
  69. <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" />
  70. <?php } elseif (function_exists('the_post_thumbnail') && !function_exists('p75GetThumbnail')) { ?>
  71. <?php if (has_post_thumbnail()) { ?>
  72. <?php the_post_thumbnail(); ?>
  73. <?php } else { ?>
  74. <?php
  75. $total = '24'; $file_type = '.jpg';
  76. // Change to the location of the folder containing the images
  77. $image_folder = '' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/';
  78. $start = '1'; $random = mt_rand($start, $total); $image_name = $random . $file_type;
  79. if ($wptouch_settings['post-cal-thumb'] == 'post-thumbnails-random') {
  80. echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
  81. } else {
  82. echo '<img src="' . compat_get_plugin_url( 'wptouch' ) . '/themes/core/core-images/thumbs/thumb-empty.jpg" alt="thumbnail" />';
  83. }
  84. ?>
  85. <?php } } ?>
  86. </div>
  87. <div class="thumb-bottom-left"></div><div class="thumb-bottom-right"></div>
  88. </div>
  89. <?php } elseif ($wptouch_settings['post-cal-thumb'] == 'calendar-icons') { ?>
  90. <div class="calendar">
  91. <div class="cal-month month-<?php echo get_the_time('m') ?>"><?php echo get_the_time('M') ?></div>
  92. <div class="cal-date"><?php echo get_the_time('j') ?></div>
  93. </div>
  94. <?php } elseif ($wptouch_settings['post-cal-thumb'] == 'nothing-shown') { } else { ?>
  95. <div class="calendar">
  96. <div class="cal-month month-<?php echo get_the_time('m') ?>"><?php echo get_the_time('M') ?></div>
  97. <div class="cal-date"><?php echo get_the_time('j') ?></div>
  98. </div>
  99. <?php } ?>
  100. <?php } ?>
  101. <a class="h2" href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  102. <div class="post-author">
  103. <?php if ($wptouch_settings['post-cal-thumb'] != 'calendar-icons') { ?><span class="lead"><?php _e("Written on", "wptouch"); ?></span> <?php echo get_the_time('M') ?> <?php echo get_the_time('j') ?>, <?php echo get_the_time('Y') ?><?php if (!bnc_show_author()) { echo '<br />';} ?><?php } ?>
  104. <?php if (bnc_show_author()) { ?><span class="lead"><?php _e("By", "wptouch"); ?></span> <?php the_author(); ?><br /><?php } ?>
  105. <?php if (bnc_show_categories()) { echo('<span class="lead">' . __( 'Categories', 'wptouch' ) . ':</span> '); the_category(', '); echo('<br />'); } ?>
  106. <?php if (bnc_show_tags() && get_the_tags()) { the_tags('<span class="lead">' . __( 'Tags', 'wptouch' ) . ':</span> ', ', ', ''); } ?>
  107. </div>
  108. <div class="clearer"></div>
  109. <div id="entry-<?php the_ID(); ?>" <?php if (bnc_excerpt_enabled()) { ?>style="display:none"<?php } ?> class="mainentry <?php echo $wptouch_settings['style-text-size']; ?> <?php echo $wptouch_settings['style-text-justify']; ?>">
  110. <?php the_excerpt(); ?>
  111. <a class="read-more" href="<?php the_permalink() ?>"><?php _e( "Read This Post", "wptouch" ); ?></a>
  112. </div>
  113. </div>
  114. <?php endwhile; ?>
  115. <?php if (!function_exists('dsq_comments_template') && !function_exists('id_comments_template')) { ?>
  116. <div id="call<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="ajax-load-more">
  117. <div id="spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="spin" style="display:none"></div>
  118. <a class="ajax" href="javascript:void(0);" onclick="$wptouch('#spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeIn(200); $wptouch('#ajaxentries<?php echo md5($_SERVER['REQUEST_URI']); ?>').load('<?php echo get_next_posts_page_link(); ?>', {}, function(){ $wptouch('#call<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeOut();});">
  119. <?php _e( "Load more entries...", "wptouch" ); ?>
  120. </a>
  121. </div>
  122. <div id="ajaxentries<?php echo md5($_SERVER['REQUEST_URI']); ?>"></div>
  123. <?php } else { ?>
  124. <div class="main-navigation">
  125. <div class="alignleft">
  126. <?php previous_posts_link( __( 'Newer Entries', 'wptouch') ) ?>
  127. </div>
  128. <div class="alignright">
  129. <?php next_posts_link( __('Older Entries', 'wptouch')) ?>
  130. </div>
  131. </div>
  132. <?php } ?>
  133. </div><!-- #End post -->
  134. <?php else : ?>
  135. <div class="result-text-footer">
  136. <?php wptouch_core_else_text(); ?>
  137. </div>
  138. <?php endif; ?>
  139. <!-- 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 -->
  140. <?php global $is_ajax; if (!$is_ajax) get_footer(); ?>