[17de4c]: index.php Maximize Restore History

Download this file

index.php    124 lines (107 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?
function formatDocs($filename, $title='') {
$content = file_get_contents($filename);
$content = str_replace("\n",'[\n]', $content);
// Fix links to man pages.
$content = preg_replace('/<a href="([\/\w]+)\.html(\#?\w*)">([^<]+)<\/a>/',
'<a href="?docs=$1&amp;title=$3$2">$3</a>', $content);
// External modules -- link to perldoc.perl.org and hope they have it.
$content = preg_replace('/<a href="..\/([\/\w]+)\.html(\#?\w*)">/',
'<a href="http://perldoc.perl.org/$1.html$2">', $content);
// Remove body tags.
$content = preg_replace('/^.*<body[^>]*>/', '', $content);
$content = preg_replace('/<\/body>.*$/', '', $content);
// Finished.
$content = str_replace('[\n]', "\n", $content);
$content = preg_replace('/\n+/', "\n", $content);
return "
<b>See also:</b> <a href='?page=function-ref'>How do I search for a function?</a>
<h1 class='title'>$title</h1>
<div class='pod'>$content</div>
";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Perl Data Language</title>
<link rel="shortcut icon" href="images/favicon.ico"
type="image/vnd.microsoft.icon" />
<link rel="stylesheet" type="text/css"
href="http://www.google.com/cse/style/look/espresso.css" />
<link rel='stylesheet' type='text/css' href='google-search.css' />
<link rel="stylesheet" type="text/css"
href="css/jquery-ui-1.8.2.custom.css" />
<link rel='stylesheet' type='text/css' href='pdl.css' />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"
type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17388934-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!-- BANNER -->
<div class="banner">
<a href="index.php?page=home">
<img src="images/icons/pdl.png" alt="PDL" height="79px" width="146px"/>
</a>
<img src="images/banners/pos-1-opt-<?=rand(0,2)?>.jpg" alt="Banner image1" height="79px" width="278px"/>
<img src="images/banners/pos-2-opt-<?=rand(0,2)?>.jpg" alt="Banner image2" height="79px" width="93px"/>
<img src="images/banners/pos-4-opt-<?=rand(0,1)?>.jpg" alt="Banner image3" height="79px" width="110px" style="margin-left: 25px"/>
<div id="cse-search-form" style="position: absolute; top: 20px; left: 700px">Loading</div>
</div>
<!-- END BANNER -->
<!-- SIDE BAR -->
<div class="sidebar-container">
<? include "content/sidebar.html" ?>
</div>
<!-- END SIDE BAR -->
<!-- END GOOGLE SEARCH -->
<table id="cse-container">
<tr>
<td id="cse"></td>
</tr>
</table>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function() {
var customSearchControl = new google.search.CustomSearchControl('005624475199589227813:0cr_qvao0qc');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.setSearchFormRoot('cse-search-form');
options.setAutoComplete(true);
customSearchControl.draw('cse', options);
}, true);
</script>
<!-- END GOOGLE SEARCH -->
<!-- MAIN CONTENT -->
<div class="main">
<?
function issane($string) {
return preg_match('/^[-_a-zA-Z0-9\/]+$/',$string);
}
if (isset($_GET['page']) && issane($_GET['page'])) {
require_once "content/".$_GET['page'].".html";
} elseif (isset($_GET['docs']) && issane($_GET['docs'])) {
echo formatDocs("PDLdocs/".$_GET['docs'].".html",$_GET['title']);
} else {
require_once "content/home.html";
}
?>
</div>
<!-- END CONTENT -->
</body>
</html>