Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

November 25, 2009

(English) Wordpress Plugin: Download Counter Visualization

Widget Chart example
Widget Chart example

last update: 2010-04-14

This plugin adds a widget to display download statistics based on the Download Counter plugin on your site. The sidebar widget will show a highly configurable chart based on the Google Chart API. Furthermore it offers a dashboard widget that summarizes your downloads, to get information quick at a glance.

The plugin supports following chart types:
  • Bar (horizontal)
  • Pie
  • Pie 3D

You can include a chart of your downloads on a page or in a post using the downloadcounterchart-shortcut. Of course a download chart is includable in your theme. See extended documentation for detailed explanations for that.

July 26, 2008

Überschrift des Related-Post Plugins ändern

Das Related-Post Wordpress Plugin liefert zusätzliche Informationen für einen Beitrag. Allerdings kann der durch das Plugin erzeugte HMTL-Code nur durch eine Änderung am Plugin selber angepasst werden. Allerdings besteht eine weitere Möglichkeit das Rendering anzupassen: Reguläre Ausdrücke. Der folgende Code-Schnipsel zeigt die Veränderung der Überschrift, indem einfach das HTML-Markup darum ausgetauscht wird.
$related = wp_get_related_posts();

$find = '/<h3>(.*)<\/h3>(.*)/i';
$replace = '<h4 class="highlighted">$1</h4>$2';
echo preg_replace($find, $replace, $related);
The related posts plugin of wordpress generates nice additional information for a post. But to customize the generated HTML code you have to change the plugin code. Another solution is using a regular expression. Following this approach it is very easy to customize the header generated by the plugin. Here is the according PHP code snippet.
$related = wp_get_related_posts();

$find = '/<h3>(.*)<\/h3>(.*)/i';
$replace = '<h4 class="highlighted">$1</h4>$2';
echo preg_replace($find, $replace, $related);

It simply extract the header text and wrap it into other HTML tags.