コード例 #1
0
ファイル: upload.php プロジェクト: armpit/e107
 function renderForm()
 {
     /*
     		$template = "
     		<div class='form-group'>
             <label for='firstname' class='col-sm-3 control-label'>First Name:**</label>
             <div class='col-sm-9'>
                     <input id='firstname' class=\"form-control tbox\" type=\"text\" name=\"FIRSTNAME\" size=\"20\" maxlength=\"20\" value=\"". $_POST['FIRSTNAME']. "\" required />
             </div>
          	 </div>	";
     */
     $ns = e107::getRender();
     $tp = e107::getParser();
     $text = "<div style='text-align:center'>\n\t\t\t<form enctype='multipart/form-data' method='post' onsubmit='return frmVerify()' action='" . e_SELF . "'>\n\t\t\t<table style='" . USER_WIDTH . "' class='table fborder'>\n\t\t\t<colgroup>\n\t\t\t<col style='width:30%' />\n\t\t\t<col style='width:70%' />\n\t\t\t</colgroup>\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'>" . DOWLAN_11 . ":</td>\n\t\t\t<td class='forumheader3'>";
     require_once e_CORE . "shortcodes/batch/download_shortcodes.php";
     $dlparm = isset($download_category) ? $download_category : "";
     $text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}", true, $download_shortcodes);
     //FIXME - move to e_upload.php
     $text .= "</td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td style='text-align:center' class='forumheader3'>" . LAN_419 . "</td>\n\t\t\t<td class='forumheader3'>";
     //	$text .= "<b>".LAN_406."</b><br />".LAN_419.":";
     $a_filetypes = get_filetypes();
     if (count($a_filetypes) == 0) {
         $ns->tablerender(LAN_417, LAN_UL_025);
         return;
     }
     $max_upload_size = calc_max_upload_size(-1);
     // Find overriding maximum upload size
     $max_upload_size = set_max_size($a_filetypes, $max_upload_size);
     if (ADMIN) {
         $upper_limit = calc_max_upload_size();
         $allowed_filetypes = "<table class='table table-striped table-bordered'><tr><th class='text-center'>" . LAN_UL_023 . "&nbsp;&nbsp;</th><th style='text-align:right'>" . LAN_UL_024 . "</th></tr>";
         foreach ($a_filetypes as $type => $size) {
             $allowed_filetypes .= "<tr><td>{$type}</td><td style='text-align:right'>" . eHelper::parseMemorySize($size, 0) . "</td></tr>";
         }
         $allowed_filetypes .= "</table>";
     } else {
         $a_filetypes = array_keys($a_filetypes);
         $allowed_filetypes = implode(' | ', $a_filetypes);
     }
     $text .= " " . $allowed_filetypes;
     $text .= "<div class='alert alert-block alert-danger'>" . LAN_407 . "<br />" . LAN_418 . eHelper::parseMemorySize($max_upload_size, 0) . " (" . LAN_UL_022 . ")<br />";
     $text .= "<span style='text-decoration:underline'>" . LAN_408 . "</span> " . LAN_420;
     $text .= "</div>";
     $text .= "</td></tr>";
     //TODO Replcae all form inputs with $frm methods.
     if (!USER) {
         $text .= "<tr>\n\t\t\t<td class='forumheader3'>" . LAN_61 . "</td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'><span style='text-decoration:underline'>" . LAN_112 . "</span></td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%' name='file_email' id='user_email' type='text' size='50' maxlength='100' value='" . $postemail . "' required /></td>\n\t\t\t</tr>";
     }
     $text .= "\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'><span style='text-decoration:underline'>" . LAN_409 . "</span></td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%'  name='file_name' id='file_name' type='text' size='50' maxlength='100' required /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'>" . LAN_410 . "</td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%' name='file_version' type='text' size='10' maxlength='10' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'><span style='text-decoration:underline'>" . LAN_411 . "</span></td>\n\t\t\t<td class='forumheader3'><input class='tbox' style='width:90%'  id='file_realpath' name='file_userfile[]' type='file' size='47' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'>" . LAN_412 . "</td>\n\t\t\t<td class='forumheader3'><input class='tbox' style='width:90%' name='file_userfile[]' type='file' size='47' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'><span style='text-decoration:underline'>" . LAN_413 . "</span></td>\n\t\t\t<td class='forumheader3'><textarea class='tbox form-control' style='width:90%' name='file_description' id='file_description' cols='59' rows='6' required></textarea></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'>" . LAN_144 . "</td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%' name='file_website' type='text' size='50' maxlength='100' value='" . (defined(USERURL) ? USERURL : "") . "' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td class='forumheader3'>" . LAN_414 . "<br /><span class='smalltext'>" . LAN_415 . "</span></td>\n\t\t\t<td class='forumheader3'><input class='tbox form-control' style='width:90%' name='file_demo' type='text' size='50' maxlength='100' /></td>\n\t\t\t</tr>\n\t\t\n\t\t\t<tr>\n\t\t\t<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-primary button' type='submit' name='upload' value='" . LAN_416 . "' /></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</form>\n\t\t\t</div>";
     $ns->tablerender(LAN_417, $text);
 }
コード例 #2
0
ファイル: upload.php プロジェクト: notzen/e107
$dlparm = isset($download_category) ? $download_category : "";
$text .= $tp->parseTemplate("{DOWNLOAD_CATEGORY_SELECT={$dlparm}}", true, $download_shortcodes);
$text .= "\n\t</td>\n\t</tr>\n\n\t<tr>\n\t<td style='text-align:center' colspan='2' class='forumheader3'>";
$text .= "<b>" . LAN_406 . "</b><br />" . LAN_419 . ":";
require_once e_HANDLER . 'upload_handler.php';
$a_filetypes = get_filetypes();
if (count($a_filetypes) == 0) {
    $text .= LAN_UL_025 . "</td></tr></table>\n\t</form>\n\t</div>";
    $ns->tablerender(LAN_417, $text);
    require_once FOOTERF;
}
$max_upload_size = calc_max_upload_size(-1);
// Find overriding maximum upload size
$max_upload_size = set_max_size($a_filetypes, $max_upload_size);
if (ADMIN) {
    $upper_limit = calc_max_upload_size();
    $allowed_filetypes = "<table><tr><td>" . LAN_UL_023 . "&nbsp;&nbsp;</td><td style='text-align:right'>" . LAN_UL_024 . "</td></tr>";
    foreach ($a_filetypes as $type => $size) {
        $allowed_filetypes .= "<tr><td>{$type}</td><td style='text-align:right'>" . $e107->parseMemorySize($size, 0) . "</td></tr>";
    }
    $allowed_filetypes .= "</table>";
} else {
    $a_filetypes = array_keys($a_filetypes);
    $allowed_filetypes = implode(' | ', $a_filetypes);
}
$text .= " " . $allowed_filetypes . "<br />" . LAN_407 . "<br />\n\t" . LAN_418 . $e107->parseMemorySize($max_upload_size, 0) . " (" . LAN_UL_022 . ")<br />";
$text .= "<span style='text-decoration:underline'>" . LAN_408 . "</span> " . LAN_420 . "</td>\n\t</tr>";
if (!USER) {
    // Prompt for name, email
    $text .= "<tr>\n\t<td class='forumheader3'>" . LAN_61 . "</td>\n\t<td class='forumheader3'><input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' /></td>\n\t</tr>\n\n\t<tr>\n\t<td class='forumheader3'><span style='text-decoration:underline'>" . LAN_112 . "</span></td>\n\t<td class='forumheader3'><input class='tbox' style='width:90%' name='file_email' id='user_email' type='text' size='50' maxlength='100' value='" . $postemail . "' /></td>\n\t</tr>";
}
コード例 #3
0
ファイル: upload_handler.php プロジェクト: armpit/e107
function get_user_max_upload()
{
    $a_filetypes = get_filetypes();
    if (count($a_filetypes) == 0) {
        return 0;
    }
    // Return if no upload allowed
    $max_upload_size = calc_max_upload_size(-1);
    // Find overriding maximum upload size
    $max_upload_size = set_max_size($a_filetypes, $max_upload_size);
    return $max_upload_size;
}
コード例 #4
0
ファイル: forum_post.php プロジェクト: notzen/e107
$e107 = e107::getInstance();
//if thread is not active and not new thread, show warning
if ($action != 'nt' && !$threadInfo['thread_active'] && !MODERATOR) {
    require_once HEADERF;
    $ns->tablerender(LAN_20, "<div style='text-align:center'>" . LAN_397 . '</div>');
    require_once FOOTERF;
    exit;
}
$forumInfo['forum_name'] = $tp->toHTML($forumInfo['forum_name'], true);
define('e_PAGETITLE', ($action == 'rp' ? LAN_02 . $threadInfo['thread_name'] : LAN_03) . ' / ' . $forumInfo['forum_name'] . ' / ' . LAN_01);
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if ($forum->prefs->get('attach')) {
    global $allowed_filetypes, $max_upload_size;
    include_once e_HANDLER . 'upload_handler.php';
    $a_filetypes = get_filetypes();
    $max_upload_size = calc_max_upload_size(-1);
    // Find overriding maximum upload size
    $max_upload_size = set_max_size($a_filetypes, $max_upload_size);
    $max_upload_size = $e107->parseMemorySize($max_upload_size, 0);
    $a_filetypes = array_keys($a_filetypes);
    $allowed_filetypes = implode(' | ', $a_filetypes);
}
if (isset($_POST['submitpoll'])) {
    require_once e_PLUGIN . 'poll/poll_class.php';
    $poll = new poll();
    require_once HEADERF;
    if (!$FORUMPOST) {
        if (file_exists(THEME . 'forum_posted_template.php')) {
            require_once THEME . 'forum_posted_template.php';
        } else {
            require_once e_PLUGIN . 'forum/templates/forum_posted_template.php';