Changeset 956 for trunk/wp-admin/upload.php
- Timestamp:
- 03/01/2004 06:13:32 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r891 r956 7 7 die ("Cheatin' uh ?"); 8 8 9 if (! $use_fileupload) //Checks if file upload is enabled in the config9 if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config 10 10 die ("The admin disabled this function"); 11 11 12 $allowed_types = explode(' ', trim( $fileupload_allowedtypes));12 $allowed_types = explode(' ', trim(get_settings('fileupload_allowedtypes'))); 13 13 14 14 if ($HTTP_POST_VARS['submit']) { … … 18 18 } 19 19 20 if (!is_writable( $fileupload_realpath))20 if (!is_writable(get_settings('fileupload_realpath'))) 21 21 $action = 'not-writable'; 22 22 ?> … … 28 28 case 'not-writable': 29 29 ?> 30 <p>It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code><?php echo $ fileupload_realpath; ?></code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.</p>30 <p>It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code><?php echo $get_settings('fileupload_realpath'); ?></code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.</p> 31 31 32 32 <?php … … 43 43 <label for="img1">File:</label> 44 44 <br /> 45 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $fileupload_maxk* 1024 ?>" />45 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') * 1024 ?>" /> 46 46 <input type="file" name="img1" id="img1" size="35" class="uploadform" /></p> 47 47 <p> … … 97 97 98 98 if (strlen($imgalt)) { 99 $pathtofile = $fileupload_realpath."/".$imgalt;99 $pathtofile = get_settings('fileupload_realpath')."/".$imgalt; 100 100 $img1 = $HTTP_POST_VARS['img1']; 101 101 } else { 102 $pathtofile = $fileupload_realpath."/".$img1_name;102 $pathtofile = get_settings('fileupload_realpath')."/".$img1_name; 103 103 $img1 = $HTTP_POST_FILES['img1']['tmp_name']; 104 104 } … … 119 119 120 120 if (file_exists($pathtofile) && !strlen($imgalt)) { 121 $i = explode( " ",$fileupload_allowedtypes);122 $i = implode( ", ",array_slice($i, 1, count($i)-2));121 $i = explode(' ', get_settings('fileupload_allowedtypes')); 122 $i = implode(', ',array_slice($i, 1, count($i)-2)); 123 123 $moved = move_uploaded_file($img1, $pathtofile2); 124 124 // if move_uploaded_file() fails, try copy() … … 139 139 <p>Confirm or rename:</p> 140 140 <form action="upload.php" method="post" enctype="multipart/form-data"> 141 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $fileupload_maxk*1024 ?>" />141 <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') *1024 ?>" /> 142 142 <input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" /> 143 143 <input type="hidden" name="img1_name" value="<?php echo $img2_name;?>" /> … … 198 198 199 199 if ( ereg('image/',$img1_type)) { 200 $piece_of_code = "<img src=" $fileupload_url/$img1_name" alt="$imgdesc" />";200 $piece_of_code = "<img src="". get_settings('fileupload_url') ."/$img1_name" alt="$imgdesc" />"; 201 201 } else { 202 $piece_of_code = "<a href=" $fileupload_url/$img1_name" title="$imgdesc" />$imgdesc</a>";202 $piece_of_code = "<a href="". get_settings('fileupload_url') . "/$img1_name" title="$imgdesc" />$imgdesc</a>"; 203 203 }; 204 204
Note: See TracChangeset
for help on using the changeset viewer.