Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

First commit of the released version

  • Loading branch information...
commit 409843f658eaf282a53f11e14e5c1a69249729e8 0 parents
@okeeblow authored
BIN  Screenshot-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  beastiepress-en_US.mo
Binary file not shown
86 beastiepress-en_US.po
@@ -0,0 +1,86 @@
+# Translation of the WordPress plugin BeastiePress 1.0 by Nicole Reid.
+# Copyright (C) 2010 Nicole Reid
+# This file is distributed under the same license as the BeastiePress package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: BeastiePress 1.0\n"
+"Report-Msgid-Bugs-To: http://wordpress.org/tag/beastiepress\n"
+"POT-Creation-Date: 2010-10-25 00:05-0400\n"
+"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: beastiepress.php:128
+msgid "BeastiePress requires at least WordPress 2.8."
+msgstr ""
+
+#: beastiepress.php:191
+msgid "You do not have sufficient permissions to access this page."
+msgstr ""
+
+#: beastiepress.php:198
+msgid "BeastiePress Settings"
+msgstr ""
+
+#: beastiepress.php:205 beastiepress.php:208
+msgid "Port Linking"
+msgstr ""
+
+#: beastiepress.php:212 beastiepress.php:255 beastiepress.php:280
+#: beastiepress.php:305
+msgid "Enable"
+msgstr ""
+
+#: beastiepress.php:230
+#, php-format
+msgid "Use the %s Ports index."
+msgstr ""
+
+#: beastiepress.php:240 beastiepress.php:265 beastiepress.php:290
+#: beastiepress.php:315
+#, php-format
+msgid "Match the %s tag."
+msgstr ""
+
+#: beastiepress.php:248 beastiepress.php:251
+msgid "Problem Report Linking"
+msgstr ""
+
+#: beastiepress.php:273 beastiepress.php:276
+msgid "File Tagging"
+msgstr ""
+
+#: beastiepress.php:298 beastiepress.php:301
+msgid "Manual Page Linking"
+msgstr ""
+
+#: beastiepress.php:328
+msgid "Save Changes"
+msgstr ""
+
+#. Plugin Name of the plugin/theme
+msgid "BeastiePress"
+msgstr ""
+
+#. Plugin URI of the plugin/theme
+msgid "http://cooltrainer.org/software/beastiepress/"
+msgstr ""
+
+#. Description of the plugin/theme
+msgid "Adds some FreeBSD-specific shortcodes to WordPress"
+msgstr ""
+
+#. Author of the plugin/theme
+msgid "Nicole Reid"
+msgstr ""
+
+#. Author URI of the plugin/theme
+msgid "http://cooltrainer.org"
+msgstr ""
344 beastiepress.php
@@ -0,0 +1,344 @@
+<?php
+/*
+Plugin Name: BeastiePress
+Plugin URI: http://cooltrainer.org/software/beastiepress/
+Description: Adds some FreeBSD-specific shortcodes to WordPress
+Version: 1.0
+Author: Nicole Reid
+Author URI: http://cooltrainer.org
+License: X11
+*/
+
+define("PR_URL", "http://www.freebsd.org/cgi/query-pr.cgi?pr=");
+define("MAN_URL", "http://www.freebsd.org/cgi/man.cgi?query=");
+
+if(!class_exists('BeastiePress'))
+{
+ class BeastiePress
+ {
+ var $port_sites;
+ var $beastiepress_port_enable;
+ var $beastiepress_port_tag;
+ var $beastiepress_port_site;
+ var $beastiepress_pr_enable;
+ var $beastiepress_pr_tag;
+ var $beastiepress_file_enable;
+ var $beastiepress_file_tag;
+ var $beastiepress_man_enable;
+ var $beastiepress_man_tag;
+
+ function beastiepress()
+ {
+ if(version_compare(get_bloginfo("version"), "2.8", "<"))
+ {
+ add_action('admin_notices', array(&$this, "version_check"));
+ }
+
+ // Set up known Ports index sites
+ $this->port_sites = array(
+ "freebsd" => array("url" => "http://cvsweb.freebsd.org/ports/", "name" => "FreeBSD.org CVSWeb", "postfix" => "/"),
+ "freshports" => array("url" => "http://freshports.org/", "name" => "Freshports.org", "postfix" => "/"),
+ "freebsdsoftware" => array("url" => "http://www.freebsdsoftware.org/", "name" => "FreeBSDSoftware.org", "postfix" => ".html")
+ );
+
+ // Load translations
+ load_plugin_textdomain("beastiepress", null, basename(dirname(__FILE__)));
+
+ // What to do when our plugin is activated and uninstalled
+ register_activation_hook(__FILE__, array(&$this, "install"));
+ register_uninstall_hook(__FILE__, array(&$this, "uninstall"));
+
+ // Get options from DB
+ $this->get_options();
+
+ // Attach to WordPress
+ if($this->beastiepress_port_enable == true)
+ {
+ add_shortcode($this->beastiepress_port_tag, array(&$this, "port"));
+ }
+ if($this->beastiepress_pr_enable == true)
+ {
+ add_shortcode($this->beastiepress_pr_tag, array(&$this, "pr"));
+ }
+ if($this->beastiepress_file_enable == true)
+ {
+ add_shortcode($this->beastiepress_file_tag, array(&$this, "file"));
+ }
+ if($this->beastiepress_man_enable == true)
+ {
+ add_shortcode($this->beastiepress_man_tag, array(&$this, "man"));
+ }
+
+ add_action("admin_menu", array(&$this, "admin_menu"));
+ add_action("admin_init", array(&$this, "register_options"));
+
+ }
+
+ function install()
+ {
+ add_option("beastiepress_port_enable", true);
+ add_option("beastiepress_port_tag", "port");
+ add_option("beastiepress_port_site", "freshports");
+ add_option("beastiepress_pr_enable", true);
+ add_option("beastiepress_pr_tag", "pr");
+ add_option("beastiepress_file_enable", true);
+ add_option("beastiepress_file_tag", "file");
+ add_option("beastiepress_man_enable", true);
+ add_option("beastiepress_man_tag", "man");
+ }
+
+ function uninstall()
+ {
+ delete_option("beastiepress_port_enable");
+ delete_option("beastiepress_port_tag");
+ delete_option("beastiepress_port_site");
+ delete_option("beastiepress_pr_enable");
+ delete_option("beastiepress_pr_tag");
+ delete_option("beastiepress_file_enable");
+ delete_option("beastiepress_file_tag");
+ delete_option("beastiepress_man_enable");
+ delete_option("beastiepress_man_enable");
+ }
+
+ function register_options()
+ {
+ register_setting("beastiepress", "beastiepress_port_enable");
+ register_setting("beastiepress", "beastiepress_port_tag");
+ register_setting("beastiepress", "beastiepress_port_site");
+ register_setting("beastiepress", "beastiepress_pr_enable");
+ register_setting("beastiepress", "beastiepress_pr_tag");
+ register_setting("beastiepress", "beastiepress_file_enable");
+ register_setting("beastiepress", "beastiepress_file_tag");
+ register_setting("beastiepress", "beastiepress_man_enable");
+ register_setting("beastiepress", "beastiepress_man_enable");
+ }
+
+ function get_options()
+ {
+ $this->beastiepress_port_enable = get_option("beastiepress_port_enable");
+ $this->beastiepress_port_tag = get_option("beastiepress_port_tag");
+ $this->beastiepress_port_site = get_option("beastiepress_port_site");
+ $this->beastiepress_pr_enable = get_option("beastiepress_pr_enable");
+ $this->beastiepress_pr_tag = get_option("beastiepress_pr_tag");
+ $this->beastiepress_file_enable = get_option("beastiepress_file_enable");
+ $this->beastiepress_file_tag = get_option("beastiepress_file_tag");
+ $this->beastiepress_man_enable = get_option("beastiepress_man_enable");
+ $this->beastiepress_man_tag = get_option("beastiepress_man_tag");
+ }
+
+ function version_check()
+ {
+ $this->show_error(__("BeastiePress requires at least WordPress 2.8.", "beastiepress"));
+ }
+
+ function show_error($error_message)
+ {
+ echo <<<END
+<div id="message" class="error"><p>{$error_message}</p></div>
+END;
+ }
+
+ function port($attributes, $content = null)
+ {
+ extract(shortcode_atts(array(
+ "site" => $this->beastiepress_port_site
+ ), $attributes));
+
+ return <<<END
+<a href="{$this->port_sites[$site]["url"]}{$content}{$this->port_sites[$site]["postfix"]}">{$content}</a>
+END;
+ }
+
+ function pr($attributes, $content = null)
+ {
+ $url = PR_URL;
+ return <<<END
+<a href="{$url}{$content}">{$content}</a>
+END;
+ }
+
+ function file($attributes, $content = null)
+ {
+ return <<<END
+<span class="{$this->beastiepress_file_tag}">{$content}</span>
+END;
+ }
+
+ function man($attributes, $content = null)
+ {
+ extract(shortcode_atts(array(
+ "section" => 0,
+ "release" => "Latest"
+ ), $attributes));
+
+
+ $url = MAN_URL;
+ $suffix = ($attributes["section"] == 0) ? "" : "({$attributes["section"]})";
+
+ return <<<END
+<a href="{$url}{$content}&sektion={$attributes["section"]}&manpath={$attributes["release"]}">{$content}{$suffix}</a>
+END;
+ }
+
+
+ function admin_menu()
+ {
+ add_options_page("BeastiePress Options", "BeastiePress", "manage_options", "beastiepress", array(&$this, "admin_options"));
+ }
+
+
+ function admin_options()
+ {
+ if (!current_user_can('manage_options'))
+ {
+ wp_die( __('You do not have sufficient permissions to access this page.') );
+ }
+
+
+?>
+<div class="wrap">
+ <div id="icon-options-general" class="icon32"></div>
+ <h2><?php echo __("BeastiePress Settings", "beastiepress"); ?></h2>
+ <form method="post" action="options.php">
+ <?php settings_fields("beastiepress"); ?>
+
+ <table class="form-table">
+
+ <tr valign="top">
+ <th scope="row"><?php echo __("Port Linking", "beastiepress");?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><span><?php echo __("Port Linking", "beastiepress");?></span></legend>
+
+ <label for="beastiepress_port_enable">
+ <input type="checkbox" id="beastiepress_port_enable" name="beastiepress_port_enable" <?php echo ($this->beastiepress_port_enable == true) ? "checked=\"checked\"" : "" ?> />
+ <?php echo __("Enable", "beastiepress");?>
+ </label>
+
+ <br />
+
+ <?php
+ $select = <<<END
+ <label for="beastiepress_port_site">
+ <select id="beastiepress_port_site" name="beastiepress_port_site">
+END;
+ foreach($this->port_sites as $key => $site)
+ {
+ $selected = ($this->beastiepress_port_site == $key) ? "selected=\"selected\"" : "";
+ $select .= <<<END
+ <option value="{$key}" {$selected}>{$site["name"]}</option>
+END;
+ }
+ $select .= "</select></label>";
+ printf(__("Use the %s Ports index.", "beastiepress"), $select);
+ ?>
+
+ <br />
+
+ <label for="beastiepress_port_tag">
+ <?php
+ $input = <<<END
+ <input type="text" id="beastiepress_port_tag" name="beastiepress_port_tag" value="{$this->beastiepress_port_tag}"/>
+END;
+ printf(__("Match the %s tag.", "beastiepress"), $input);
+ ?>
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><?php echo __("Problem Report Linking", "beastiepress");?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><span><?php echo __("Problem Report Linking", "beastiepress");?></span></legend>
+
+ <label for="beastiepress_pr_enable">
+ <input type="checkbox" id="beastiepress_pr_enable" name="beastiepress_pr_enable" <?php echo ($this->beastiepress_pr_enable == true) ? "checked=\"checked\"" : "" ?> />
+ <?php echo __("Enable", "beastiepress");?>
+ </label>
+
+ <br />
+
+ <label for="beastiepress_pr_tag">
+ <?php
+ $input = <<<END
+ <input type="text" id="beastiepress_pr_tag" name="beastiepress_pr_tag" value="{$this->beastiepress_pr_tag}"/>
+END;
+ printf(__("Match the %s tag.", "beastiepress"), $input);
+ ?>
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><?php echo __("File Tagging", "beastiepress");?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><span><?php echo __("File Tagging", "beastiepress");?></span></legend>
+
+ <label for="beastiepress_file_enable">
+ <input type="checkbox" id="beastiepress_file_enable" name="beastiepress_file_enable" <?php echo ($this->beastiepress_file_enable == true) ? "checked=\"checked\"" : "" ?> />
+ <?php echo __("Enable", "beastiepress");?>
+ </label>
+
+ <br />
+
+ <label for="beastiepress_file_tag">
+ <?php
+ $input = <<<END
+ <input type="text" id="beastiepress_file_tag" name="beastiepress_file_tag" value="{$this->beastiepress_file_tag}"/>
+END;
+ printf(__("Match the %s tag.", "beastiepress"), $input);
+ ?>
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><?php echo __("Manual Page Linking", "beastiepress");?></th>
+ <td>
+ <fieldset>
+ <legend class="screen-reader-text"><span><?php echo __("Manual Page Linking", "beastiepress");?></span></legend>
+
+ <label for="beastiepress_man_enable">
+ <input type="checkbox" id="beastiepress_man_enable" name="beastiepress_man_enable" <?php echo ($this->beastiepress_man_enable == true) ? "checked=\"checked\"" : "" ?> />
+ <?php echo __("Enable", "beastiepress");?>
+ </label>
+
+ <br />
+
+ <label for="beastiepress_man_tag">
+ <?php
+ $input = <<<END
+ <input type="text" id="beastiepress_man_tag" name="beastiepress_man_tag" value="{$this->beastiepress_man_tag}"/>
+END;
+ printf(__("Match the %s tag.", "beastiepress"), $input);
+ ?>
+ </label>
+ </fieldset>
+ </td>
+ </tr>
+
+ </table>
+
+ <input type="hidden" name="action" value="update" />
+ <input type="hidden" name="page_options" value="new_option_name,some_other_option,option_etc" />
+
+ <p class="submit">
+ <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
+ </p>
+
+ </form>
+</div>
+
+<?php
+ } //admin_options()
+ } // class definition
+
+ $beastiepress = new BeastiePress();
+
+} // if class exists
+?>
86 beastiepress.pot
@@ -0,0 +1,86 @@
+# Translation of the WordPress plugin BeastiePress 1.0 by Nicole Reid.
+# Copyright (C) 2010 Nicole Reid
+# This file is distributed under the same license as the BeastiePress package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: BeastiePress 1.0\n"
+"Report-Msgid-Bugs-To: http://wordpress.org/tag/beastiepress\n"
+"POT-Creation-Date: 2010-10-25 00:05-0400\n"
+"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: beastiepress.php:128
+msgid "BeastiePress requires at least WordPress 2.8."
+msgstr ""
+
+#: beastiepress.php:191
+msgid "You do not have sufficient permissions to access this page."
+msgstr ""
+
+#: beastiepress.php:198
+msgid "BeastiePress Settings"
+msgstr ""
+
+#: beastiepress.php:205 beastiepress.php:208
+msgid "Port Linking"
+msgstr ""
+
+#: beastiepress.php:212 beastiepress.php:255 beastiepress.php:280
+#: beastiepress.php:305
+msgid "Enable"
+msgstr ""
+
+#: beastiepress.php:230
+#, php-format
+msgid "Use the %s Ports index."
+msgstr ""
+
+#: beastiepress.php:240 beastiepress.php:265 beastiepress.php:290
+#: beastiepress.php:315
+#, php-format
+msgid "Match the %s tag."
+msgstr ""
+
+#: beastiepress.php:248 beastiepress.php:251
+msgid "Problem Report Linking"
+msgstr ""
+
+#: beastiepress.php:273 beastiepress.php:276
+msgid "File Tagging"
+msgstr ""
+
+#: beastiepress.php:298 beastiepress.php:301
+msgid "Manual Page Linking"
+msgstr ""
+
+#: beastiepress.php:328
+msgid "Save Changes"
+msgstr ""
+
+#. Plugin Name of the plugin/theme
+msgid "BeastiePress"
+msgstr ""
+
+#. Plugin URI of the plugin/theme
+msgid "http://cooltrainer.org/software/beastiepress/"
+msgstr ""
+
+#. Description of the plugin/theme
+msgid "Adds some FreeBSD-specific shortcodes to WordPress"
+msgstr ""
+
+#. Author of the plugin/theme
+msgid "Nicole Reid"
+msgstr ""
+
+#. Author URI of the plugin/theme
+msgid "http://cooltrainer.org"
+msgstr ""
44 readme.txt
@@ -0,0 +1,44 @@
+=== Plugin Name ===
+Contributors: okeeblow
+Donate link: http://cooltrainer.org/
+Tags: freebsd
+Requires at least: 2.8
+Tested up to: 3.0.1
+Stable tag: 1.0
+
+BeastiePress adds several shortcodes for interaction with the BSD community.
+
+== Description ==
+
+BeastiePress adds several shortcodes for interaction with the BSD community, including linking to ports, manual pages, and problem reports.
+
+This plugin should be compatible with WP 2.8, but I've only tested it on my 3.0 site. Let me know!
+
+== Installation ==
+
+This section describes how to install the plugin and get it working.
+
+e.g.
+
+1. Upload `plugin-name.php` to the `/wp-content/plugins/` directory
+1. Activate the plugin through the 'Plugins' menu in WordPress
+1. Place `<?php do_action('plugin_name_hook'); ?>` in your templates
+
+== Frequently Asked Questions ==
+
+= Is this FreeBSD-specific? =
+For now, yes. FreeBSD is my go-to version. The [man] tag, however, links to the freebsd man page browser which has pages from other BSD flavors.
+
+== Screenshots ==
+
+1. The BeastiePress admin page.
+
+== Changelog ==
+
+= 1.0 =
+* First release
+
+== Upgrade Notice ==
+
+= 1.0 =
+Cleanup from development version, mostly regarding saving and loading options.
Please sign in to comment.
Something went wrong with that request. Please try again.