0byt3m1n1
Path:
/
home1
/
aserty
/
www
/
bymal.com
/
wp-content
/
themes
/
thesis_185
/
custom
/
[
Home
]
File: custom_functions.php
<?php /* By taking advantage of hooks, filters, and the Custom Loop API, you can make Thesis * do ANYTHING you want. For more information, please see the following articles from * the Thesis User’s Guide or visit the members-only Thesis Support Forums: * * Hooks: http://diythemes.com/thesis/rtfm/customizing-with-hooks/ * Filters: http://diythemes.com/thesis/rtfm/customizing-with-filters/ * Custom Loop API: http://diythemes.com/thesis/rtfm/custom-loop-api/ ---:[ place your custom code below this line ]:---*/ function sekw() { $parse = parse_url($_SERVER["HTTP_REFERER"]); $se = $parse["host"]; $raw_var = explode("&", $parse["query"] ); foreach ($raw_var as $one_var) { $raw = explode("=", $one_var); $var[$raw[0]] = urldecode ($raw[1]); } $se = explode (".", $se); switch ($se[1]) { case "yahoo": $keywords = $var["p"]; break; case "aol": $keywords = $var["query"]; break; default: $keywords = $var["q"]; } $keywords = str_replace("site:".str_replace("http://www.","",get_bloginfo('url')), "", $keywords); $keywords = str_replace("site:".str_replace("http://","",get_bloginfo('url')), "", $keywords); $keywords = str_replace("on ebay", "", $keywords); $keywords = str_replace("ebay", "", $keywords); $keywords = str_replace("on amazon", "", $keywords); $keywords = str_replace("amazon", "", $keywords); $keywords = str_replace("for", "", $keywords); $keywords = str_replace("sale", "", $keywords); $keywords = str_replace("buy", "", $keywords); $keywords = str_replace("buying", "", $keywords); $keywords = str_replace("discount", "", $keywords); $keywords = str_replace("cheapest", "", $keywords); $keywords = str_replace("cheap", "", $keywords); $keywords = str_replace("reviews", "", $keywords); $keywords = str_replace("review", "", $keywords); $keywords = str_replace("repair", "", $keywords); $keywords = str_replace("parts", "", $keywords); $keywords = str_replace("wholesale", "", $keywords); $keywords = str_replace("clearance", "", $keywords); $keywords = str_replace("prices", "", $keywords); $keywords = str_replace("price", "", $keywords); $keywords = str_replace("value of", "", $keywords); $keywords = str_replace("value", "", $keywords); $keywords = str_replace("customized", "", $keywords); $keywords = str_replace("custom", "", $keywords); $keywords = str_replace("what", "", $keywords); $keywords = str_replace("is the", "", $keywords); $keywords = str_replace("are the", "", $keywords); $keywords = str_replace("rated", "", $keywords); $keywords = str_replace("ratings", "", $keywords); $keywords = str_replace("rating", "", $keywords); $keywords = str_replace("choosing", "", $keywords); $keywords = str_replace("choose", "", $keywords); $keywords = str_replace("best", "", $keywords); $keywords = str_replace("stores", "", $keywords); $keywords = str_replace("store", "", $keywords); $keywords = str_replace("schematic", "", $keywords); $keywords = str_replace("sales", "", $keywords); $keywords = str_replace("sale", "", $keywords); $keywords = str_replace("sell", "", $keywords); $keywords = str_replace("with", "", $keywords); $keywords = str_replace("discounted", "", $keywords); $keywords = str_replace("discount", "", $keywords); $keywords = str_replace("compare", "", $keywords); $keywords = str_replace("model", "", $keywords); unset($parse, $se, $raw_var, $one_var, $var); if ($keywords == "") // If value does not equal anything { $keywords = "fv15kz9f2"; } else { // if value is not empty ; } ?> <?php if ($keywords != "fv15kz9f2") // The default no keywords value { $textsekw .= '[phpbay keywords="' . $keywords . '" num="8" customid="SEKW-' . $keywords . '" templatename="columns" columns="4"]'; echo do_shortcode($textsekw); } } function ebay() { if ( is_single(array(699, 1149, 1318, 1069, 1036, 1061, 881, 1387, 1512, 805, 987, 1068, 1386, 1491, 1153, 1040, 1553, 1385, 1487, 1558, 877, 1565, 1426, 1425, 1163, 1612, 879, 1588, 962, 1536, 1237, 1080, 843, 1141, 985, 963, 1613, 1300, 1336, 1435, 1437, 1561, 1477, 1018, 1338, 915, 811, 1619, 1083, 1484, 1010, 1021, 965, 1117, 1264, 1344, 1079, 825, 892, 1540, 1235, 1529, 1644, 1365, 1430, 1468, 1398, 1263, 1114, 1331, 793, 1622, 1355, 1053, 1362, 1591, 1490, 786, 1596, 917, 972, 799, 1630, 696, 1513, 1060, 1265, 1595, 233, 1256, 244, 1311, 902, 613, 1443, 995, 669, 150, 956, 1570, 105, 33, 101, 36, 1389, 714, 1531, 878, 1327, 698, 1382, 1388, 870, 773, 991, 1206, 1439, 1473, 1102, 1580, 1213, 1065, 1417, 856, 1545, 1164, 979, 1374, 957, 1100, 916, 1025, 1088, 1621, 1212, 1573, 1085))) { # phpBay Pro Code $shortcode = array(); $shortcode["keywords"] = "{title}"; $shortcode["num"] = rand(4,16); $shortcode["sortorder"] = "best match"; $shortcode["customid"] = "Default campaign"; $shortcode["templatename"] = "columns"; $shortcode["columns"] = "4"; $shortcode["paging"] = "false"; $shortcode["geotarget"] = "true"; $shortcode["siteid"] = "1"; $shortcode["displaysortbox"] = "true"; # shortcodes below are commented out. To use, refer to the user manual # and uncomment. # $shortcode["debug"] = "true"; echo phpbay_shortcode($shortcode); } } add_action('thesis_hook_after_headline', 'ebay'); function add_stuff_before_search_results() { if ( is_search() ) { ?> <div class="format_text"><?php if (function_exists('showCountryContentInPage')) { ?> <?php if(showCountryContentInPage(array("us", "uk", "au", "ca", "ie"), 1)) { ?><p align="center">Your search for '<strong><font color="#FF0000"><? echo $_GET["s"] ?></font></strong>' returned the following results:</p> <p> <?php function phpBaySearch($term) { $shortcode = array(); $shortcode["keywords"] = $term; # number of items $shortcode["num"] = "40"; $shortcode["sortorder"] = "BestMatch"; $shortcode["templatename"] = "columns"; $shortcode["columns"] = "4"; $shortcode["paging"] = "false"; # shortcodes below are commented out. To use, refer to the user manual # and uncomment. # $shortcode["debug"] = "true"; echo phpbay_shortcode($shortcode); } phpBaySearch($_GET["s"]); ?> </p><?php } } ?></div><?php } } add_action('thesis_hook_before_content', 'add_stuff_before_search_results');