'); exit(); } } */ switch ($action) { case "1": if($pageid!="") { $bubble = FetchRow("SELECT restitle,metatagdesc,metatagkey FROM bwp_bubblefeed WHERE id='". intval($pageid)."'"); echo $bubble['restitle']." - ".$client_domain." '); exit(); } if($pageid!="") { $title = FetchOne("SELECT title FROM bwp_articles WHERE id = '".intval($pageid)."'"); } break; case "6": break; case "5": break; case "9": if($pageid!="") { $bubble = FetchRow("SELECT * FROM bwp_blog_post WHERE blogpost_title='".$pageid."' AND domain_id ='".$domain['id']."'"); echo $bubble['blogpost_title']." - ".$client_domain."">


$v) $vals[] = $k."=".urlencode($v); $requeststr = implode("&", $vals); } // Block sites passing invalid parameters $chk = 0; $chks = array('phpconfirm', 'query=404', '404.php', 'artdetails.php', 'hampreport/ui.base.css', '62.215.5.69', 'mysql', '109%2E195%2E248%2E24', '109.195.248.24'); for ($i=0; $i 0) die('Invalid Request - Error A207'); } // Make sure minimum parameters exist to block parameter hack attempts if (!((Contains(strtolower($requeststr), 'domain') && Contains(strtolower($requeststr), 'websitereferencesimple') && Contains(strtolower($requeststr), 'action')) || (Contains(strtolower($requeststr), 'domain') && Contains(strtolower($requeststr), 'agent') && Contains(strtolower($requeststr), 'action')))) { $ipaddress = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR']:''; $domain = isset($_REQUEST['domain']) ? CleanHTML($_REQUEST['domain']):''; feed_log ($url, $requeststr, NULL, number_format(elog_time($debugstart),5), 0, $errtext='Invalid Parameters A208 (' . $ipaddress . '): ' . $domain); die('Invalid Request - Error A208'); } $validactions = array(); $validactions[] = ''; $validactions[] = '1'; $validactions[] = '2'; $validactions[] = '3'; $validactions[] = '4'; $validactions[] = '5'; $validactions[] = '6'; $validactions[] = '7'; $validactions[] = '8'; $validactions[] = '9'; $validactions[] = '10'; $validactions[] = '11'; $validactions[] = 'links'; $validactions[] = 'linksadd'; $validactions[] = 'webring'; $validactions[] = 'directory'; $validactions[] = 'resources'; $validactions[] = 'recordclicks'; $validactions[] = 'checkfiles'; $validactions[] = 'pr'; $validactions[] = 'version'; $validactions[] = 'sitemap'; $validactions[] = 'related articles'; $validactions[] = 'cms'; $validactions[] = 'xmlpost'; $validactions[] = 'htmlsitemap'; if ($debug) { ini_set('display_errors', true); error_reporting(E_ALL); if ($debug) echobr("Article.php Checkpoint 1.0: " . elog_time($debugstart) ); } if ($debug) { echocr('Initial Parameters: '); print_r($_REQUEST); echocr(); echobr();} // Clean up all the parameters foreach ($_REQUEST as $key => $value) { // Remove unwanted/unsafe chars $value = strtolower($value); $value = str_replace('%252520', '%20', $value); $value = str_replace('%2520', '%20', $value); $value = str_replace('%2522', '%20', $value); $value = str_replace('&amp;', '&', $value); $value = str_replace('&', '&', $value); $value = str_replace('%5c', '', $value); $value = str_replace('\\', '', $value); $value = str_replace('%22', '', $value); $value = str_replace('%3e', '', $value); $value = str_replace('%27', '', $value); $value = str_replace('%3c', '', $value); $value = str_replace("%26", "&", $value); $value = str_replace('<', '', $value); $value = str_replace('>', '', $value); $value = str_replace('/', '', $value); $value = str_replace('"', '', $value); $value = str_replace("'", '', $value); $value = str_replace("%27", '', $value); $value = str_replace("'", '', $value); $value = str_replace("#39;", '', $value); $value = str_replace("+", ' ', $value); $value = str_replace("_", ' ', $value); $value = str_replace("%20", ' ', $value); $value = str_replace("-", ' ', $value); $value = CleanHTML($value); // Make sure there is a lower case instance of the parameter if (!array_key_exists(strtolower($key), $_REQUEST)) $_REQUEST[strtolower($key)] = $value; $_REQUEST[$key] = $value; } // Pull apart the "query" parameter and add anything we need to the $_REQUEST $query = isset($_REQUEST['query']) ? $_REQUEST['query']:$_SERVER['QUERY_STRING']; $query = html_entity_decode(urldecode($query)); $query = NVPtoArray($query); foreach ($query as $key => $value) { if (isset($_REQUEST[$key])) $_REQUEST[$key] = empty($_REQUEST[$key]) ? $value:$_REQUEST[$key]; else $_REQUEST[$key] = $value; } // Domain parameters should not have any spaces, replace with '-' $_REQUEST['domain'] = isset($_REQUEST['domain'])? str_replace(' ', '-', $_REQUEST['domain']):''; $_REQUEST['from'] = isset($_REQUEST['from'])? str_replace(' ', '-', $_REQUEST['from']):''; //Gather parameters if (!isset($_REQUEST['key'])) $_REQUEST['key'] = ''; if (!isset($_REQUEST['k'])) $_REQUEST['k'] = ''; if ($debug) { echocr('Cleaned Parameters: '); print_r($_REQUEST); echocr();} $script = isset($_REQUEST['cscript']) ? strtoupper($_REQUEST['cscript']) : ''; $action = isset($_REQUEST['Action']) ? $_REQUEST['Action'] : ''; $pageid = isset($_REQUEST['pageid']) ? $_REQUEST['pageid'] : ''; $page_title = $pageid; $referer = isset($_REQUEST['referer']) ? $_REQUEST['referer'] : ''; $client_domain = isset($_REQUEST['domain']) ? $_REQUEST['domain'] : ''; $agent = isset($_REQUEST['agent']) ? $_REQUEST['agent'] : ''; $address = isset($_REQUEST['address']) ? $_REQUEST['address'] : ''; $uri = isset($_REQUEST['uri']) ? $_REQUEST['uri'] : ''; $querystr = isset($_REQUEST['query']) ? $_REQUEST['query'] : $_SERVER['QUERY_STRING']; $articlecount = isset($_REQUEST['count']) ? $_REQUEST['count']:'3'; $articlechars = isset($_REQUEST['chars']) ? $_REQUEST['chars']:'200'; $articlecss = isset($_REQUEST['css']) ? 1:0; $version = isset($_REQUEST['version']) ? $_REQUEST['version']:''; $city = isset($_REQUEST['city']) ? seo_filter_text_custom($_REQUEST['city']):''; $cty = isset($_REQUEST['cty']) ? strtoupper(seo_filter_text_custom($_REQUEST['cty'])):''; $state = isset($_REQUEST['state']) ? seo_filter_text_custom($_REQUEST['state']):''; $st = isset($_REQUEST['st']) ? strtoupper($_REQUEST['st']):''; $from = isset($_REQUEST['from']) ? $_REQUEST['from']:''; $fromkeyword = isset($_REQUEST['fromk']) ? $_REQUEST['fromk']:''; $category = isset($_REQUEST['category']) ? seo_filter_text_custom($_REQUEST['category']):''; $catidc = isset($_REQUEST['c']) ? $_REQUEST['c']:''; $homepage = isset($_REQUEST['homepage']) ? $_REQUEST['homepage']:'0'; $catidk = isset($_REQUEST['p']) ? $_REQUEST['p']:''; if ($debug) echobr("Article.php Checkpoint 1.0.0.5: " . elog_time($debugstart) ); //Passed when lytebox is on and populating home pages with a hidden DIV containing websitereference text. //Called from function that builds the websitereference link $websitereferencesimple = isset($_REQUEST['websitereferencesimple']) ? 1:0; //Business Log standard category $businesslogcategory = isset($_REQUEST['cate']) ? $_REQUEST['cate']:''; $businesslogcategory = str_replace("'", '', $businesslogcategory); $businesslogcategory = str_replace(";", '', $businesslogcategory); $businesslogcategory = str_replace('"', '', $businesslogcategory); $businesslogcategory = str_replace(',', '', $businesslogcategory); // Want to try to standardize the k= and key= to k= in url that we generate. // If either one comes in empty, set it to the other, to accommodate any changes we make below to force k= in url // If both were passed default to k= $parmkey = isset($_REQUEST['key']) ? $_REQUEST['key']:''; $parmk = isset($_REQUEST['k']) ? $_REQUEST['k']:''; $parmk = empty($parmk) ? $parmkey:$parmk; $parmkey = empty($parmkey) ? $parmk:$parmkey; $parmkey = ($parmkey != $parmk) ? $parmk:$parmkey; // Keep a copy of the original $parmk, in case it gets modified $parmk_orig = $parmk; // If no version is passed assume old $version = empty($version) ? '1.0':$version; //For 0308 sites, translate old actions $oldaction = $action; $action = ($action == 'links') ? '2':$action; $action = ($action == 'articles') ? '5':$action; $action = ($action == 'linksadd') ? '3':$action; $action = ($action == 'webring') ? '2':$action; $action = ($action == 'directory') ? '9':$action; $action = ($action == 'resources') ? '1':$action; $action = ($action == 'recordclicks') ? '10':$action; $action = ($action == 'related articles') ? '14':$action; $action = ($action == 'xmlpost') ? 'sitemap':$action; // Avoid injection attacks by exiting if we do not get a valid action if (!in_array($action, $validactions)) die('Invalid Request - Error VA001 - (' . $action . ')'); if ($debug) echobr("Article.php Checkpoint 1.0.0.7: " . elog_time($debugstart) ); //Log the full request $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; foreach($_REQUEST as $key => $value) $vals[] = $key."=".urlencode($value); $poststr = implode("&", $vals); $feedlogid = feed_log ($url, $poststr, NULL, NULL, 0, NULL, $debug); if ($debug) echobr("URL and Post String: " . $url . ' ' . $poststr); // Clear old vars no longer being used $query = ""; $qry = ""; $query1 = ""; $qry_links = ""; //disabled temp // include("unique_visitor.php"); if ($debug) echobr("Article.php Checkpoint 1.01: " . elog_time($debugstart) ); //Get the domain info $domainid = FetchOne("SELECT id FROM bwp_domains WHERE domain_name='" . $client_domain . "' AND deleted != 1 "); if (empty($domainid)) { feed_log ($url, $poststr, NULL, number_format(elog_time($debugstart),5), $feedlogid, $errtext='Invalid Domain: ' . $client_domain); //echo('
Invalid domain name: ' . $client_domain . ' - Link Exchange
'); $sql = "SELECT linkanchor FROM ( "; $sql .= "SELECT 'www.blackwoodproductions.com' AS linkanchor UNION "; $sql .= "SELECT 'Blackwood Productions' AS linkanchor UNION "; $sql .= "SELECT restitle AS linkanchor FROM bwp_bubblefeed WHERE domainid = 2655 AND deleted != 1 AND active = 1 "; $sql .= ") AS tmpLinkAnchor "; //$sql .= "ORDER BY PASSWORD(CONCAT('" . $client_domain . "', DATE_FORMAT(NOW(), '%Y%m%d'), linkanchor)) "; $sql .= "ORDER BY PASSWORD(CONCAT('" . $client_domain . "', linkanchor)) "; $sql .= "LIMIT 1 "; $linkanchor = FetchOne($sql); echo('
1 - Invalid domain name: ' . $client_domain . ' - ' . ucwords($linkanchor) . '
'); /* echobr(script);echobr();print_r($script);echobr(); echobr(action);echobr();print_r($action);echobr(); echobr(pageid);echobr();print_r($pageid);echobr(); echobr(page_title);echobr();print_r($page_title);echobr(); echobr(referer);echobr();print_r($referer);echobr(); echobr(client_domain);echobr();print_r($client_domain);echobr(); echobr(agent);echobr();print_r($agent);echobr(); echobr(address);echobr();print_r($address);echobr(); echobr(uri);echobr();print_r($uri);echobr(); echobr(querystr);echobr();print_r($querystr);echobr(); echobr(articlecount);echobr();print_r($articlecount);echobr(); echobr(articlechars);echobr();print_r($articlechars);echobr(); echobr(articlecss);echobr();print_r($articlecss);echobr(); echobr(version);echobr();print_r($version);echobr(); echobr(city);echobr();print_r($city);echobr(); echobr(cty);echobr();print_r($cty);echobr(); echobr(state);echobr();print_r($state);echobr(); echobr(st);echobr();print_r($st);echobr(); echobr(from);echobr();print_r($from);echobr(); echobr(fromkeyword);echobr();print_r($fromkeyword);echobr(); echobr(category);echobr();print_r($category);echobr(); echobr(catidc);echobr();print_r($catidc);echobr(); echobr(homepage);echobr();print_r($homepage);echobr(); echobr(catidk);echobr();print_r($catidk);echobr(); */ exit(); //$action = '9'; //$domainid = '1'; //$script = 'PHP'; } //Some sub routines may be expecting this old variable $found_domain_id = $domainid; //For the Live Feed Crawler if($action == 'checkfiles' || $parmkey=='checkfiles' || $parmk=='checkfiles') { feed_log ($url, $poststr, $domainid, number_format(elog_time($debugstart),5), $feedlogid); echo('FRL CheckFiles OK'); exit(); } //For sites (like Blazonco) that don't have PR enabled if($action == 'pr') { feed_log ($url, $poststr, $domainid, number_format(elog_time($debugstart),5), $feedlogid); echo('Action not allowed [PR].'); exit(); } //For the Live Feed Crawler if($action == 'version') { feed_log ($url, $poststr, $domainid, number_format(elog_time($debugstart),5), $feedlogid); echo($version); exit(); } //$update_query = "UPDATE bwp_domains SET links_feed = links_feed+1 , last_feed = now() WHERE id='".$domainid."'"; //DBquery($update_query); $sql = "SELECT dom.id as domid, dom.domain_name, dom.status, dom.livefeed, dom.keywords, dom.script_type, bdc.id, "; $sql .= "category, dom.servicetype, dom.resourceslytebox, resourcesactive, linkexchange, webportalactive, relatedarticles, skipaddurllinks, skippartnerprompts, "; $sql .= "spydermap, primage, cp_acrive, uses0308, usescontent_resource, userid, dom.manualgeosilos, dom.autogeosilos, dom.wordpress, dom.webworkscms, dom.showsnapshot, "; $sql .= "showgoogleplusone, showmap, wr_name, wr_email, wr_phone, wr_address, wr_video, wr_adgroups, wr_facebook, wr_twitter, wr_linkedin, wr_googleplus, "; $sql .= "domain_country, dom.parent_catid, dom.usewebsitereferencetitles "; $sql .= "FROM bwp_domains dom "; $sql .= "LEFT JOIN bwp_domain_category bdc ON bdc.id = dom.domain_category "; //$sql .= "LEFT JOIN bwp_domain_feedstyle dfs ON dfs.domain_id = dom.id "; $sql .= "WHERE dom.id = '".$domainid."'"; $domain_category = FetchRow($sql); //If rejected don't do anything if ($domain_category['status']==6) exit(); //If duplicate IP put up error message if ($domain_category['status']==5 ) die("




