3600) { return unlink($dirname); } // Loop through the folder if(is_dir($dirname)) { $dir = dir($dirname); while (false !== $entry = $dir->read()) { // Skip pointers if ($entry == '.' || $entry == '..') { continue; } // Recurse rmdirr("$dirname/$entry",$oc); } $dir->close(); } // Clean up if ($oc==1) { return rmdir($dirname); } } function options($options, $selected = null, $labelIsValue = false) { $html = ''; settype($selected, 'array'); settype($options, 'array'); foreach ($options as $value=>$label) { if (is_array($label)) { $value = $label[0]; $label = $label[1]; } $label = htmlspecialchars($label, ENT_QUOTES, "utf-8"); $value = $labelIsValue ? $label : htmlspecialchars($value, ENT_QUOTES, "utf-8"); $html .= ''; } return $html; } $css = new csstidy(); if(isset($_REQUEST['custom']) && !empty($_REQUEST['custom'])) { setcookie ('custom_template', $_REQUEST['custom'], time()+360000); } rmdirr('temp'); if(isset($_REQUEST['case_properties'])) $css->set_cfg('case_properties',$_REQUEST['case_properties']); if(isset($_REQUEST['lowercase'])) $css->set_cfg('lowercase_s',true); if(!isset($_REQUEST['compress_c']) && isset($_REQUEST['post'])) $css->set_cfg('compress_colors',false); if(!isset($_REQUEST['compress_fw']) && isset($_REQUEST['post'])) $css->set_cfg('compress_font-weight',false); if(isset($_REQUEST['merge_selectors'])) $css->set_cfg('merge_selectors', $_REQUEST['merge_selectors']); if(isset($_REQUEST['optimise_shorthands'])) $css->set_cfg('optimise_shorthands',$_REQUEST['optimise_shorthands']); if(!isset($_REQUEST['rbs']) && isset($_REQUEST['post'])) $css->set_cfg('remove_bslash',false); if(isset($_REQUEST['preserve_css'])) $css->set_cfg('preserve_css',true); if(isset($_REQUEST['sort_sel'])) $css->set_cfg('sort_selectors',true); if(isset($_REQUEST['sort_de'])) $css->set_cfg('sort_properties',true); if(isset($_REQUEST['remove_last_sem'])) $css->set_cfg('remove_last_;',true); if(isset($_REQUEST['discard'])) $css->set_cfg('discard_invalid_properties',true); if(isset($_REQUEST['css_level'])) $css->set_cfg('css_level',$_REQUEST['css_level']); if(isset($_REQUEST['timestamp'])) $css->set_cfg('timestamp',true); ?> <?php echo $lang[$l][0]; echo $css->version; ?>)

csstidy version; ?>)

: English Deutsch French Chinese

size="35" />

get_cfg('preserve_css')) echo 'checked="checked"'; ?> />
get_cfg('sort_selectors')) echo 'checked="checked"'; ?> />
get_cfg('sort_properties')) echo 'checked="checked"'; ?> />


get_cfg('compress_colors')) echo 'checked="checked"';?> />
get_cfg('compress_font-weight')) echo 'checked="checked"';?> />
get_cfg('lowercase_s')) echo 'checked="checked"'; ?> />

get_cfg('case_properties') == 0) echo 'checked="checked"'; ?> /> get_cfg('case_properties') == 1) echo 'checked="checked"'; ?> /> get_cfg('case_properties') == 2) echo 'checked="checked"'; ?> />
get_cfg('remove_bslash')) echo 'checked="checked"'; ?> />
get_cfg('remove_last_;')) echo 'checked="checked"'; ?> />
get_cfg('discard_invalid_properties')) echo 'checked="checked"'; ?> />
get_cfg('timestamp')) echo 'checked="checked"'; ?> />
/>
load_template($_REQUEST['custom'],false); } break; case 3: $css->load_template('highest_compression'); break; case 2: $css->load_template('high_compression'); break; case 0: $css->load_template('low_compression'); break; } } if($url) { if(substr($_REQUEST['url'],0,7) != 'http://') { $_REQUEST['url'] = 'http://'.$_REQUEST['url']; } $result = $css->parse_from_url($_REQUEST['url'],0); } elseif(isset($_REQUEST['css_text']) && strlen($_REQUEST['css_text'])>5) { $result = $css->parse($_REQUEST['css_text']); } if($result) { $ratio = $css->print->get_ratio(); $diff = $css->print->get_diff(); if(isset($_REQUEST['file_output'])) { $filename = md5(mt_rand().time().mt_rand()); $handle = fopen('temp/'.$filename.'.css','w'); if($handle) { if(fwrite($handle,$css->print->plain())) { $file_ok = true; } } fclose($handle); } if($ratio>0) $ratio = ''.$ratio.'% ('.$diff.' Bytes)'; else $ratio = ''.$ratio.'% ('.$diff.' Bytes)'; if(count($css->log) > 0): ?>
Messages
log as $line => $array) { echo '
'.$line.'
'; for($i = 0; $i < count($array); $i++) { echo '
'.$array[$i]['m'].'
'; } } ?>
'.$lang[$l][37].': '.$css->print->size('input').'KB, '.$lang[$l][38].':'.$css->print->size('output').'KB, '.$lang[$l][36].': '.$ratio; if($file_ok) { echo ' - Download'; } echo ''; echo '
';
        echo $css->print->formatted();
        echo '
'; echo ''; } elseif(isset($_REQUEST['css_text']) || isset($_REQUEST['url'])) { echo '

'.$lang[$l][28].'

'; } ?>

For bugs and suggestions feel free to contact me.