WordPress.org

Support

Support » Plugins and Hacks » Top 10 - Popular posts plugin for WordPress » [Plugin: Top 10] Patch: Option for no title on manually placed top lists

[Plugin: Top 10] Patch: Option for no title on manually placed top lists

  • This patch adds the option to not show the title automatically on manually placed top lists. This way they can be written and formatted separately from the widgets.

    1.1. In admin.inc.php after line 18, which is $tptn_settings[title_daily] = ($_POST['title_daily']);, add the line $tptn_settings[show_manual_title] = (($_POST['show_manual_title']) ? true : false);.

    1.2. Then on what used to be from line 168 and now is line 169, find

    <h4>
          <?php _e('Output Options:',TPTN_LOCAL_NAME); ?>
        </h4>
        <p>
          <label>
          <?php _e('Title of popular posts: ',TPTN_LOCAL_NAME); ?>
          <input type="textbox" name="title" id="title" value="<?php echo stripslashes($tptn_settings[title]); ?>">
          </label>
        </p>
        <p>
          <label>
          <?php _e('Title of daily popular posts: ',TPTN_LOCAL_NAME); ?>
          <input type="textbox" name="title_daily" id="title_daily" value="<?php echo stripslashes($tptn_settings[title_daily]); ?>">

    and replace it with

    <h4><?php _e('Title Options:',TPTN_LOCAL_NAME); ?></h4>
        <p>
          <label>
          <?php _e('Title of popular posts widget: ',TPTN_LOCAL_NAME); ?>
          <input type="textbox" name="title" id="title" value="<?php echo stripslashes($tptn_settings[title]); ?>">
          </label>
        </p>
        <p>
          <label>
          <?php _e('Title of daily popular posts widget: ',TPTN_LOCAL_NAME); ?>
          <input type="textbox" name="title_daily" id="title_daily" value="<?php echo stripslashes($tptn_settings[title_daily]); ?>">
          </label>
        </p>
        <p>
          <label>
          <input type="checkbox" name="show_manual_title" id="show_manual_title" <?php if ($tptn_settings[show_manual_title]) echo 'checked="checked"' ?> />
          <?php _e('Use these titles also for manually placed (non-widget) top lists?',TPTN_LOCAL_NAME); ?>

    2.1. In top-10.php find from line 145

    $output .= '<div id="tptn_related">'.$tptn_settings['title'];
    		} else {
    			$output .= '<div id="tptn_related_daily">'.$tptn_settings['title_daily'];
    		}

    and replace it with

    $output .= '<div id="tptn_related">';
    		} else {
    			$output .= '<div id="tptn_related_daily">';
    		}
    		if ($tptn_settings['show_manual_title']) $output .= $tptn_settings['title_daily'];

    2.2. After what used to be line 306 and now is 307 and reads $tptn_settings = Array (, add the line 'show_manual_title' => true, // Show title automatically on manually placed (non-widget) elements.

    http://wordpress.org/extend/plugins/top-10/

  • The topic ‘[Plugin: Top 10] Patch: Option for no title on manually placed top lists’ is closed to new replies.
Skip to toolbar