('.$ext.' '.$filesize.')'; } function my_download_link($my_mime_type) { // create download link based on attachment mime type $download=''; switch (true) { case (stristr($my_mime_type,'pdf')): $download = 'Adobe Acrobat Reader'; break; case (stristr($my_mime_type,'msword')): $download = 'Microsoft® Word or Word Viewer 2003'; break; case (stristr($my_mime_type,'excel')): $download = 'Microsoft® Excel or Excel Viewer 2003'; break; case (stristr($my_mime_type,'powerpoint')): $download = 'Microsoft® Powerpoint or Powerpoint Reader'; break; case (stristr($my_mime_type,'quicktime')): $download = 'Quicktime'; break; } if($download !='') echo '
This file requires '.$download.'.
'; } /* enhanced_link_pages() function taken from ePage Links plugin by Rich Pedley (http://quirm.net/) Alternative for wp_link_pages to be able to specifiy wrappers for each link. Simply useenhanced_link_pages(array('blink'=>'<li>','alink'=>'</li>','before' => '<ul>', 'after' => '</ul>', 'next_or_number' => 'number'));
in place of wp_link_pages in your themes.
eg. enhanced_link_pages(array('blink'=>'' . __('Pages:'), 'after' => '
', 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), 'previouspagelink' => __('Previous page'), 'pagelink' => '%', 'more_file' => '', 'echo' => 1, 'blink'=>'','alink'=>''); $r = array_merge($defaults, $r); extract($r, EXTR_SKIP); global $id, $page, $numpages, $multipage, $more, $pagenow; if ( $more_file != '' ) $file = $more_file; else $file = $pagenow; $output = ''; if ( $multipage ) { if ( 'number' == $next_or_number ) { $output .= $before; for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) { $j = str_replace('%',"$i",$pagelink); $output .= ' '; if ( ($i != $page) || ((!$more) && ($page==1)) ) { if ( 1 == $i ) { $output .= $blink.''.$j.''.$alink; } else { if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= $blink.''.$j.''.$alink; else $output .= $blink.''.$j.''.$alink; } }else{ $output .= $blink.''.$j.''.$alink; } } $output .= $after; } else { if ( $more ) { $output .= $before; $i = $page - 1; if ( $i && $more ) { if ( 1 == $i ) { $output .= $blink.'' . $previouspagelink . ''.$alink; } else { if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= $blink.'' . $previouspagelink . ''.$alink; else $output .= $blink.'' . $previouspagelink . ''.$alink; } } $i = $page + 1; if ( $i <= $numpages && $more ) { if ( 1 == $i ) { $output .= $blink.'' . $nextpagelink . ''.$alink; } else { if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= $blink.'' . $nextpagelink . ''.$alink; else $output .= $blink.'' . $nextpagelink . ''.$alink; } } $output .= $after; } } } if ( $echo ) echo $output; return $output; } /* adds backwardscomments compatibility for pre-WP 2.7 Requires legacy.comments.php in theme */ add_filter( 'comments_template', 'legacy_comments' ); function legacy_comments($file) { if(!function_exists('wp_list_comments')) $file = TEMPLATEPATH . '/legacy.comments.php'; return $file; } /* customised comment template */ function my_theme_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; static $my_comment_count=0; $my_comment_count++; ?>This comment is currently in a moderation queue.