예제 #1
0
echo "<form accept-charset=\"utf-8\" name=\"attachments\" method=\"post\" action=\"edit_attachments.php\">\n";
echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "  ", form_input_hidden('popup', htmlentities_array($popup)), "\n";
echo "  " . form_input_hidden('aid', htmlentities_array($aid)), "\n";
echo "  " . form_input_hidden('uid', htmlentities_array($uid)), "\n";
echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
echo "    <tr>\n";
echo "      <td align=\"left\">\n";
echo "        <table class=\"box\" width=\"100%\">\n";
echo "          <tr>\n";
echo "            <td align=\"left\" class=\"posthead\">\n";
echo "              <table class=\"posthead\" width=\"100%\">\n";
if (is_md5($aid)) {
    $attachment_result = attachments_get($uid, $aid, $attachments_array, $image_attachments_array);
} else {
    $attachment_result = attachments_get_users($uid, $attachments_array, $image_attachments_array);
}
if ($attachment_result) {
    if (is_md5($aid)) {
        echo "                <tr>\n";
        echo "                  <td class=\"subhead_checkbox\" align=\"center\" width=\"1%\">", form_checkbox("toggle_main", "toggle_main"), "</td>\n";
        echo "                  <td align=\"left\" colspan=\"4\" class=\"subhead\">", gettext("Attachments for this message"), "</td>\n";
        echo "                </tr>\n";
    } else {
        echo "                <tr>\n";
        echo "                  <td class=\"subhead_checkbox\" align=\"center\" width=\"1%\">", form_checkbox("toggle_main", "toggle_main"), "</td>\n";
        echo "                  <td align=\"left\" colspan=\"4\" class=\"subhead\">", gettext("Attachments"), "</td>\n";
        echo "                </tr>\n";
    }
    if (is_array($attachments_array) && sizeof($attachments_array) > 0) {
        foreach ($attachments_array as $key => $attachment) {
예제 #2
0
if (isset($_POST['aid']) && is_md5($_POST['aid'])) {
    $aid = $_POST['aid'];
} else {
    $aid = md5(uniqid(mt_rand()));
}
// Check to see if we should show the set for all forums checkboxes
if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0) && $admin_edit || $uid == session::get_value('UID') && $admin_edit === false) {
    $show_set_all = forums_get_available_count() > 1;
} else {
    $show_set_all = false;
}
// Arrays to hold our attachments
$attachments_array = array();
$image_attachments_array = array();
// User's attachments for profile and avatar pictures
$user_attachments = attachments_get_users($uid, $attachments_array, $image_attachments_array);
// Prepare the attachments for use in a drop down.
$image_attachments_array = user_prefs_prep_attachments($image_attachments_array);
// Start Output Here
if ($admin_edit === true) {
    $user = user_get($uid);
    html_draw_top(sprintf('title=%s', sprintf(gettext("Admin - User Details - %s"), format_user_name($user['LOGON'], $user['NICKNAME']))), 'attachments.js', 'class=window_title');
    echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("User Details"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", word_filter_add_ob_tags(format_user_name($user['LOGON'], $user['NICKNAME']), true), "</h1>\n";
} else {
    html_draw_top(sprintf('title=%s', gettext("My Controls - User Details")), 'class=window_title');
    echo "<h1>", gettext("User Details"), "</h1>\n";
}
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    html_display_error_array($error_msg_array, '600', $admin_edit ? 'center' : 'left');
} else {
    if (isset($_GET['updated'])) {