%PDF- %PDF-
Direktori : /home/dordingu/public_html/geisp/wp-content4d75a3/plugins/ |
Current File : /home/dordingu/public_html/geisp/wp-content4d75a3/plugins/categoricallinkspage.php |
<?php /* Plugin Name: Categorical Links Page Plugin URI: http://www.alucinari.net/wordpress Description: Output links seperated by categories onto a static page (Based on Links Page (http://www.asymptomatic.net/wp-hacks) by Owen Winkler.) Version: 1.1 Author: Jeremy Albrecht Author URI: http://www.alucinari.net/ */ ?> <?php /* INSTRUCTIONS ------------ 1. Upload this file into your wp-content/plugins directory. 2. Activate the Links Page with Categories plugin in your WordPress admin panel. 3. Create a new static page. 4. Add <!--catlinkspage--> to the static page content where you want the links to appear. Enjoy! */ ?> <?php define('LINK_USE_UL', false); function catlinks_page_callback() { global $wpdb; $output = ''; $linkcats = $wpdb->get_results("SELECT DISTINCT cat_id, cat_name FROM {$wpdb->categories}"); $output .= '<div class="catlinkspage">'; foreach($linkcats as $cat) { $links = get_links($cat->cat_id, '<li class="clplink">', '</li>', '<br /> >> ', true, 'name', true, false, -1, true, false); if($links) { $output .= '<h2 class="clplinkcategory">' . $cat->cat_name . '</h2> '; $output .= '<ul class="clplinklist"> '; $output .= $links; $output .= '</ul> '; } else { $output .= ''; } } $output .= '</div>'; return $output; } function catlinks_page($content) { if ( strpos($content, '<!--catlinkspage-->') !== false ) $content = catlinks_page_callback(); return $content; } add_filter('the_content', 'catlinks_page'); ?>