Ejemplo n.º 1
0
function showforum(&$forum, $type = '', $last = '', $toggle = false)
{
    global $_G;
    if ($last == '') {
        $navs = array();
        foreach (C::t('common_nav')->fetch_all_by_navtype_type(0, 5) as $nav) {
            $navs[] = $nav['identifier'];
        }
        $return = '<tr class="hover">' . '<td class="td25"' . ($type == 'group' ? ' onclick="toggle_group(\'group_' . $forum['fid'] . '\', $(\'a_group_' . $forum['fid'] . '\'))"' : '') . '>' . ($type == 'group' ? '<a href="javascript:;" id="a_group_' . $forum['fid'] . '">' . ($toggle ? '[+]' : '[-]') . '</a>' : '') . '</td>
			<td class="td25"><input type="text" class="txt" name="order[' . $forum['fid'] . ']" value="' . $forum['displayorder'] . '" /></td><td>';
        if ($type == 'group') {
            $return .= '<div class="parentboard">';
            $_G['fg'] = !empty($_G['fg']) ? intval($_G['fg']) : 0;
            $_G['fg']++;
        } elseif ($type == '') {
            $return .= '<div class="board">';
        } elseif ($type == 'sub') {
            $return .= '<div id="cb_' . $forum['fid'] . '" class="childboard">';
        }
        $boardattr = '';
        if (!$forum['status'] || $forum['password'] || $forum['redirect'] || in_array($forum['fid'], $navs)) {
            $boardattr = '<div class="boardattr">';
            $boardattr .= $forum['status'] ? '' : cplang('forums_admin_hidden');
            $boardattr .= !$forum['password'] ? '' : ' ' . cplang('forums_admin_password');
            $boardattr .= !$forum['redirect'] ? '' : ' ' . cplang('forums_admin_url');
            $boardattr .= !in_array($forum['fid'], $navs) ? '' : ' ' . cplang('misc_customnav_parent_top');
            $boardattr .= '</div>';
        }
        $return .= '<input type="text" name="name[' . $forum['fid'] . ']" value="' . dhtmlspecialchars($forum['name']) . '" class="txt" />' . ($type == '' ? '<a href="###" onclick="addrowdirect = 1;addrow(this, 2, ' . $forum['fid'] . ')" class="addchildboard">' . cplang('forums_admin_add_sub') . '</a>' : '') . '</div>' . $boardattr . '</td><td align="right" class="td23 lightfont">(' . ($type == 'group' ? 'gid:' : 'fid:') . $forum['fid'] . ')</td>' . '</td><td class="td23">' . showforum_moderators($forum) . '</td>
			<td width="160"><input class="checkbox" value="' . $forum['fid'] . '" type="checkbox"' . ($type != 'group' ? ' chkvalue="g' . $_G['fg'] . '" onclick="multiupdate(this, ' . $forum['fid'] . ')"' : ' name="gc' . $_G['fg'] . '" onclick="checkAll(\'value\', this.form, \'g' . $_G['fg'] . '\', \'gc' . $_G['fg'] . '\', 1)"') . ' />' . '
			<a href="' . ADMINSCRIPT . '?action=forums&operation=edit&fid=' . $forum['fid'] . '" title="' . cplang('forums_edit_comment') . '" class="act">' . cplang('edit') . '</a>' . ($type != 'group' ? '<a href="' . ADMINSCRIPT . '?action=forums&operation=copy&source=' . $forum['fid'] . '" title="' . cplang('forums_copy_comment') . '" class="act">' . cplang('forums_copy') . '</a>' : '') . '<a href="' . ADMINSCRIPT . '?action=forums&operation=delete&fid=' . $forum['fid'] . '&formhash=' . FORMHASH . '" title="' . cplang('forums_delete_comment') . '" class="act">' . cplang('delete') . '</a></td></tr>';
        if ($type == 'group') {
            $return .= '<tbody id="group_' . $forum['fid'] . '"' . ($toggle ? ' style="display:none;"' : '') . '>';
        }
    } else {
        if ($last == 'lastboard') {
            $return = '</tbody><tr><td></td><td colspan="4"><div class="lastboard"><a href="###" onclick="addrow(this, 1, ' . $forum['fid'] . ')" class="addtr">' . cplang('forums_admin_add_forum') . '</a></div></td><td>&nbsp;</td></tr>';
        } elseif ($last == 'lastchildboard' && $type) {
            $return = '<script type="text/JavaScript">$(\'cb_' . $type . '\').className = \'lastchildboard\';</script>';
        } elseif ($last == 'last') {
            $return = '</tbody><tr><td></td><td colspan="4"><div><a href="###" onclick="addrow(this, 0)" class="addtr">' . cplang('forums_admin_add_category') . '</a></div></td>' . '<td class="bold"><a href="javascript:;" onclick="if(getmultiids()) location.href=\'' . ADMINSCRIPT . '?action=forums&operation=edit&multi=\' + getmultiids();return false;">' . cplang('multiedit') . '</a></td>' . '</tr>';
        }
    }
    echo $return = isset($return) ? $return : '';
    return $forum['fid'];
}
Ejemplo n.º 2
0
function showcategoryrow($key, $type = '', $last = '')
{
    global $category, $lang;
    $forum = $forums[$key];
    $showedforums[] = $key;
    if ($last == '') {
        $return = '<tr class="hover"><td class="td25"><input type="text" class="txt" name="order[' . $forum['fid'] . ']" value="' . $forum['displayorder'] . '" /></td><td>';
        if ($type == 'group') {
            $return .= '<div class="parentboard">';
        } elseif ($type == '') {
            $return .= '<div class="board">';
        } elseif ($type == 'sub') {
            $return .= '<div id="cb_' . $forum['fid'] . '" class="childboard">';
        }
        $boardattr = '';
        if (!$forum['status'] || $forum['password'] || $forum['redirect']) {
            $boardattr = '<div class="boardattr">';
            $boardattr .= $forum['status'] ? '' : $lang['forums_admin_hidden'];
            $boardattr .= !$forum['password'] ? '' : ' ' . $lang['forums_admin_password'];
            $boardattr .= !$forum['redirect'] ? '' : ' ' . $lang['forums_admin_url'];
            $boardattr .= '</div>';
        }
        $return .= '<input type="text" class="txt" name="name[' . $forum['fid'] . ']" value="' . dhtmlspecialchars($forum['name']) . '" class="txt" />' . ($type == '' ? '<a href="###" onclick="addrowdirect = 1;addrow(this, 2, ' . $forum['fid'] . ')" class="addchildboard">' . $lang['forums_admin_add_sub'] . '</a>' : '') . '</div>' . $boardattr . '</td><td>' . showforum_moderators($forum) . '</td>
			<td><a href="' . ADMINSCRIPT . '?action=forums&operation=edit&fid=' . $forum['fid'] . '" title="' . $lang['forums_edit_comment'] . '" class="act">' . $lang['edit'] . '</a>' . ($type != 'group' ? '<a href="' . ADMINSCRIPT . '?action=forums&operation=copy&source=' . $forum['fid'] . '" title="' . $lang['forums_copy_comment'] . '" class="act">' . $lang['forums_copy'] . '</a>' : '') . '<a href="' . ADMINSCRIPT . '?action=forums&operation=delete&fid=' . $forum['fid'] . '" title="' . $lang['forums_delete_comment'] . '" class="act">' . $lang['delete'] . '</a></td></tr>';
    } else {
        if ($last == 'lastboard') {
            $return = '<tr><td></td><td colspan="3"><div class="lastboard"><a href="###" onclick="addrow(this, 1, ' . $forum['fid'] . ')" class="addtr">' . $lang['forums_admin_add_forum'] . '</a></div></td></tr>';
        } elseif ($last == 'lastchildboard' && $type) {
            $return = '<script type="text/JavaScript">$(\'cb_' . $type . '\').className = \'lastchildboard\';</script>';
        } elseif ($last == 'last') {
            $return = '<tr><td></td><td colspan="3"><div><a href="###" onclick="addrow(this, 0)" class="addtr">' . $lang['forums_admin_add_category'] . '</a></div></td></tr>';
        }
    }
    return $return;
}
Ejemplo n.º 3
0
function showforum(&$forum, $type = '', $last = '')
{
    global $_G;
    if ($last == '') {
        $return = '<tr class="hover"><td class="td25"><input type="text" class="txt" name="order[' . $forum['fid'] . ']" value="' . $forum['displayorder'] . '" /></td><td>';
        if ($type == 'group') {
            $return .= '<div class="parentboard">';
            $_G['fg'] = !empty($_G['fg']) ? intval($_G['fg']) : 0;
            $_G['fg']++;
        } elseif ($type == '') {
            $return .= '<div class="board">';
        } elseif ($type == 'sub') {
            $return .= '<div id="cb_' . $forum['fid'] . '" class="childboard">';
        }
        $boardattr = '';
        if (!$forum['status'] || $forum['password'] || $forum['redirect']) {
            $boardattr = '<div class="boardattr">';
            $boardattr .= $forum['status'] ? '' : cplang('forums_admin_hidden');
            $boardattr .= !$forum['password'] ? '' : ' ' . cplang('forums_admin_password');
            $boardattr .= !$forum['redirect'] ? '' : ' ' . cplang('forums_admin_url');
            $boardattr .= '</div>';
        }
        $return .= '<input type="text" name="name[' . $forum['fid'] . ']" value="' . htmlspecialchars($forum['name']) . '" class="txt" />' . ($type == '' ? '<a href="###" onclick="addrowdirect = 1;addrow(this, 2, ' . $forum['fid'] . ')" class="addchildboard">' . cplang('forums_admin_add_sub') . '</a>' : '') . '</div>' . $boardattr . '</td><td>' . showforum_moderators($forum) . '</td>
			<td><input class="checkbox" value="' . $forum['fid'] . '" type="checkbox"' . ($type != 'group' ? ' chkvalue="g' . $_G['fg'] . '" onclick="multiupdate(this, ' . $forum['fid'] . ')"' : ' name="gc' . $_G['fg'] . '" onclick="checkAll(\'value\', this.form, \'g' . $_G['fg'] . '\', \'gc' . $_G['fg'] . '\', 1)"') . ' />' . '
			<a href="' . ADMINSCRIPT . '?action=forums&operation=edit&fid=' . $forum['fid'] . '" title="' . cplang('forums_edit_comment') . '" class="act">' . cplang('edit') . '</a>' . ($type != 'group' ? '<a href="' . ADMINSCRIPT . '?action=forums&operation=copy&source=' . $forum['fid'] . '" title="' . cplang('forums_copy_comment') . '" class="act">' . cplang('forums_copy') . '</a>' : '') . '<a href="' . ADMINSCRIPT . '?action=forums&operation=delete&fid=' . $forum['fid'] . '" title="' . cplang('forums_delete_comment') . '" class="act">' . cplang('delete') . '</a></td></tr>';
    } else {
        if ($last == 'lastboard') {
            $return = '<tr><td></td><td colspan="3"><div class="lastboard"><a href="###" onclick="addrow(this, 1, ' . $forum['fid'] . ')" class="addtr">' . cplang('forums_admin_add_forum') . '</a></div></td></tr>';
        } elseif ($last == 'lastchildboard' && $type) {
            $return = '<script type="text/JavaScript">$(\'cb_' . $type . '\').className = \'lastchildboard\';</script>';
        } elseif ($last == 'last') {
            $return = '<tr><td></td><td colspan="3"><div><a href="###" onclick="addrow(this, 0)" class="addtr">' . cplang('forums_admin_add_category') . '</a></div></td></tr>';
        }
    }
    echo $return = isset($return) ? $return : '';
    return $forum['fid'];
}