| 1 |
<?php
|
| 2 |
|
| 3 |
// $Header: /cvsroot/tikiwiki/tiki/tiki-view_cache.php,v 1.9.2.1 2005/01/01 00:11:27 damosoft 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 |
/*
|
| 13 |
if($feature_listPages != 'y') {
|
| 14 |
$smarty->assign('msg',tra("This feature is disabled"));
|
| 15 |
$smarty->display("error.tpl");
|
| 16 |
die;
|
| 17 |
}
|
| 18 |
*/
|
| 19 |
if (isset($_REQUEST['url'])) {
|
| 20 |
$id = $tikilib->get_cache_id($_REQUEST['url']);
|
| 21 |
|
| 22 |
if (!$id) {
|
| 23 |
$smarty->assign('msg', tra("No cache information available"));
|
| 24 |
|
| 25 |
$smarty->display("error.tpl");
|
| 26 |
die;
|
| 27 |
}
|
| 28 |
|
| 29 |
$_REQUEST["cacheId"] = $id;
|
| 30 |
}
|
| 31 |
|
| 32 |
if (!isset($_REQUEST["cacheId"])) {
|
| 33 |
$smarty->assign('msg', tra("No page indicated"));
|
| 34 |
|
| 35 |
$smarty->display("error.tpl");
|
| 36 |
die;
|
| 37 |
}
|
| 38 |
|
| 39 |
// Get a list of last changes to the Wiki database
|
| 40 |
$info = $tikilib->get_cache($_REQUEST["cacheId"]);
|
| 41 |
$ggcacheurl = 'http://google.com/search?q=cache:'.urlencode(strstr($info['url'],'http://'));
|
| 42 |
|
| 43 |
// test if url ends with .txt : formatting for text
|
| 44 |
if (substr($info["url"], -4, 4) == ".txt") {
|
| 45 |
$info["data"] = "<pre>" . $info["data"] . "</pre>";
|
| 46 |
}
|
| 47 |
|
| 48 |
$smarty->assign('ggcacheurl', $ggcacheurl);
|
| 49 |
$smarty->assign_by_ref('info', $info);
|
| 50 |
$smarty->assign('mid', 'tiki-view_cache.tpl');
|
| 51 |
$smarty->display('tiki-view_cache.tpl');
|
| 52 |
|
| 53 |
?>
|