If you want to upgrade from an older version of TWG please copy your changes form the old config.php to the file my_config.php.');
}
if ('2.4.9' != $twg_version_internal) {
die('You are using a config_internal.php that does not belong to this version.
If you want to upgrade from an older version of TWG please copy your changes form the old config.php to the file my_config.php.');
}
if ($autodetect_errors && !$php_include) {
if (isset($_SESSION['TWG_CALL_COUNTER'])) { // increase the call counter
$_SESSION['TWG_CALL_COUNTER'] = $_SESSION['TWG_CALL_COUNTER'] + 1;
} else {
$_SESSION['TWG_CALL_COUNTER'] = 0;
}
set_error_handler("on_error_no_output"); // this is needed because the session is already started if this include is used by index.php - at all other places here is the initialization of the session!
// the session has to be closed and reopend because othewite the session is not written if the counter fails.
@session_write_close();
@session_start();
set_error_handler("on_error");
}
// autenables the session cache of TWG because too many users don't turn it on and TWG is much slower than it should be
if ($autoenable_cache >= 0) {
if (isset($_SESSION['TWG_REQUEST_COUNTER'])) {
$_SESSION['TWG_REQUEST_COUNTER'] = $_SESSION['TWG_REQUEST_COUNTER'] + 1;
} else {
$_SESSION['TWG_REQUEST_COUNTER'] = 0;
}
if ($_SESSION['TWG_REQUEST_COUNTER'] > $autoenable_cache) {
$_SESSION['twg_enable_session_cache'] = true;
}
}
if (file_exists(dirname(__FILE__) . '/skins/' . $skin . '.php')) {
include dirname(__FILE__) . '/skins/' . $skin . '.php';
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$lang_browser = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if (file_exists(dirname(__FILE__) . '/language/language_' . $lang_browser . '.php')) {
$default_language = $lang_browser;
}
}
$twg_root = getScriptName(); // needed in some i_frames !! we store this later in the session for the other frames !
// read the request parameters
include dirname(__FILE__) . '/inc/parserequest.inc.php';
// some intro settings
$detailswidth = 300;
$hoverjs = false;
$is_cache_call = false;
$CurrentVer = $twg_version;
$webpath = 'http://www.tinywebgallery.com'; // don't modify this - this can only be done if you register ;)
/* set some session variables */
include (dirname(__FILE__) . '/inc/mysession.inc.php');
$basedir_save = $basedir;
$basedir = $install_dir . $basedir;
include dirname(__FILE__) . '/inc/loadconfig.inc.php';
include dirname(__FILE__) . '/inc/setspecials.inc.php';
// now we set the path's it has to be done after the session include because there the install dir can be set to '' if standalone!
// some paths need seo fixes.
$cachedir = $install_dir . $cachedir;
$counterdir = $install_dir . $counterdir;
$xmldir = $install_dir . $xmldir;
// the install dir can change on the view for seo. therefore this is a new setting.
$install_dir_view = $install_dir;
$basedir_view = $basedir;
$twg_seo_active = false;
$twg_seo_image_active = false;
if ($enable_basic_seo && isset($_SERVER['REQUEST_URI'])) {
$redirect_url = $_SERVER['REQUEST_URI'];
if (strpos($redirect_url, '/twg_image/') !== false) { // imageview
$twg_seo_active = $twg_seo_image_active = true;
$install_dir_view = '../../' . $install_dir_view;
$basedir_view = '../../' . $basedir_view;
} else if ($top10) {
} else if (strpos($redirect_url, '/twg_album/') !== false ||
strpos($redirect_url, '/twg_show/') !== false ) {// thumbnailview - or top 10 view
$twg_seo_active = true;
$install_dir_view = '../' . $install_dir_view;
$basedir_view = '../' . $basedir_view;
}
}
@ob_end_clean();
if ($test_connection && $test_client_connection) { // speedtest!
if (!$test_connection_background) {
include (dirname(__FILE__) . '/inc/speed.inc.php');
return;
}
}
ob_start();
if (!checkFullscreen()) {
$activate_lightbox_thumb = $activate_lightbox_thumb_full = $activate_lightbox_image = $activate_lightbox_topx = $activate_lightbox_topx_full = $enable_album_tree = false;
$fullscreen_active = true;
} else if (!checkP()) {
$enable_basic_seo = false;
}
// make some settings that should be done in the config.php but the user have not configured properly
if ($php_include) {
$use_dynamic_background = false;
$enable_maximized_view = false;
$open_in_maximized_view = false;
}
if (!$enable_maximized_view) {
$default_is_fullscreen = false;
}
if (!checkCacheDirs()) { // checks if all cache dir are here and set the right umask
return;
}
require dirname(__FILE__) . '/language/language_default.php';
require dirname(__FILE__) . '/language/language_' . $default_language . '.php';
include dirname(__FILE__) . '/inc/fixfont.inc.php';
// we set the default title to $default_gallery_title if no one is set
if ($lang_titel == '') {
$lang_titel = $default_gallery_title;
}
// first we build the cache tree if needed.
if ($show_number_of_pic || $show_changes > 0 || $show_counter_in_jstree) {
count_tree($basedir);
}
$relativepath = '';
include dirname(__FILE__) . '/inc/checkprivate.inc.php';
cleanup_cache();
$twg_rot_available = checktwg_rot();
if (!$twg_rot_available) {
$autorotate_images = '';
}
// check private login
$twg_showprivatelogin = false;
if (($privategal == true) && (!in_array(trim($privatelogin), $passwd))) { // we want to have a login :)
$twg_showprivatelogin = true;
}
include dirname(__FILE__) . '/inc/readxml.inc.php';
// delete comment
include dirname(__FILE__) . '/inc/delcomment.inc.php';
// important check if we already have to show fullscreen
$default_is_fullscreen = ($image != false && $default_is_fullscreen && !$no_zoom_request_set);
$root_mode_no_login = false;
include dirname(__FILE__) . '/inc/multiroot.inc.php';
if ($twg_showprivatelogin || ($multi_root_mode && !$twg_album) || $root_mode_no_login) {
$use_round_corners = false;
}
$generatecounter = false;
if (isset($charset) && !$php_include) {
header('Content-Type: text/html;charset=' . $charset);
}
// we check if the album exists and/or the input is invalid.
// A nice 404 is sent then and for an invalid image the first of the folder is displayed.
$path = ($twg_album) ? $basedir . '/' . $twg_album : $basedir;
$pathimage = ($image && $image != 'x') ? $path . '/' . $image : $path;
if ($input_invalid || !file_exists($path) || !file_exists($pathimage)) {
header('HTTP/1.1 404 Not Found');
}
include dirname(__FILE__) . '/inc/index.inc.php';
@ob_end_clean(); // from now we do output
include dirname(__FILE__) . '/inc/head.inc.php'; // prints all from to
if ($default_big_navigation == 'HTML_SIDE') {
$numberofpics = $numberofpics_html_side;
}
$numberofpics = floor(($numberofpics - 1) / 2);
include dirname(__FILE__) . '/inc/bodytag.inc.php'; // prints
include dirname(__FILE__) . '/inc/private.inc.php';
include dirname(__FILE__) . '/js/twg.js.php';
if ($use_dynamic_background && $show_background_images && !$default_is_fullscreen) {
echo '
';
}
?>
';
includeHeader($enable_external_html_include, $outerspan);
echo '
';
include ($lefthtml);
echo ' | ';
$leftinclude = $inner_table = true;
}
}
if ($enable_album_tree && $myborder != 'TRUE') {
if (!$leftinclude) {
echo '';
includeHeader($enable_external_html_include, $colspan);
echo '';
}
print_album_tree($basedir);
// if (!$leftinclude) {
// echo ''; //
//} else {
echo ' | ';
// }
$leftinclude = $inner_table = true; // close the table at the end!
}
if ($myborder == 'TRUE' && !$default_is_fullscreen) {
echo '';
if (!$leftinclude) {
includeHeader($enable_external_html_include, $colspan);
}
includeTop($enable_external_html_include, $colspan);
echo '';
if ($enable_album_tree) {
print_album_tree($basedir);
}
echo '';
if ($enable_album_tree) {
if (!$opera) {
$static = 'N';
} else {
$static = 'Y';
}
echo ' ';
$widthfix = 'width:100%;';
} else {
$widthfix = '';
}
echo ' | ';
$inner_table = true;
}
if ($inner_table) {
$isinner = '';
} else {
$isinner = fix_ie_height();
}
echo '';
if ($myborder != 'TRUE') {
includeTop($enable_external_html_include, $colspan);
}
// start of small top navigation
if (!$default_is_fullscreen) {
echo '';
include (dirname(__FILE__) . '/inc/topnavigation.inc.php');
echo ' ';
}
// end of small top navigation
?>
';
} else {
echo '';
echo '';
}
echo '';
if ($myborder != 'TRUE' && !$default_is_fullscreen) {
if ($enable_album_tree) {
if (!$opera) {
$static = 'N';
} else {
$static = 'Y';
}
// align is needed here - not possible in the style because IE sucks!
echo ' ';
}
}
echo '
';
if (!$default_is_fullscreen) {
echo '';
} else {
echo ' | ';
}
echo '';
// start of image section
if ($input_invalid) {
printErrorInvalid();
} else if ($twg_showprivatelogin) {
echo ' ';
echo ' ';
$input_invalid = true;
} else if ($multi_root_mode && !$twg_album) {
echo ' ';
echo isset($lang_root_mode_access) ? $lang_root_mode_access : 'Main access is not allowed in root mode.';
echo ' ';
$input_invalid = true;
} else if ($root_mode_no_login) {
echo ' ';
echo isset($lang_root_mode_login) ? $lang_root_mode_login : 'You don\'t have access to this album.';
echo ' ';
$input_invalid = true;
} else if ($image != false) { // imageview
include (dirname(__FILE__) . '/inc/image.inc.php');
} else if ($top10) {
print_top_10($album_enc, $top10_type);
} else if ($twg_album != false) { // thumbnailview - or top 10 view
print_thumbnails($twg_album, $twg_offset, $werte, $index, $twg_foffset);
} else { // main view!
print_thumbnails(false, $twg_offset, $werte, $index, $twg_foffset);
}
echo ' | ';
//
//
if (!$default_is_fullscreen && (!$input_invalid)) {
include dirname(__FILE__) . '/inc/bottomnav.inc.php';
}
echo ' | ';
// don't ever remove this it is used for some measurement stuff
echo '';
echo ' ';
echo ' | ';
if (!$default_is_fullscreen) {
include dirname(__FILE__) . '/inc/bottom.inc.php';
} else {
echo ' ';
}
if ($leftinclude) {
echo ' | ';
includeFooter($enable_external_html_include, $outerspan);
echo ' ';
}
// we are through most of the code - lets load the javascripts that can be loaded here
include dirname(__FILE__) . '/inc/late_js.inc.php';
if ($use_dynamic_background && $show_background_images && !$default_is_fullscreen) {
echo '';
if ($backgroundimage != '') { // we make this later because then it it loaded afterwards!
echo '';
}
}
echo '';
echo '';
if (!$default_is_fullscreen) {
if (!$input_invalid) {
include dirname(__FILE__) . '/inc/counterdiv.inc.php';
}
} else {
include dirname(__FILE__) . '/inc/fullscreen.inc.php';
createFullscreenControl($twg_album, $image);
}
if ($activate_lightbox_topx || $activate_lightbox_thumb || ($activate_lightbox_image && $enable_download)) {
if ($use_lytebox) {
echo '';
} else {
echo '';
}
}
if (!$php_include) {
echo '';
echo ' | |