<?php
// $Id: metadata.php,v 1.15 2004/02/13 14:33:41 prazgod Exp $
/**
* Metadata code
* @package Mambo Open Source
* @Copyright (C) 2000 - 2003 Miro International Pty Ltd
* @ All rights reserved
* @ Mambo Open Source is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version $Revision: 1.15 $
* @todo Must make the record level meta information an include rather than hardcoded
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

function showMeta( &$database, $option ) {
	global $mosConfig_MetaDesc, $mosConfig_MetaKeys, $mosConfig_live_site, $mosConfig_sef;

	$pageKeys = '';
	$pageDesc = '';

	if ($option == 'content') {
		$id = mosGetParam( $_REQUEST, 'id', 0 );
		if ($id) {
			$row = new mosContent( $database );
			$row->load( $id );
			$pageKeys = $row->metakey;
			$pageDesc = $row->metadesc;
		}
	}

    if ($mosConfig_MetaDesc) {
    ?>
        <meta name="description" content="<?php echo "$mosConfig_MetaDesc ,$pageDesc";?>" />
    <?php
    }

    if ($mosConfig_MetaKeys) {
    ?>
        <meta name="keywords" content="<?php echo "$mosConfig_MetaKeys, $pageKeys";?>" />
    <?php
    }

	if (isset($mosConfig_sef) && $mosConfig_sef) {
		echo "<base href=\"$mosConfig_live_site/\" />\r\n";
	}
}

showMeta( $database, $option );

if ($my->id) { ?>
<script language="JavaScript1.2" src="<?php echo $mosConfig_live_site;?>/includes/js/rollover.js" type="text/javascript"></script>
<script language="JavaScript1.2" src="<?php echo $mosConfig_live_site;?>/includes/js/mambojavascript.js" type="text/javascript"></script>
<?php
}
?>