1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Frontend scripts tests. (may break some things)

This commit is contained in:
Cameron
2021-01-19 18:52:56 -08:00
parent ce1273f8a4
commit b19f9ffbc3
41 changed files with 312 additions and 395 deletions

View File

@@ -9,12 +9,12 @@
*/
require_once("class2.php");
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
e107::coreLan('upload');
if (!$pref['upload_enabled'] || $pref['upload_class'] == 255)
if (!isset($pref['upload_enabled']) ||( varset($pref['upload_class']) == 255))
{
e107::redirect();
exit;
exit;
}
if (!defined("USER_WIDTH") && defset('BOOTSTRAP')==false){ define("USER_WIDTH","width:97%"); }
@@ -400,7 +400,7 @@ class userUpload
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-primary button' type='submit' name='upload' value='".LAN_416."' /></td>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-primary button' type='submit' name='upload' value=\"".defset('LAN_UL_039', "Submit and Upload")."\" /></td>
</tr>
</table>
</form>
@@ -415,7 +415,7 @@ class userUpload
//TODO Shortcodes for the form elements above.
function sc_author()
{
$poster = '';
return "<input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' />";
}
@@ -428,165 +428,7 @@ require_once(HEADERF);
$up->init();
require_once(FOOTERF);
exit;
/*
if (!check_class($pref['upload_class']))
{
$text = "<div style='text-align:center'>".LAN_UL_002."</div>";
$ns->tablerender(LAN_UL_020, $text);
require_once(FOOTERF);
exit;
}
*/
/*
$text = "<div style='text-align:center'>
<form enctype='multipart/form-data' method='post' onsubmit='return frmVerify()' action='".e_SELF."'>
<table style='".USER_WIDTH."' class='table fborder'>
<colgroup>
<col style='width:30%' />
<col style='width:70%' />
</colgroup>
<tr>
<td class='forumheader3'>".DOWLAN_11.":</td>
<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);
$text .= "
</td>
</tr>
<tr>
<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>
</form>
</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 />
".LAN_418.$e107->parseMemorySize($max_upload_size,0)." (".LAN_UL_022.")<br />";
$text .= "<span style='text-decoration:underline'>".LAN_408."</span> ".LAN_420."</td>
</tr>";
if (!USER)
{ // Prompt for name, email
$text .= "<tr>
<td class='forumheader3'>".LAN_61."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' value='{$poster}' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_112."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_email' id='user_email' type='text' size='50' maxlength='100' value='".$postemail."' /></td>
</tr>";
}
$text .= "
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_409."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_name' id='file_name' type='text' size='50' maxlength='100' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_410."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_version' type='text' size='10' maxlength='10' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_411."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' id='file_realpath' name='file_userfile[]' type='file' size='47' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_412."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_userfile[]' type='file' size='47' /></td>
</tr>
<tr>
<td class='forumheader3'><span style='text-decoration:underline'>".LAN_413."</span></td>
<td class='forumheader3'><textarea class='tbox' style='width:90%' name='file_description' id='file_description' cols='59' rows='6'></textarea></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_144."</td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_website' type='text' size='50' maxlength='100' value='".(defined(USERURL) ? USERURL : "")."' /></td>
</tr>
<tr>
<td class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_415."</span></td>
<td class='forumheader3'><input class='tbox' style='width:90%' name='file_demo' type='text' size='50' maxlength='100' /></td>
</tr>
<tr>
<td style='text-align:center' colspan='2' class='forumheader'><input class='btn btn-default button' type='submit' name='upload' value='".LAN_416."' /></td>
</tr>
</table>
</form>
</div>";
$ns->tablerender(LAN_417, $text);
require_once(FOOTERF);
*/
?>