}
    $ch_a = '';
    while ($row = $xoopsDB->fetchArray($res)) {
        // show item_type's name
        $ch_b = intval($row["item_type_id"]);
        if (empty($ch_a) || $ch_a !== $ch_b) {
            $tab_name = $xoopsDB->prefix('xoonips_item_type');
            $tsql = "SELECT display_name FROM " . $tab_name . " WHERE item_type_id=" . $ch_b . "";
            $tres = $xoopsDB->query($tsql);
            $trow = $xoopsDB->fetchArray($tres);
            $item_type_title = $ts->htmlSpecialChars($trow['display_name']);
            $title_t = "<table><tr><td>&nbsp;&nbsp;" . $item_type_title . "</td></tr></table>";
            $item_htmls[] = array('html' => $title_t, 'th' => 'on');
        }
        // make item block
        $tmp = itemid2ListBlock(intval($row['item_id']));
        foreach ($tmp as $key => $value) {
            $item_htmls[] = array('html' => $value);
        }
        $ch_a = intval($row["item_type_id"]);
    }
}
$xoopsTpl->assign('item_htmls', $item_htmls);
if (isset($_SESSION['xoopsUserId'])) {
    if (intval($_SESSION['xoopsUserId']) == $uid) {
        $piedit = 1;
        $xoopsTpl->assign('piedit', $piedit);
    }
    $aid = intval($_SESSION['xoopsUserId']);
    $xoopsTpl->assign('aid', $aid);
}
/**
 * get item html
 *
 * @access private
 * @param int $item_id item id
 * @return string html
 */
function _xoonips_editshowitem_get_item_html($item_id)
{
    $htmls = itemid2ListBlock($item_id);
    return $htmls[$item_id];
}