Location: PHPKode > scripts > TinyWebGallery > twg188/inc/head.inc.php
<?php
/*************************
Copyright (c) 2004-2012 TinyWebGallery
  written by Michael Dempfle
 
  This program is free software; you can redistribute it and/or modify 
  it under the terms of the TinyWebGallery license (based on the GNU  
  General Public License as published by the Free Software Foundation;  
  either version 2 of the License, or (at your option) any later version. 
  See license.txt for details.
 
  TWG version: 1.8.8
 
$Date: 2009-06-17 22:57:10 +0200 (Mi, 17 Jun 2009) $
$Revision: 73 $
 **********************************************/

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

$optimize_array = array();

if (!$php_include) {
    header('P3P: CP="ADMa PSAa PSDa IVAa CONi OUR IND ONL COM NAV INT DEM CNT STA PRE DSP OTI COR"');
    $ie_height_iframe_fix = $msie && $iframe_include && ($twg_standalone == "");
    if ($ie_height_iframe_fix) {
        // I actually tried all doctypes - IE sucks with all in an iframe!  // "http://www.w3.org/TR/html4/strict.dtd"
        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
        $use_round_corners = false;
    } else {
        echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
    }
    echo '
<html>
';
}

?>
<!--
Powered by TinyWebGallery 1.8.8
Please go to http://www.tinywebgallery.com for the latest version.

Please don't remove this header if you use TWG or a modified version of it!

Copyright (c) 2004-2012 TinyWebGallery written by Michael Dempfle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-->
<?php

if (!$php_include) {
    echo '
<head>
';
}

?>
<?php
if (!$php_include) {

    if ($top10_type) {
        $browser_title_prefix .= " - " . $top10_type;
    }

    if ($image && !$input_invalid) {
        // this is the basic one - it is later improved when the title is read - but for robots a goot title has to exist
        $image_title = removeTitleChars(removeExtension($image)); 
        if ($filesystem_encoding == '') {
           $image_title =  utf8_encode($image_title);
        } 
        echo '<title>' . $browser_title_prefix . ' - ' . $image_title . '</title>';
    } else if ($twg_album && !$input_invalid) {
        $image_title = removeTitleChars($twg_album);
        if ($filesystem_encoding == '') {
           $image_title =  utf8_encode($image_title);
        } 
        echo '<title>' . $browser_title_prefix . ' - ' . $image_title . '</title>';
    } else {
        echo '<title>' . $browser_title_prefix . '</title>';
    }
    echo '
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="author" content="Michael Dempfle" >
<meta name="DC.Identifier" content="http://www.tinywebgallery.com" >
<!-- Use IE7 mode -->
';
    if ($use_ie_compability_mode) {
        echo '
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="X-UA-Compatible" content="IE=8">';
    }
    $image_meta = htmlspecialchars(utf8_decode($image), ENT_QUOTES);
    $album_meta = htmlspecialchars(utf8_decode($twg_album), ENT_QUOTES);

    if (!$input_invalid) {
        if ($metatags == "" && !$twg_album) { // if no metatags are provided and we have no image we use default
            $meta = trim($image_meta . ',' . $album_meta, " ,");
            echo'<meta name="keywords" content="' . $meta . ',TinyWebGallery, twg, photo album, gallery, image gallery, galerie" >';
        } else {
            $meta = trim($image_meta . ',' . $album_meta . ',' . $metatags, " ,");
            echo '<meta name="keywords" content="' . $meta . '" >';
        }
    }
    if ($metadescription == '' && !$image && !$twg_album) { // if no metatags are provided we use default
        if ($default_language != 'de') {
            echo '<meta name="description" lang="en" content="TinyWebGallery is a free php/xml based photo album / gallery that is very easy to install, extremely user friendly and has many unique features.">';
        } else {
            echo '<meta name="description" lang="de" content="TinyWebGallery ist eine freie php/xml Galerie, die einfach zu installieren, extrem benutzerfreundlich ist und viele Features hat, die man sonst vergeblich sucht.">';
        }
    } else if ($metadescription == '' && $image && $twg_album) {
        if ($default_language != 'de') {
            echo '<meta name="description" lang="en" content="This image is in the folder ' . $album_meta . ' and has the name ' . $image_meta . '" >';
        } else {
            echo '<meta name="description" lang="de" content="Dieses Bild ist im Ordner ' . $album_meta . ' und hat den Namen ' . $image_meta . '" >';
        }
    } else if ($metadescription == '' && !$image) {
        if ($default_language != 'de') {
            echo '<meta name="description" lang="en" content="This is the thumbnail page of  the folder ' . $album_meta . '." >';
        } else {
            echo '<meta name="description" lang="de" content="Dies ist die Übersichtsseite des Ordners ' . $album_meta . '." >';
        }
    } else { // There is a meta description set
        $meta = trim($image_meta . ',' . $album_meta, " ,");
        echo '
  <meta name="description" content="' . $metadescription . " - " . $meta . '" >';
    }
    echo '
<meta name="robots" content="index,follow,all">
';
}
if (isset($charset)) {
    echo '<META http-equiv="Content-Type" content="text/html; charset=' . $charset . '">';
}

if ($support_piclens && !$image) {
    $plfile = ($privatelogin == "FALSE") ? $cachedir . "/all_pl.rss" : $cachedir . "/all_pl_" . md5($privatelogin) . ".rss";
    if (file_exists($plfile)) {
        echo '
    <link rel="alternate" href="' . $plfile . '" type="application/rss+xml" title="" id="gallery" />';
    }
}

?>

<?php
printCss('<style type="text/css">#div1{height:' . $menu_pic_size_y . 'px;width:' . $menu_pic_size_x . 'px;text-align:center;}</style>', true);
printCss('css/style-min.css');
printCss('language/language_flags-min.css');
if ($msie) {
    printCss('css/style_ie-min.css');
}
if ($wii) {
    printCss('css/style_wii.css');
}

if (file_exists($install_dir . 'buttons/iconsets/' . $icon_set . '/style.css')) {
    printCss('buttons/iconsets/' . $icon_set . '/style.css');
}

?>
<link rel="shortcut icon" href="<?php echo $install_dir ?>favicon.ico" type="image/ico">
<link rel="icon" href="<?php echo $install_dir ?>favicon.ico">
<?php
if ($activate_lightbox_topx || $activate_lightbox_thumb || ($activate_lightbox_image && $enable_download)) {

    if ($use_lytebox) {
        printCss('lightbox/lytebox-min.css');
    } else {
        printCss('lightbox/css/lightbox-min.css');
        if ($msie) {
            printCss('lightbox/css/lightbox_ie-min.css');
        }
    }
}

// this stylesheet adds the border to the image gallery
if ($myborder == 'TRUE' && !$default_is_fullscreen) {
   printCss('css/framestyle-min.css');
}
// this stylesheet if for language dependant stylesheet for different font sizes!
/*
$cssname = $install_dir . "language/language_" . $default_language . "_style.css";
if (file_exists($cssname)) {
  echo '<link rel="stylesheet" type="text/css" href="' . $cssname . '" >';
}
*/

if (file_exists($install_dir . 'skins/' . $skin . '.css')) {
    printCss('skins/' . $skin . '.css');
}

// additional stylesheet if no border is displayed!
if ($show_border != 'TRUE' && file_exists($install_dir . "skins/" . $skin . "_noborder.css")) {
    printCss('skins/' . $skin . '_noborder.css');
    $use_round_corners = false;
}

if ($use_round_corners && file_exists($install_dir . "skins/" . $skin . "_round.css")) {
    printCss('skins/' . $skin . '_round.css');
}

if (file_exists($install_dir . 'my_style.css')) {
    printCss('my_style.css');
}
if ($msie && file_exists($install_dir . "my_style_ie.css")) {
    printCss('my_style_ie.css');
}

if ($d && $enable_album_tree) {
    printCss('dtree/dtree-min.css');
}

if (!$php_include) {
    if ($ie_height_iframe_fix) {
        printCss('<style type="text/css">td.twg_info {height: 89%;}</style>', true);
    }
}

if (!$default_is_fullscreen) {
    $custstylesheet = $install_dir . $basedir_save . "/" . $twg_album . "/style.css";
    if (file_exists($custstylesheet)) { // individual css
        printCss($basedir_save . '/' . twg_urlencode($twg_album) . '/style.css', false, $basedir_save . '/' . $twg_album . '/style.css');
    }
} else {
    if (file_exists($install_dir . "fullscreen.css")) {
        printCss('fullscreen.css');
    }
}

if (!$show_counter || !$enable_counter_details) {
    printCss('<style type="text/css">td.bottomtablesideleft { cursor: auto; } </style>', true);
}


$isImageview = $image != false && ($default_big_navigation != "HTML") && ($twg_smallnav == 'FALSE') && !$twg_slideshow;

// now all the css are combined and printed!
if ($optimize_css) {
    printOptimizedCss($optimize_array);
}
?>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/jquery-1.6.1.min.js"></script>
<script type="text/javaScript">
    var $j = jQuery.noConflict();
</script>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/twg_image-min.js"></script>
<?php
if ($isImageview) {
    echo '
<script type="text/javascript" src="' . $install_dir . 'js/twg_motiongallery-min.js">
/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
';
}


if (checkFullscreen()) {
    echo "<script type='text/javascript'>isFullscreen();</script>";
}

if ($test_connection && $test_client_connection) {
    if ($test_connection_background) {
        include dirname(__FILE__) . "/../js/twg_speed.js.php";
    }
}

// height is defined earlier because in twg.js this height is needed	
if ($show_comments_in_layer) {
    $lang_height_comment += $height_of_comment_layer;
}

echo '<link rel="prefetch" href="http://www.tinywebgallery.com/index2.php">';

// we add a canonical URL
if ($image && $twg_album) {
    // we check if we have more than 2 parameters!
    if (count($_GET) > 2) {
        $fullurl = getScriptName() . '?twg_album=' . $album_enc . '&amp;twg_show=' . $image;
        echo '<link rel="canonical" href="' . $fullurl . '">';
    }
} else if (!$image && $twg_album) {
    // thumbnail page - we check if we have more than 1 parameters!
    if (count($_GET) > 1) {
        $fullurl = getScriptName() . '?twg_album=' . $album_enc;
        echo '<link rel="canonical" href="' . $fullurl . '">';
    }
} else if (isset($GET['twg_lang'])) {
    // language selector is only available on the 1st page.
    $fullurl = getScriptName();
    echo '<link rel="canonical" href="' . $fullurl . '">';
}

if (file_exists($install_dir . 'head_addon.php')) {
    include ($install_dir . 'head_addon.php');
}

if (!$php_include) {
    echo '
</head>
';
} else {
    $show_background_images = false;
}
// we flush the header that css and js can be loaded already.
flush();

?>
Return current item: TinyWebGallery