Skip to content

Instantly share code, notes, and snippets.

@stnadmin
Created April 16, 2015 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stnadmin/99eb13ccf4e2d18d734c to your computer and use it in GitHub Desktop.
Save stnadmin/99eb13ccf4e2d18d734c to your computer and use it in GitHub Desktop.
common.php
<?php defined( "_VALID_MOS" ) or die( "Direct Access to this location is not allowed." );
header('X-UA-Compatible: IE=Edge');
// This will turn on the StarField corner icon.
$STN_tpl['StarField'] = false;
// You can cut'n'paste the codes here.
$STN_tpl['StarField_CNP'] = <<<CNP
<span id="siteseal"><script src="https://seal.starfieldtech.com/getSeal?sealID=iT8sV1o2aQOjr8mf0UigKGyrj239Vt6uYlnCAsabbmc3jv7veAzwcix6LXM" type="text/javascript"></script></span>
CNP;
// This will allow logo hover to switch images.
// (logo.png will become logo_on.png)
$STN_tpl['logo_hover'] = false;
// Add more images to this array if you want them to be preloaded.
// (For smooth animations and hovering effects)
$STN_tpl['preload_images'] = array(
);
/**************************************************/
/**************************************************/
$STN_tpl = array_merge($STN_tpl, array (
'words' => array(
'zero',
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
'eight',
'nine'
),
));
$STN_tpl['body_id'] = 'stn-id-' . htmlattr($_REQUEST['option']);
if ($_REQUEST['option'] == 'com_virtuemart') {
$STN_tpl['classes'][] = 'stn-vm-page';
$STN_tpl['body_id'] .= '-' . htmlattr(str_replace('.', '_', $_REQUEST['page']));
}
STN::depend('SEF');
if (sefRelToAbs(SEF::getRequest()) == sefRelToAbs('/')) {
$STN_tpl['classes'][] = 'stn-homepage';
} else if ($_GET['option'] == 'com_content') {
STN::depend('SEF/ContentSEF');
if ($_GET['id'] == ContentSEF::getHomepageID()) {
$STN_tpl['classes'][] = 'stn-homepage';
}
}
function selectorize($hah) {
$hah = strtolower($hah);
$hah = preg_replace('#[^a-z]+#', '-', $hah);
$hah = trim($hah, '-');
return $hah;
}
if ($_REQUEST['option'] == 'com_content') {
STN::depend('Article', 'Section', 'Category');
$article = Article::getById($_REQUEST['id']);
$category = Category::getById($article['catid']);
$section = Section::getById($article['sectionid']);
$STN_tpl['classes'][] = selectorize('section-' . $section['name']);
$STN_tpl['classes'][] = selectorize('category-' . $category['name']);
}
$STN_tpl['classes'][] = $STN_tpl['words'][$STN_tpl['columns']] . "col";
if (is_array($STN_tpl['override'])) {
$STN_tpl = array_merge($STN_tpl, $STN_tpl['override']);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--[if IE]>
<!--[if lt IE 6]>
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn ie ie-old <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<!--[if IE 6]>
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn ie ie6 <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<!--[if IE 7]>
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn ie ie7 <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<!--[if IE 8]>
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn ie ie8 <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<!--[if gt IE 8]>
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn ie ie-gt-8 <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<![endif]-->
<!--[if !IE]> -->
<html id='<?= $STN_tpl['body_id']; ?>' lang="en" xmlns="http://www.w3.org/1999/xhtml" class="stn <?= implode(" ", $STN_tpl['classes']); ?>">
<![endif]-->
<head>
<?php if ( $my->id ) { initEditor(); } ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo "<link rel='stylesheet' href='{$mosConfig_live_site}/templates/css/reset-fonts-grids.css' type='text/css'/>" ; ?>
<?php mosShowHead(); ?>
<?php $hash = dechex(filemtime("{$GLOBALS['mosConfig_absolute_path']}/configuration.php")); ?>
<?php echo "<link rel='stylesheet' href='{$mosConfig_live_site}/templates/css/default.css?$hash' type='text/css'/>" ; ?>
<?php if(false) { /*This is for Dreamweaver, do not delete */?>
<link href="css/reset-fonts-grids.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<?php } ?>
<?php echo "<link rel='shortcut icon' href='{$mosConfig_live_site}/images/favicon.ico' />" ; ?>
<script type="text/javascript" src="<?= $mosConfig_live_site ?>/templates/js/modernizr.js"></script>
<link rel="stylesheet" type="text/css" href="css/<?= strtolower(date('M'))?>.css" id="monthCSS"/>
</head>
<body class="stn">
<div id="custom-doc" class="yui-t2 stn-doc">
<div id="hd">
<a id="logo" href="<?= $mosConfig_live_site ?>"><img src="<?= $mosConfig_live_site ?>/templates/images/logo.png" /></a>
<div id="login-cart"><?php mosLoadModules('login-cart', -2); ?></div>
<div id="pos-header"><?php mosLoadModules('header', -2); ?></div>
<div id="infoheader"><?php mosLoadModules('banner-h', -2); ?></div>
</div>
<?php STN_body() ?>
<?php if(false) {?>
<!--#include file="template_2col/index.php" -->
<?php } ?>
<div id="ft">
<div id="site-footer">
<?php mosLoadModules('bottom', -2); ?>
</div>
<div id="stn-footer">
<?php include_once($mosConfig_absolute_path."/includes/footer.php"); ?>
</div>
</div>
</div>
<div id="debug">
<?php mosLoadModules ( 'debug', -2 ); ?>
</div>
<script type='text/javascript'>
STN.init(
<?php
echo json_encode($STN_tpl['preload_images']);
if ($STN_tpl['logo_hover']) {
echo ', "logo"';
}
?>
);
</script>
<?php if ($STN_tpl['StarField']): ?>
<?= $STN_tpl['StarField_CNP'] ?>
<div id="cornerssl">
</div>
<style type="text/css">
#siteseal img{
position:fixed;
right:5px;
bottom:30px;
z-index:1000;
}
#cornerssl{
position:fixed;
right:0;
bottom:0;
background-image:url('templates/images/ssl-cert-frame.gif');
width:141px;
height:123px;
cursor:pointer;
}
</style>
<script type="text/javascript">
YAHOO.util.Event.onDOMReady(function () {
YAHOO.util.Event.addListener(
document.getElementById('cornerssl'),
'click',
verifySeal
);
});
</script>
<?php endif; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment