Example #1
0
    $bb->nxt_siteurl = rtrim(trim($bb->nxt_siteurl), " \t\n\r\v/");
}
$bb->nxt_home = bb_get_option('nxt_home');
if ($bb->nxt_home) {
    $bb->nxt_home = rtrim(trim($bb->nxt_home), " \t\n\r\v/");
}
$bb->nxt_cookies_integrated = false;
$bb->cookiedomain = bb_get_option('cookiedomain');
$bb->cookiepath = bb_get_option('cookiepath');
$bb->nxtclass_mu_primary_blog_id = bb_get_option('nxtclass_mu_primary_blog_id');
if ($bb->nxt_siteurl && $bb->nxt_home) {
    if ($bb->cookiedomain) {
        $bb->nxt_cookies_integrated = true;
    } else {
        $cookiedomain = bb_get_common_domains($bb->uri, $bb->nxt_home);
        if (bb_match_domains($bb->uri, $bb->nxt_home)) {
            if ($bb->nxtclass_mu_primary_blog_id) {
                $bb->cookiedomain = '.' . $cookiedomain;
            }
            if (!$bb->cookiepath) {
                $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->nxt_home);
            }
            $bb->nxt_cookies_integrated = true;
        } elseif ($cookiedomain && strpos($cookiedomain, '.') !== false) {
            $bb->cookiedomain = '.' . $cookiedomain;
            if (!$bb->cookiepath) {
                $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->nxt_home);
            }
            $bb->nxt_cookies_integrated = true;
        }
        unset($cookiedomain);
Example #2
0
 /**
  * Returns an array of URLs that pingbacked the given URL
  *
  * @since 1.0
  * @link http://www.aquarionics.com/misc/archives/blogite/0198.html
  * @return array The array of URLs that pingbacked the given topic
  * @param array $args Arguments passed by the XML-RPC call
  * @param string $args[0] The full URI of the post where the pingback is being sent from
  * @param string $args[1] The full URI of the post where the pingback is being sent to
  *
  * XML-RPC request to get all pingbacks on a topic
  * <methodCall>
  *     <methodName>pingback.ping</methodName>
  *     <params>
  *         <param><value><string>http://example.com/2008/08/post-tobe-queried/</string></value></param>
  *     </params>
  * </methodCall>
  */
 function pingback_extensions_getPingbacks($args)
 {
     do_action('bb_xmlrpc_call', 'pingback.extensions.getPingbacks');
     $this->escape($args);
     // Don't accept arrays of arguments
     if (is_array($args)) {
         $this->error = new IXR_Error(404, __('The requested method only accepts one parameter.'));
         return $this->error;
     } else {
         $url = (string) $args;
     }
     // Tidy up ampersands in the URI
     $url = str_replace('&amp;', '&', $url);
     $url = str_replace('&', '&amp;', $url);
     // Check if the URI is in our site
     if (!bb_match_domains($url, bb_get_uri())) {
         // These are not the droids you are looking for
         $this->error = new IXR_Error(0, __('The specified target URL is not on this domain.'));
         return $this->error;
     }
     // Make sure the specified URI is in fact associated with a topic
     if (!($topic = bb_get_topic_from_uri($url))) {
         $this->error = new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn\'t exist, or it is not a pingback-enabled resource.'));
         return $this->error;
     }
     // Grab the posts from the topic
     $query = new BB_Query('post', array('topic_id' => $topic_to->topic_id, 'append_meta' => true), 'get_thread');
     $posts_to = $query->results;
     unset($query);
     // Check for pingbacks in the post meta data
     $pingbacks = array();
     foreach ($posts_to as $post) {
         if (isset($post->pingback_uri)) {
             $pingbacks[] = $post->pingback_uri;
         }
     }
     unset($post);
     // This will return an empty array on failure
     return $pingbacks;
 }
Example #3
0
    $bb->wp_siteurl = rtrim(trim($bb->wp_siteurl), " \t\n\r\v/");
}
$bb->wp_home = bb_get_option('wp_home');
if ($bb->wp_home) {
    $bb->wp_home = rtrim(trim($bb->wp_home), " \t\n\r\v/");
}
$bb->wp_cookies_integrated = false;
$bb->cookiedomain = bb_get_option('cookiedomain');
$bb->cookiepath = bb_get_option('cookiepath');
$bb->wordpress_mu_primary_blog_id = bb_get_option('wordpress_mu_primary_blog_id');
if ($bb->wp_siteurl && $bb->wp_home) {
    if ($bb->cookiedomain) {
        $bb->wp_cookies_integrated = true;
    } else {
        $cookiedomain = bb_get_common_domains($bb->uri, $bb->wp_home);
        if (bb_match_domains($bb->uri, $bb->wp_home)) {
            if ($bb->wordpress_mu_primary_blog_id) {
                $bb->cookiedomain = '.' . $cookiedomain;
            }
            if (!$bb->cookiepath) {
                $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
            }
            $bb->wp_cookies_integrated = true;
        } elseif ($cookiedomain && strpos($cookiedomain, '.') !== false) {
            $bb->cookiedomain = '.' . $cookiedomain;
            if (!$bb->cookiepath) {
                $bb->cookiepath = bb_get_common_paths($bb->uri, $bb->wp_home);
            }
            $bb->wp_cookies_integrated = true;
        }
        unset($cookiedomain);