Want more features on Pastebin? Sign Up, it's FREE!

Decode for hackscript@wordpress.org

By: johnburn on Jan 3rd, 2012  |  syntax: PHP  |  size: 6.43 KB  |  views: 84  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $nama = get_theme_option('nama_agc');
  3. add_filter('term_links-post_tag', 'replace_tag_domain', 100);
  4. function replace_tag_domain($links) {
  5.     $find = 'tag/';
  6.     $replace_with = get_theme_option('nama_agc') . '-';
  7.     foreach($links as $k => $link) $links[$k] = str_replace($find, $replace_with, $link);
  8.     return $links;
  9. }
  10. function review($limit) {
  11.     $review = explode(' ', get_comment_text(), $limit);
  12.     if (count($review) >= $limit) {
  13.         array_pop($review);
  14.         $review = implode(' ', $review) . '';
  15.     } else {
  16.         $review = implode(' ', $review);
  17.     }
  18.     $review = preg_replace('`\[[^\]]*\]`', '', $review);
  19.     return $review;
  20. }
  21. define('BING_API_KEY', '');
  22. function pete_curl_get($url, $params) {
  23.     $post_params = array();
  24.     foreach($params as $key => & $val) {
  25.         if (is_array($val)) $val = implode(',', $val);
  26.         $post_params[] = $key . '=' . urlencode($val);
  27.     }
  28.     $post_string = implode('&', $post_params);
  29.     $fullurl = $url . '?' . $post_string;
  30.     $ch = curl_init();
  31.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  32.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  33.     curl_setopt($ch, CURLOPT_URL, $fullurl);
  34.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  35.     curl_setopt($ch, CURLOPT_USERAGENT, 'msnbot/1.0 (+http://search.msn.com/msnbot.htm)');
  36.     $result = curl_exec($ch);
  37.     curl_close($ch);
  38.     return $result;
  39. }
  40. function perform_bing_web_search($termstring) {
  41.     $searchurl = 'http://api.bing.net/json.aspx?';
  42.     $searchurl.= 'AppId=' . get_theme_option('api_agc');
  43.     $searchurl.= '&Query=site%3A' . get_theme_option('source_agc') . '+' . urlencode($termstring);
  44.     $searchurl.= '&Sources=Web';
  45.     $searchurl.= '&Web.Count=' . get_theme_option('number_agc') . '';
  46.     $searchurl.= '&Web.Offset=0';
  47.     $searchurl.= '&Web.Options=DisableHostCollapsing+DisableQueryAlterations';
  48.     $searchurl.= '&JsonType=raw';
  49.     $response = pete_curl_get($searchurl, array());
  50.     $responseobject = json_decode($response, true);
  51.     if ($responseobject['SearchResponse']['Web']['Total'] == 0) return array();
  52.     $allresponseresults = $responseobject['SearchResponse']['Web']['Results'];
  53.     $result = array();
  54.     foreach($allresponseresults as $responseresult) {
  55.         $result[] = array('url' => $responseresult['Url'], 'title' => $responseresult['Title'], 'abstract' => $responseresult['Description'],);
  56.     }
  57.     return $result;
  58. }
  59. function perform_bing_image_search($termstring) {
  60.     $searchurl = 'http://api.bing.net/json.aspx?';
  61.     $searchurl.= 'AppId=' . get_theme_option('api_agc');
  62.     $searchurl.= '&Query=site%3A' . get_theme_option('source_agc') . '+' . urlencode($termstring);
  63.     $searchurl.= '&Sources=image';
  64.     $searchurl.= '&Adult=Strict';
  65.     $searchurl.= '&Image.Count=' . get_theme_option('number_agc') . '';
  66.     $searchurl.= '&Image.Offset=0';
  67.     $searchurl.= '&JsonType=raw';
  68.     $response = pete_curl_get($searchurl, array());
  69.     $responseobject = json_decode($response, true);
  70.     if ($responseobject['SearchResponse']['Image']['Total'] == 0) return array();
  71.     $allresponseresults = $responseobject['SearchResponse']['Image']['Results'];
  72.     $result = array();
  73.     foreach($allresponseresults as $responseresult) {
  74.         $result[] = array('url' => $responseresult['Url'], 'title' => $responseresult['Title'], 'media' => $responseresult['MediaUrl'], 'thumbnail' => $responseresult['Thumbnail'], 'height' => $responseresult['Height'], 'width' => $responseresult['Width'], 'size' => $responseresult['FileSize'], 'type' => $responseresult['ContentType'],);
  75.     }
  76.     return $result;
  77. }
  78. if (isset($_REQUEST['s'])) {
  79.     $termstring = urldecode($_REQUEST['s']);
  80. } else {
  81.     $termstring = '';
  82. }
  83. function CleanFileNameBan($result) {
  84.     $bannedkey = get_theme_option('badword_act');
  85.     $bannedkey = explode(',', $bannedkey);
  86.     $result = str_replace($bannedkey, '', $result);
  87.     $result = trim($result);
  88.     return $result;
  89. }
  90. function hilangkan_spesial_karakter($result) {
  91.     $result = strip_tags($result);
  92.     $result = preg_replace('/&.+?;/', '', $result);
  93.     $result = preg_replace('/\s+/', ' ', $result);
  94.     $result = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', ' ', $result);
  95.     $result = preg_replace('|-+|', ' ', $result);
  96.     $result = preg_replace('/&#?[a-z0-9]+;/i', '', $result);
  97.     $result = preg_replace('/[^%A-Za-z0-9 _-]/', ' ', $result);
  98.     $result = trim($result, ' ');
  99.     return $result;
  100. }
  101. function ubah_tanda($result) {
  102.     $result = strtolower($result);
  103.     $result = preg_replace('/&.+?;/', '', $result);
  104.     $result = preg_replace('/\s+/', '-', $result);
  105.     $result = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '-', $result);
  106.     $result = preg_replace('|-+|', '-', $result);
  107.     $result = preg_replace('/&#?[a-z0-9]+;/i', '', $result);
  108.     $result = preg_replace('/[^%A-Za-z0-9 _-]/', '-', $result);
  109.     $result = trim($result, '-');
  110.     return $result;
  111. }
  112. function kecilkan($result) {
  113.     $result = strtolower($result);
  114.     return $result;
  115. }
  116. function CleanUrlBlog($request) {
  117.     $request = htmlspecialchars($request);
  118.     $request = str_replace('.html', ' ', $request);
  119.     $request = str_replace('.htm', ' ', $request);
  120.     $request = str_replace('.', ' ', $request);
  121.     $request = str_replace('/', ' ', $request);
  122.     $request = str_replace('+', ' ', $request);
  123.     $request = str_replace('-', ' ', $request);
  124.     $request_a = explode(' ', $request);
  125.     $request_new = array();
  126.     foreach($request_a as $token) {
  127.         $request_new[] = ucwords(trim($token));
  128.     }
  129.     $request = implode(' ', $request_new);
  130.     return $request;
  131. }
  132. function hilangkan_special_karakter_title($title) {
  133.     $title = CleanUrlBlog($_SERVER['REQUEST_URI']);
  134.     $title = preg_replace('/&.+?;/', ' ', $title);
  135.     $title = preg_replace('/\s+/', ' ', $title);
  136.     $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', ' ', $title);
  137.     $title = preg_replace('|-+|', '', $title);
  138.     $title = preg_replace('/&#?[a-z0-9]+;/i', ' ', $title);
  139.     $title = preg_replace('/[^%A-Za-z0-9 _-]/', ' ', $title);
  140.     $title = str_replace(' -', ' ', $title);
  141.     $title = str_replace('.com', '+com', $title);
  142.     $title = str_replace('.net', '+net', $title);
  143.     $title = str_replace('.info', '+info', $title);
  144.     $title = str_replace('.org', '+org', $title);
  145.     $title = str_replace('.us', '+us', $title);
  146.     $title = str_replace('.co.id', '+co+id', $title);
  147.     $title = trim(strip_tags($title));
  148.     return ($title);
  149. }
  150. ?>
clone this paste RAW Paste Data