Exemplo n.º 1
0
         print_stop_message2('invalid_channel_specified');
     }
     print_form_header('forum', 'update');
     print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['channel'], vB_String::htmlSpecialCharsUni($channel['title']), $channel['nodeid']));
     construct_hidden_code('nodeid', $vbulletin->GPC['nodeid']);
 }
 $channel['title'] = str_replace('&', '&', $channel['title']);
 $channel['description'] = str_replace('&', '&', $channel['description']);
 print_input_row($vbphrase['title'], 'channel[title]', $channel['title']);
 print_textarea_row($vbphrase['description_gcpglobal'], 'channel[description]', $channel['description']);
 //print_input_row($vbphrase['forum_link'], 'forum[link]', $forum['link']);
 print_input_row("{$vbphrase['display_order']}<dfn>{$vbphrase['zero_equals_no_display']}</dfn>", 'channel[displayorder]', $channel['displayorder']);
 //print_input_row($vbphrase['default_view_age'], 'forum[daysprune]', $forum['daysprune']);
 if ($vbulletin->GPC['nodeid'] != -1) {
     if (!isset($channel['guid']) or $channel['guid'] != vB_Channel::MAIN_CHANNEL and !in_array($channel['nodeid'], vB_Api::instance('content_channel')->fetchTopLevelChannelIds())) {
         print_channel_chooser($vbphrase['parent_forum'], 'channel[parentid]', $channel['parentid'], false, false, false, null, true);
     }
 } else {
     construct_hidden_code('parentid', 0);
 }
 print_table_header($vbphrase['style_options']);
 if ($channel['styleid'] == 0) {
     $channel['styleid'] = -1;
     // to get the "use default style" option selected
 }
 print_style_chooser_row('channel[styleid]', $channel['styleid'], $vbphrase['use_default_style_gforum'], $vbphrase['custom_forum_style'], 1);
 print_yes_no_row($vbphrase['override_style_choice'], 'channel[options][styleoverride]', $channel['options']['styleoverride']);
 /*
 	print_input_row($vbphrase['prefix_for_forum_status_images'], 'forum[imageprefix]', $forum['imageprefix']);
 
 	print_table_header($vbphrase['access_options']);
Exemplo n.º 2
0
        }
    }
    $result = vB::getDbAssertor()->assertQuery('permission', array(vB_dB_Query::TYPE_KEY => vB_dB_Query::QUERY_DELETE, 'permissionid' => $removeids));
    build_channel_permissions();
    print_stop_message2('deleted_forum_permissions_successfully', 'forumpermission', array('do' => 'modify'));
}
// ###################### Start quick forum setup #######################
if ($_REQUEST['do'] == 'quickforum') {
    $usergrouplist = array();
    foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) {
        $usergrouplist[] = "<input type=\"checkbox\" name=\"usergrouplist[{$usergroup['usergroupid']}]\" id=\"usergrouplist_{$usergroup['usergroupid']}\" value=\"1\" tabindex=\"1\" /><label for=\"usergrouplist_{$usergroup['usergroupid']}\">{$usergroup['title']}</label>";
    }
    $usergrouplist = implode('<br />', $usergrouplist);
    print_form_header('forumpermission', 'doquickforum');
    print_table_header($vbphrase['quick_channel_permission_setup']);
    print_channel_chooser($vbphrase['apply_permissions_to_channel'], 'nodeid', 0);
    print_label_row($vbphrase['apply_permissions_to_usergroup'], "<span class=\"smallfont\">{$usergrouplist}</span>", '', 'top', 'usergrouplist');
    print_description_row($vbphrase['permission_overwrite_notice']);
    print_table_break();
    print_channel_permission_rows($vbphrase['permissions']);
    print_submit_row();
}
// ###################### Start do quick forum #######################
if ($_POST['do'] == 'doquickforum') {
    $vbulletin->input->clean_array_gpc('p', array('usergrouplist' => vB_Cleaner::TYPE_ARRAY, 'nodeid' => vB_Cleaner::TYPE_INT, 'forumpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'moderatorpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'createpermissions' => vB_Cleaner::TYPE_ARRAY_INT, 'edit_time' => vB_Cleaner::TYPE_INT, 'require_moderate' => vB_Cleaner::TYPE_INT, 'maxtags' => vB_Cleaner::TYPE_INT, 'maxstartertags' => vB_Cleaner::TYPE_INT, 'maxothertags' => vB_Cleaner::TYPE_INT, 'maxattachments' => vB_Cleaner::TYPE_INT));
    if (sizeof($vbulletin->GPC['usergrouplist']) == 0) {
        print_stop_message2('invalid_usergroup_specified');
    }
    require_once DIR . '/includes/functions_misc.php';
    $bf_ugp_forumpermissions = vB::getDatastore()->getValue('bf_ugp_forumpermissions');
    $bf_misc_moderatorpermissions = vB::getDatastore()->getValue('bf_misc_moderatorpermissions');
Exemplo n.º 3
0
    print_yes_no_row($vbphrase['feed_is_enabled'], 'options[enabled]', $feed['options']['enabled']);
    print_input_row($vbphrase['title'], 'title', $feed['title'], false, 50);
    print_input_row($vbphrase['url_of_feed'], 'url', $feed['url'], true, 50);
    print_select_row($vbphrase['check_feed_every'], 'ttl', array(600 => construct_phrase($vbphrase['x_minutes'], 10), 1200 => construct_phrase($vbphrase['x_minutes'], 20), 1800 => construct_phrase($vbphrase['x_minutes'], 30), 3600 => construct_phrase($vbphrase['x_minutes'], 60), 7200 => construct_phrase($vbphrase['x_hours_gcron'], 2), 14400 => construct_phrase($vbphrase['x_hours_gcron'], 4), 21600 => construct_phrase($vbphrase['x_hours_gcron'], 6), 28800 => construct_phrase($vbphrase['x_hours_gcron'], 8), 36000 => construct_phrase($vbphrase['x_hours_gcron'], 10), 43200 => construct_phrase($vbphrase['x_hours_gcron'], 12)), $feed['ttl']);
    print_input_row($vbphrase['maximum_items_to_fetch'], 'maxresults', $feed['maxresults'], true, 50);
    print_label_row($vbphrase['search_items_for_words'], '
		<div><textarea name="searchwords" rows="5" cols="50" tabindex="1">' . $feed['searchwords'] . '</textarea></div>
		<input type="hidden" name="options[searchboth]" value="0" />
		<input type="hidden" name="options[matchall]" value="0" />
		<div class="smallfont">
			<label for="cb_searchboth"><input type="checkbox" name="options[searchboth]" id="cb_searchboth" value="1" tabindex="1"' . $checked['searchboth'] . ' />' . $vbphrase['search_item_body'] . '</label>
			<label for="cb_matchall"><input type="checkbox" name="options[matchall]" id="cb_matchall" value="1" tabindex="1"' . $checked['matchall'] . ' />' . $vbphrase['match_all_words_gcron'] . '</label>
		</div>
	', '', 'top', 'searchwords');
    print_input_row($vbphrase['username'], 'username', $feed['username'], false, 50);
    print_channel_chooser($vbphrase['channel'], 'nodeid', $feed['nodeid'], null, true, false, '[%s]');
    print_yes_no_row($vbphrase['convert_html_to_bbcode'], 'options[html2bbcode]', $feed['options']['html2bbcode']);
    print_table_header($vbphrase['templates']);
    print_description_row('<div class="smallfont">' . $vbphrase['rss_templates_description'] . '</div>');
    print_input_row($vbphrase['title_template'], 'titletemplate', $feed['titletemplate'], true, 50);
    print_textarea_row($vbphrase['body_template'], 'bodytemplate', $feed['bodytemplate'], 10, 50);
    print_description_row('<label for="rb_itemtype_thread"><input type="radio" name="itemtype" value="topic" id="rb_itemtype_thread"' . $checked['itemtype']['topic'] . "  />{$vbphrase['post_items_as_threads']}</label>", false, 2, 'thead', 'left', 'itemtype');
    if ($prefix_options = construct_prefix_options(0, $feed['prefixid'])) {
        print_label_row($vbphrase['prefix'] . '<dfn>' . $vbphrase['note_prefix_must_allowed_forum'] . '</dfn>', '<select name="prefixid" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid');
    }
    // build thread icon picker
    $icons = array();
    $icons_result = vB_Api::instanceInternal('icon')->fetchAll(array('imagecategoryid', 'displayorder'));
    $icons_total = count($icons_result);
    foreach ($icons_result as $icon) {
        $icons[] = $icon;
Exemplo n.º 4
0
         $perms = convert_bits_to_array($moderator['permissions'], $vbulletin->bf_misc_moderatorpermissions);
         $perms2 = convert_bits_to_array($moderator['permissions2'], $vbulletin->bf_misc_moderatorpermissions2);
         $moderator = array_merge($perms, $perms2, $moderator);
         log_admin_action('username = '******'username'] . ', userid = ' . $moderator['userid']);
         // delete link
         print_form_header('moderator', 'remove');
         construct_hidden_code('moderatorid', $vbulletin->GPC['moderatorid']);
         print_table_header($vbphrase['if_you_would_like_to_remove_this_moderator_gmoderator'] . ' &nbsp; &nbsp; <input type="submit" class="button" value="' . $vbphrase['remove'] . '" tabindex="1" />');
         print_table_footer();
         print_form_header('moderator', 'update');
         construct_hidden_code('moderatorid', $vbulletin->GPC['moderatorid']);
         print_table_header(construct_phrase($vbphrase['edit_moderator_x_for_channel_y'], $moderator['username'], $moderator['htmltitle']));
     }
 }
 if ($_REQUEST['do'] != 'editglobal') {
     print_channel_chooser($vbphrase['channel_and_subchannels'], 'nodeid', $moderator['nodeid']);
     if ($_REQUEST['do'] == 'add') {
         print_input_row($vbphrase['moderator_usernames'] . "<dfn>{$vbphrase['separate_usernames_semicolon']}</dfn>", 'modusername', $moderator['username'], 0);
     } else {
         if ($_REQUEST['do'] == 'edit') {
             print_input_row($vbphrase['moderator_username'], 'modusername', $moderator['username'], 0);
         }
     }
     construct_hidden_code('redir', $vbulletin->GPC['redir']);
 }
 // usergroup membership options
 if ($_REQUEST['do'] == 'add' and can_administer('canadminusers')) {
     $usergroups = array(0 => $vbphrase['do_not_change_usergroup']);
     foreach ($vbulletin->usergroupcache as $usergroupid => $usergroup) {
         $usergroups["{$usergroupid}"] = $usergroup['title'];
     }
Exemplo n.º 5
0
        $announcement = $announcement->current();
        if (!$userContext->hasAdminPermission('cancontrolpanel')) {
            if ($announcement['nodeid'] == -1 and !$userContext->hasPermission('adminpermissions', 'ismoderator')) {
                print_table_header($vbphrase['no_permission_global_announcement']);
                print_table_break();
            } else {
                if ($announcement['nodeid'] != -1 and !$userContext->getChannelPermission('moderatorpermissions', 'canannounce', $announcement['nodeid'])) {
                    print_table_header($vbphrase['no_permission_announcement']);
                    print_table_break();
                }
            }
        }
        construct_hidden_code('announcementid', $vbulletin->GPC['announcementid']);
        print_table_header(construct_phrase($vbphrase['x_y_id_z'], $vbphrase['announcement'], vB_String::htmlSpecialCharsUni($announcement['title']), $announcement['announcementid']));
    }
    print_channel_chooser($vbphrase['channel_and_subchannels'], 'nodeid', $announcement['nodeid'], $vbphrase['all_channels']);
    print_input_row($vbphrase['title'], 'title', $announcement['title']);
    print_time_row($vbphrase['start_date'], 'startdate', $announcement['startdate'], 0);
    print_time_row($vbphrase['end_date'], 'enddate', $announcement['enddate'], 0);
    print_textarea_row($vbphrase['text_gcpglobal'], 'pagetext', $announcement['pagetext'], 20, '75" style="width:100%');
    if ($vbulletin->GPC['announcementid']) {
        print_yes_no_row($vbphrase['reset_views_counter'], 'reset_views', 0);
    }
    $announcementOptions = $datastore->getValue('bf_misc_announcementoptions');
    print_yes_no_row($vbphrase['allow_bbcode'], 'announcementoptions[allowbbcode]', $announcement['announcementoptions'] & $announcementOptions['allowbbcode'] ? 1 : 0);
    print_yes_no_row($vbphrase['allow_smilies'], 'announcementoptions[allowsmilies]', $announcement['announcementoptions'] & $announcementOptions['allowsmilies'] ? 1 : 0);
    print_yes_no_row($vbphrase['allow_html'], 'announcementoptions[allowhtml]', $announcement['announcementoptions'] & $announcementOptions['allowhtml'] ? 1 : 0);
    print_yes_no_row($vbphrase['automatically_parse_links_in_text'], 'announcementoptions[parseurl]', $announcement['announcementoptions'] & $announcementOptions['parseurl'] ? 1 : 0);
    print_yes_no_row($vbphrase['show_your_signature_gposting'], 'announcementoptions[signature]', $announcement['announcementoptions'] & $announcementOptions['signature'] ? 1 : 0);
    print_submit_row($vbphrase['save']);
}
Exemplo n.º 6
0
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['view_permissions_gcppermission']);
$perm_phrase = array('canview' => $vbphrase['can_view_forum'], 'canviewthreads' => $vbphrase['can_view_threads'], 'canviewothers' => $vbphrase['can_view_others_threads'], 'cansearch' => $vbphrase['can_search_forum'], 'canemail' => $vbphrase['can_use_email_to_friend'], 'canpostnew' => $vbphrase['can_post_threads'], 'canreply' => $vbphrase['can_reply_to_threads'], 'caneditpost' => $vbphrase['can_edit_own_posts'], 'candeletepost' => $vbphrase['can_delete_own_posts'], 'candeletethread' => $vbphrase['can_delete_own_threads'], 'canopenclose' => $vbphrase['can_open_close_own_threads'], 'canmove' => $vbphrase['can_move_own_threads'], 'cangetattachment' => $vbphrase['can_view_attachments'], 'cangetimgattachment' => $vbphrase['can_view_image_attachments'], 'canseethumbnails' => $vbphrase['can_see_thumbnails'], 'canpostattachment' => $vbphrase['can_post_attachments'], 'canpostpoll' => $vbphrase['can_post_polls'], 'canvote' => $vbphrase['can_vote_on_polls'], 'canthreadrate' => $vbphrase['can_rate_threads'], 'canseedelnotice' => $vbphrase['can_see_deletion_notices'], 'followforummoderation' => $vbphrase['follow_forum_moderation_rules'], 'cantagown' => $vbphrase['can_tag_own_threads'], 'cantagothers' => $vbphrase['can_tag_others_threads'], 'candeletetagown' => $vbphrase['can_delete_tags_own_threads'], 'canconfigchannel' => $vbphrase['can_configure_channel'], 'canusehtml' => $vbphrase['can_use_html'], 'canpublish' => $vbphrase['can_publish'], 'cancreateblog' => $vbphrase['can_create_blog'], 'canjoin' => $vbphrase['can_join'], 'canuploadchannelicon' => $vbphrase['can_upload_channel_icons'], 'cananimatedchannelicon' => $vbphrase['can_use_animated_channel_icon'], 'cancomment' => $vbphrase['can_comment'], 'caneditothers' => $vbphrase['can_edit_others_content'], 'candeleteothers' => $vbphrase['can_delete_others_content'], 'canattachmentcss' => $vbphrase['can_css_attachments']);
//build a nice array with permission names
foreach ($vbulletin->bf_ugp_forumpermissions as $key => $val) {
    $bitfieldnames["{$val}"] = $perm_phrase["{$key}"];
}
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'index';
}
// ###################### Start index ########################
if ($_REQUEST['do'] == 'index') {
    print_form_header('resources', 'view');
    print_table_header($vbphrase['view_forum_permissions_gcppermission']);
    print_channel_chooser($vbphrase['channel'], 'nodeid', 0, "({$vbphrase['channel']})");
    print_chooser_row($vbphrase['usergroup'], 'usergroupid', 'usergroup', '', "({$vbphrase['usergroup']})");
    print_label_row($vbphrase['forum_permissions_gcppermission'], '<label for="cb_checkall"><input type="checkbox" id="cb_checkall" name="allbox" onclick="js_check_all(this.form)" />' . $vbphrase['check_all'] . '</label>', 'thead');
    foreach ($vbulletin->bf_ugp_forumpermissions as $field => $value) {
        print_checkbox_row($perm_phrase["{$field}"], "checkperm[{$value}]", false, $value);
    }
    print_submit_row($vbphrase['find']);
}
// ###################### Start viewing resources for forums or usergroups ########################
if ($_REQUEST['do'] == 'view') {
    $vbulletin->input->clean_array_gpc('r', array('checkperm' => vB_Cleaner::TYPE_ARRAY_INT));
    if ($vbulletin->GPC['nodeid'] <= 0 and $vbulletin->GPC['usergroupid'] <= 0) {
        print_stop_message2('you_must_pick_a_usergroup_or_channel_to_check_permissions');
    }
    if (empty($vbulletin->GPC['checkperm'])) {
        $vbulletin->GPC['checkperm'][] = 1;
Exemplo n.º 7
0
    $trans_link = "phrase.php?" . vB::getCurrentSession()->get('sessionurl') . "do=edit&fieldname=prefix&t=1&varname=";
    // has varname appended
    print_input_row($vbphrase['title'] . ($prefixset['prefixsetid'] ? '<dfn>' . construct_link_code($vbphrase['translations'], $trans_link . "prefixset_{$prefixset['prefixsetid']}_title", 1) . '</dfn>' : ''), 'title', $prefixset['title']);
    print_input_row($vbphrase['display_order'], 'displayorder', $prefixset['displayorder']);
    $enabled_channels = array();
    if ($prefixset['prefixsetid']) {
        $channels_sql = $vbulletin->db->query_read("\n\t\t\tSELECT nodeid\n\t\t\tFROM " . TABLE_PREFIX . "channelprefixset\n\t\t\tWHERE prefixsetid = '" . $vbulletin->db->escape_string($prefixset['prefixsetid']) . "'\n\t\t");
        while ($channel = $vbulletin->db->fetch_array($channels_sql)) {
            $enabled_channels[] = $channel['nodeid'];
        }
    }
    if (empty($enabled_channels)) {
        // default to selecting "none"
        $enabled_channels = array(-1);
    }
    print_channel_chooser($vbphrase['use_prefix_set_in_these_channels'], 'nodeids[]', $enabled_channels, $vbphrase['none'], false, true);
    print_submit_row();
}
// ########################################################################
if ($_POST['do'] == 'displayorder') {
    $vbulletin->input->clean_array_gpc('p', array('prefixset_order' => vB_Cleaner::TYPE_ARRAY_UINT, 'prefix_order' => vB_Cleaner::TYPE_ARRAY_UINT));
    foreach ($vbulletin->GPC['prefixset_order'] as $prefixsetid => $displayorder) {
        $vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "prefixset SET\n\t\t\t\tdisplayorder =  " . intval($displayorder) . "\n\t\t\tWHERE prefixsetid = '" . $vbulletin->db->escape_string($prefixsetid) . "'\n\t\t");
    }
    foreach ($vbulletin->GPC['prefix_order'] as $prefixid => $displayorder) {
        $vbulletin->db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "prefix SET\n\t\t\t\tdisplayorder =  " . intval($displayorder) . "\n\t\t\tWHERE prefixid = '" . $vbulletin->db->escape_string($prefixid) . "'\n\t\t");
    }
    build_prefix_datastore();
    print_stop_message2('saved_display_order_successfully', 'prefix', array('do' => 'list'));
}
// ########################################################################