", "
  • ", $link_html); } return $link_html; } add_filter("get_archives_link", "get_archives_link_mod"); function my_custom_post_type_archive_where($where,$args){ $post_type = isset($args['post_type']) ? $args['post_type'] : 'post'; $where = "WHERE post_type = '$post_type' AND post_status = 'publish'"; return $where; } add_filter( 'getarchives_where','my_custom_post_type_archive_where',10,2); ?> ID); $filed = $file; if($blog_id != 1) { $filed = explode('files', $filed); unset($filed[0]); $filed = implode($filed); $filed = '/blogs.dir/'.$blog_id.'/files'.$filed; }else{ $filed = explode('uploads', $filed); unset($filed[0]); $filed = implode($filed); $filed = '/uploads'.$filed; } if($filed) $localpath = __DIR__.'/../..'.$filed; //$localpath = __DIR__.'/../..'.preg_replace('/^.*uploads/', '/uploads', $file); //$ext = preg_match('/\..{1,5}$/', $file, $matches) ? $matches[0] : ''; /* if( !in_array($ext, array( */ /* '.jpg', */ /* '.jpeg', */ /* '.gif', */ /* '.png', */ /* '.pdf', */ /* ) ) ){ */ /* header( 'Location: '.$file ); */ /* exit; */ /* }else{ */ if(isset($_GET['lowres']) && $_GET['lowres'] ){ //do not work with useS3 is enabled. image gets broken. readfile != <3 remote $file = html::getPhpThumbImg($file, 800, 800, false); $localpath = __DIR__.'/../..'.preg_replace('/^.*uploads/', '/uploads/', $file); } $finfo = gallery::getFileInfo($wp_query->query_vars['attachment_id']); if (file_exists($localpath)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($localpath)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($localpath)); ob_clean(); flush(); readfile($file); exit; } /* } lol */ ?>