diff --git a/admin-functions.php b/admin-functions.php index f24bf28..969e6bb 100644 --- a/admin-functions.php +++ b/admin-functions.php @@ -79,6 +79,17 @@ function reclinks_plugin_settings() { --> + + + + + +

+ /> + +

+ + @@ -105,7 +116,8 @@ function update_reclinks_settings() { 'sort_order' => $_POST['sort_order'], 'tax' => ( isset( $_POST['tax'] ) ) ? $_POST['tax'] : array(), 'allow-unregistered-vote' => (isset($_POST['allow-unregistered-vote']) && true == $_POST['allow-unregistered-vote']), - 'allow-unregistered-post' => (isset($_POST['allow-unregistered-post']) &&true == $_POST['allow-unregistered-post']), + 'allow-unregistered-post' => (isset($_POST['allow-unregistered-post']) && true == $_POST['allow-unregistered-post']), + 'vote-on-comments' => (isset($_POST['vote-on-comments']) && true == $_POST['vote-on-comments']), // no UI for this yet, but its gotta be in there 'vote-values' => array( diff --git a/display-filters.php b/display-filters.php index c984c6e..dc26bbc 100644 --- a/display-filters.php +++ b/display-filters.php @@ -137,15 +137,21 @@ function gad_reclinks_show_votelinks( $content ) { /** - * By default, filters comment_text to add the vote box above the comment text. + * By default, this function filters comment_text to add the vote box above the + * comment text IF the setting "Enable voting / points tally on comments" is on. * If you would like to add the vote box in a different location, you can remove * this filter and include the template tag reclinks_votebox() in your comment - * callback function - * + * callback function. + * */ add_filter( 'comment_text', 'reclinks_comment_show_votelinks' ); function reclinks_comment_show_votelinks( $comment_text, $comment = null ) { + $plugin_settings = get_option( 'reclinks_plugin_options' ); + + if ( false == $plugin_settings['vote-on-comments'] ) + return $comment_text; + if ( is_admin() ) return $comment_text; @@ -176,14 +182,17 @@ function gad_reclinks_permalink( $permalink ) { function reclink_domain( $echo = true ) { return reclinks_domain( $echo ); } // the price you pay for typos in documentation -function reclinks_domain( $echo = true ) { +function reclinks_domain( $echo = true, $before = '(', $after = ')' ) { global $post; if ( $href = get_post_meta( $post->ID, '_href', true ) ) $host = parse_url( $href, PHP_URL_HOST ); + + if ( empty( $host ) ) return; + if ( $echo ) - echo $host; + echo $before . $host . $after; else - return $host; + return $before . $host . $after; } diff --git a/loop-reclinks.php b/loop-reclinks.php index cd6fe73..9f90900 100644 --- a/loop-reclinks.php +++ b/loop-reclinks.php @@ -26,7 +26,7 @@
  • - () +
  • diff --git a/readme.txt b/readme.txt index 5b2748c..a5c2227 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: http://goldenapplesdesign.com/projects/recommended-links-plugin-for Tags: social bookmarking, sharing, voting, reddit, digg Requires at least: 3.2.1 Tested up to: 3.3.1 -Stable tag: 0.3.2 +Stable tag: 0.3.3 A sort of "Reddit clone" that allows users to post links, up- or down-vote them, and comment on them. @@ -68,6 +68,10 @@ There are not many special display features yet. A partial listing: == Changelog == += 0.3.3 = + +Several bugfixes; added "vote on comments" option and styling for buttons. + = 0.3.2 = Fixed a number of "missing index" bugs that caused error messages on first activation of the plugin. @@ -104,6 +108,10 @@ I built a version 0.1 back in 2010 for a personal project, which was only half c == Upgrade Notice == += 0.3.3 = + +This update fixes several bugs that were pointed out (time zone setting, posts showing up as from "anonymous", update messages not defined), and adds an option to disable voting on comments. It also styles the +1/-1 buttons a bit - skins for the style will be selectable and overridable by version 0.4, but just for now I was tired of seeing the unstyled buttons. + = 0.3 = This version includes a plugin settings page, as well as multiple new features: diff --git a/recommended-links.php b/recommended-links.php index 1a96747..7929562 100644 --- a/recommended-links.php +++ b/recommended-links.php @@ -4,7 +4,7 @@ Plugin URI: http://goldenapplesdesign.com/projects/recommended-links-plugin/ Description: A "reddit clone" that runs in Wordpress. Author: Nathaniel Taintor -Version: 0.3.2 +Version: 0.3.3 Author URI: http://goldenapplesdesign.com */ @@ -77,7 +77,6 @@ function register_cpt_reclink() { register_post_type( 'reclink', $args ); - } // Activation / deactivation @@ -90,7 +89,7 @@ function register_cpt_reclink() { function gad_check_db_tables() { $v = get_option( 'reclinks_db_version' ); - if ( !$v || $v < 3 ) + if ( !$v || $v < 4 ) reclinks_db_option_upgrade( $v ); }