| 1 |
<?php
|
| 2 |
|
| 3 |
// $Header: /cvsroot/tikiwiki/tiki/tiki-backlinks.php,v 1.9.2.2 2006/09/03 16:32:32 ohertel Exp $
|
| 4 |
|
| 5 |
// Copyright (c) 2002-2005, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
|
| 6 |
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
|
| 7 |
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
|
| 8 |
|
| 9 |
// Initialization
|
| 10 |
require_once ('tiki-setup.php');
|
| 11 |
|
| 12 |
include_once ('lib/wiki/wikilib.php');
|
| 13 |
|
| 14 |
if ($feature_wiki != 'y') {
|
| 15 |
$smarty->assign('msg', tra("This feature is disabled").": feature_wiki");
|
| 16 |
|
| 17 |
$smarty->display("error.tpl");
|
| 18 |
die;
|
| 19 |
}
|
| 20 |
|
| 21 |
if ($feature_backlinks != 'y') {
|
| 22 |
$smarty->assign('msg', tra("This feature is disabled").": feature_backlinks");
|
| 23 |
|
| 24 |
$smarty->display("error.tpl");
|
| 25 |
die;
|
| 26 |
}
|
| 27 |
|
| 28 |
// Get the page from the request var or default it to HomePage
|
| 29 |
if (!isset($_REQUEST["page"])) {
|
| 30 |
$smarty->assign('msg', tra("No page indicated"));
|
| 31 |
|
| 32 |
$smarty->display("error.tpl");
|
| 33 |
die;
|
| 34 |
} else {
|
| 35 |
$page = $_REQUEST["page"];
|
| 36 |
|
| 37 |
$smarty->assign_by_ref('page', $_REQUEST["page"]);
|
| 38 |
}
|
| 39 |
|
| 40 |
include_once ("tiki-pagesetup.php");
|
| 41 |
|
| 42 |
// Now check permissions to access this page
|
| 43 |
if ($tiki_p_view != 'y') {
|
| 44 |
$smarty->assign('msg', tra("Permission denied you cannot view backlinks for this page"));
|
| 45 |
|
| 46 |
$smarty->display("error.tpl");
|
| 47 |
die;
|
| 48 |
}
|
| 49 |
|
| 50 |
// If the page doesn't exist then display an error
|
| 51 |
if (!$tikilib->page_exists($page)) {
|
| 52 |
$smarty->assign('msg', tra("The page cannot be found"));
|
| 53 |
|
| 54 |
$smarty->display("error.tpl");
|
| 55 |
die;
|
| 56 |
}
|
| 57 |
|
| 58 |
// Get the backlinks for the page "page"
|
| 59 |
$backlinks = $wikilib->get_backlinks($page);
|
| 60 |
$smarty->assign_by_ref('backlinks', $backlinks);
|
| 61 |
ask_ticket('backlinks');
|
| 62 |
|
| 63 |
// disallow robots to index page:
|
| 64 |
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
|
| 65 |
|
| 66 |
// Display the template
|
| 67 |
$smarty->assign('mid', 'tiki-backlinks.tpl');
|
| 68 |
$smarty->assign('show_page_bar', 'y');
|
| 69 |
$smarty->display("tiki.tpl");
|
| 70 |
|
| 71 |
?>
|