Example #1
0
function print_move_prune_rows($permcheck = '')
{
    global $vbphrase;
    print_description_row($vbphrase['date_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['original_post_date_is_at_least_xx_days_ago'], 'thread[originaldaysolder]', 0, 1, 5);
    print_input_row($vbphrase['original_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[originaldaysnewer]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_least_xx_days_ago'], 'thread[lastdaysolder]', 0, 1, 5);
    print_input_row($vbphrase['last_post_date_is_at_most_xx_days_ago'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '0') . '</dfn>', 'thread[lastdaysnewer]', 0, 1, 5);
    print_description_row($vbphrase['view_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['thread_has_at_least_xx_replies'], 'thread[repliesleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_replies'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[repliesmost]', -1, 1, 5);
    print_input_row($vbphrase['thread_has_at_least_xx_views'], 'thread[viewsleast]', 0, 1, 5);
    print_input_row($vbphrase['thread_has_at_most_xx_views'] . '<dfn>' . construct_phrase($vbphrase['note_leave_x_specify_no_limit'], '-1') . '</dfn>', 'thread[viewsmost]', -1, 1, 5);
    print_description_row($vbphrase['status_options'], 0, 2, 'thead', 'center');
    print_yes_no_other_row($vbphrase['thread_is_sticky'], 'thread[issticky]', $vbphrase['either'], 0);
    $state = array('visible' => $vbphrase['visible'], 'moderation' => $vbphrase['awaiting_moderation'], 'deleted' => $vbphrase['deleted'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_state'], 'thread[state]', $state, 'any');
    $status = array('open' => $vbphrase['open'], 'closed' => $vbphrase['closed'], 'redirect' => $vbphrase['redirect'], 'not_redirect' => $vbphrase['not_redirect'], 'any' => $vbphrase['any']);
    print_radio_row($vbphrase['thread_status'], 'thread[status]', $status, 'not_redirect');
    print_description_row($vbphrase['other_options'], 0, 2, 'thead', 'center');
    print_input_row($vbphrase['username'], 'thread[posteduser]');
    print_input_row($vbphrase['title'], 'thread[titlecontains]');
    print_moderator_forum_chooser('thread[forumid]', -1, $vbphrase['all_forums'], $vbphrase['forum'], true, false, true, $permcheck);
    print_yes_no_row($vbphrase['include_child_forums'], 'thread[subforums]');
    if ($prefix_options = construct_prefix_options(0, '', true, true)) {
        print_label_row($vbphrase['prefix'], '<select name="thread[prefixid]" class="bginput">' . $prefix_options . '</select>', '', 'top', 'prefixid');
    }
}
Example #2
0
function print_user_search_rows($email = false)
{
    global $vbulletin, $vbphrase, $stylevar;
    print_label_row($vbphrase['username'], "\n\t\t<input type=\"text\" class=\"bginput\" name=\"user[username]\" tabindex=\"1\" size=\"35\"\n\t\t/><input type=\"image\" src=\"../" . $vbulletin->options['cleargifurl'] . "\" width=\"1\" height=\"1\"\n\t\t/><input type=\"submit\" class=\"button\" value=\"{$vbphrase['exact_match']}\" tabindex=\"1\" name=\"user[exact]\" />\n\t", '', 'top', 'user[username]');
    if ($email) {
        global $iusergroupcache;
        $userarray = array('usergroupid' => 0, 'membergroupids' => '');
        $iusergroupcache = array();
        $usergroups = $vbulletin->db->query_read("SELECT usergroupid, title, (forumpermissions & " . $vbulletin->bf_ugp_forumpermissions['canview'] . ") AS CANVIEW FROM " . TABLE_PREFIX . "usergroup ORDER BY title");
        while ($usergroup = $vbulletin->db->fetch_array($usergroups)) {
            if ($usergroup['CANVIEW']) {
                $userarray['membergroupids'] .= "{$usergroup['usergroupid']},";
            }
            $iusergroupcache["{$usergroup['usergroupid']}"] = $usergroup['title'];
        }
        unset($usergroup);
        $vbulletin->db->free_result($usergroups);
        print_checkbox_row($vbphrase['all_usergroups'], 'usergroup_all', 0, -1, $vbphrase['all_usergroups'], 'check_all_usergroups(this.form, this.checked);');
        print_membergroup_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 2, $userarray);
        print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2);
        print_yes_no_row($vbphrase['include_users_that_have_declined_email'], 'user[adminemail]', 0);
    } else {
        print_chooser_row($vbphrase['primary_usergroup'], 'user[usergroupid]', 'usergroup', -1, '-- ' . $vbphrase['all_usergroups'] . ' --');
        print_membergroup_row($vbphrase['additional_usergroups'], 'user[membergroup]', 2);
    }
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
    print_input_row($vbphrase['email'], 'user[email]');
    print_input_row($vbphrase['parent_email_address'], 'user[parentemail]');
    print_yes_no_other_row($vbphrase['coppa_user'], 'user[coppauser]', $vbphrase['either'], -1);
    print_input_row($vbphrase['home_page'], 'user[homepage]');
    print_input_row($vbphrase['icq_uin'], 'user[icq]');
    print_input_row($vbphrase['aim_screen_name'], 'user[aim]');
    print_input_row($vbphrase['yahoo_id'], 'user[yahoo]');
    print_input_row($vbphrase['msn_id'], 'user[msn]');
    print_input_row($vbphrase['skype_name'], 'user[skype]');
    print_input_row($vbphrase['signature'], 'user[signature]');
    print_input_row($vbphrase['user_title'], 'user[usertitle]');
    print_input_row($vbphrase['join_date_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindateafter]');
    print_input_row($vbphrase['join_date_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[joindatebefore]');
    print_input_row($vbphrase['last_activity_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivityafter]');
    print_input_row($vbphrase['last_activity_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastactivitybefore]');
    print_input_row($vbphrase['last_post_is_after'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostafter]');
    print_input_row($vbphrase['last_post_is_before'] . '<dfn>(yyyy-mm-dd hh:mm:ss)</dfn>', 'user[lastpostbefore]');
    print_input_row($vbphrase['birthday_is_after'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdayafter]');
    print_input_row($vbphrase['birthday_is_before'] . '<dfn>(yyyy-mm-dd)</dfn>', 'user[birthdaybefore]');
    print_input_row($vbphrase['posts_are_greater_than'], 'user[postslower]', '', 1, 7);
    print_input_row($vbphrase['posts_are_less_than'], 'user[postsupper]', '', 1, 7);
    print_input_row($vbphrase['reputation_is_greater_than'], 'user[reputationlower]', '', 1, 7);
    print_input_row($vbphrase['reputation_is_less_than'], 'user[reputationupper]', '', 1, 7);
    print_input_row($vbphrase['warnings_are_greater_than'], 'user[warningslower]', '', 1, 7);
    print_input_row($vbphrase['warnings_are_less_than'], 'user[warningsupper]', '', 1, 7);
    print_input_row($vbphrase['infractions_are_greater_than'], 'user[infractionslower]', '', 1, 7);
    print_input_row($vbphrase['infractions_are_less_than'], 'user[infractionsupper]', '', 1, 7);
    print_input_row($vbphrase['infraction_points_are_greater_than'], 'user[pointslower]', '', 1, 7);
    print_input_row($vbphrase['infraction_points_are_less_than'], 'user[pointsupper]', '', 1, 7);
    print_input_row($vbphrase['userid_is_greater_than'], 'user[useridlower]', '', 1, 7);
    print_input_row($vbphrase['userid_is_less_than'], 'user[useridupper]', '', 1, 7);
    print_input_row($vbphrase['registration_ip_address'], 'user[ipaddress]');
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
    $forms = array(0 => $vbphrase['edit_your_details'], 1 => "{$vbphrase['options']}: {$vbphrase['log_in']} / {$vbphrase['privacy']}", 2 => "{$vbphrase['options']}: {$vbphrase['messaging']} / {$vbphrase['notification']}", 3 => "{$vbphrase['options']}: {$vbphrase['thread_viewing']}", 4 => "{$vbphrase['options']}: {$vbphrase['date']} / {$vbphrase['time']}", 5 => "{$vbphrase['options']}: {$vbphrase['other']}");
    $currentform = -1;
    print_table_header($vbphrase['user_profile_fields']);
    $profilefields = $vbulletin->db->query_read("\n\t\tSELECT *\n\t\tFROM " . TABLE_PREFIX . "profilefield AS profilefield\n\t\tLEFT JOIN " . TABLE_PREFIX . "profilefieldcategory AS profilefieldcategory ON\n\t\t\t(profilefield.profilefieldcategoryid = profilefieldcategory.profilefieldcategoryid)\n\t\tORDER BY profilefield.form, profilefieldcategory.displayorder, profilefield.displayorder\n\t");
    while ($profilefield = $vbulletin->db->fetch_array($profilefields)) {
        if ($profilefield['form'] != $currentform) {
            print_description_row(construct_phrase($vbphrase['fields_from_form_x'], $forms["{$profilefield['form']}"]), false, 2, 'optiontitle');
            $currentform = $profilefield['form'];
        }
        $profilefield['def'] = 0;
        print_profilefield_row('profile', $profilefield);
    }
    print_description_row('<div align="' . $stylevar['right'] . '"><input type="submit" class="button" value=" ' . iif($email, $vbphrase['submit'], $vbphrase['find']) . ' " tabindex="1" /></div>');
}
Example #3
0
    print_description_row("\n\t<ul style=\"margin:0px; padding:0px; list-style:none\">\n\t\t<li><a href=\"attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=search&amp;search[orderby]=filesize&amp;search[ordering]=DESC\">" . $vbphrase['view_largest_attachments'] . "</a></li>\n\t\t<li><a href=\"attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=search&amp;search[orderby]=counter&amp;search[ordering]=DESC\">" . $vbphrase['view_most_popular_attachments'] . "</a></li>\n\t\t<li><a href=\"attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=search&amp;search[orderby]=dateline&amp;search[ordering]=DESC\">" . $vbphrase['view_newest_attachments'] . "</a></li>\n\t\t<li><a href=\"attachment.php?" . $vbulletin->session->vars['sessionurl'] . "do=search&amp;search[orderby]=dateline&amp;search[ordering]=ASC\">" . $vbphrase['view_oldest_attachments'] . "</a></li>\n\t</ul>\n\t");
    print_table_break();
    print_table_header($vbphrase['prune_attachments']);
    print_input_row($vbphrase['find_all_attachments_older_than_days'], 'prunedate', 30);
    print_submit_row($vbphrase['search'], 0);
    print_form_header('attachment', 'search');
    print_table_header($vbphrase['advanced_search']);
    print_input_row($vbphrase['filename'], 'search[filename]');
    print_input_row($vbphrase['attached_by'], 'search[attachedby]');
    print_input_row($vbphrase['attached_before'], 'search[datelinebefore]');
    print_input_row($vbphrase['attached_after'], 'search[datelineafter]');
    print_input_row($vbphrase['downloads_greater_than'], 'search[downloadsmore]');
    print_input_row($vbphrase['downloads_less_than'], 'search[downloadsless]');
    print_input_row($vbphrase['filesize_greater_than'], 'search[sizemore]');
    print_input_row($vbphrase['filesize_less_than'], 'search[sizeless]');
    print_yes_no_other_row($vbphrase['attachment_is_visible'], 'search[visible]', $vbphrase['either'], -1);
    print_label_row($vbphrase['order_by'], '
		<select name="search[orderby]" tabindex="1" class="bginput">
			<option value="username">' . $vbphrase['attached_by'] . '</option>
			<option value="counter">' . $vbphrase['downloads'] . '</option>
			<option value="filename" selected="selected">' . $vbphrase['filename'] . '</option>
			<option value="filesize">' . $vbphrase['filesize'] . '</option>
			<option value="dateline">' . $vbphrase['time'] . '</option>
			<option value="state">' . $vbphrase['visible'] . '</option>
		</select>
		<select name="search[ordering]" tabindex="1" class="bginput">
			<option value="DESC">' . $vbphrase['descending'] . '</option>
			<option value="ASC">' . $vbphrase['ascending'] . '</option>
		</select>
	', '', 'top', 'orderby');
    print_input_row($vbphrase['attachments_to_show_per_page'], 'search[results]', 20);
Example #4
0
    //cache_forums();
    foreach ($vbulletin->forumcache as $forumid => $forum) {
        if (is_array($accessarray["{$forum['forumid']}"])) {
            if ($accessarray["{$forum['forumid']}"]['accessmask'] == 0) {
                $sel = 0;
            } else {
                if ($accessarray["{$forum['forumid']}"]['accessmask'] == 1) {
                    $sel = 1;
                } else {
                    $sel = -1;
                }
            }
        } else {
            $sel = -1;
        }
        print_yes_no_other_row(construct_depth_mark($forum['depth'], '- - ') . " {$forum['title']}", "accessupdate[{$forum['forumid']}]", $vbphrase['default'], $sel);
    }
    print_submit_row();
}
// ###################### Start Update Access #######################
if ($_POST['do'] == 'updateaccess') {
    if (!can_administer('canadminpermissions')) {
        print_cp_no_permission();
    }
    $vbulletin->input->clean_array_gpc('p', array('userid' => TYPE_INT, 'accessupdate' => TYPE_ARRAY_INT));
    $user = fetch_userinfo($vbulletin->GPC['userid']);
    if (!$user) {
        print_stop_message('invalid_user_specified');
    }
    // delete all old access masks
    $db->query_write("DELETE FROM " . TABLE_PREFIX . "access WHERE userid = " . $vbulletin->GPC['userid']);
Example #5
0
		<input type="button" value="' . $vbphrase['all_yes'] . '" onclick="js_check_all_option(this.form, 1);" class="button" />
		<input type="button" value=" ' . $vbphrase['all_no'] . ' " onclick="js_check_all_option(this.form, 0);" class="button" />
		<input type="button" value="' . $vbphrase['all_default'] . '" onclick="js_check_all_option(this.form, -1);" class="button" />
	');
    //require_once(DIR . '/includes/functions_databuild.php');
    //cache_forums();
    $channels = vB_Api::instanceInternal('search')->getChannels(true);
    foreach ($channels as $nodeid => $node) {
        if (!isset($accessarray["{$nodeid}"])) {
            $sel = -1;
        } elseif ($accessarray["{$nodeid}"] == 0) {
            $sel = 0;
        } elseif ($accessarray["{$nodeid}"] == 1) {
            $sel = 1;
        }
        print_yes_no_other_row(construct_depth_mark($node['depth'], '- - ') . " {$node['htmltitle']}", "accessupdate[{$nodeid}]", $vbphrase['default'], $sel);
    }
    print_submit_row();
}
// ###################### Start Update Access #######################
if ($_POST['do'] == 'updateaccess') {
    if (!can_administer('canadminpermissions')) {
        print_cp_no_permission();
    }
    $vbulletin->input->clean_array_gpc('p', array('userid' => vB_Cleaner::TYPE_INT, 'accessupdate' => vB_Cleaner::TYPE_ARRAY_INT));
    try {
        vB_Api::instanceInternal('user')->updateAccess($vbulletin->GPC['userid'], $vbulletin->GPC['accessupdate']);
    } catch (vB_Exception_Api $e) {
        $errors = $e->get_errors();
        if (!empty($errors)) {
            $error = array_shift($errors);
Example #6
0
				$sel = 0;
			}
			else if ($accessarray["$forum[forumid]"]['accessmask'] == 1)
			{
				$sel = 1;
			}
			else
			{
				$sel = -1;
			}
		}
		else
		{
			$sel = -1;
		}
		print_yes_no_other_row(construct_depth_mark($forum['depth'], '- - ') . " $forum[title]", "accessupdate[$forum[forumid]]", $vbphrase['default'], $sel);
	}
	print_submit_row();
}

// ###################### Start Update Access #######################
if ($_POST['do'] == 'updateaccess')
{
	if (!can_administer('canadminpermissions'))
	{
		print_cp_no_permission();
	}

	$vbulletin->input->clean_array_gpc('p', array(
		'userid'	      => TYPE_INT,
		'accessupdate' => TYPE_ARRAY_INT,