Extension:LinkHint

What can this extension do?
LinkHint gives you a Hint on inner links - a tooltip of the first sentence of the value appears when you hover the link.

Usage
No special usage - just install and hover over inner links.

Installation
require_once("$IP/extensions/linkhint.php");
 * 1) Patch your include/linker.php. the patch is here.
 * 2) Make file called extensions/linkhint.php and copy the code into it.
 * 3) Change your LocalSettings.php:

Enjoy! :)

extensions/linkhint.php
 'LinkHint',        'status' => 'beta',        'type' => 'hook',        'author' => 'Nadav Wexler (nadavwexler [at] yahoo.com) - Original idea by Noam Galili',        'version' => '0.9',        'update' => '7-27-2007',        'description' => 'Shows the first line of a link as its tooltip.', );

$wgHooks['ParserAfterTidy'][] = 'fnLinkHint';

// Callback Function used on the main function function fnGetLinkLine($matches) { $title = Title::newFromText($matches[1]); if ($title) { $wordArticle = new Article( $title ); $wordArticle->getContent; if( $wordArticle->mContentLoaded ) { $res = $wordArticle->mContent. '.';             // Take only the first sentence $res = substr($res, 0, strpos($res, '.')); // Tidy a bit $res = str_replace(array('[',']'),'',$res); $res = preg_replace("/\s+/"," ",$res); return 'class="innerlink" title="' . htmlspecialchars($res) . '"'; }     }      return $matches[0]; }

// Main Callback function - finds and replace the links function fnLinkHint( &$parser, &$text) { global $action; // Access the global "action" variable // Only do the replacement if the action is not edit or history if(               $action !== 'edit'                && $action !== 'history'                && $action !== 'delete'                && $action !== 'watch'        ) {                               $text = preg_replace_callback ('|class="innerlink"\s+title="(.*?)"|',                                                 'fnGetLinkLine', $text); } }

?>