source: trunk/www/includes/common.inc @ 8963

Last change on this file since 8963 was 8963, checked in by wbb4, 16 years ago

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

Add a note to visitors from darwinports.com about the (non-existent) relationship.

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1<?php
2
3# $Id: common.inc,v 1.2 2004/10/27 05:28:17 wbb4 Exp $
4# Copyright (c) 2003, OpenDarwin
5
6######################################################################
7
8# print the page header
9function print_header($title, $encoding) {
10  global $DOCUMENT_ROOT;
11?>
12<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
13  "http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd">
14<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
15  <head>
16    <title><?php echo("$title"); ?></title>
17    <meta http-equiv="Content-type" content="text/html; charset=<?php echo("$encoding"); ?>" />
18    <meta name="author" content="Jim Mock (mij@opendarwin.org)" />
19    <meta name="copyright" content="2003, OpenDarwin" />
20    <meta name="robots" content="all" />
21    <link rel="stylesheet" type="text/css" href="/dp.css" />
22    <link rel="alternate" type="application/rss+xml" href="http://darwinports.opendarwin.org/dp.xml" />
23  </head>
24
25  <body>
26
27  <?php check_referer(); ?>
28 
29  <div id="main">
30
31<?php
32  include("$DOCUMENT_ROOT/includes/header.inc");
33}
34
35######################################################################
36
37# print the page footer
38function print_footer() {
39  global $DOCUMENT_ROOT;
40
41  include("$DOCUMENT_ROOT/includes/footer.inc");
42
43  echo "  </body>\n";
44  echo "</html>\n";
45}
46
47######################################################################
48function check_referer() {
49        global $_SERVER;
50        if (preg_match("/darwinports.com/", $_SERVER['HTTP_REFERER'])) {
51?>
52        <div class="referer_box">
53                <h1>The Official DarwinPorts Web Site</h1>
54               
55                <p>You have arrived at the <b>Official DarwinPorts Web Site</b> from <i>darwinports.com</i>.</p>
56         
57                <p><i>darwinports.com</i> <b>is not the official DarwinPorts Web Site</b>, nor is it a mirror of the <i>Official DarwinPorts Web Site</i>.  There is <b>no relationship</b> between the <i>DarwinPorts Project</i> and <i>darwinports.com</i>.</p>
58
59                <p>The information you may have been presented with on <i>darwinports.com</i> may be incorrect or outdated and is not maintained by the <i>DarwinPorts Project</i>.  For the most accurate information about DarwinPorts, please bookmark this site, <a href="http://darwinports.opendarwin.org">http://darwinports.opendarwin.org</a>.</p>
60        </div>
61
62<?php
63        }
64}       
65?>
Note: See TracBrowser for help on using the repository browser.