Browse Source

Fix the content manager title so that it works with the html title again.

Mark Crane 13 years ago
parent
commit
f26363064a
2 changed files with 15 additions and 22 deletions
  1. 0 1
      includes/footer.php
  2. 15 21
      includes/header.php

+ 0 - 1
includes/footer.php

@@ -70,7 +70,6 @@ require_once "includes/require.php";
 	require_once "includes/menu.php";
 	require_once "includes/menu.php";
 
 
 //prepare the template to display the output
 //prepare the template to display the output
-	$custom_title = '';
 	$custom_head = '';
 	$custom_head = '';
 	$output = str_replace ("<!--{title}-->", $custom_title, $template); //<!--{title}--> defined in each individual page
 	$output = str_replace ("<!--{title}-->", $custom_title, $template); //<!--{title}--> defined in each individual page
 	$output = str_replace ("<!--{head}-->", $custom_head, $output); //<!--{head}--> defined in each individual page
 	$output = str_replace ("<!--{head}-->", $custom_head, $output); //<!--{head}--> defined in each individual page

+ 15 - 21
includes/header.php

@@ -66,7 +66,7 @@ require_once "includes/require.php";
 	ob_start();
 	ob_start();
 
 
 // get the content
 // get the content
-	if (isset($content)) {
+	if (isset($_GET["c"])) {
 		$content = $_GET["c"]; //link
 		$content = $_GET["c"]; //link
 	}
 	}
 	else {
 	else {
@@ -74,8 +74,7 @@ require_once "includes/require.php";
 	}
 	}
 
 
 //get the parent id
 //get the parent id
-	$sql = "";
-	$sql .= "select * from v_menu_items ";
+	$sql = "select * from v_menu_items ";
 	$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
 	$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
 	$sql .= "and menu_item_link = '".$_SERVER["SCRIPT_NAME"]."' ";
 	$sql .= "and menu_item_link = '".$_SERVER["SCRIPT_NAME"]."' ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement = $db->prepare(check_sql($sql));
@@ -88,8 +87,7 @@ require_once "includes/require.php";
 	unset($result);
 	unset($result);
 
 
 //get the content
 //get the content
-	$sql = "";
-	$sql .= "select * from v_rss ";
+	$sql = "select * from v_rss ";
 	$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
 	$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
 	$sql .= "and rss_category = 'content' ";
 	$sql .= "and rss_category = 'content' ";
 	if (strlen($content) == 0) {
 	if (strlen($content) == 0) {
@@ -98,34 +96,30 @@ require_once "includes/require.php";
 	else {
 	else {
 		$sql .= "and rss_link = '".$content."' ";
 		$sql .= "and rss_link = '".$content."' ";
 	}
 	}
-	$sql .= "and length(rss_del_date) = 0 ";
-	$sql .= "or domain_uuid = '$domain_uuid' ";
-	$sql .= "and rss_category = 'content' ";
-	if (strlen($content) == 0) {
-		$sql .= "and rss_link = '".$_SERVER["PHP_SELF"]."' ";
-	}
-	else {
-		$sql .= "and rss_link = '".$content."' ";
-	}
-	$sql .= "and rss_del_date is null ";
+	$sql .= "and (length(rss_del_date) = 0 ";
+	$sql .= "or rss_del_date is null) ";
 	$sql .= "order by rss_order asc ";
 	$sql .= "order by rss_order asc ";
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement = $db->prepare(check_sql($sql));
 	$prep_statement->execute();
 	$prep_statement->execute();
 	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
 	$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
 	$result_count = count($result);
 	$result_count = count($result);
 
 
-	$customtitle = '';
+	$custom_title = '';
 	foreach($result as $row) {
 	foreach($result as $row) {
-		$template_rss_sub_category = $row[rss_sub_category];
-		if (strlen($row[rss_group]) == 0) {
+		$template_rss_sub_category = $row['rss_sub_category'];
+		if (strlen($row['rss_group']) == 0) {
 			//content is public
 			//content is public
-			$content_from_db = &$row[rss_description];
-			$customtitle = $row[rss_title];
+			$content_from_db = &$row['rss_description'];
+			if (strlen($row['rss_title']) > 0) {
+				$custom_title = $row['rss_title'];
+			}
 		}
 		}
 		else {
 		else {
 			if (if_group($row[rss_group])) { //viewable only to designated group
 			if (if_group($row[rss_group])) { //viewable only to designated group
 				$content_from_db = &$row[rss_description];
 				$content_from_db = &$row[rss_description];
-				$customtitle = $row[rss_title];
+				if (strlen($row['rss_title']) > 0) {
+					$custom_title = $row['rss_title'];
+				}
 			}
 			}
 		}
 		}
 	} //end foreach
 	} //end foreach