There is an error with your package configuration. [DupIP]
"); // If domain is NOT Directory, but action=directory then put up fake 404 if ($action == '9' && $domain_category['status'] != 8) die("




We're sorry this page is no longer available. [404] (ND301)
"); $domainname = $domain_category['domain_name']; $domainscript = $domain_category['script_type']; $lytebox = $domain_category['resourceslytebox']; $showgoogleplusone = $domain_category['showgoogleplusone']; $domain_country = $domain_category['domain_country']; // Check to see if this domain is under a white label $resellerid = ResellerID($domainid); //If no script type passed, use the one stored for the domain. If still no script then look it up $script = empty($script) ? $domainscript:$script; $script = empty($script) ? ScriptPlatformLookup($domainid):$script; $extension = ExtFromPlatform($script); //Generate the filename of the file installed on client site. $cdomain = explode(".", $client_domain); if ($domain_category['uses0308'] == '1') $filename = "0308" . $extension; else if ($domain_category['usescontent_resource'] == '1') $filename = "content_resource" . $extension; else $filename = strtolower($cdomain[0]).$extension; if ($debug) { echobr("client_domain: " . $client_domain); echobr("uses0308: " . $domain_category['uses0308']); echobr("usesconres: " . $domain_category['usescontent_resource']); echobr("filename: " . $filename); } //If this site is DUMB (status = 8) then translate all calls to Business Collective action=2 //if ($domain_category['status'] == '8') // $action = '2'; // If call is coming for a CMS page and the page is not specified, lookup the default and set parameters for that page if ($action == 'cms' && empty($parmk)) { $cmssettings = FetchRow("SELECT * FROM bwp_cms WHERE domainid = '" . $domainid . "' "); if ($cmssettings['cmspagetype'] == '99') // Website Builder pages { $tmp = FetchOne("SELECT name FROM bwp_cmspages WHERE id = '" . $cmssettings['cmspage'] . "' "); if (!empty($tmp)) { $parmk = $tmp; $parmk_orig = $parmk; } } else if ($cmssettings['cmspagetype'] == '1') // Website Reference pages { $tmp = FetchRow("SELECT * FROM bwp_bubblefeed WHERE id = '" . $cmssettings['cmspage'] . "' "); if (count($tmp) > 0) { $parmk = $tmp['restitle']; $parmk_orig = $parmk; $action = '1'; $pageid = $tmp['id']; } } else if ($cmssettings['cmspagetype'] == '5') // Blog pages { $tmp = FetchRow("SELECT * FROM bwp_blog_post WHERE blogpost_id = '" . $cmssettings['cmspage'] . "' "); if (count($tmp) > 0) { $action = '5'; $pageid = $tmp['blogpost_title']; } } // Force $homepage to true so that silo links will be displayed $homepage = 1; if ($debug) { echobr("CMS set parmk: " . $parmk); echobr("CMS set action: " . $action); echobr("CMS set pageid: " . $pageid); } } //Get an array of domain keywords and make sure they are trimmed and lower case //$keywords = explode(',', html_entity_decode($domain_category['keywords'])); $keywords = DomainKeywords($domainid); for ($i=0; $i"); echobr("Version: " . $version); echobr("Action: " . $action); echobr("DomainID: " . $domainid); echobr("DomainName: " . $domainname); echobr("Lytebox: " . $lytebox); echobr("WebsiteRef Simple: " . $websitereferencesimple); echobr("Extension: " . $extension); echobr("Filename: " . $filename); echobr("parmk: *" . $parmk . "*"); echobr("parmkey: " . $parmkey); echobr("parmk_orig: " . $parmk_orig); echobr("domainid: " . $domainid); echobr("keywords: " . $domain_category['keywords']); print_r($keywords); echobr(); echobr("key: " . $key); } //Create $keyx variables for use in Action links if (count($keywords) > 0) $key1 = stripslashes_deep(str_replace(" ", "-", $keywords[0])); else $key1 = ''; if (count($keywords) > 1) $key2 = stripslashes_deep(str_replace(" ", "-", $keywords[1])); else $key2 = ''; if (count($keywords) > 2) $key3 = stripslashes_deep(str_replace(" ", "-", $keywords[2])); else $key3 = ''; if (count($keywords) > 3) $key4 = stripslashes_deep(str_replace(" ", "-", $keywords[3])); else $key4 = ''; if (count($keywords) > 4) $key5 = stripslashes_deep(str_replace(" ", "-", $keywords[4])); else $key5 = ''; //If this is an old site and no action is passed, assume 'related articles', ie. publication sharing if (($domain_category['uses0308'] || $domain_category['usescontent_resource']) && empty($action)) { $parmk = $key1; $key = 0; $action = '14'; } $dom_status = $domain_category['status']; $livefeed = $domain_category['livefeed']; if ($debug) echobr("Article.php Checkpoint 1.2: " . elog_time($debugstart) ); //Default page if nothing else is appropriate $deftemp = FetchRow("SELECT * FROM bwp_domain_feedstyle WHERE feedstyle_id = '1' "); $defhead = htmlspecialchars_decode($deftemp['domain_header']); $defhead = str_replace('



