Revision [5314]
This is an old revision of BacklinksHandler made by DarTar on 2005-01-28 10:28:21.
Backlinks Handler
See also:
Documentation: BacklinksHandlerInfo.Nothing more than a couple of minor modifications to the WakkaBacklinksHandler.
The handler shows a list of pages linking to the current page.
Given the strong page-dependence of this function, I think it makes more sense to have it work as a handler than an action.
To install it just save the code block below as handlers/page/backlinks.php
Use it as any other handler, appending /backlinks to the page URL.
<div class="page">
<?php
echo $this->Format('=== Pages linking to '.$this->tag.'=== --- ---');
if ($pages = $this->LoadPagesLinkingTo($this->getPageTag())) {
foreach ($pages as $page) {
$links[] = $this->Link($page["tag"]);
}
print(implode('<br>\n', $links));
} else {
echo 'There are no backlinks to this page';
}
?>
</div>
<?php
echo $this->Format('=== Pages linking to '.$this->tag.'=== --- ---');
if ($pages = $this->LoadPagesLinkingTo($this->getPageTag())) {
foreach ($pages as $page) {
$links[] = $this->Link($page["tag"]);
}
print(implode('<br>\n', $links));
} else {
echo 'There are no backlinks to this page';
}
?>
</div>
CategoryDevelopment