Return to Snippet

Revision: 10330
at December 19, 2008 11:24 by conspirator


Updated Code
<?php
// USED WITH ACCRISOFT FREEDOM
// USED TO PULL PAGE_TITLE_OVERRIDE, BUT DEFAULT TO PAGE TITLE WHEN EMPTY
// MUST HAVE CREATED A TAG FIRST!!! [[tag.page_title_override]]
// WRAPPED IN GENDOCS CONDITIONAL

	if  ($_REQUEST['src'] == 'gendocs') {

		$x_sql = "SELECT metatags FROM gendocs WHERE keywords = '{$_REQUEST['ref']}' LIMIT 1 ";
		$x_result = mysql_query($x_sql);
		$x_row = mysql_fetch_array($x_result);
		$x_lines = split("\n", $x_row['metatags']);
		foreach($x_lines as $x_line) {
			if (strstr ($x_line, 'Page_Title_Override')) {
				list($null, $x_title) = split("=", $x_line);
			}
		}

		if ($x_title == '') {
?>
			<title>Grand Oak | [[Page_Title]]</title>
<?php
		} else {
			echo "<title>Grand Oak | {$x_title}</title>";
		}
	} else {
?>
		<title>Grand Oak | [[Page_Title]]</title>
<?php
	}
?>

Revision: 10329
at December 19, 2008 11:13 by conspirator


Initial Code
<?php
// USED WITH GOLDEN TO PULL OVERRIDE PAGE_TITLE_OVERRIDE, BUT DEFAULT TO PAGE TITLE WHEN EMPTY
// MUST HAVE CREATED A TAG FIRST!!!
// [[tag.page_title_override]]


$x_sql = "SELECT metatags FROM gendocs WHERE keywords = '{$_REQUEST['ref']}' LIMIT 1 ";
$x_result = mysql_query($x_sql);
$x_row = mysql_fetch_array($x_result);
$x_lines = split("n", $x_row['metatags']);
foreach($x_lines as $x_line) {
	if (strstr ($x_line, 'Page_Title_Override')) {
		list($null, $x_title) = split("=", $x_line);
	}
}

if ($x_title == '') {
?>
	<title>Grand Oak | [[Page_Title]]</title>
<?php
} else {
	echo "<title>Grand Oak | {$x_title}</title>";
}

?>

Initial URL

                                

Initial Description

                                

Initial Title
accrisoft freedom page title override - php

Initial Tags
php, textmate, page

Initial Language
Other