Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. <?php if($use_pagination) { ?>
  2. if(!wpp_pagination_<?php echo $unique_hash; ?>) {
  3. jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_pagination_slider_wrapper").each(function() {
  4. var this_parent = this;
  5. /* Slider */
  6. jQuery('.wpp_pagination_slider', this).slider({
  7. value:1,
  8. min: 1,
  9. max: <?php echo $pages; ?>,
  10. step: 1,
  11. slide: function( event, ui ) {
  12. /* Update page counter - we do it here because we want it to be instant */
  13. jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_current_page_count").text(ui.value);
  14. jQuery("#wpp_shortcode_<?php echo $unique_hash; ?> .wpp_pagination_slider .slider_page_info .val").text(ui.value);
  15. },
  16. stop: function(event, ui) {
  17. wpp_query_<?php echo $unique_hash; ?> = changeAddressValue(ui.value, wpp_query_<?php echo $unique_hash; ?>);
  18. }
  19.  
  20. });
  21.  
  22. /* Fix slider width based on button width */
  23. var slider_width = (jQuery(this_parent).width() - jQuery(".wpp_pagination_back", this_parent).outerWidth() - jQuery(".wpp_pagination_forward", this_parent).outerWidth() - 30);
  24. jQuery(".wpp_pagination_slider", this_parent).css('width', slider_width);
  25.  
  26. jQuery('.wpp_pagination_slider .ui-slider-handle', this).append('<div class="slider_page_info"><div class="val">1</div><div class="arrow"></div></div>');
  27.  
  28. });
  29. wpp_pagination_<?php echo $unique_hash; ?> = true;
  30. }
  31. <?php } ?>
  32. });
  33. </script>
  34. <?php
  35. $js_result = ob_get_contents();
  36. ob_end_clean();
  37.  
  38. ob_start(); ?>
  39. <div class="properties_pagination <?php echo $settings['class']; ?> wpp_slider_pagination" id="properties_pagination_<?php echo $unique_hash; ?>">
  40. <div class="wpp_pagination_slider_status">
  41.  
  42. <?php
  43. if(function_exists('WPPFL_getNumberOfFavorites')) {
  44. $num_of_favorites = WPPFL_getNumberOfFavorites();
  45. } else{
  46. $num_of_favorites = 0;
  47. }
  48.  
  49. $currentTemplate = "";
  50. if (isset($wpp_query['template'])) {
  51. $currentTemplate = $wpp_query['template'];
  52. }
  53. ?>
  54. <?php if ($currentTemplate==TEMPLATEPATH . "/list-my-property-content.php") { ?>
  55. <div class="wppcs-sub-menu">
  56. <?php global $post;
  57. $post_name = $post->post_name; ?>
  58. <?php $class='class="active"'; ?>
  59. <ul>
  60. <li <?php if($post_name == 'list-my-property') { echo $class; } ?>>
  61. <a href="<?php echo get_bloginfo('url'); ?>/list-my-property/">
  62. View Listed Properties
  63. </a>
  64. </li>
  65. <li <?php if($post_name == 'add-new-property') { echo $class; } ?>>
  66. <a href="<?php echo get_bloginfo('url'); ?>/list-my-property/add-new-property/">
  67. Add New Property
  68. </a>
  69. </li>
  70. </ul>
  71. </div>
  72. <?php } else { ?>
  73. <ul class="top_part">
  74. <li><a>Search results</a></li>
  75. <li class="favor"><a href="/favourite-properties">My Favourites(<span class="number_of_favorites"><?php echo $num_of_favorites; ?></span>)</a></li>
  76. </ul>
  77. <?php } ?>
  78. <div class="clear"></div>
  79. </div>
  80. <?php if($use_pagination) { ?>
  81. <div class="wpp_pagination_slider_wrapper">
  82. <div class="wpp_page_numbers_block">
  83. <span class="numbers-title">Pages</span>
  84. <?php
  85. if ($pages < 10) {
  86. for($i=1; $i<=$pages; $i++) {
  87. echo '<span class="page_numbers" data-value="'.$i.'">'.$i.'</span>';
  88. }
  89. } else {
  90. for($i=1; $i<=$pages; $i++) {
  91. if (($i < 4) || ($i>$pages-3)) {
  92. echo '<span class="page_numbers" data-value="'.$i.'">'.$i.'</span>';
  93. }
  94. if ($i==4) {
  95. echo '<span class="middle-pages"><span class="dotted-separator">...</span></span>';
  96. }
  97. }
  98. }?>
  99. </div>
  100. <div class="wpp_pagination_back wpp_pagination_button"><?php _e('Prev', 'wpp'); ?></div>
  101. <div class="wpp_pagination_forward wpp_pagination_button"><?php _e('Next', 'wpp'); ?></div>
  102. <div class="wpp_pagination_slider"></div>
  103. </div>
  104. <?php } ?>
  105. </div>
  106. <div class="ajax_loader"></div>
  107. <?php
  108. $html_result = ob_get_contents();
  109. ob_end_clean();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement