include_once ("_filter.php");
// pulls constitution section and link number from url parameters
$constsection= $_GET["const"];
$linkstring=$_GET["link"];
// conditional to set variables should user hit page without them
if (($constsection == "") AND ($linkstring == "")) {
$constsection = "00_pre_00";
$linkstring = "003";
}
// conditional to default content type to explanation, else set it to content type called for
if ($active == "") {
$activetype="explain";
}
else {
$activetype=$_GET["active"];
}
// check referrer and see if user is coming from search results page
$ref = getenv('HTTP_REFERER');
$parts = explode("/", $ref);
$size = (count($parts)-1);
$page = $parts[$size];
// if user coming from search results, and search type was premade (published by CMS),
// set the back to search link appropriately
if (strstr($ref, "/results_") != "") {
$backtosearchlink = $page;
$searchtype = "premade";
$replacer = substr($page, strlen("results_"), (strlen($page)-strlen("results_")-strlen(".html")));
$explanationkw3 = str_replace( "%27", "'", $replacer );
$explanationkw2 = str_replace( "_", " ", $explanationkw3 );
$explanationkw = str_replace( "%2C", ",", $explanationkw2 );
// js workaround for terms with ' in them
$explanationkw_js = str_replace( "'", "", $explanationkw );
}
// condition for user continuing on with search term present - either keyword or premade
if ($searchlink != "") {
if (strstr($searchlink, "results_") == "") {
$searchtype = "keyword";
$explanationkw4 = str_replace( "\\", "", $searchlink );
$explanationkw3 = str_replace( "%27", "'", $explanationkw4 );
$explanationkw2 = str_replace( "_", " ", $explanationkw3 );
$explanationkw = str_replace( "+", " ", $explanationkw2 );
// js workaround for terms with ' in them
$explanationkw_js = str_replace( "'", "", $explanationkw );
$backtosearchlink = urlencode($explanationkw);
}
else {
$searchtype = "premade";
$replacer3 = substr($searchlink, strlen("results_"), (strlen($searchlink)-strlen("results_")-strlen(".html")));
$explanationkw4 = str_replace( "\\", "", $replacer3 );
$explanationkw3 = str_replace( "_", " ", $explanationkw4 );
$explanationkw2 = str_replace( "%27", "'", $explanationkw3 );
$explanationkw = str_replace( "+", " ", $explanationkw2 );
// js workaround for terms with ' in them
$explanationkw_js = str_replace( "'", "", $explanationkw );
$backtosearchlink = $searchlink;
}
}
// condition for user coming from keyword search page
if ($keyword != "") {
$searchtype = "keyword";
$explanationkw3 = str_replace( "%27", "'", $keyword );
$explanationkw2 = str_replace( "\\", "", $explanationkw3 );
$explanationkw = str_replace( "+", " ", $explanationkw2 );; // used to pass the first kw to subnav (highlight.php)
// js workaround for terms with ' in them
$explanationkw_js = str_replace( "'", "", $explanationkw );
$backtosearchlink = urlencode($explanationkw);
}
// noting that user came in via flash nav
if ((strstr($ref, "/results_") == "") AND ($searchlink == "") AND ($keyword == "")) {
$flash_referred = 'yes';
}
// array to define section names and start link for each section
$get_section = substr($constsection, 0, 2);
define("TB_SNAME",0);
define("TB_START",1);
define("RATIFIED_DATE",2);
$sections = array(
'00' => array("Preamble","003","September 17th, 1787"),
'01' => array("Article I","010","September 17th, 1787"),
'02' => array("Article II","069","September 17th, 1787"),
'03' => array("Article III","091","September 17th, 1787"),
'04' => array("Article IV","099","September 17th, 1787"),
'05' => array("Article V","108","September 17th, 1787"),
'06' => array("Article VI","112","September 17th, 1787"),
'07' => array("Article VII","116","September 17th, 1787"),
'08' => array("Amendment I","120","December 15, 1791"),
'09' => array("Amendment II","126","December 15, 1791"),
'10' => array("Amendment III","129","December 15, 1791"),
'11' => array("Amendment IV","132","December 15, 1791"),
'12' => array("Amendment V","135","December 15, 1791"),
'13' => array("Amendment VI","141","December 15, 1791"),
'14' => array("Amendment VII","148","December 15, 1791"),
'15' => array("Amendment VIII","151","December 15, 1791"),
'16' => array("Amendment IX","154","December 15, 1791"),
'17' => array("Amendment X","157","December 15, 1791"),
'18' => array("Amendment XI","160","February 7, 1795"),
'19' => array("Amendment XII","162","June 15, 1804"),
'20' => array("Amendment XIII","168","December 6, 1865"),
'21' => array("Amendment XIV","171","July 9, 1868"),
'22' => array("Amendment XV","182","February 3, 1870"),
'23' => array("Amendment XVI","185","February 3, 1913"),
'24' => array("Amendment XVII","187","April 8, 1913"),
'25' => array("Amendment XVIII","191","January 16, 1919"),
'26' => array("Amendment XIX","195","August 18, 1920"),
'27' => array("Amendment XX","197","January 23, 1933"),
'28' => array("Amendment XXI","204","December 5, 1933"),
'29' => array("Amendment XXII","208","February 27, 1951"),
'30' => array("Amendment XXIII","211","March 29, 1961"),
'31' => array("Amendment XXIV","214","January 23, 1964"),
'32' => array("Amendment XXV","216","February 10, 1967"),
'33' => array("Amendment XXVI","222","July 1, 1971"),
'34' => array("Amendment XXVII","224","May 7, 1992"),
);
$section_name = $sections[$get_section][TB_SNAME];
$section_intro = $sections[$get_section][TB_START];
$section_ratified = $sections[$get_section][RATIFIED_DATE];
?>
National Constitution Center: Interactive Constitution
if ($filter == 'on') {
print(" ");
}
?>
if ($filter == 'on') {
print("");
}
?>
require("js/flash_check_scripts_search.html"); ?>
if ((strstr($ref, "/results_") == "") AND ($searchlink == "") AND ($keyword == "")) {
print("\n");
}
?>