This Wordpress plugin that lets Battlestar Galactica fans display a count of the number of times the word “frak” appears in posts for displaying in themes.
Author: Vicky Arulsingam
Current Version: 0.1 (added: February 2, 2007)
Download: frak-o-meter.zip
Installation
- Upload the file: frak-o-meter.php to the Wordpress plugins folder (wp-content/plugins)
- Activate the plugin from the Plugin Management screen.
Usage
Customize your theme’s templates to display the Frak Counter and the Frak-O-Meter. These are global tags and should be placed outside of your post template tags. I’ve placed them in my sidebar.
A. FRAK COUNTER
<?php if (function_exists('FrakCounter')) FrakCounter(); ?>
By default this template tag shows:
x fraks and counting
Average: x fraks in y posts
Other options include:
<?php if (function_exists('FrakCounter')) FrakCounter('counter'); ?>
This shows:
x fraks and counting
<?php if (function_exists('FrakCounter')) FrakCounter('average'); ?>
This shows:
Average: x fraks in y posts
B. FRAK-O-METER
Specify a minimum and maximum number to display an appropriate message.
<?php if (function_exists('frakometer')) frakometer(5,50); ?>
In this example, 5 is the minimum count and 50 is the maximum count.
If you have a frak count that is less than 5 the following message shows up:
If your frak count is 5 or more but less than 50 you’ll see this message:
If you frak count is greater than or equal to 50 this is what you’ll see:
Change the values to change the message displayed.
BONUS TEMPLATE TAG
Now if you use frak a lot and want to have a frak count for EACH post then use the following template tag: FrakPostCount($post->ID).
PLEASE KEEP IN MIND:
Using this tag WILL INCREASE the page load time of your site.
Why? This tag repeats the process of counting the number of fraks for each post.
In my tests using this tag increased my load time by 7 seconds. Eeeep!
By using…
<?php if (function_exists('FrakPostCounter')) FrakPostCounter($post->ID); ?>
The following HTML code is created:
Frak-O-Meter: x fraks today<br />
You can define your own text or html before and after the frak count. For example
<?php if (function_exists('FrakPostCounter')) FrakPostCounter('<strong>Frak Count</strong><br />', '<br />', $post->ID); ?>
This shows the following HTML code:
<strong>Frak Count</strong><br /> x fraks today <br />
If your frak count is 0 then nothing shows up.
See a screenshot of the frak-o-meter in action.
Back to Top
Support
If you need help with this plugin, please comment here