Beispiel #1
0
/**
 * Finds the list of blogs (without checking the user permissions).
 *
 * @param string $uid
 * @return array
 */
function pivot_get_user_blogs($uid)
{
    global $Weblogs, $Current_weblog, $Users, $Paths;
    $Current_weblog_orig = $Current_weblog;
    $ThisUser = $Users[$uid];
    $blogs = array();
    foreach ($Weblogs as $key => $value) {
        $Current_weblog = $key;
        $blogs[] = array("blogid" => $key, "blogName" => snippet_weblogtitle(), "url" => $Paths['host'] . snippet_home());
    }
    $Current_weblog = $Current_weblog_orig;
    i18n_array_to_utf8($blogs, $dummy, true);
    return $blogs;
}
function snippet_blogapi_autodiscovery()
{
    global $Weblogs, $Current_weblog, $Paths;
    $filname = basename($Weblogs[$Current_weblog]['front_filename'], '.php');
    $filename = $Weblogs[$Current_weblog]['rss_path'] . 'rsd-' . $filname . '.xml';
    $rsdfilename = fixpath($Paths['pivot_dir'] . $filename);
    $rsdurl = fixpath($Paths['pivot_url'] . $filename);
    // Some desktop blogging tools (Flock at least) needs to know the host explicitly...
    $rsdurl = $Paths['host'] . $rsdurl;
    $blogurl = $Paths['host'] . snippet_home();
    $blogapiurl = $Paths['host'] . $Paths['pivot_url'] . 'metaweblog.php';
    $output = '<?xml version="1.0"?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
    <service>
        <engineName>Pivot</engineName>
        <engineLink>http://pivotlog.net/</engineLink>
        <homePageLink>' . $blogurl . '</homePageLink>
        <apis>
            <api name="MetaWeblog" preferred="true"
                apiLink="' . $blogapiurl . '"
                blogID="' . $Current_weblog . '" />
        </apis>
    </service>
</rsd>';
    write_file($filename, $output);
    $output = '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . $rsdurl . '" />';
    return $output;
}