PageRenderTime 52ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

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

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