示例#1
0
    exit;
}
if (!empty($_POST['do_comimport']) && !empty($_POST['comimport_mid']) && !empty($_POST['comimport_forum_id'])) {
    set_time_limit(0);
    if (!$xoopsGTicket->check(true, 'd3forum_admin')) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
    }
    $mid = intval(@$_POST['comimport_mid']);
    if (empty($comimportable_modules[$mid])) {
        die(_MD_A_D3FORUM_ERR_INVALIDMID);
    }
    $forum_id = intval(@$_POST['comimport_forum_id']);
    d3forum_comimport_as_topics($mydirname, $mid, $forum_id);
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/admin/index.php?page=advanced_admin", 3, _MD_A_D3FORUM_MSG_COMIMPORTDONE);
    exit;
}
//
// form stage
//
$synctopics_start = intval(@$_SESSION[$mydirname . '_synctopics_start']);
$synctopics_num = empty($_SESSION[$mydirname . '_synctopics_num']) ? 100 : intval($_SESSION[$mydirname . '_synctopics_num']);
list($max_topic_id) = $db->fetchRow($db->query("SELECT MAX(topic_id) FROM " . $db->prefix($mydirname . "_topics")));
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new XoopsTpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'max_topic_id' => $max_topic_id, 'synctopics_start' => $synctopics_start, 'synctopics_num' => $synctopics_num, 'import_from_options' => $importable_modules, 'comimport_from_options' => $comimportable_modules, 'comimport_to_options' => d3forum_make_jumpbox_options($mydirname, '1', '1', -1), 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3forum_admin')));
$tpl->display('db:' . $mydirname . '_admin_advanced_admin.html');
xoops_cp_footer();
示例#2
0
    $post_auto_approved_checked = $post_auto_approved ? "checked='checked'" : "";
    $is_moderator_checked = $is_moderator ? "checked='checked'" : "";
    $group_trs .= "\n\t\t<tr>\n\t\t\t<td class='even'>" . $group->getVar('name') . "</td>\n\t\t\t<td class='even'><input type='checkbox' name='can_reads[{$gid}]' id='gcol_1_{$gid}' value='1' {$can_read_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_posts[{$gid}]' id='gcol_2_{$gid}' value='1' {$can_post_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_edits[{$gid}]' id='gcol_3_{$gid}' value='1' {$can_edit_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_deletes[{$gid}]' id='gcol_4_{$gid}' value='1' {$can_delete_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='post_auto_approveds[{$gid}]' id='gcol_5_{$gid}' value='1' {$post_auto_approved_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='is_moderators[{$gid}]' id='gcol_6_{$gid}' value='1' {$is_moderator_checked} /></td>\n\t\t</tr>\n";
}
// create user form
$fars = $db->query("SELECT u.uid,u.uname,fa.can_post,fa.can_edit,fa.can_delete,fa.post_auto_approved,fa.is_moderator FROM " . $db->prefix($mydirname . "_forum_access") . " fa LEFT JOIN " . $db->prefix("users") . " u ON fa.uid=u.uid WHERE fa.forum_id={$forum_id} AND fa.groupid IS NULL ORDER BY u.uid ASC");
$user_trs = '';
while (list($uid, $uname, $can_post, $can_edit, $can_delete, $post_auto_approved, $is_moderator) = $db->fetchRow($fars)) {
    $uid = intval($uid);
    $uname4disp = htmlspecialchars($uname, ENT_QUOTES);
    $can_post_checked = $can_post ? "checked='checked'" : "";
    $can_edit_checked = $can_edit ? "checked='checked'" : "";
    $can_delete_checked = $can_delete ? "checked='checked'" : "";
    $post_auto_approved_checked = $post_auto_approved ? "checked='checked'" : "";
    $is_moderator_checked = $is_moderator ? "checked='checked'" : "";
    $user_trs .= "\n\t\t<tr>\n\t\t\t<td class='even'>{$uid}</td>\n\t\t\t<td class='even'>{$uname4disp}</td>\n\t\t\t<td class='even'><input type='checkbox' name='can_reads[{$uid}]' id='ucol_1_{$uid}' value='1' checked='checked' /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_posts[{$uid}]' id='ucol_2_{$uid}' value='1' {$can_post_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_edits[{$uid}]' id='ucol_3_{$uid}' value='1' {$can_edit_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='can_deletes[{$uid}]' id='ucol_4_{$uid}' value='1' {$can_delete_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='post_auto_approveds[{$uid}]' id='ucol_5_{$uid}' value='1' {$post_auto_approved_checked} /></td>\n\t\t\t<td class='even'><input type='checkbox' name='is_moderators[{$uid}]' id='ucol_6_{$uid}' value='1' {$is_moderator_checked} /></td>\n\t\t</tr>\n";
}
// create new user form
$newuser_trs = '';
for ($i = 0; $i < 5; $i++) {
    $newuser_trs .= "\n\t\t<tr>\n\t\t\t<td class='head'><input type='text' size='4' name='new_uids[{$i}]' value='' /></th>\n\t\t\t<td class='head'><input type='text' size='12' name='new_unames[{$i}]' value='' /></th>\n\t\t\t<td class='head'><input type='checkbox' name='new_can_reads[{$i}]' id='ncol_1_{$i}' checked='checked' disabled='disabled' /></th>\n\t\t\t<td class='head'><input type='checkbox' name='new_can_posts[{$i}]' id='ncol_2_{$i}' value='1' /></th>\n\t\t\t<td class='head'><input type='checkbox' name='new_can_edits[{$i}]' id='ncol_3_{$i}' value='1' /></td>\n\t\t\t<td class='head'><input type='checkbox' name='new_can_deletes[{$i}]' id='ncol_4_{$i}' value='1' /></td>\n\t\t\t<td class='head'><input type='checkbox' name='new_post_auto_approveds[{$i}]' id='ncol_5_{$i}' value='1' /></td>\n\t\t\t<td class='head'><input type='checkbox' name='new_is_moderators[{$i}]' id='ncol_6_{$i}' value='1' /></td>\n\t\t</tr>\n\t\n";
}
//
// display stage
//
xoops_cp_header();
include dirname(__FILE__) . '/mymenu.php';
$tpl = new XoopsTpl();
$tpl->assign(array('mydirname' => $mydirname, 'mod_name' => $xoopsModule->getVar('name'), 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'forum_id' => $forum_id, 'forum_title' => htmlspecialchars($forum_title, ENT_QUOTES), 'forum_jumpbox_options' => d3forum_make_jumpbox_options($mydirname, '1', '1', $forum_id), 'group_trs' => $group_trs, 'user_trs' => $user_trs, 'newuser_trs' => $newuser_trs, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3forum_admin')));
$tpl->display('db:' . $mydirname . '_admin_forum_access.html');
xoops_cp_footer();
示例#3
0
        $whr_forum = "f.forum_id={$forum_id}";
    } else {
        $whr_forum = '1';
    }
    // uname
    if (!empty($_GET['search_username'])) {
        $uname = $myts->stripSlashesGPC($_GET['search_username']);
        $uname4disp = htmlspecialchars($uname, ENT_QUOTES);
        $uname4sql = addslashes($uname);
        $whr_uname = "u.uname='{$uname4sql}'";
    } else {
        $whr_uname = '1';
        $uname4disp = '';
    }
    $allowed_sortbys = array("p.uid", "p.uid desc", "p.post_time", "p.post_time desc", "t.topic_title", "t.topic_title desc", "t.topic_views", "t.topic_views desc", "t.topic_sticky", "t.topic_sticky desc", "t.topic_locked", "t.topic_locked desc", "t.topic_solved", "t.topic_solved desc", "t.topic_posts_count", "t.topic_posts_count desc", "f.forum_id", "f.forum_id desc", "f.forum_title", "f.forum_title desc", "c.cat_id", "c.cat_id desc", "c.cat_title", "c.cat_title desc", "u.uname", "u.uname desc");
    $sortby = in_array(@$_GET['sortby'], $allowed_sortbys) ? $_GET['sortby'] : "p.post_time desc";
    $sql = 'SELECT u.uid,u.uname,p.post_id,p.subject,p.post_time,p.icon,LENGTH(p.post_text) AS body_length,p.votes_count,p.votes_sum,t.topic_id,t.topic_title,t.topic_views,t.topic_posts_count,f.forum_id,f.forum_title,c.cat_id,c.cat_title FROM ' . $db->prefix($mydirname . '_posts') . ' p LEFT JOIN ' . $db->prefix('users') . ' u ON p.uid=u.uid LEFT JOIN ' . $db->prefix($mydirname . '_topics') . ' t ON p.topic_id = t.topic_id LEFT JOIN ' . $db->prefix($mydirname . '_forums') . ' f ON t.forum_id = f.forum_id LEFT JOIN ' . $db->prefix($mydirname . '_categories') . " c ON f.cat_id = c.cat_id WHERE ({$whr_keyword}) AND ({$whr_forum}) AND ({$whr_uname}) AND ({$whr_read4forum}) AND ({$whr_read4cat}) ORDER BY {$sortby}";
    // TODO :-)
    if (!($result = $db->query($sql, 100, 0))) {
        die(_MD_D3FORUM_ERR_SQL . __LINE__);
    }
    $results4assign = array();
    $hits_count = $db->getRowsNum($result);
    while ($row = $db->fetchArray($result)) {
        $results4assign[] = array('forum_title' => $myts->makeTboxData4Show($row['cat_title']), 'forum_id' => intval($row['cat_id']), 'forum_title' => $myts->makeTboxData4Show($row['forum_title']), 'forum_id' => intval($row['forum_id']), 'topic_title' => $myts->makeTboxData4Show($row['topic_title']), 'topic_id' => intval($row['topic_id']), 'topic_replies' => $row['topic_posts_count'] - 1, 'topic_views' => intval($row['topic_views']), 'post_id' => intval($row['post_id']), 'subject' => $myts->makeTboxData4Show($row['subject']), 'icon' => intval($row['icon']), 'body_length' => intval($row['body_length']), 'poster_uid' => intval($row['uid']), 'poster_uname' => $myts->makeTboxData4Show($row['uname']), 'post_time' => intval($row['post_time']), 'post_time_formatted' => formatTimestamp($row['post_time'], 'm'), 'votes_avg' => $row['votes_count'] ? $row['votes_sum'] / (double) $row['votes_count'] : 0) + $row;
    }
}
$xoopsOption['template_main'] = $mydirname . '_main_search.html';
include XOOPS_ROOT_PATH . "/header.php";
$xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'hits_count' => intval(@$hits_count), 'keyword' => @$keyword4disp, 'andor_options' => array('or' => _MD_D3FORUM_LABEL_SEARCHOR, 'and' => _MD_D3FORUM_LABEL_SEARCHAND), 'andor_selected' => empty($andor_selected) ? 'or' : $andor_selected, 'target_options' => array('subject' => _MD_D3FORUM_SUBJECT, 'body' => _MD_D3FORUM_BODY, 'both' => _MD_D3FORUM_LABEL_TARGETBOTH), 'target_selected' => empty($target_selected) ? 'both' : $target_selected, 'sortby_options' => array('p.post_time desc' => _MD_D3FORUM_ON, 't.topic_title' => _MD_D3FORUM_TOPICTITLE, 'f.forum_id' => _MD_D3FORUM_FORUM, 'u.uname' => _MD_D3FORUM_POSTER), 'sortby_selected' => empty($sortby_selected) ? 'p.post_time desc' : $sortby_selected, 'uname' => @$uname4disp, 'show_results' => !empty($_GET['submit']) ? true : false, 'results' => $results4assign, 'forum_jumpbox_options' => d3forum_make_jumpbox_options($mydirname, $whr_read4cat, $whr_read4forum, @$forum_id), 'xoops_module_header' => "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . str_replace('{mod_url}', XOOPS_URL . '/modules/' . $mydirname, $xoopsModuleConfig['css_uri']) . "\" />" . $xoopsTpl->get_template_vars("xoops_module_header"), 'xoops_pagetitle' => _MD_D3FORUM_TITLE_SEARCH, 'xoops_breadcrumbs' => array_merge($xoops_breadcrumbs, array(array('name' => _MD_D3FORUM_TITLE_SEARCH)))));
include XOOPS_ROOT_PATH . '/footer.php';
示例#4
0
                } else {
                    include dirname(dirname(__FILE__)) . '/include/listcategories.php';
                    $d3forum_output_rss = false;
                }
            }
        }
    }
}
// form elements or javascripts for anti-SPAM
if (d3forum_common_is_necessary_antispam($xoopsUser, $xoopsModuleConfig)) {
    $antispam_obj =& d3forum_common_get_antispam_object($xoopsModuleConfig);
    $antispam4assign = $antispam_obj->getHtml4Assign();
} else {
    $antispam4assign = array();
}
$xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'xoops_config' => $xoopsConfig, 'uid' => $uid, 'postorder' => $postorder, 'icon_meanings' => $d3forum_icon_meanings, 'antispam' => $antispam4assign, 'forum_jumpbox_options' => d3forum_make_jumpbox_options($mydirname, $whr_read4cat, $whr_read4forum, @$forum_row['forum_id']), 'xoops_module_header' => "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . str_replace('{mod_url}', XOOPS_URL . '/modules/' . $mydirname, $xoopsModuleConfig['css_uri']) . "\" />" . $xoopsTpl->get_template_vars("xoops_module_header")));
if (!empty($d3forum_output_rss)) {
    // RSS 2.0
    if (function_exists('mb_http_output')) {
        mb_http_output('pass');
    }
    if (_CHARSET != 'UTF-8') {
        $data = $xoopsTpl->get_template_vars();
        d3forum_common_utf8_encode_recursive($data);
        $xoopsTpl->assign($data);
        if (empty($_GET['forum_id'])) {
            $rss = array('title' => $data['pagetitle'], 'query' => 'cat_ids=' . $data['cat_ids'], 'desc' => '', 'category_title' => '');
        } else {
            $rss = array('title' => $data['forum']['title'], 'query' => 'forum_id=' . $data['forum']['id'], 'desc' => $data['forum']['desc'], 'category_title' => $data['category']['title']);
        }
        $xoopsTpl->assign('rss', $rss);
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/index.php?topic_id={$topic_id}", 2, _MD_D3FORUM_TOPICMANAGERDONE);
    exit;
}
if (!empty($_POST['topicman_export_copy']) || !empty($_POST['topicman_export_move'])) {
    require_once dirname(dirname(__FILE__)) . '/include/import_functions.php';
    if (!$xoopsGTicket->check(true, 'd3forum')) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
    }
    $export_mid = intval(@$_POST['export_mid']);
    $export_forum_id = intval(@$_POST['export_forum_id'][$export_mid]);
    if (!empty($exportable_modules[$export_mid]) && $export_forum_id > 0) {
        d3forum_export_topic_to_d3forum($mydirname, $export_mid, $export_forum_id, $forum_id, $topic_id, !empty($_POST['topicman_export_move']));
        redirect_header(XOOPS_URL . "/modules/{$mydirname}/index.php?forum_id={$forum_id}", 2, _MD_D3FORUM_TOPICMANAGERDONE);
        exit;
    }
}
// get target forums
$jump_box_forums = array();
foreach ($forum_permissions as $forum_id => $perms) {
    if ($perms['is_moderator']) {
        $jump_box_forums[] = $forum_id;
    }
}
$whr4forum_jump_box = empty($jump_box_forums) ? '0' : 'f.forum_id IN (' . implode(',', $jump_box_forums) . ')';
// FORM PART
$xoopsOption['template_main'] = $mydirname . '_main_topicmanager.html';
include XOOPS_ROOT_PATH . "/header.php";
// make edit data (special patch)
$topic4assign['title4edit'] = htmlspecialchars($topic_row['topic_title'], ENT_QUOTES);
$xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'category' => $category4assign, 'forum' => $forum4assign, 'topic' => $topic4assign, 'forum_jumpbox_options' => d3forum_make_jumpbox_options($mydirname, '1', $isadmin ? '1' : $whr4forum_jump_box, $topic_row['forum_id']), 'export_to_module_options' => $exportable_modules, 'export_to_forum_options' => $exportable_module_forums, 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'd3forum'), 'xoops_module_header' => "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . str_replace('{mod_url}', XOOPS_URL . '/modules/' . $mydirname, $xoopsModuleConfig['css_uri']) . "\" />" . $xoopsTpl->get_template_vars("xoops_module_header"), 'xoops_pagetitle' => _MD_D3FORUM_TOPICMANAGER, 'xoops_breadcrumbs' => array_merge($xoops_breadcrumbs, array(array('name' => _MD_D3FORUM_TOPICMANAGER)))));
include XOOPS_ROOT_PATH . '/footer.php';
    redirect_header(XOOPS_URL . "/modules/{$mydirname}/index.php?topic_id={$new_topic_id}", 2, _MD_D3FORUM_CUTPASTESUCCESS);
    exit;
} else {
    // FORM PART
    // references to confirm the post will be deleted
    $reference_message4html = $myts->displayTarea($post_row['post_text'], $post_row['html'], $post_row['smiley'], $post_row['xcode'], $xoopsModuleConfig['allow_textimg'], $post_row['br']);
    $reference_time = intval($post_row['post_time']);
    if (!empty($post_row['guest_name'])) {
        $reference_name4html = htmlspecialchars($post_row['guest_name'], ENT_QUOTES);
    } else {
        if ($post_row['uid']) {
            $reference_name4html = XoopsUser::getUnameFromId($post_row['uid']);
        } else {
            $reference_name4html = $xoopsModuleConfig['anonymous_name'];
        }
    }
    $reference_subject4html = $myts->makeTboxData4Show($post_row['subject']);
    // get target forums
    $jump_box_forums = array();
    foreach ($forum_permissions as $forum_id => $perms) {
        if ($perms['is_moderator']) {
            $jump_box_forums[] = $forum_id;
        }
    }
    $whr4forum_jump_box = empty($jump_box_forums) ? '0' : 'f.forum_id IN (' . implode(',', $jump_box_forums) . ')';
    // dare to set 'template_main' after header.php (for disabling cache)
    include XOOPS_ROOT_PATH . "/header.php";
    $xoopsOption['template_main'] = $mydirname . '_main_cutpasteposts.html';
    $xoopsTpl->assign(array('mydirname' => $mydirname, 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $xoopsModuleConfig['images_dir'], 'mod_config' => $xoopsModuleConfig, 'mode' => 'delete', 'post_id' => $post_id, 'post' => array('pid' => intval($post_row['pid'])), 'reference_subject' => @$reference_subject4html, 'reference_message' => @$reference_message4html, 'reference_name' => @$reference_name4html, 'reference_time' => @$reference_time, 'reference_time_formatted' => formatTimestamp(@$reference_time, 'm'), 'children_count' => count($children), 'category' => $category4assign, 'forum' => $forum4assign, 'topic' => $topic4assign, 'post' => $post4assign, 'forum_jumpbox_options' => d3forum_make_jumpbox_options($mydirname, '1', $isadmin ? '1' : $whr4forum_jump_box, $forum_row['forum_id']), 'xoops_module_header' => "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . str_replace('{mod_url}', XOOPS_URL . '/modules/' . $mydirname, $xoopsModuleConfig['css_uri']) . "\" />" . $xoopsTpl->get_template_vars("xoops_module_header"), 'xoops_pagetitle' => _MD_D3FORUM_CUTPASTEPOSTS, 'xoops_breadcrumbs' => array_merge($xoops_breadcrumbs, array(array('name' => _MD_D3FORUM_CUTPASTEPOSTS)))));
    include XOOPS_ROOT_PATH . '/footer.php';
}