Make WordPress Core


Ignore:
Timestamp:
03/01/2004 06:13:32 AM (21 years ago)
Author:
saxmatt
Message:

Migration to get_settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r891 r956  
    77    die ("Cheatin' uh ?");
    88
    9 if (!$use_fileupload) //Checks if file upload is enabled in the config
     9if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config
    1010    die ("The admin disabled this function");
    1111
    12 $allowed_types = explode(' ', trim($fileupload_allowedtypes));
     12$allowed_types = explode(' ', trim(get_settings('fileupload_allowedtypes')));
    1313
    1414if ($HTTP_POST_VARS['submit']) {
     
    1818}
    1919
    20 if (!is_writable($fileupload_realpath))
     20if (!is_writable(get_settings('fileupload_realpath')))
    2121    $action = 'not-writable';
    2222?>
     
    2828case 'not-writable':
    2929?>
    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>
    3131
    3232<?php
     
    4343      <label for="img1">File:</label>
    4444      <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 ?>" />
    4646    <input type="file" name="img1" id="img1" size="35" class="uploadform" /></p>
    4747    <p>
     
    9797
    9898    if (strlen($imgalt)) {
    99         $pathtofile = $fileupload_realpath."/".$imgalt;
     99        $pathtofile = get_settings('fileupload_realpath')."/".$imgalt;
    100100        $img1 = $HTTP_POST_VARS['img1'];
    101101    } else {
    102         $pathtofile = $fileupload_realpath."/".$img1_name;
     102        $pathtofile = get_settings('fileupload_realpath')."/".$img1_name;
    103103        $img1 = $HTTP_POST_FILES['img1']['tmp_name'];
    104104    }
     
    119119
    120120    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));
    123123        $moved = move_uploaded_file($img1, $pathtofile2);
    124124        // if move_uploaded_file() fails, try copy()
     
    139139    <p>Confirm or rename:</p>
    140140    <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 ?>" />
    142142    <input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" />
    143143    <input type="hidden" name="img1_name" value="<?php echo $img2_name;?>" />
     
    198198
    199199if ( ereg('image/',$img1_type)) {
    200     $piece_of_code = "&lt;img src=&quot;$fileupload_url/$img1_name&quot; alt=&quot;$imgdesc&quot; /&gt;";
     200    $piece_of_code = "&lt;img src=&quot;". get_settings('fileupload_url') ."/$img1_name&quot; alt=&quot;$imgdesc&quot; /&gt;";
    201201} else {
    202     $piece_of_code = "&lt;a href=&quot;$fileupload_url/$img1_name&quot; title=&quot;$imgdesc&quot; /&gt;$imgdesc&lt;/a&gt;";
     202    $piece_of_code = "&lt;a href=&quot;". get_settings('fileupload_url') . "/$img1_name&quot; title=&quot;$imgdesc&quot; /&gt;$imgdesc&lt;/a&gt;";
    203203};
    204204
Note: See TracChangeset for help on using the changeset viewer.