Find this functions in your b2template.functions.php (look below for XHTML 1.0 Strict compliancy):
function waypath($content) {
if (!preg_match ("//i", $content)) {
//include("xmlrpc.inc");
$client = new xmlrpc_client("/", "xmlrpc1.waypath.com", 80);
$short_content = substr($content, 0, 2000); #send first 2000 characters of the post
# this function has been defined further under http://www.waypath.com/apis/
# variables can be changed to suit your own needs
$msg = new xmlrpcmsg('inline.relatedByExcerpt', array( new xmlrpcval('23000023'), # user key (anonymous)
new xmlrpcval("45", "int"), # last 45 days
new xmlrpcval($short_content, "string"), # url
new xmlrpcval("3", "int"), #style
new xmlrpcval("10", "int"), # maxresults
new xmlrpcval("0", "int"), # sort by relevance (1==date)
new xmlrpcval("nothing related", "string"),
new xmlrpcval("3", "int"), # focus (1=loose,2=normal,3=strict)
new xmlrpcval(array(), "array"), # includedSites
new xmlrpcval(array(), "array") # excludedSites
));
$client->setDebug(0);
$result = $client->send($msg);
if ($result->faultCode() != 0)
{
print "Couldn't process request: " . $result->faultString();
return;
}
function print_vars($obj) {
$arr = get_object_vars($obj->val);
while (list($prop, $val) = each($arr))
echo "\t$prop = $val\n";
}
$outString=$result->value();
$arr=xmlrpc_decode($outString);
return $arr[box];
}
}
And replace with this function:
function waypath($content) {
if (!preg_match ("//i", $content)) {
//include("xmlrpc.inc");
$client = new xmlrpc_client("/", "xmlrpc1.waypath.com", 80);
$short_content = substr($content, 0, 2000); #send first 2000 characters of the post
# this function has been defined further under http://www.waypath.com/apis/
# variables can be changed to suit your own needs
$msg = new xmlrpcmsg('inline.relatedByExcerpt', array( new xmlrpcval('23000023'), # user key (anonymous)
new xmlrpcval("45", "int"), # last 45 days
new xmlrpcval($short_content, "string"), # url
new xmlrpcval("3", "int"), #style
new xmlrpcval("10", "int"), # maxresults
new xmlrpcval("0", "int"), # sort by relevance (1==date)
new xmlrpcval("nothing related", "string"),
new xmlrpcval("3", "int"), # focus (1=loose,2=normal,3=strict)
new xmlrpcval(array(), "array"), # includedSites
new xmlrpcval(array(), "array") # excludedSites
));
$client->setDebug(0);
$result = $client->send($msg);
if ($result->faultCode() != 0)
{
print "Couldn't process request: " . $result->faultString();
return;
}
function print_vars($obj) {
$arr = get_object_vars($obj->val);
while (list($prop, $val) = each($arr))
echo "\t$prop = $val\n";
}
$outString=$result->value();
$arr=xmlrpc_decode($outString);
//return $arr[box];
$output = $arr[box];
$small_content = explode ("/i", $content)) {
//include("xmlrpc.inc");
$client = new xmlrpc_client("/", "xmlrpc1.waypath.com", 80);
$short_content = substr($content, 0, 2000); #send first 2000 characters of the post
# this function has been defined further under http://www.waypath.com/apis/
# variables can be changed to suit your own needs
$msg = new xmlrpcmsg('inline.relatedByExcerpt', array( new xmlrpcval('23000023'), # user key (anonymous)
new xmlrpcval("45", "int"), # last 45 days
new xmlrpcval($short_content, "string"), # url
new xmlrpcval("2", "int"), #style
new xmlrpcval("10", "int"), # maxresults
new xmlrpcval("0", "int"), # sort by relevance (1==date)
new xmlrpcval("nothing related", "string"),
new xmlrpcval("3", "int"), # focus (1=loose,2=normal,3=strict)
new xmlrpcval(array(), "array"), # includedSites
new xmlrpcval(array(), "array") # excludedSites
));
$client->setDebug(0);
$result = $client->send($msg);
if ($result->faultCode() != 0)
{
print "Couldn't process request: " . $result->faultString();
return;
}
function print_vars($obj) {
$arr = get_object_vars($obj->val);
while (list($prop, $val) = each($arr))
echo "\t$prop = $val\n";
}
$outString=$result->value();
$arr=xmlrpc_decode($outString);
//return $arr[box];
$output = $arr[box];
$small_content = explode (" and tags