mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
new module creation
This commit is contained in:
37
e107_files/shortcode/uploadfile.sc
Normal file
37
e107_files/shortcode/uploadfile.sc
Normal file
@@ -0,0 +1,37 @@
|
||||
// $Id: uploadfile.sc,v 1.1.1.1 2006-12-02 04:33:40 mcfly_e107 Exp $
|
||||
|
||||
// Your <form> tag must include: enctype='multipart/form-data' - in order to work.
|
||||
// parm is the path to the upload folder.
|
||||
global $pref;
|
||||
|
||||
if(!FILE_UPLOADS)
|
||||
{
|
||||
return LAN_UPLOAD_SERVEROFF;
|
||||
}
|
||||
if(USER_AREA === TRUE && !check_class($pref['upload_class']))
|
||||
{
|
||||
return LAN_DISABLED;
|
||||
}
|
||||
|
||||
|
||||
if($parm && !is_writable($parm))
|
||||
{
|
||||
return LAN_UPLOAD_777." <b>".str_replace("../","",$parm)."</b>";
|
||||
}
|
||||
|
||||
$name = "file_userfile[]";
|
||||
|
||||
$text .="
|
||||
<!-- Upload Shortcode -->
|
||||
<div style='width:90%'><div id='up_container' >
|
||||
<span id='upline' style='white-space:nowrap'>
|
||||
<input class='tbox' type='file' name='$name' size='40' />
|
||||
</span><br />
|
||||
</div>
|
||||
<span style='float:left;padding-top:3px'><input type='button' class='button' value=\"".LAN_UPLOAD_ADDFILE."\" onclick=\"duplicateHTML('upline','up_container');\" /></span>
|
||||
<span style='float:right;padding-top:3px'><input class='button' type='submit' name='uploadfiles' value=\"".LAN_UPLOAD_FILES."\" onclick=\"return jsconfirm('".LAN_UPLOAD_CONFIRM."')\" /></span>
|
||||
</div>
|
||||
<!-- End Upload Shortcode -->
|
||||
";
|
||||
|
||||
return $text;
|
Reference in New Issue
Block a user