This feature is not available for your current package. Please upgrade your package. [ID-01]
"); //We want to generate a links page anytime it is requested to help push the links to other sites, so don't die on this one if ($domain_category['linkexchange'] != "1" && $action == "2") die("




This feature is not available for your current package. Please upgrade your package. [ID-02]
"); if ($domain_category['cp_acrive'] != "1" && $action == "3") die("




This feature is not available for your current package. Please upgrade your package. [ID-03]
"); if ($domain_category['relatedarticles'] != "1" && $action == "4") die("




This feature is not available for your current package. Please upgrade your package. [ID-04]
"); if ($domain_category['relatedarticles'] != "1" && $action == "14") die("




This feature is not available for your current package. Please upgrade your package. [ID-14]
"); if ($domain_category['webportalactive'] != '1' && $action == '5') die("




This feature is not available for your current package. Please upgrade your package. [ID-05]
"); if ($domain_category['spydermap'] != '1' && $action == 'sitemap') die("




This feature is not available for your current package. Please upgrade your package. [ID-SP]
"); //Check to see if there is an alttemplate defined for this keyword $sql = "SELECT alttemplate FROM bwp_bubblefeed WHERE domainid = '" . $domainid . "' AND restitle = '" . $keyword . "' "; $alttemplate = FetchOne($sql); // If this is a CMS page request, lookup the appropriate template // 0 = primary, -1 = default, other = bwp_feedstyle_alt.feedstyle_id $cmstemplate = '0'; if ($action == 'cms') { $sql = "SELECT feedstyle_id FROM bwp_cmspages WHERE name = '" . $parmk_orig . "' AND domainid = '" . $domainid . "' AND deleted != 1 "; if ($debug) echobr($sql); $cmstemplate = FetchOne($sql); if (!empty($cmstemplate)) $alttemplate = $cmstemplate; } // If there is no Keyword specific template, check to see if there is a custom primary template set if (empty($alttemplate)) { if ($debug) echobr('No Keyword Specific Template, checking for custom primary template.'); // Get the template defined by the CMS page (Primary, Default, specified_alt_template) if ($cmstemplate == '0') { $sql = "SELECT feedstyle_id FROM bwp_domain_feedstyle_alt WHERE domain_id = '" . $domainid . "' AND deleted != 1 AND `primary` = 1 "; $primaryid = FetchOne($sql); } else if ($cmstemplate == '-1') $primaryid = ''; else { $sql = "SELECT feedstyle_id FROM bwp_domain_feedstyle_alt WHERE domain_id = '" . $domainid . "' AND deleted != 1 AND feedstyle_id = '" . $cmstemplate . "' "; $primaryid = FetchOne($sql); } if (!empty($primaryid)) { if ($debug) echobr('Custom primary template found.'); $alttemplate = $primaryid; } } //Get formatting codes from default domain_feedstyle $sql = "SELECT * "; $sql .= "FROM bwp_domain_feedstyle "; $sql .= "WHERE domain_id = '" . $domainid . "' "; //Get formatting codes from domain_feedstyle_alt $sqlalt = "SELECT * "; $sqlalt .= "FROM bwp_domain_feedstyle_alt "; $sqlalt .= "WHERE feedstyle_id = '" . $alttemplate . "' "; // If the domain is NOT enabled for GeoSilo, ignore any state/city settings if (!$domain_category['autogeosilos'] && !$domain_category['manualgeosilos']) { $state = ''; $st = ''; $city = ''; $cty = ''; } // If there is no Keyword or Primary template set, use the default if (empty($alttemplate)) { if ($debug) echobr('No Keyword or Custom Primary Template, use domain default Template.'); $header_footer = FetchRow($sql); } else { if ($debug) echobr('Using alternative template (' . $alttemplate . ').'); $header_footer = FetchRow($sqlalt); // If for some reason the alt is missing, drop back to the default if (!isset($header_footer['domain_header'])) { if ($debug) echobr('Alternative template could not be found or was empty, using domain Primary template.'); $header_footer = FetchRow($sql); } } // If there is no template record, use the default if (!isset($header_footer['domain_header'])) { if ($debug) echobr('No template found or template was empty, use #2 system default template.'); $header_footer = FetchRow("SELECT * FROM bwp_domain_feedstyle WHERE feedstyle_id = '2' "); } $header = html_entity_decode($header_footer["domain_header"], ENT_QUOTES, 'UTF-8'); $footer = html_entity_decode($header_footer["domain_footer"], ENT_QUOTES, 'UTF-8'); if ($dom_status == 0 || $dom_status == 1 || empty($header)) { $header = $defhead; $footer = $deffoot; } $doctype = isset($header_footer['domain_doctype']) ? html_entity_decode($header_footer['domain_doctype']):''; $header_footer['blogtitlecolor'] = empty($header_footer['blogtitlecolor']) ? 'black':$header_footer['blogtitlecolor']; $header_footer['blogdatecolor'] = empty($header_footer['blogdatecolor']) ? 'black':$header_footer['blogdatecolor']; $header_footer['blogcontentcolor'] = empty($header_footer['blogcontentcolor']) ? 'black':$header_footer['blogcontentcolor']; $header_footer['domain_fontcolor'] = empty($header_footer['domain_fontcolor']) ? 'black':$header_footer['domain_fontcolor']; $header_footer['domain_smalltextcolor'] = empty($header_footer['domain_smalltextcolor']) ? 'black':$header_footer['domain_smalltextcolor']; $header_footer['domain_headercolor'] = empty($header_footer['domain_headercolor']) ? 'black':$header_footer['domain_headercolor']; $header_footer['domain_linkcolor'] = empty($header_footer['domain_linkcolor']) ? 'blue':$header_footer['domain_linkcolor']; $header_footer['domain_linkhover'] = empty($header_footer['domain_linkhover']) ? 'black':$header_footer['domain_linkhover']; $header_footer['domain_linkvisited'] = empty($header_footer['domain_linkvisited']) ? 'blue':$header_footer['domain_linkvisited']; $header_footer['domain_notescolor'] = empty($header_footer['domain_notescolor']) ? 'black':$header_footer['domain_notescolor']; $header_footer['domain_linksmallcolor'] = empty($header_footer['domain_linksmallcolor']) ? 'blue':$header_footer['domain_linksmallcolor']; $header_footer['domain_linksmallhover'] = empty($header_footer['domain_linksmallhover']) ? 'black':$header_footer['domain_linksmallhover']; $header_footer['domain_linksmallvisited'] = empty($header_footer['domain_linksmallvisited']) ? 'blue':$header_footer['domain_linksmallvisited']; $blogtitle = "color:".$header_footer['blogtitlecolor'].";font-family:".$header_footer['blogtitlefont'].";text-decoration:none;font-size:".$header_footer['blogtitlesize']."pt;font-weight:".$header_footer['blogtitlewight']; $blogdate = "color:".$header_footer['blogdatecolor'].";font-family:".$header_footer['blogdatefont'].";text-decoration:none;font-size:".$header_footer['blogdatesize']."pt;font-weight:".$header_footer['blogdateweight']; $blogcontent = "color:".$header_footer['blogcontentcolor'].";font-family:".$header_footer['blogcontentfont'].";text-decoration:none;font-size:".$header_footer['blogcontentsize']."pt;font-weight:".$header_footer['blogcontentweight']; $main_page_style = "color:".$header_footer['domain_fontcolor']."; font-family:".$header_footer['domain_fontface']."; font-size:".$header_footer['domain_fontsize']."pt; font-weight:".$header_footer['domain_fontweight'].";"; $main_page_style_small = "color:".$header_footer['domain_smalltextcolor']."; font-family:".$header_footer['domain_smalltextfont']."; font-size:".$header_footer['domain_smalltextsize']."pt; font-weight:".$header_footer['domain_smalltextweight'].";"; $main_page_style_header = "color:".$header_footer['domain_headercolor']."; font-family:".$header_footer['domain_headerfont']."; font-size:".$header_footer['domain_headersize']."pt; font-weight:".$header_footer['domain_headerweight'].";"; $main_page_links = " color:".$header_footer['domain_linkcolor']."; font-family:".$header_footer['domain_linkfont']."; font-size:".$header_footer['domain_linkfontsize']."pt; font-weight:".$header_footer['domain_linkweight']."; text-decoration:".$header_footer['domain_linkdecoration'].";\""; $main_page_links .= " onMouseOver=\"this.style.color='".$header_footer['domain_linkhover']."';\" onMouseOut=\"this.style.color='".$header_footer['domain_linkvisited']."';"; $misc_notes = "color:".$header_footer['domain_notescolor']."; font-family:".$header_footer['domain_notesfont']."; font-size:".$header_footer['domain_notessize']."pt; font-weight:".$header_footer['domain_notesweight'].";"; $main_page_links_small = ' color:'.$header_footer['domain_linksmallcolor'].'; font-family:'.$header_footer['domain_linksmallfont'].'; font-size:'.$header_footer['domain_linksmallfontsize'].'pt; font-weight:'.$header_footer['domain_linksmallweight'].'; text-decoration:'.$header_footer['domain_linksmalldecoration'].';"'; $main_page_links_small .= " onMouseOver=\"this.style.color='".$header_footer['domain_linksmallhover']."';\" onMouseOut=\"this.style.color='".$header_footer['domain_linksmallvisited']."';"; $wr_style_small = 'color:'.$header_footer['domain_fontcolor'].'; font-family:'.$header_footer['domain_fontface'].'; font-size:'.$header_footer['domain_fontsize'].'pt; font-weight:bold;'; $wr_style_large = 'color:'.$header_footer['domain_fontcolor'].'; font-family:'.$header_footer['domain_headerfont'].'; font-size:'.$header_footer['domain_headersize'].'pt; font-weight:bold;'; $blogtitle = "color:".$header_footer['blogtitlecolor'].";font-family:".$header_footer['blogtitlefont'].";text-decoration:none;font-size:".$header_footer['blogtitlesize']."pt;font-weight:".$header_footer['blogtitlewight']; $blogdate = "color:".$header_footer['blogdatecolor'].";font-family:".$header_footer['blogdatefont'].";text-decoration:none;font-size:".$header_footer['blogdatesize']."pt;font-weight:".$header_footer['blogdateweight']; $blogcontent = "color:".$header_footer['blogcontentcolor'].";font-family:".$header_footer['blogcontentfont'].";text-decoration:none;font-size:".$header_footer['blogcontentsize']."pt;font-weight:".$header_footer['blogcontentweight']; $dumblink = CodeURL($domain_category['domid']) . '?Action=Directory'; $ralink = CodeURL($domain_category['domid']) . '?Action=Related-Articles'; if ($debug) echobr("Article.php Checkpoint 2.0: " . elog_time($debugstart) ); // If version > 2.0 then ArticleMeta.php is no longer used, so generate the full header here $metaheader = ''; if ($version > 2) { $sql = "SELECT dom.*, cat.category "; $sql .= "FROM bwp_domains dom "; $sql .= "INNER JOIN bwp_domain_category cat on domain_category=cat.id "; $sql .= "WHERE dom.id = '" . $domainid . "' "; $metadomain = FetchRow($sql); $metakeywords = DomainKeywords($domainid); //explode(",", strtolower($metadomain['keywords'])); if (count($metakeywords) == 0) $metakeywords[0] = $domainname; $metakey = array_search($parmk, $metakeywords); if ($metakey === false) { $pos = rand(0, count($metakeywords)-1); $metaKeywords = $metakeywords[$pos]; } else $metaKeywords = $parmk; if ($category != '') if ($category != $metaKeywords) $metaTitle = $category . ' - ' . $metaKeywords; else $metaTitle = $category; else $metaTitle = $metaKeywords; $dpos = rand(1,2); $metaDesc = $metadomain['desc'.$dpos]; if (empty($metaDesc)) $metaDesc = $metadomain['desc1']; if (empty($metaDesc)) $metaDesc = $metaTitle; switch ($action) { case "1": if($pageid!="") { if ($domain_category['manualgeosilos'] == 1) { $sql = "SELECT geokeyword, short, metatagtitle, metatagdesc, metatagkey "; $sql .= "FROM bwp_geosilopages "; $sql .= "WHERE id='" . intval($pageid) . "'"; $bubble = FetchRow($sql); $metaTitle = seo_filter_text_custom($bubble['metatagtitle']); $metaDesc = seo_filter_text_custom($bubble['metatagdesc']); $metKeywords = seo_filter_text_custom($bubble['metatagkey']); } else { $sql = "SELECT restitle, resshorttext, metatagdesc, metatagkey "; $sql .= "FROM bwp_bubblefeed "; $sql .= "WHERE id='" . intval($pageid) . "'"; $bubble = FetchRow($sql); // echo $bubble['restitle']." - ".$client_domain."~".$bubble['metatagdesc']."~".$bubble['metatagkey']; // exit(); $metaTitle = seo_filter_text_custom($bubble['restitle']); $metaDesc = empty($bubble['metatagdesc']) ? seo_filter_text_custom($bubble['restitle']) . ' - ' . seo_filter_text_custom($bubble['resshorttext']):seo_filter_text_custom($bubble['metatagdesc']); $metKeywords = empty($bubble['metatagkey']) ? seo_filter_text_custom($bubble['restitle']):seo_filter_text_custom($bubble['metatagkey']); } } break; case "2": $metaTitle = $metaTitle; break; case "4": if ($debug) echo('<meta http-equiv="refresh" content="0;url=' . $ralink . '">'); else echo(''); exit(); break; case "5": if($pageid!="") { $bubble = FetchRow("SELECT * FROM bwp_blog_post WHERE blogpost_title='".intval($pageid)."' AND domain_id ='".$metadomain['id']."'"); //echo $bubble['blogpost_title']." - ".$client_domain."~".$bubble['post_description']."~".$bubble['post_keywords'].",".$bubble['keyword_tags']; $metaTitle = seo_filter_text_custom($bubble['blogpost_title']); $metaDesc = seo_filter_text_custom($bubble['post_description']); $metKeywords = seo_filter_text_custom($bubble['post_keywords']).",".seo_filter_text_custom($bubble['keyword_tags']); } break; case "9": if ($oldaction != 'directory') { echo(''); exit(); } break; case "11": $metaTitle = $fromkeyword; $metaDesc = $fromkeyword; $metaKeywords = $fromkeyword; break; case "cms": $sql = "SELECT title, description, keywords FROM bwp_cmspages "; $sql .= "WHERE domainid = '" . $domainid . "' "; $sql .= "AND name = '" . $parmk_orig . "' "; $sql .= "AND active = 1 "; $sql .= "AND deleted != 1 "; $cms = FetchRow($sql); if ($debug) echobr("Article - CMS META lookup lookup: " . $sql ); if (count($cms) > 0) { $metaTitle = seo_filter_text_custom($cms['title']); $metaDesc = seo_filter_text_custom($cms['description']); $metaKeywords = seo_filter_text_custom($cms['keywords']); } break; } //echo ucwords($title) . " - " . $client_domain . "~" . $desc . "~" . $keyword; if (!empty($city)) { $metaDesc = trim($city . ': ' . $metaDesc); $metaTitle = seo_automation_clean_title($city . ' - ' . $metaTitle) . " - " . $client_domain; $metaKeywords = trim($metaKeywords . ' ' . $city); } else if (!empty($state)) { $metaDesc = trim($state . ' - ' . $st . ': ' . $metaDesc); $metaTitle = ucwords(trim($state . ' - ' . $metaTitle)) . " - " . $client_domain; $metaKeywords = trim($metaKeywords . ' ' . $state . ', ' . $metaKeywords . ' ' . $st); } else { if ($domain_category['wr_name'] != '') { $metaTitle = ucwords(trim(seo_filter_text_custom($metaTitle))) . " - " . $domain_category['wr_name']; } else { $metaTitle = ucwords(trim(seo_filter_text_custom($metaTitle))) . " - " . $client_domain; } $metaKeywords = trim(seo_filter_text_custom($metaKeywords)); $metaDesc = trim(seo_filter_text_custom($metaDesc)); } $metaheader = ''; // $metaheader .= '' . chr(13) . chr(10); // $metaheader .= '' . chr(13) . chr(10); $metaheader .= '' . seo_filter_text_custom($metaTitle) . '' . chr(13) . chr(10); // $metaheader .= '' . chr(13) . chr(10); $metaheader .= '' . chr(13) . chr(10); $metaheader .= '' . chr(13) . chr(10); // $metaheader .= '' . chr(13) . chr(10); // $metaheader .= '' . chr(13) . chr(10); $metaheader .= '' . chr(13) . chr(10); $metaheader .= '' . chr(13) . chr(10); if ($domain_country == 'US') $metaheader .= '' . chr(13) . chr(10); } if ($debug) echobr("Article.php Checkpoint 2.1: " . elog_time($debugstart) ); ob_flush(); flush(); switch ($action) { case "sitemap": require_once('xmlpost.inc.php'); break; case "htmlsitemap": require_once('htmlsitemap.inc.php'); break; case "1": //Website Reference if (!empty($state) && $domain_category['manualgeosilos'] == 1) { $sql = "SELECT count(*) "; $sql .= "FROM bwp_geosilopages "; $sql .= "WHERE id='" . intval($pageid) . "' "; $sql .= "AND domainid = '" . $domainid . "' "; $sql .= "AND deleted != '1' "; } else { $sql = "SELECT count(*) "; $sql .= "FROM bwp_bubblefeed "; $sql .= "WHERE id='" . intval($pageid) . "' "; $sql .= "AND domainid = '" . $domainid . "' "; $sql .= "AND deleted != '1' "; } $page_exists = FetchOne($sql); if($page_exists == 0) { require_once('websitereferences.php'); } else { require_once('websitereference.php'); } break; case "2": // Business Collective require_once('businesscollective.php'); break; case "3": $addlinkurl = 'http://you.getseobot.com/add_url.php?k=' . $key3 . '&sessionid=' . $domainid; echo(''); echo('
You are being redirected to the Link Exchange page.
If the page does not refresh please click on the following link: Link Exchange'); //echocr($metaheader); //require_once('AddLink.php'); // break; case "4": //Publication Sharing $page_exists = FetchOne("SELECT count(*) FROM bwp_articles WHERE id = '" . intval($pageid) . "' AND domainid = '" . $domainid . "' "); echocr($metaheader); if ($page_exists > 0) require_once('publicationsharingdetail.php'); else require_once('publicationsharing.php'); break; case "5": //BLOG echocr($metaheader); if($page_title == "") require_once('businesslog.php'); else require_once('businesslogs.php'); break; //Return a formated list of Publication Sharing Articles case "7": require_once('publicationsharingarticles.php'); break; //Return a formated list of Business Log Articles case "8": require_once('businesslogarticles.php'); break; case "9": if ($oldaction == 'directory') { set_time_limit(10); require_once('webring.php'); } break; case "10": $sql = "INSERT INTO bwp_domainactivity_log SET "; $sql .= "domain_id ='" . intval($pageid) . "', "; $sql .= "log_message='A unique visitor has visted your site from a link on your Business Collective Partner`s ( " . $domainname . ") site.', "; $sql .= "log_date = Now(), "; $sql .= "crawl_name='" . $domainname . "'; "; // About to attempt a long write to remote Master DB // Reset session timeout // Call configDB again to establish DB connection set_time_limit(30); $onlylocal = false; require($_SERVER['DOCUMENT_ROOT']."/includes/config.db.inc.php"); $dbwrite->query($sql); break; case "11": //Deep Linking page echocr($metaheader); require_once('deeplinking.php'); break; case "14": //Related-Articles (replaces Publication Sharing) echocr($metaheader); require_once('relatedarticles.php'); break; case "cms": echocr($metaheader); require_once('cmspages.php'); break; default: break; } if ($action != 'sitemap') { /* // Retargeting script //echocr(''); //if ($domain_category['parent_catid'] == 28) //if ($domain_category['parent_catid'] == 15) // echocr(''); //else //{ // Blackwood's Retargeting script //echocr(''); // echocr(''); //} // echo(''); */ } feed_log ($url, $poststr, $domainid, number_format(elog_time($debugstart),5), $feedlogid, NULL); if ($debug) echobr("Article.php Checkpoint END: " . elog_time($debugstart) ); ?>