Location: PHPKode > scripts > TinyWebGallery > tinywebgallery/inc/head.inc.php
<?php
/*************************  
  Copyright (c) 2004-2010 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
 
  $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.');

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
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-2010 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 ($twg_album && !$input_invalid) {
  echo '<title>'.$browser_title_prefix.' - '.remove_br(getDirectoryName($basedir."/".$twg_album,$twg_album)).'</title>';
} else {
  echo '<title>'.$browser_title_prefix.'</title>';
}
echo '
<meta name="author" content="Michael Dempfle" >
<meta name="DC.Identifier" content="http://www.tinywebgallery.com" >
<!-- Use IE7 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<meta http-equiv="X-UA-Compatible" content="IE=8">
';
if (!$input_invalid) {
    if ($metatags == "") { // if no metatags are provided we use default
    echo'
    <meta name="keywords" content="TinyWebGallery, twg, ajax, php, photo album, gallery, image gallery, galerie, xml, upload,'.$twg_album.','.$image.'" >
    ';
    } else {
      echo '<meta name="keywords" content="' . $metatags .','.$twg_album.','.$image.'" >';
    }
}

if ($metadescription == "") { // if no metatags are provided we use default
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.">
<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 {
  echo '<meta name="description" content="' . $metadescription . '" >';
}
	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" />';
  }
}

?>
<script type="text/javascript">
// check if we are using Netscape < 4.x
var wrongBrowser = false;
if (parseInt(navigator.appVersion.substring(0,1)) <= 4) {
		if (navigator.appName == "Netscape")
			wrongBrowser = true;
}
if (wrongBrowser) {
   document.write('<meta http-equiv="refresh" content="0; URL=html/wrongbrowser.html">');
}
</script>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/shadedborder.js"></script>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/prototype.lite.js"></script>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/swfobject.js"></script>
<?php if ($video_player=="QT") { ?>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/AC_QuickTime.js"></script>
<?php } ?>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/twg_xhconn.js"></script>
<!-- 
This loads an external script from the twg server! I try to remove ads like shown on funpic. 
Because they change the code very often I only have to update this file and you don't have a problem
with ad's. if you don't like/need this simply remove the next 3 lines!  
-->
<?php if (get_server_name() != "localhost" && (stristr(get_server_name(), 'funpic') !== FALSE) && $enable_external_adremove) { ?>
  <script type="text/javascript" src="http://www.tinywebgallery.com/js/remove_ad.js" ></script>
<?php } ?>
<?php
echo '<style type="text/css">';
echo '				#div1{height:' . $menu_pic_size_y . 'px;width:' . $menu_pic_size_x . 'px;text-align: center; }';
echo '</style>';

?>
<link rel="stylesheet" type="text/css" href="<?php echo $install_dir ?>style.css" >
<link rel="stylesheet" type="text/css" href="<?php echo $install_dir ?>language/language_flags.css" >
<?php
if ($msie) {
	echo '<link rel="stylesheet" type="text/css" href="' . $install_dir . 'style_ie.css" >';
}
if ($wii) {
	echo '<link rel="stylesheet" type="text/css" href="' . $install_dir . 'style_wii.css" >';
}

if (file_exists($install_dir . 'buttons/iconsets/' . $icon_set . '/style.css')) {
	echo '<link rel="stylesheet" type="text/css" href="' . $install_dir . '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) {
    echo '<link rel="stylesheet" href="' . $install_dir . 'lightbox/lytebox.css" type="text/css" media="screen"> ';
  } else {
	echo '<link rel="stylesheet" href="' . $install_dir . 'lightbox/css/lightbox.css" type="text/css"> ';
	if ($msie) {
		echo '<link rel="stylesheet" href="' . $install_dir . 'lightbox/css/lightbox_ie.css" type="text/css">';
	}
 }
}
?>
<script type="text/javaScript" src="<?php echo $install_dir ?>./js/twg_image.js"></script>
<?php

if (checkFullscreen()) {
	echo "<script type='text/javascript'>isFullscreen();</script>";
}
// this stylesheet adds the border to the image gallery
if ($myborder == 'TRUE' && !$default_is_fullscreen) {
	echo "<link rel='stylesheet' type='text/css' href='" . $install_dir . "framestyle.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")) {
	echo "<link rel='stylesheet' type='text/css' href='" . $install_dir . "skins/" . $skin . ".css' >";
}

// additional stylesheet if no border is displayed!
if ($show_border !='TRUE' && file_exists($install_dir . "skins/" . $skin . "_noborder.css")) {
   echo "<link rel='stylesheet' type='text/css' href='" . $install_dir . "skins/" . $skin . "_noborder.css' >";
   $use_round_corners = false;
}

if ($use_round_corners && file_exists($install_dir . "skins/" . $skin . "_round.css")) {
   echo "<link rel='stylesheet' type='text/css' href='" . $install_dir . "skins/" . $skin . "_round.css' >";
}


if (file_exists($install_dir . "my_style.css")) {
	echo "<link rel='stylesheet' type='text/css' href='" . $install_dir . "my_style.css' >";
}

if (!$php_include) {
	if ($ie_height_iframe_fix) {
		echo '<style>
		td.twg_info {
			height: 89%;
		}
		</style>';
	}
}

if (!$default_is_fullscreen) {
	$custstylesheet = $basedir . "/" . $twg_album . "/style.css";
	if (file_exists($custstylesheet)) { // individual css
		$custstylesheet = $basedir . "/" . twg_urlencode($twg_album) . "/style.css";
		echo "<link rel='stylesheet' type='text/css' href='" . $custstylesheet . "' >";
	} else {
		$custstylesheet = $cachedir . "/" . twg_urlencode(str_replace("/", "_", $twg_album)) . "_style.css"; // we link directly to the background - because of special characters like (+ü$§!%&-;) this type of encoding is used here
		if (file_exists($custstylesheet)) { // individual css
			echo "<link rel='stylesheet' type='text/css' href='" . $custstylesheet . "' >";
		}
	}
}

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

if ($image != false && ($default_big_navigation != "HTML") && ($twg_smallnav == 'FALSE') && !$twg_slideshow) { // we are in the image view abd twg_show th dhtml navi
	if ($msie) {
		echo '<link rel="stylesheet" type="text/css" href="' . $install_dir . 'js/gallerystyle_ie.css">';
	} else {
		echo '<link rel="stylesheet" type="text/css" href="' . $install_dir . 'js/gallerystyle.css">';
	}
	echo '
<script type="text/javascript" src="' . $install_dir . 'js/twg_motiongallery.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 ($test_connection && $test_client_connection) {
	if ($test_connection_background) {
		include dirname(__FILE__) . "/../js/twg_speed.js.php";
	}
}

if ($activate_lightbox_topx || $activate_lightbox_thumb || ($activate_lightbox_image && $enable_download)) {

if ($use_lytebox) {
   	echo '<script type="text/javascript" src="' . $install_dir . 'lightbox/lytebox.js"></script>';
} else {
	echo '<script type="text/javascript" src="' . $install_dir . 'lightbox/js/prototype.js"></script>';
// 	echo '<script type="text/javascript" src="' . $install_dir . 'lightbox/js/scriptaculous.js?load=effects"></script>';
  echo '<script type="text/javascript" src="' . $install_dir . 'lightbox/js/effects.js"></script>';
  echo '<script type="text/javascript" src="' . $install_dir . 'lightbox/js/lightbox.js"></script>';
  }
}
// in this section we set some settings that are not possible because of other
// settings ;).
if ($safari) {
	if ($twg_slide_type = "TRUE") {
		$twg_slide_type = "FALSE";
	}
	$show_optimized_slideshow = false;
	// $default_big_navigation = "HTML"; // fixed in 1.4.3!
}

if ($opera) {
	if ($twg_slide_type = "TRUE") {
		$twg_slide_type = "FALSE";
	}
	$show_optimized_slideshow = false;
	// works now in opera 9 and 10 - was not working 8 but it really seldom used now...
  // $use_dynamic_background = false;
}

// 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">';
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