[1c18df]: index.php Maximize Restore History

Download this file

index.php    177 lines (153 with data), 5.8 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?
//
// Choose a random banner.
//
function pickBanner() {
// Banners are identified by a binary number from 0000 to 1111.
$binary = '';
$binary .= rand(0,1);
$binary .= rand(0,1) * rand(0,1); // I like 0 better. :-)
$binary .= rand(0,1);
$binary .= rand(0,1);
return "blue-$binary.jpg";
}
function formatContents($filename, $title='') {
$content = file_get_contents($filename);
$content = str_replace('<div name="index">',
'<div class="index" name="index">', $content);
$content = str_replace("\n",'[\n]', $content);
//
// Fix URLs.
//
$content = str_replace('<a href="./', '<a href="', $content);
// PDL man pages.
$content = preg_replace('/<a href="([\/\w]+)\.html(\#?\w*)">([^<]+)<\/a>/',
'<a href="?docs=$1&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);
$content = preg_replace('/^.*<body[^>]*>/', '', $content);
$content = preg_replace('/<\/body>.*$/', '', $content);
$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>
$content
";
}
?>
<!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">
<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">
<img src="images/icons/pdl.png" height="79px" width="146px"/>
<div id="pos1" class="rotation">
<img src="images/banners/pos-1-opt-0.jpg" height="79px" width="278px"/>
<img src="images/banners/pos-1-opt-1.jpg" height="79px" width="278px"/>
<img src="images/banners/pos-1-opt-2.jpg" height="79px" width="278px"/>
</div>
<div id="pos2" class="rotation" style="left: 435px">
<img src="images/banners/pos-2-opt-0.jpg" height="79px" width="93px"/>
<img src="images/banners/pos-2-opt-1.jpg" height="79px" width="93px"/>
<img src="images/banners/pos-2-opt-2.jpg" height="79px" width="93px"/>
</div>
<div id="pos4" class="rotation" style="left: 555px">
<img src="images/banners/pos-4-opt-0.jpg" height="79px" width="110px"/>
<img src="images/banners/pos-4-opt-1.jpg" height="79px" width="110px"/>
</div>
<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 formatContents("PDLdocs/".$_GET['docs'].".html",$_GET['title']);
} else {
require_once "content/home.html";
}
?>
</div>
<!-- END CONTENT -->
<script type="text/javascript">
$(document).ready(function() {
//
// Banner animation.
//
// Change a random part of the banner.
function changeBanner() {
var rand = Math.random();
if (0.00 < rand && rand < 0.33) $('.banner #pos1').cycle('next');
if (0.33 < rand && rand < 0.66) $('.banner #pos2').cycle('next');
if (0.66 < rand && rand < 1.00) $('.banner #pos4').cycle('next');
}
// Change the banner every 5 seconds forever.
function rotateBanner() {
changeBanner();
setTimeout(rotateBanner, 5000);
}
// Initialize slideshow plugin and start rotation.
$('.rotation').cycle({ fx: 'fade', timeout: 0 });
rotateBanner();
});
</script>
</body>
</html>