Ejemplo n.º 1
0
                jperror('Remote url does not seem to be running WordPress.');
                break;
            }
            if (!($xmlrpc_url = $wpcf->xmlrpc_path())) {
                jperror('Unable to locate XMLRPC path.');
                break;
            }
            if (!($valid_url = $wpcf->getValidPost())) {
                jperror('No valid posts with pingback enabled found');
                break;
            }
            $data = array('initial_ip' => $initial_ip, 'valid_url' => $valid_url, 'xmlrpc_url' => $xmlrpc_url);
            $info = $wpcf->setInitialData($data);
            $remote_url = SITE_URL . '/post/' . $info['id'] . '/' . $info['hash'] . '.html';
            $wpcf->pingback_request($remote_url, $valid_url);
            jprint(array('error' => false, 'message' => 'Processing..', 'data' => $info));
            break;
    }
} else {
    jperror('Invalid Action.');
}
function structure_url($parsed_url)
{
    $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
    $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
    $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
    $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
    $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
    $pass = $user || $pass ? "{$pass}@" : '';
    $path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
    return "{$scheme}{$user}{$pass}{$host}{$port}{$path}";
Ejemplo n.º 2
0
function jperror($msg = '')
{
    jprint(array('error' => true, 'message' => $msg));
}