while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_dir(BASE_PATH . '/media/albums/' . $file)) { // Fill albums array $albums[] = $file; } } closedir($handle); sort($albums, SORT_STRING); // to make sure $count[] array is in sync with the $albums[] array, we need to perform this extra round AFTER the sort() operation. foreach ($albums as $key => $file) { // Count files in album $images = fileList(BASE_PATH . '/media/albums/' . $file); $count[$key] = count($images); } } $album = getGETparam4Filename('album'); $album_path = in_array($album, $albums) ? BASE_PATH . '/media/albums/' . $album : null; $page_id = getGETparam4IdOrNumber('page_id'); $preview_checkcode = GenerateNewPreviewCode($page_id); $tinyMCE_required = false; $textarea4descr_id = str2variablename('lightbox_' . $page_id . (!empty($album) ? '_' . $album : '')); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Lightbox module</title> <link rel="stylesheet" type="text/css" href="../../../admin/img/styles/base.css,liquid.css,layout.css,sprite.css,last_minute_fixes.css" /> <link rel="stylesheet" type="text/css" href="modLightbox.css" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="../../../admin/img/styles/ie.css" />
// Define default location if (!defined('BASE_PATH')) { $base = str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__))))); define('BASE_PATH', $base); } // Include general configuration /*MARKER*/ require_once BASE_PATH . '/admin/includes/security.inc.php'; // when session expires or is overridden, the login page won't show if we don't include this one, but a cryptic error will be printed. if (!checkAuth() || empty($_SESSION['rc1']) || empty($_SESSION['rc2'])) { die("No external access to file"); } $do = getGETparam4IdOrNumber('do'); $status = getGETparam4IdOrNumber('status'); $status_message = getGETparam4DisplayHTML('msg'); $page_id = getGETparam4Filename('page_id'); if (empty($page_id)) { die($ccms['lang']['system']['error_forged'] . ' (' . __FILE__ . ', ' . __LINE__ . ')'); } $pagerow = $db->SelectSingleRow($cfg['db_prefix'] . 'pages', array('page_id' => MySQL::SQLValue($page_id, MySQL::SQLVALUE_NUMBER))); if (!$pagerow) { $db->Kill(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Comments module</title> <link rel="stylesheet" type="text/css" href="../../../admin/img/styles/base.css,liquid.css,layout.css,sprite.css,last_minute_fixes.css" /> <!--[if IE]>
along with CompactCMS. If not, see <http://www.gnu.org/licenses/>. > Contact me for any inquiries. > E: Xander@CompactCMS.nl > W: http://community.CompactCMS.nl/forum ************************************************************ */ /* make sure no-one can run anything here if they didn't arrive through 'proper channels' */ if (!defined("COMPACTCMS_CODE")) { die('Illegal entry point!'); } /*MARKER*/ // Default albums location $album_path = BASE_PATH . '/media/albums'; $album_url = $cfg['rootdir'] . 'media/albums'; $pageID = getGETparam4Filename('page'); $imgID = getGETparam4Filename('id'); $is_printing = $ccms['printing'] == 'Y'; // Read through selected album, get first and count all function fileList($d) { $l = array(); if (is_dir($d)) { foreach (array_diff(scandir($d), array('.', '..', 'index.html', 'info.txt', '_thumbs')) as $f) { if (is_file($d . '/' . $f)) { $ext = strtolower(pathinfo($f, PATHINFO_EXTENSION)); if ($ext == "jpg" || $ext == "jpeg" || $ext == "png" || $ext == "gif") { $l[] = $f; } } } sort($l, SORT_STRING);
You should have received a copy of the GNU General Public License along with CompactCMS. If not, see <http://www.gnu.org/licenses/>. > Contact me for any inquiries. > E: Xander@CompactCMS.nl > W: http://community.CompactCMS.nl/forum ************************************************************ */ /* make sure no-one can run anything here if they didn't arrive through 'proper channels' */ if (!defined("COMPACTCMS_CODE")) { die('Illegal entry point!'); } /*MARKER*/ // Set Captcha value $_SESSION['ccms_captcha'] = mt_rand('123456', '987654'); // Load comment preferences $pagename = getGETparam4Filename('page'); $is_printing = $ccms['printing'] == 'Y'; $pagerow = $db->SelectSingleRow($cfg['db_prefix'] . 'pages', array('urlpage' => MySQL::SQLValue($pagename, MySQL::SQLVALUE_TEXT))); if ($db->ErrorNumber() != 0) { $db->Kill(); } $page_id = $pagerow->page_id; if (empty($page_id) || empty($pagename)) { die($ccms['lang']['system']['error_forged'] . ' (' . __FILE__ . ', ' . __LINE__ . ')'); } // code requires mootools: make sure we load it! tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-core.js'); tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/includes/js/mootools-more.js'); // now register our own JS and make sure it ends up AFTER the mootools stuff has been loaded: tmpl_set_autoprio($ccms['JS.required_files'], $cfg['rootdir'] . 'lib/modules/comment/resources/script.js'); tmpl_set_autoprio($ccms['CSS.required_files'], $cfg['rootdir'] . 'lib/modules/comment/resources/style.css > media="screen" title="comments"');
$location = explode("/", $_SERVER['PHP_SELF']); $php_src_is_admin_code = in_array("admin", $location); if ($php_src_is_admin_code) { /*MARKER*/ require_once BASE_PATH . '/admin/includes/security.inc.php'; } // DATABASE == // All set! Now this statement will connect to the database if (!$db->Open($cfg['db_name'], $cfg['db_host'], $cfg['db_user'], $cfg['db_pass'])) { $db->Kill($ccms['lang']['system']['error_database']); } // ENVIRONMENT == // Some variables to help this file orientate on its environment $current = basename(filterParam4FullFilePath($_SERVER['REQUEST_URI'])); // [i_a] $curr_page was identical (enough) to $pagereq before $pagereq = checkSpecialPageName(getGETparam4Filename('page'), SPG_GIVE_PAGENAME); $ccms['pagereq'] = $pagereq; $ccms['printing'] = getGETparam4boolYN('printing', 'N'); $preview = getGETparam4IdOrNumber('preview'); // in fact, it's a hash plus ID! $preview = IsValidPreviewCode($preview); $ccms['preview'] = $preview ? 'Y' : 'N'; //$ccms['responsecode'] = null; // default: 200 : OK //$ccms['page_id'] = false; //$ccms['page_name'] = false; //$ccms['content'] = false; //$ccms['template'] = null; // This files' current version $ccms['ccms_version'] = $v = "1.4.2"; // preparation for plugins, et.c which want to load JavaScript files through the template: $ccms['CSS.required_files'] = array();