<?php
$sel_server_id = mysql_result(mysql_query("select server_id from autoposter_projects where id='$pjid'"),0);
$res = mysql_query("select * from Projects where project_id='{$sel_server_id}'");
$project_id = mysql_result($res, 0, "project_id");
$domain = mysql_result($res, 0, "domain");
$web_folder = mysql_result($res, 0, "web_folder");
$username = mysql_result($res, 0, "admin_login");
$password = mysql_result($res, 0, "admin_password");

if($web_folder=="") {
	$domain_url = $domain;
} else {
	$domain_url = $domain . "/" . $web_folder;
}

$domain_url = "http://" . $domain_url . "/xmlrpc.php";

$url = parse_url($domain_url);
$host = trim($url['host']);
$path = trim($url['path']);

include_once("./class.mtclient.php");
include_once("./blogger.php");

$blog = new mtclient($username, $password, $host, $path);

$data = blogger_getUserInfo($username, $password);
$gtuserid = get_usrid($data);
$blogID = $gtuserid;

//echo $blogID;

if($rntctlst == 1) {
$v5 = "";
$n = "";
$c = "";
$fn = "";

$myBlogs = $blog->getCategoryList($blogID);

while(list($key, $value) = each($myBlogs)) {
   foreach($value as $k3 => $v4){
        $v5[] = $v4;
	}
}

foreach ($v5 as $kz => $vz) {
	if(is_numeric($vz)) {
		$n[] = $vz;
	} else {
		$c[] = $vz;
	}
}

for($i=0; $i < count($n); $i++) {
	$n2 = $n[$i];
	$c2 = $c[$i];

	$fn[] = array("$n2" => "$c2");
}

$calist = "<tr><td valign=\"top\">Categories for ({$domain}/{$web_folder}):</td><td>";
$calist .= get_cat_list($fn, $pjid, $iz+1);
$calist .= "</td></tr>";

return $calist;
}
?>