cvs: pearweb /include layout.php /public_html source.php
| From: | Martin Jansen | Date: | Thu, 10 May 2001 20:26:30 +0000 |
| Subject: | cvs: pearweb /include layout.php /public_html source.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-129@lists.php.net to get a copy of this message | ||
mj Thu May 10 13:26:30 2001 EDT
Added files:
/pearweb/public_html source.php
Modified files:
/pearweb/include layout.php
Log:
* Added "Show Source"-function
Index: pearweb/include/layout.php
diff -u pearweb/include/layout.php:1.5 pearweb/include/layout.php:1.6
--- pearweb/include/layout.php:1.5 Sat Apr 28 10:31:55 2001
+++ pearweb/include/layout.php Thu May 10 13:26:29 2001
@@ -1,5 +1,5 @@
<?php
-/* $Id: layout.php,v 1.5 2001/04/28 17:31:55 mj Exp $ */
+/* $Id: layout.php,v 1.6 2001/05/10 20:26:29 mj Exp $ */
require_once 'site.php';
@@ -252,7 +252,7 @@
#
function commonFooter() {
- global $LAST_UPDATED, $MIRRORS, $MYSITE, $COUNTRIES;
+ global $LAST_UPDATED, $MIRRORS, $MYSITE, $COUNTRIES,$SCRIPT_NAME;
?>
<br>
</td>
Index: pearweb/public_html/source.php
+++ pearweb/public_html/source.php
<?php
response_header('Show Source');
echo "<H2>Show Source</H2>\n";
if (!isset($url)) {
echo "No page URL specified.";
commonFooter();
exit;
}
?>
Source of: <?php echo $url; ?><BR>
<?php
echo hdelim();
$legal_dirs = array(
"/manual" => 1,
"/include" => 1,
"/stats" => 1);
$dir = dirname($url);
if ($dir && $legal_dirs[$dir]) {
$page_name = $DOCUMENT_ROOT . $url;
} else {
$page_name = basename($url);
}
echo("<!-- $page_name -->\n");
if (file_exists($page_name) && !is_dir($page_name)) {
show_source($page_name);
} else if (is_dir($page_name)) {
echo "<P>No file specified. Can't show source for a
directory.</P>\n";
}
echo hdelim();
?>
<P>
The syntax highlighted source is automatically generated by PHP from the plaintext script.<br>
If you want to see the source of this page, have a look
<?php print_link("/source.php?url=/source.php", "here"); ?>.
</P>
<?
response_footer();
?>