<?php
/**
@brief 新着のエントリー
@version $Id: bxparty_newentry.php,v 1.1 2004/07/27 03:54:49 minahito Exp $
*/
require_once XOOPS_ROOT_PATH."/modules/exFrame/frameloader.php";
require_once dirname(__FILE__)."/../class/global.php";
require_once dirname(__FILE__)."/../class/party.php";
require_once dirname(__FILE__)."/../class/entry.php";
require_once dirname(__FILE__)."/../class/status.php";

function b_bxparty_newentry_show ( $options )
{
	global $xoopsDB;
	$block = array ();

	$handler=&bxParty::getHandler('entry');
	$pHandler=&bxParty::getHandler('party');

	$sql="SELECT t1.* FROM ".$xoopsDB->prefix('bxparty_entry')." t1,".
		$xoopsDB->prefix('bxparty')." t2 WHERE t1.id=t2.id AND t2.private=0 ".
		" ORDER BY update_date DESC";
	$res=$xoopsDB->query($sql,0,$options[0]);

	while($row=$xoopsDB->fetchArray($res)) {
		$instance=&$handler->create();
		$instance->assignVars($row);

		$party=&$pHandler->get($row['id']);

		$arr=$instance->getStructure();
		$arr['party']=$party->getStructure();

		$block['entrys'][]=$arr;
		unset($arr);
	}

	return $block;
}

function b_bxparty_newentry_edit ( $options ) {
    $inputtag = "<input type='text' name='options[0]' value='".$options[0]."' />";
    $form = sprintf(_MB_BXPARTY_DISPLAY,$inputtag);
    return $form;
}


?>