Advertisement
plas71k

hex file - decoded

Dec 19th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.03 KB | None | 0 0
  1. <?php
  2. function wmpagenavigationfnc($args = null)
  3. {
  4.     $defaults  = array(
  5.         "page" => null,
  6.         "pages" => null,
  7.         "range" => 3,
  8.         "gap" => 3,
  9.         "anchor" => 1,
  10.         "before" => "<div class=\"emm-paginate\">",
  11.         "after" => "</div>",
  12.         "title" => __("Pages:"),
  13.         "nextpage" => __("&raquo;"),
  14.         "previouspage" => __("&laquo"),
  15.         "echo" => 1
  16.     );
  17.     $r = wp_parse_args($args, $defaults);
  18.     extract($r, EXTR_SKIP);
  19.     if (!$page && !$pages) {
  20.         global $wp_query;
  21.         $page  = get_query_var("paged");
  22.         $page  = !empty($page) ? intval($page) : 1;
  23.         $posts_per_page   = intval(get_query_var("posts_per_page"));
  24.         $pages = intval(ceil($wp_query->found_posts / $posts_per_page));
  25.     }
  26.     $output = "";
  27.     if ($pages > 1) {
  28.         $output .= "$before<span class='emm-title'>$title</span>";
  29.         $ellipsis               = "<span class='emm-gap'>...</span>";
  30.         if ($page > 1 && !empty($previouspage)) {
  31.             $output .= "<a href='" . get_pagenum_link($page - 1) . "' class='emm-prev'>$previouspage</a>";
  32.         }
  33.         $min_links                     = $range * 2 + 1;
  34.         $block_min      = min($page - $range, $pages - $min_links);
  35.         $block_high  = max($page + $range, $min_links);
  36.         $left_gap                 = (($block_min - $anchor - $gap) > 0) ? true : false;
  37.         $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
  38.         if ($left_gap && !$right_gap) {
  39.             $output .= sprintf("%s%s%s", emm_paginate_loop(1, $anchor), $ellipsis, emm_paginate_loop($block_min, $pages, $page));
  40.         } else if ($left_gap && $right_gap) {
  41.             $output .= sprintf("%s%s%s%s%s", emm_paginate_loop(1, $anchor), $ellipsis, emm_paginate_loop($block_min, $block_high, $page), $ellipsis, emm_paginate_loop(($pages - $anchor + 1), $pages));
  42.         } else if ($right_gap && !$left_gap) {
  43.             $output .= sprintf("%s%s%s", emm_paginate_loop(1, $block_high, $page), $ellipsis, emm_paginate_loop(($pages - $anchor + 1), $pages));
  44.         } else {
  45.             $output .= emm_paginate_loop(1, $pages, $page);
  46.         }
  47.         if ($page < $pages && !empty($nextpage)) {
  48.             $output .= "<a href='" . get_pagenum_link($page + 1) . "' class='emm-next'>$nextpage</a>";
  49.         }
  50.         $output .= $after;
  51.     }
  52.     if ($echo) {
  53.         echo $output;
  54.     }
  55.     return $output;
  56. }
  57. function emm_paginate_loop($start, $max, $page = 0)
  58. {
  59.     $output = "";
  60.     for ($i = $start; $i <= $max; $i++) {
  61.         $output .= ($page === intval($i)) ? "<span class='emm-page emm-current'>$i</span>" : "<a href='" . get_pagenum_link($i) . "' class='emm-page'>$i</a>";
  62.     }
  63.     return $output;
  64. }
  65. function this_theme_post_content($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '')
  66. {
  67.     $content                = get_the_content($more_link_text, $stripteaser, $more_file);
  68.     $content = apply_filters("the_content", $content);
  69.     $content               = str_replace("]]>", "]]&gt;", $content);
  70.     $content = strip_tags($content, "");
  71.     if (strlen($_GET["p"]) > 0) {
  72.         echo "<p>";
  73.         echo $content;
  74.         echo "&nbsp;<a href='";
  75.         the_permalink();
  76.         echo "'>" . "Read More &rarr;</a>";
  77.         echo "</p>";
  78.     } else if ((strlen($content) > $max_char) && ($espacio = strpos($content, " ", $max_char))) {
  79.         $content = substr($content, 0, $espacio);
  80.         $content = $content;
  81.         echo "<p>";
  82.         echo $content;
  83.         echo "...";
  84.         echo "&nbsp;<a href='";
  85.         the_permalink();
  86.         echo "'>" . $more_link_text . "</a>";
  87.         echo "</p>";
  88.     } else {
  89.         echo "<p>";
  90.         echo $content;
  91.         echo "&nbsp;<a href='";
  92.         the_permalink();
  93.         echo "'>" . "Read More &rarr;</a>";
  94.         echo "</p>";
  95.     }
  96. }
  97. function get_wpcategory($cat_name)
  98. {
  99.     $term = get_term_by("name", $cat_name, "category");
  100. //==================================== PAYMENT =========================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement