WordPress.org

Ready to get started?Download WordPress

Forums

Better Blogroll
Feature request: Linkable title (2 posts)

  1. belg4mit
    Member
    Posted 2 years ago #

    It would be nice if it were possible to specify a destination URL for the widget title to link to

    http://wordpress.org/extend/plugins/better-blogroll/

  2. belg4mit
    Member
    Posted 1 year ago #

    --- better_blogroll.bak 2012-11-27 08:55:35.000000000 -0600
    +++ better_blogroll.php 2012-11-27 08:55:53.000000000 -0600
    @@ -24,6 +24,7 @@
                    $options = get_option('widget_betterblogroll');
                    $bbw_title = $options['title'];  // Title in sidebar for widget
                    $bbw_number = $options['show'];  // # of Posts we are showing
    +               $bbw_titlelink = $options['titlelink'];
                    $bbw_explanation = $options['explanation']; //a small explanation that the blogroll is rolling
                    $bbw_use_cat = $options['use_cat'] ? '1': '0';//should the category be shown in the list?
                    $bbw_limit_cat=$options['limit_cat']; //Limit the blogroll to a particular category
    @@ -38,6 +39,8 @@
                    if (!$bbw_number || $bbw_number<1) $bbw_number = 10;
                    // Output
    
    +               if(!empty($bbw_titlelink)){ $bbw_title = '<a href="' . $bbw_titlelink . '">'. "$bbw_title</a>"; }
    +
                    echo $before_widget . $before_title . $bbw_title . $after_title;
                    if(!empty($bbw_explanation)){echo '<p><div style="width: 140px;margin-bottom:10px;"><small>'.$bbw_explanation.'</small></div></p>';}
    
    @@ -108,7 +111,7 @@
                                            $bbw_result.= ' target="'.$bbw_link_target.'"';}
                                    $bbw_result.= ' href="'.$bbw_link_url.'" title="'.$bbw_link_desc.'">';
                                    if (($bbw_use_images)&&($bbw_link_image)){
    -                                       $bbw_result.= '<img src="'.$bbw_link_image.'" alt="Click to visit '.$bbw_link_name.'" /><br />';}
    +                                       $bbw_result.= '<img src="'.$bbw_link_image.'" alt="Click to visit '.$bbw_link_name.'" />';}
                                    if ($bbw_use_link_name){
                                            $bbw_result.= $bbw_link_name;}
                                    $bbw_result.= '</a>';
    @@ -138,6 +141,7 @@
                            // Remember to sanitize and format use input appropriately.
                            $options['title'] = strip_tags(stripslashes($_POST['betterblogroll-title']));
                            $options['show'] = strip_tags(stripslashes($_POST['betterblogroll-show']));
    +                       $options['titlelink'] = strip_tags(stripslashes($_POST['betterblogroll-titlelink']));
                            $options['explanation'] = strip_tags(stripslashes($_POST['betterblogroll-explanation']));
                            $options['use_cat'] = isset($_POST['betterblogroll-use_cat']);
                            $options['limit_cat'] = strip_tags(stripslashes($_POST['betterblogroll-limit_cat']));
    @@ -153,6 +157,7 @@
    
                    // Get options for form fields to show
                    $bbw_title = htmlspecialchars($options['title'], ENT_QUOTES);
    +               $bbw_titlelink = htmlspecialchars($options['titlelink'], ENT_QUOTES);
                    $bbw_number = htmlspecialchars($options['show'], ENT_QUOTES);
                    $bbw_explanation = htmlspecialchars($options['explanation'], ENT_QUOTES);
                    $bbw_use_cat = $options['use_cat'] ? 'checked="checked"' : '';
    @@ -170,6 +175,10 @@
                                    <input style="width: 200px;" id="betterblogroll-title" name="betterblogroll-title" type="text" value="'.$bbw_title.'" />
                                    </label></p>';
                    echo '<p style="text-align:right;">
    +                               <label for="betterblogroll-titlelink">' . __('Title Link:') . '
    +                               <input style="width: 200px;" id="betterblogroll-titlelink" name="betterblogroll-titlelink" type="text" value="'.$bbw_titlelink.'" />
    +                               </label></p>';
    +               echo '<p style="text-align:right;">
                                    <label for="betterblogroll-explanation">' . __('Explanation:') . '
                                    <input style="width: 200px; id="betterblogroll-explanation" name="betterblogroll-explanation" type="text" value="'.$bbw_explanation.'" />
                                    </label></p>';

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic