Example #1
0
function replaceTemplateValues($string, $siteid, $page_title)
{
    $db = Database::obtain();
    $sql = "SELECT * FROM " . TABLE_WEBSITES . "\n\t\t\t\t\tWHERE `id` =" . $siteid . "";
    $websitedata = $db->query_first($sql);
    $website_template = $websitedata['website_template'];
    $website_protect_value = $websitedata['website_protect'];
    $website_name = $websitedata['website_name'];
    $meta_description = $websitedata['website_description'];
    $meta_keywords = $websitedata['website_keywords'];
    $creator_name = $websitedata['creator_name'];
    $creator_website = $websitedata['creator_website'];
    $website_template = $websitedata['website_template'];
    $default_file_extension = '.html';
    if (isUser($_SESSION['userid']) or isActive($_SESSION['userid']) == false) {
        $website_footer = MSG00010 . ' <a href ="' . szUrl() . '" >' . szName() . '</a> - ' . MSG00082 . ' ' . szYear() . ' ' . $website_name . '. ' . MSG00057 . ' ';
    } else {
        $website_footer = MSG00009 . ' <a href="http://' . $creator_website . '" target="_blank" alt="' . $creator_name . '" title="' . $creator_name . '">' . $creator_name . '</a> - ' . MSG00082 . ' ' . szYear() . ' ' . $website_name . '. ' . MSG00057 . ' ';
    }
    $meta_generator_name = szName();
    $meta_language = szLanguage();
    if ($website_protect_value == '1') {
        $website_protect = protectSite();
    } else {
        $website_protect = '';
    }
    $website_header = '
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>' . $page_title . ' - ' . $website_name . '</title>
		<meta name="description" content="' . $meta_description . '">
		<meta name="keywords" content="' . $meta_keywords . '">
		<meta http-equiv="Copyright" content="' . $website_name . '" />
		<meta name="generator" content="' . $meta_generator_name . '" />
		<meta http-equiv="content-language" content="' . $meta_language . '" />
		<meta name="robots" content="index, follow" />
		<link rel="shortcut icon" href="favicon.ico"/>
		<link href="sitezilla.css" rel="stylesheet" type="text/css">
		<link href="templates/' . $website_template . '/style.css" rel="stylesheet" type="text/css">
		' . ie6Css($website_template) . ie7Css($website_template) . $website_protect . '';
    $webauthor = getAuthor($website_template);
    if ($webauthor == MSG00007) {
        $author = '';
    } else {
        if (strlen(stristr($webauthor, szCompany())) > 0) {
            $author = '';
        } else {
            $author = '&nbsp;' . MSG00008 . ' ' . $webauthor;
        }
    }
    $placeholders = array('WEBSITE_HEADER', 'WEBSITE_NAME', 'WEBSITE_FOOTER', 'TEMPLATE_AUTHOR');
    $new_vals = array($website_header, '<a href="index' . $default_file_extension . '" alt="' . $website_name . '" title="' . $website_name . '">' . $website_name . '</a>', $website_footer, $author);
    $newString = str_replace($placeholders, $new_vals, $string);
    return $newString;
}
Example #2
0
echo sz_config('name');
?>
 will automatically replace <strong>WEBSITE_FOOTER</strong> with <code>Website created with <a href="<?php 
echo szUrl();
?>
" alt="<?php 
echo sz_config('name');
?>
" title="<?php 
echo sz_config('name');
?>
"><?php 
echo sz_config('name');
?>
</a> -  Copyright &copy <?php 
echo szYear();
?>
 Website Name</code>. Templates that do not provide the <strong>WEBSITE_FOOTER</strong> placeholder will be modified before being made available in <?php 
echo sz_config('name');
?>
. An example of an acceptable footer is:<br><br>

<strong>&lt;div id="footer"&gt;</strong><br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;WEBSITE_FOOTER&lt;br&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;TEMPLATE_AUTHOR/p&gt;<br>
<strong>&lt;/div&gt;</strong>
<br><br>

<strong>TEMPLATE_AUTHOR</strong> will be replaced by:<br>
'- Template by ' and the content in <strong>author.php</strong> which will produce a full link. Example:<br><br>
- Template by &lt;a href="http://www.youwebsite.domain" target="_blank" alt="Your Name" title="Your Name"&gt;Your Name&lt;/a&gt;<br>