Commit 0ee7b1e9 authored by Martin Postma's avatar Martin Postma
Browse files

Issue #1947786 by lolandese: Link to 3rd party PR check.

parent 3ac260f9
Loading
Loading
Loading
Loading
+7 −0
Changes for pr_widget.admin.inc: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -46,6 +46,13 @@ function pr_widget_admin_settings() {
    '#description' => t('String to append. Suggestions " / 10", " out of 10" or nothing (default). <strong>Do not forget desired spaces.</strong>'),
  );

  $form['pr_settings']['pr_widget_link'] = array(
    '#type' => 'textfield',
    '#title' => t('Link to a third party PR check'),
    '#default_value' => variable_get('pr_widget_link', 'http://domaintyper.com/PageRankCheck/'),
    '#description' => t('Leave empty to disable, but the reliability of the widget is perceived better it leads to a third party PR check (default: "http://domaintyper.com/PageRankCheck/").<br /><strong>Use only services that accept a trailing domain in the URL to query. Do not forget the trailing slash or "?q=http://"</strong>, depending on the used service.'),
  ); 
  
  // Grabbing the PageRank once a day is enough, but leave it up to the
  // site owner to decide.
  $form['pr_settings']['pr_widget_interval'] = array(
+10 −0
Changes for pr_widget.module: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -138,6 +138,16 @@ function pr_widget_contents($which_block) {
      // If pagerank is enabled we want it..
      if (variable_get('pr_widget_enabled', 1)) {
        $pagerank = variable_get('pr_widget_string', t('PageRank')) . ': ' . variable_get('pr_widget_ratio', t('[No data yet]') . variable_get('pr_widget_suffix', '') . ' ');
        $link = variable_get('pr_widget_link', 'http://domaintyper.com/PageRankCheck/');
        if (!empty($link)) {
          $pagerank = l($pagerank, $link . parse_url($GLOBALS['base_url'], PHP_URL_HOST), 
            array('attributes' => 
              array(
                'title' => t('Check on') . ' ' . parse_url($link, PHP_URL_HOST)
              )
            )
          );
        }
      }
      else {
        // ..and leave it empty it's disabled.
+9 −2
Changes for pr_widget.tpl.php: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -6,7 +6,11 @@
?>
<div class="pr_widget-wrap">
  <?php if (variable_get('pr_widget_enabled', 1)): ?>
    <table class="pr_widget-table" summary="PageRank Widget">
    <?php $link = variable_get('pr_widget_link', 'http://domaintyper.com/PageRankCheck/'); ?>
    <?php if (!empty($link)): ?>
      <a href="<?php print $link . parse_url($GLOBALS['base_url'], PHP_URL_HOST); ?>" title="<?php print t('Check on') . ' ' . parse_url($link, PHP_URL_HOST); ?>">
    <?php endif; ?>
    <table class="pr_widget-table"">
      <tbody class="pr_widget-body">
        <tr>
          <td class="pr_widget-first">
@@ -20,6 +24,9 @@
        </tr>
      </tbody>
    </table>
    <?php if (!empty($link)): ?>
      </a>
    <?php endif; ?>
  <?php endif; ?>
  <table class="pr_widget-table notice" style="width: auto;">
    <tbody class="pr_widget-body">
@@ -33,7 +40,7 @@
              $notice = ' ' . variable_get('pr_widget_prepend', '') . ' © ' . (($year != date('Y') && !empty($year)) ? $year . '-' . date('Y') : date('Y'));
            }
            else {
              // ..and leave it empty it's disabled.
              // ..and leave it empty if it's disabled.
              $notice = '';
              $host = '';
            }