<commit_before><?php
	#
	# $Id: freshports.php,v 1.4.2.241 2006-01-07 21:29:11 dan Exp $
	#
	# Copyright (c) 1998-2006 DVL Software Limited
	#

	require_once($_SERVER['DOCUMENT_ROOT'] . '/include/constants.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/include/burstmedia.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/../configuration/freshports.conf.php');

	if (IsSet($ShowAnnouncements)) {
		require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/announcements.php');
	}
#
# special HTMLified mailto to foil spam harvesters
#
DEFINE('MAILTO',                '&#109;&#97;&#105;&#108;&#116;&#111;');
DEFINE('COPYRIGHTYEARS',        '2000-2006');
DEFINE('URL2LINK_CUTOFF_LEVEL', 0);
DEFINE('FAQLINK',               'faq.php');
DEFINE('PORTSMONURL',			'http://portsmon.freebsd.org/portoverview.py');
DEFINE('NOBORDER',              '0');
DEFINE('BORDER',                '1');

DEFINE('MESSAGE_ID_OLD_DOMAIN', '@freshports.org');
DEFINE('MESSAGE_ID_NEW_DOMAIN', '@dev.null.freshports.org');

DEFINE('UNMAINTAINTED_ADDRESS', '<EMAIL>');

DEFINE('BACKGROUND_COLOUR', '#8c0707');


if ($Debug) echo "'" . $_SERVER['DOCUMENT_ROOT'] . '/../classes/watchnotice.php<BR>';

require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/watchnotice.php');

function freshports_MainTable() {
	GLOBAL $TableWidth;

	return '<TABLE WIDTH="' . $TableWidth . '" BORDER="0">
';
}

function freshports_MainContentTable($Border=1, $ColSpan=1) {
	return '<TABLE WIDTH="100%" border="' . $Border . '" CELLSPACING="0" CELLPADDING="8">
' . PortsFreezeStatus($ColSpan);
}

function  freshports_ErrorContentTable() {
	echo '<TABLE WIDTH="100%" BORDER="1" ALIGN="center" CELLPADDING="1" CELLSPACING="0">
';
}


function PortsFreezeStatus($ColSpan=1) {
	#
	# this function checks to see if there is a port freeze on.
	# if there is, it returns text that indicates same.
	# otherwise, it returns an empty string.
	#
	$result = '';

	if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/../dynamic/PortsFreezeIsOn")) {
		$result = '
<tr>' . freshports_PageBannerText('There is a PORTS FREEZE in effect!', $ColSpan) . '</tr>
<tr><td';
		if ($ColSpan > 1) {
			$result .= ' colspan="' . $ColSpan . '"';
		}
		$result .= '>
<p>A <a href="http://www.freebsd.org/doc/en/articles/committers-guide/ports.html#AEN1395">ports freeze</a>
 means that commits will be few and far between and only by approval.
</p>
</td></tr>
';
	}

	return $result;
}


function freshports_link_to_port($CategoryName, $PortName) {

	$HTML = '';
	$HTML .= '<a href="/' . $CategoryName . '/">' . $CategoryName . '</a>/';
	$HTML .= '<a href="/' . $CategoryName . '/' . $PortName . '/">' 
	            . $PortName . '</a>';

	return $HTML;
}

#
# These are the pages which take NOINDEX and NOFOLLOW meta tags
#


function freshports_IndexFollow($URI) {
	$NOINDEX["/index.php"]				= 1;
	$NOINDEX["/date.php"]				= 1;

	$NOINDEX['/ports-broken.php']		= 1;
	$NOINDEX['/ports-deleted.php']		= 1;
	$NOINDEX['/ports-forbidden.php']	= 1;
	$NOINDEX['/ports-deprecated.php']	= 1;
	$NOINDEX['/ports-ignore.php']		= 1;
	$NOINDEX['/ports-new.php']			= 1;

	$NOFOLLOW["/date.php"]				= 1;
	$NOFOLLOW['/ports-deleted.php']		= 1;
	$NOFOLLOW['/graphs.php']			= 1;
	$NOFOLLOW['/ports-deleted.php']		= 1;
	$NOFOLLOW['/commit.php']		= 1;

	# well, OK, so it may not be a URI... but it's close

	$HTML = '';

	GLOBAL $g_NOFOLLOW;
	GLOBAL $g_NOINDEX;

	$l_NoFollow = 0;
	$l_NoIndex  = 0;

	if (IsSet($NOFOLLOW[$URI]) || $g_NOFOLLOW) $l_NoFollow = 1;
	if (IsSet($NOINDEX[$URI])  || $g_NOINDEX)  $l_NoIndex  = 1;

	if ($l_NoFollow || $l_NoIndex) {
		$HTML .= '	<meta name="robots" content="';
		if ($l_NoIndex) {
			$HTML .= 'noindex';
			if ($l_NoFollow) {
				$HTML .= ',';
			}
		}

		if ($l_NoFollow) {<commit_msg>Allow index.php to be indexed. Don't index new-user.php and login.php<commit_after><?php
	#
	# $Id: freshports.php,v 1.4.2.242 2006-01-24 18:38:12 dan Exp $
	#
	# Copyright (c) 1998-2006 DVL Software Limited
	#

	require_once($_SERVER['DOCUMENT_ROOT'] . '/include/constants.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/include/burstmedia.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/../configuration/freshports.conf.php');

	if (IsSet($ShowAnnouncements)) {
		require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/announcements.php');
	}
#
# special HTMLified mailto to foil spam harvesters
#
DEFINE('MAILTO',                '&#109;&#97;&#105;&#108;&#116;&#111;');
DEFINE('COPYRIGHTYEARS',        '2000-2006');
DEFINE('URL2LINK_CUTOFF_LEVEL', 0);
DEFINE('FAQLINK',               'faq.php');
DEFINE('PORTSMONURL',			'http://portsmon.freebsd.org/portoverview.py');
DEFINE('NOBORDER',              '0');
DEFINE('BORDER',                '1');

DEFINE('MESSAGE_ID_OLD_DOMAIN', '@freshports.org');
DEFINE('MESSAGE_ID_NEW_DOMAIN', '@dev.null.freshports.org');

DEFINE('UNMAINTAINTED_ADDRESS', '<EMAIL>');

DEFINE('BACKGROUND_COLOUR', '#8c0707');


if ($Debug) echo "'" . $_SERVER['DOCUMENT_ROOT'] . '/../classes/watchnotice.php<BR>';

require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/watchnotice.php');

function freshports_MainTable() {
	GLOBAL $TableWidth;

	return '<TABLE WIDTH="' . $TableWidth . '" BORDER="0">
';
}

function freshports_MainContentTable($Border=1, $ColSpan=1) {
	return '<TABLE WIDTH="100%" border="' . $Border . '" CELLSPACING="0" CELLPADDING="8">
' . PortsFreezeStatus($ColSpan);
}

function  freshports_ErrorContentTable() {
	echo '<TABLE WIDTH="100%" BORDER="1" ALIGN="center" CELLPADDING="1" CELLSPACING="0">
';
}


function PortsFreezeStatus($ColSpan=1) {
	#
	# this function checks to see if there is a port freeze on.
	# if there is, it returns text that indicates same.
	# otherwise, it returns an empty string.
	#
	$result = '';

	if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/../dynamic/PortsFreezeIsOn")) {
		$result = '
<tr>' . freshports_PageBannerText('There is a PORTS FREEZE in effect!', $ColSpan) . '</tr>
<tr><td';
		if ($ColSpan > 1) {
			$result .= ' colspan="' . $ColSpan . '"';
		}
		$result .= '>
<p>A <a href="http://www.freebsd.org/doc/en/articles/committers-guide/ports.html#AEN1395">ports freeze</a>
 means that commits will be few and far between and only by approval.
</p>
</td></tr>
';
	}

	return $result;
}


function freshports_link_to_port($CategoryName, $PortName) {

	$HTML = '';
	$HTML .= '<a href="/' . $CategoryName . '/">' . $CategoryName . '</a>/';
	$HTML .= '<a href="/' . $CategoryName . '/' . $PortName . '/">' 
	            . $PortName . '</a>';

	return $HTML;
}

#
# These are the pages which take NOINDEX and NOFOLLOW meta tags
#


function freshports_IndexFollow($URI) {
#	$NOINDEX["/index.php"]				= 1;
	$NOINDEX["/date.php"]				= 1;

	$NOINDEX['/ports-broken.php']		= 1;
	$NOINDEX['/ports-deleted.php']		= 1;
	$NOINDEX['/ports-forbidden.php']	= 1;
	$NOINDEX['/ports-deprecated.php']	= 1;
	$NOINDEX['/ports-ignore.php']		= 1;
	$NOINDEX['/ports-new.php']			= 1;

	$NOFOLLOW["/date.php"]				= 1;
	$NOFOLLOW['/ports-deleted.php']		= 1;
	$NOFOLLOW['/graphs.php']			= 1;
	$NOFOLLOW['/ports-deleted.php']		= 1;
	$NOFOLLOW['/commit.php']			= 1;

	$NOFOLLOW['/new-user.php']			= 1;
	$NOFOLLOW['/login.php']				= 1;


	# well, OK, so it may not be a URI... but it's close

	$HTML = '';

	GLOBAL $g_NOFOLLOW;
	GLOBAL $g_NOINDEX;

	$l_NoFollow = 0;
	$l_NoIndex  = 0;

	if (IsSet($NOFOLLOW[$URI]) || $g_NOFOLLOW) $l_NoFollow = 1;
	if (IsSet($NOINDEX[$URI])  || $g_NOINDEX)  $l_NoIndex  = 1;

	if ($l_NoFollow || $l_NoIndex) {
		$HTML .= '	<meta name="robots" content="';
		if ($l_NoIndex) {
			$HTML .= 'noindex';
			if ($l_NoFollow) {
				$HTML .= ',';
			}
		}

		if ($l_NoFollow) {
{'fraction_non_alphanumeric': 0.20680559219203376, 'fraction_numerical': 0.02637826431020839, 'mean_word_length': 3.8796653796653797, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7380942', 'n_tokens_mistral': 3247, 'n_tokens_neox': 2902, 'n_words': 547}