<?php
// $Id: getUsersBlogs.php,v 1.1 2004/07/11 10:28:46 Farsus Exp $
// -------------------------------------------------------------------------//
//			                 RUNCMS                                         //
//                                                                          //
//	 reliable - Unique - Nocost &  Simplicity & ease off use                //
//                       < http://www.runcms.org >                          //
// -------------------------------------------------------------------------//
// Original Author: i-Tech (Half-Dead)
// Author Website : http://www.i-Technology.NET
// License Type   : LGPL: See /manual/LICENSES/LGPL.txt
// ------------------------------------------------------------------------- //

// Function: blogger.getUserBlogs

load_function("isAdmin");
$user = (string)$params[1];
$pass = (string)$params[2];
$uid  = login($user, $pass);

// Start the response array
$rpc_encoder->start_array();

$rpc_encoder->start_struct();
$rpc_encoder->add_value("string" , XOOPS_URL . "/", "url");
$rpc_encoder->add_value("integer", 0, "blogid");
$rpc_encoder->add_value("string" , _phpRPC_All, "blogName");
$rpc_encoder->end_struct();

$query = $db->query("SELECT topic_id, topic_title FROM " . $db->prefix("topics"));

while (list($id, $title) = $db->fetch_row($query)) {

// Each respose has a struct
$rpc_encoder->start_struct();
$rpc_encoder->add_value("string" , XOOPS_URL . "/modules/news/index.php?storytopic=$id", "url");
$rpc_encoder->add_value("integer", $id   , "blogid");
$rpc_encoder->add_value("string" , $title, "blogName");
$rpc_encoder->end_struct();
}

// End of response array
$rpc_encoder->end_array();

if (!$query) {
	trigger_error(_phpRPC_DBerreur, E_USER_ERROR);
}

// Return the result
$rpc_encoder->return_call();
?>
