if(!defined('DATALIFEENGINE')) { die("Hacking attempt!"); } if ($galConfig['off'] == "1") include_once ENGINE_DIR.'/modules/offline.php'; if ($config["lang_".$config['skin']]) { include_once ROOT_DIR.'/language/'.$config["lang_".$config['skin']].'/gallery.web.lng'; } else { include_once ROOT_DIR.'/language/'.$config['langs'].'/gallery.web.lng'; } $GalCat = get_vars("gal_cat"); if (!$GalCat) { $GalCat = array (); $db->query("SELECT * FROM " . PREFIX . "_gal_cat ORDER BY cat_id"); while($row = $db->get_row()){ $GalCat[$row['cat_id']] = array (); foreach ($row as $key => $value) { $GalCat[$row['cat_id']][$key] = $value; } } set_vars ("gal_cat", $GalCat); $db->free(); } require_once ENGINE_DIR.'/gallery/functions.web.php'; if (isset($_REQUEST['jump'])) gredirection ($_REQUEST['jump'], $_REQUEST['ident'], $cat_ID); if ($cat_ID && isset($_REQUEST['foto'])){ $foto = intval($_GET['foto']); $subaction = "foto"; } elseif ($cat_ID){ $subaction = "album"; } if (isset($_REQUEST['user']) && $galConfig['user_cats_limit']){ $subaction = "userfoto"; } if ($cstart < 0) $cstart = 0; if (isset($_REQUEST['icstart'])) $cstarti = intval($_GET['icstart']); else $cstarti = 0; if ($cstarti < 0) $cstarti = 0; switch ($subaction) { case "" : case "userfoto" : include ENGINE_DIR.'/gallery/mainpage.php'; $metatags['title'] = $langGal['gallery']; $s_navigation = "$langGal[gallery]"; break; case "album" : if (check_permission ("view", $GalCat[$cat_ID]['cat_view_level'], $GalCat[$cat_ID]['cat_status'], $GalCat[$cat_ID]['us_cat'])){ include ENGINE_DIR.'/gallery/show.category.php'; if ($config['allow_alt_url'] == "yes"){ $href = $config['http_home_url']."gallery/"; $href2 = $href.$GalCat[$cat_ID]['cat_alt_name']."/"; } else { $href = $config['http_home_url']."index.php?do=gallery"; $href2 = $href."&catid=$cat_ID"; } $metatags['title'] = stripslashes($GalCat[$cat_ID]['cat_title']); $s_navigation = "$langGal[gallery] » $metatags[title]"; } else msgbox ($langGal['cat_error'], $langGal['no_thatalb']); break; case "foto" : include ENGINE_DIR.'/gallery/show.image.php'; if ($config['allow_alt_url'] == "yes"){ $href = $config['http_home_url']."gallery/"; $href2 = $config['http_home_url']."gallery/".$GalCat[$cat_ID]['cat_alt_name']."/"; } else { $href = $config['http_home_url']."index.php?do=gallery"; $href2 = $config['http_home_url']."index.php?do=gallery&catid=$cat_ID"; } $s_navigation = "$langGal[gallery] » ".stripslashes($GalCat[$cat_ID]['cat_title'])." » $metatags[title]"; break; case "lastcomments" : include ENGINE_DIR.'/gallery/lastcomments.php'; if ($config['allow_alt_url'] == "yes") $href = $config['http_home_url']."gallery/"; else $href = $config['http_home_url']."index.php?do=gallery"; $metatags['title'] = $langGal['gallery']; $s_navigation = "$langGal[gallery] » $langGal[t_last_com]"; break; case "new" : $search = false; include ENGINE_DIR.'/gallery/newfoto.php'; if ($config['allow_alt_url'] == "yes") $href = $config['http_home_url']."gallery/"; else $href = $config['http_home_url']."index.php?do=gallery"; $metatags['title'] = $langGal['gallery']; $s_navigation = "$langGal[gallery] » $langGal[t_new_foto]"; break; case "create" : case "upload" : case "edit_cat" : case "delete_cat" : include_once ENGINE_DIR.'/gallery/admin/functions.admin.php'; if (isset($_REQUEST['id'])) $id = intval($_REQUEST['id']); else $id = 0; include ENGINE_DIR.'/gallery/admin/mod.category.php'; if ($config['allow_alt_url'] == "yes") $href = $config['http_home_url']."gallery/"; else $href = $config['http_home_url']."index.php?do=gallery"; $s_navigation = "$langGal[gallery] » $metatags[title]"; break; case "edit_image" : case "del_image" : case "mass_del_foto" : case "mass_move_foto" : case "mass_approve_foto" : case "moderation" : include_once ENGINE_DIR.'/gallery/admin/functions.admin.php'; if (isset($_REQUEST['id'])) $id = intval($_REQUEST['id']); else $id = 0; include ENGINE_DIR.'/gallery/admin/mod.picture.php'; if ($config['allow_alt_url'] == "yes") $href = $config['http_home_url']."gallery/"; else $href = $config['http_home_url']."index.php?do=gallery"; $s_navigation = "$langGal[gallery] » $metatags[title]"; break; case "editcomment" : case "deletecomment" : case "delallcomms" : ////for picture case "delallcomments" : ////for album if (isset($_REQUEST['id'])) $id = intval($_REQUEST['id']); else $id = 0; include ENGINE_DIR.'/gallery/admin/mod.comments.php'; if ($config['allow_alt_url'] == "yes") $href = $config['http_home_url']."gallery/"; else $href = $config['http_home_url']."index.php?do=gallery"; $s_navigation = "$langGal[gallery] » $metatags[title]"; break; case "search" : if ($_REQUEST['mode'] == "advanced") $_REQUEST['full_search'] = 1; include ENGINE_DIR.'/gallery/search.php'; break; default: msgbox ($langGal['cat_error'], $langGal['unknown']); } $tpl->result['content'] .= "\n\r\n"; ?>