HennasCoolCats: hennas-cool-cats.php

File hennas-cool-cats.php, 2.2 KB (added by henna, 7 years ago)

The main plugin file to be put in your Wordpress plugin directory

Line 
1<?php
2/*
3Plugin Name: Henna's cool cats/tags
4Plugin URI: http://hennadatta.com/blog/archives/2005/04/30/hennas-cool-catstags-for-wp-my-first-ever-wordpress-plugin/
5Description: Displays the categories/tags in a cool linked up list with link icons to Technorati, del.icio.us and Flickr.
6Version: 1
7Author: Henna Datta
8Author URI: http://hennadatta.com/
9Original code/icons by: Mark Jaquith, Keith McDuffee and Jonathan Deutsch
10*/
11
12function hennaz_taglist() {
13    $categories = get_the_category();
14   
15      if (empty($categories)) {
16        _e('Untagged');
17        return;
18    }
19$tlink = "http://www.technorati.com/tag/";
20$timg = get_settings('siteurl') . '/wp-content/plugins/technosquare.gif';
21$t_alt = "Technorati Tag";
22$dlink = "http://del.icio.us/tag/";
23$dimg = get_settings('siteurl') . '/wp-content/plugins/deliciousIconSaturated.gif';
24$d_alt = "del.icio.us tag";
25$flink = "http://www.flickr.com/photos/tags/";
26$fimg = get_settings('siteurl') . '/wp-content/plugins/hennaz_flickr_icon.gif';
27$f_alt = "Flickr tag";
28/* $dllink = "http://de.lirio.us/rubric/entries/tags/";
29$dlimg = get_settings('siteurl') . '/wp-content/plugins/deliciousIconSaturated.gif';
30$dl_alt = "de.lirio.us tag"; */
31    $thelist = '';
32        $i = 1;
33            foreach ($categories as $category) {
34            $category->cat_name = $category->cat_name;
35                          $thelist .= '<li><a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts tagged as %s"), $category->cat_name) . '">'.$category->cat_name.'</a>&nbsp;<a href="' . $tlink .$category->cat_name .'" rel="tag" title="' . sprintf(__("View tag:%s at Technorati"), $category->cat_name) . '">'.'<img src="' . $timg . '" border="0" alt="' . $t_alt . '"/>'.'</a>&nbsp;<a href="' . $dlink .$category->cat_name .'" rel="tag" title="' . sprintf(__("View tag:%s at del.icio.us"), $category->cat_name) . '">'.'<img src="' . $dimg . '" border="0" alt="' . $d_alt . '"/>'.'</a>&nbsp;<a href="' . $flink .$category->cat_name .'" rel="tag" title="' . sprintf(__("View tag:%s at Flickr"), $category->cat_name) . '">'.'<img src="' . $fimg . '" border="0" alt="' . $f_alt . '"/>'.'</a></li>';
36                     ++$i;
37        }
38    echo apply_filters('the_category', $thelist);
39}
40?>