web/wp-content/plugins/wp-explorer/inc/functions_misc.php
changeset 136 bde1974c263b
equal deleted inserted replaced
135:53cff4b4a802 136:bde1974c263b
       
     1 <?php
       
     2 
       
     3 function wp_explorer_opmap()
       
     4 {
       
     5 	$options = array();
       
     6 	$options['tmp_filebit'] = '<tr>
       
     7     <td class="$file[class]"><img src="$siteurl/wp-content/plugins/wp-explorer/icons/$file[icon]" alt="" /> <a href="$siteurl/$file[url]">$file[name]</a></td>
       
     8     <td class="$file[class]" align="center">$file[size]</td>
       
     9     <td class="$file[class]" align="center">$file[version]</td>
       
    10     <td class="$file[class]" align="center">$file[date]</td>
       
    11 </tr>';
       
    12 	$options['tmp_dirbit'] = '<tr>
       
    13     <td class="$file[class]"><img src="$siteurl/wp-content/plugins/wp-explorer/icons/$file[icon]" alt="" /> <a href="$file[url]">$file[name]</a></td>
       
    14     <td class="$file[class]" align="center">$file[date]</td>
       
    15 </tr>';
       
    16 	
       
    17 	$options['tmp_filetbl'] = '<table class="widefat">
       
    18 <thead>
       
    19 	<tr>
       
    20 		<td class="thead">$phrase[name]</td>
       
    21 		<td class="thead" align="center">$phrase[size]</td>
       
    22 		<td class="thead" align="center">$phrase[version]</td>
       
    23 		<td class="thead" align="center">$phrase[date]</td>
       
    24 	</tr>
       
    25 </thead>
       
    26 $filebit
       
    27 </table>';
       
    28 
       
    29 	$options['tmp_dirtbl'] = '<table class="widefat">
       
    30 <thead>
       
    31 	<tr>
       
    32 		<td class="thead">$phrase[name]</td>
       
    33 		<td class="thead" align="center">$phrase[date]</td>
       
    34 	</tr>
       
    35 </thead>
       
    36 $dirbit
       
    37 </table>';
       
    38 	$options['tmp_main'] = '$display_dirs
       
    39 $display_files
       
    40 <div style="color:#739E48; font-size:10px; font-weight:bold; text-align:right; padding:2px 1px 6px 0px;">$phrase[location] $location | $leech_protection  | $folder_stats</div>';
       
    41 	$options['tmp_error'] = '<p class="error">$error_message</p>';
       
    42 
       
    43 	$options['exclude_files'] = '.htaccess,.htpasswd,index.html,index.htm,index.php,index.asp';
       
    44 	$options['exclude_folders'] = 'folder1,folder2';
       
    45 	$options['exclude_extensions'] = 'php,php3,php4';
       
    46 	$options['enable_fancylinks'] = 0;
       
    47 	$options['enable_antileech'] = 0;
       
    48 	return $options;
       
    49 }
       
    50 
       
    51 function wp_explorer_preptmp($code)
       
    52 {
       
    53 	$code = addslashes($code);
       
    54 	$code = str_replace("\\'", "'", $code);
       
    55 	return $code;
       
    56 }
       
    57 
       
    58 function wp_explorer_sanitize($file, $ext, $version)
       
    59 {
       
    60 	$file = basename($file, $ext);
       
    61 	$file = str_replace($version, '', $file);
       
    62 	$file = preg_replace( array('/\./', '/\-/', '/\_/' ), ' ', $file);
       
    63 	$file = ucwords(strtolower($file));
       
    64 	return $file;
       
    65 }
       
    66 
       
    67 ?>