function render($template, $vars = array(), $debug = FALSE) { if ($debug) { echo '<pre>'; var_dump($vars); echo '</pre>'; } if (is_array($vars) && count($vars) > 0) { $this->setVars($vars); } $viewPath = $this->getViewPath($template); if (!file_exists($viewPath)) { cpg_die(ERROR, sprintf(Lang::item('error.missing_vw_file'), $viewPath), __FILE__, __LINE__); } extract($this->vars); // checking model $authorizer = check_model::getInstance(); ob_start(); include_once $viewPath; $fr_contents = ob_get_contents(); ob_end_clean(); if (empty($fr_title) || !$fr_title) { $fr_title = $vars[nagavitor][0][1] . " - " . Config::item('fr_title'); } include_once $this->getMainPath(); }
function display_log_list() { global $lang_viewlog_php; $log_list = getloglist('logs/'); if (count($log_list) > 0) { foreach ($log_list as $log) { echo <<<EOT \t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t\t<td class="tableb"> \t\t\t\t\t\t\t\t\t\t\t\t<img src="images/folder.gif" alt="" /> <a href= "{$_SERVER['PHP_SELF']}?log={$log['logname']}">{$log['logname']}</a> \t\t\t\t\t\t\t\t\t\t\t\t ( <i>{$log['filesize']} KB</i> ) \t\t\t\t\t\t\t\t\t\t</td> \t\t\t\t\t\t\t\t</tr> EOT; } echo <<<EOT \t\t\t\t\t\t\t\t<tr> \t\t\t\t\t\t\t\t\t\t<td class="tableb" align="center"> \t\t\t\t\t\t\t\t\t\t\t\t<input class="button" type="button" value="{$lang_viewlog_php['delete_all']}" name="dall" id="dall" onclick="window.location='viewlog.php?action=dall';" /> \t\t\t\t\t\t\t\t\t\t</td> \t\t\t\t\t\t\t\t</tr> EOT; } else { cpg_die(INFORMATION, $lang_viewlog_php['no_logs'], __FILE__, 1); } }
function display_log_list() { global $lang_viewlog_php, $folder_icon, $delete_all_icon, $delete_this_icon, $view_icon, $lang_date; $log_list = getloglist('logs/'); if (count($log_list) > 0) { foreach ($log_list as $log) { $mtime = localised_date($log['mtime'], $lang_date['log']); $filesize = cpg_format_bytes($log['filesize']); echo <<<EOT <tr> <td class="tableb"> {$folder_icon} <a href= "viewlog.php?log={$log['logname']}">{$log['logname']}</a> ( <em>{$filesize}</em>, {$lang_viewlog_php['last_updated']}: <em>{$mtime}</em>) </td> </tr> EOT; } echo <<<EOT <tr> <td class="tableb" align="center"> <button type="button" class="button" name="dall" value="{$lang_viewlog_php['delete_all']}" id="dall" onclick="window.location='viewlog.php?action=dall';">{$delete_all_icon}{$lang_viewlog_php['delete_all']}</button> </td> </tr> EOT; } else { cpg_die(INFORMATION, $lang_viewlog_php['no_logs'], __FILE__, __LINE__); } }
function process_post_data() { global $HTTP_POST_VARS, $CONFIG; global $lang_errors; $pid = (int) $HTTP_POST_VARS['id']; $aid = (int) $HTTP_POST_VARS['aid']; $pwidth = (int) $HTTP_POST_VARS['pwidth']; $pheight = (int) $HTTP_POST_VARS['pheight']; $title = $HTTP_POST_VARS['title']; $caption = $HTTP_POST_VARS['caption']; $keywords = $HTTP_POST_VARS['keywords']; $user1 = $HTTP_POST_VARS['user1']; $user2 = $HTTP_POST_VARS['user2']; $user3 = $HTTP_POST_VARS['user3']; $user4 = $HTTP_POST_VARS['user4']; $read_exif = isset($HTTP_POST_VARS['read_exif']); $reset_vcount = isset($HTTP_POST_VARS['reset_vcount']); $reset_votes = isset($HTTP_POST_VARS['reset_votes']); $del_comments = isset($HTTP_POST_VARS['del_comments']) || $delete; $query = "SELECT category, filepath, filename FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND pid='{$pid}'"; $result = db_query($query); if (!mysql_num_rows($result)) { cpg_die(CRITICAL_ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__); } $pic = mysql_fetch_array($result); mysql_free_result($result); if (!(GALLERY_ADMIN_MODE || USER_ADMIN_MODE)) { if ($pic['category'] != FIRST_USER_CAT + USER_ID) { cpg_die(ERROR, $lang_errors['perm_denied'] . "<br />(picture category = {$pic['category']}/ {$pid})", __FILE__, __LINE__); } if (!isset($user_album_set[$aid])) { cpg_die(ERROR, $lang_errors['perm_denied'] . "<br />(target album = {$aid})", __FILE__, __LINE__); } } $update = "aid = '" . $aid . "'"; if (is_movie($pic['filename'])) { $update .= ", pwidth = " . $pwidth; $update .= ", pheight = " . $pheight; } $update .= ", title = '" . addslashes($title) . "'"; $update .= ", caption = '" . addslashes($caption) . "'"; $update .= ", keywords = '" . addslashes($keywords) . "'"; $update .= ", user1 = '" . addslashes($user1) . "'"; $update .= ", user2 = '" . addslashes($user2) . "'"; $update .= ", user3 = '" . addslashes($user3) . "'"; $update .= ", user4 = '" . addslashes($user4) . "'"; if ($reset_vcount) { $update .= ", hits = '0'"; } if ($reset_votes) { $update .= ", pic_rating = '0', votes = '0'"; } if ($del_comments) { $query = "DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='{$pid}'"; $result = db_query($query); } else { $query = "UPDATE {$CONFIG['TABLE_PICTURES']} SET {$update} WHERE pid='{$pid}' LIMIT 1"; $result = db_query($query); } }
function template_uninstall() { global $CONFIG, $lang_errors; $superCage = Inspekt::makeSuperCage(); if (!checkFormToken()) { cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } // Delete the plugin config records return true; }
/** * cpg_db_error() * * Error message if a query failed * * @param $the_error * @return **/ function cpg_db_error($the_error) { global $CONFIG, $lang_errors; if (!$CONFIG['debug_mode']) { cpg_die(CRITICAL_ERROR, $lang_errors['database_query'], __FILE__, __LINE__); } else { $the_error .= "\n\nmySQL error: " . mysql_error() . "\n"; $out = "<br />" . $lang_errors['database_query'] . ".<br /><br/>\n <form name=\"mysql\"><textarea rows=\"8\" cols=\"60\">" . htmlspecialchars($the_error) . "</textarea></form>"; die($out); } }
function remove_picture_geodata() { global $CONFIG, $USER_DATA, $lang_errors, $lang_editpics_php, $geodata_superCage, $lang_plugin_geodata, $aid; //Check if the form token is valid if (!checkFormToken()) { cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } //PID picture + AID album $pid = $geodata_superCage->post->getInt('id'); $query = "DELETE from {$CONFIG['TABLE_PREFIX']}plugin_geodata where geodata_pid='{$pid}'"; $vResult = cpg_db_query($query); }
function plugin_geoip_uninstall() { global $CONFIG; $superCage = Inspekt::makeSuperCage(); if (!checkFormToken()) { global $lang_errors; cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } // Delete the plugin config records cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_geoip_scope'"); return true; }
function index() { $vars = array(); $authorizer = check_model::getInstance(); $vars['nagavitor'] = $this->forum->get_nagavitor(); $vars['cat_id'] = $this->validate->get->getInt('id'); if ($vars['cat_id']) { if (!$authorizer->is_cat_id($vars['cat_id'])) { cpg_die(ERROR, Lang::item('error.wrong_cat_id'), __FILE__, __LINE__); } } $vars['user_posts'] = $this->forum->get_user_post_count(); $vars['last_visit'] = $this->forum->get_last_visit_time(); $cats = $this->forum->get_category($vars['cat_id'], 'cat_id, name'); $vars['categories'] = array(); foreach ($cats as $cat) { $newcat = array(); $newcat['name'] = $cat['name']; $newcat['id'] = $cat['cat_id']; $boards = $this->forum->get_first_level_board($cat['cat_id'], 'board_id,name,description,last_msg_id,topics,posts,child_level'); $newcat['boards'] = array(); foreach ($boards as $board) { $last_message = $this->forum->get_message_data($board['last_msg_id'], 'subject, poster_id, poster_time'); $newboard = array(); $newboard['icon'] = 'plugins/forum/forum/html/images/icon_board_new.gif'; $newboard['id'] = $board['board_id']; $newboard['name'] = $board['name']; $newboard['description'] = $board['description']; $newboard['last_post_id'] = $board['last_msg_id']; $newboard['last_post_title'] = $last_message['subject']; $newboard['last_post_time'] = $last_message['poster_time']; $newboard['last_post_author_id'] = $last_message['poster_id']; $newboard['last_post_author_name'] = get_username($last_message['poster_id']); $newboard['topics'] = $board['topics']; $newboard['replies'] = $board['posts']; $newboard['childs'] = $this->forum->get_child_board($board['board_id'], $board['child_level'], 'board_id, name'); $newcat['boards'][] = $newboard; unset($newboard); } $vars['categories'][] = $newcat; unset($newcat); } $recents = $this->forum->get_latest_message(); $vars['recents'] = $recents; $vars['stats'] = $this->forum->get_statistics(); $vars['newest_members'] = $this->forum->get_latest_user(); $vars['active_members'] = $this->forum->get_active_user(); $this->view->render('home/index', $vars); }
function make_form($form_param, $form_data) { global $CONFIG; global $lang_register_php; foreach ($form_param as $element) { switch ($element[0]) { case 'label': echo <<<EOT <tr> <td colspan="2" class="tableh2"> <b>{$element[1]}<b> </td> </tr> EOT; break; case 'text': echo <<<EOT <tr> <td width="40%" class="tableb" height="25"> {$element[2]} </td> <td width="60%" class="tableb"> {$form_data[$element[1]]} </td> </tr> EOT; break; case 'input': $value = $form_data[$element[1]]; echo <<<EOT <tr> <td width="40%" class="tableb" height="25"> {$element[2]} </td> <td width="60%" class="tableb" valign="top"> <input type="text" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="{$value}" class="textinput" /> </td> </tr> EOT; break; default: cpg_die(_CRITICAL_ERROR, 'Invalid action for form creation ' . $element[0], __FILE__, __LINE__); } } }
function limit_page_views_main() { if (!GALLERY_ADMIN_MODE) { global $CONFIG; $allowed_page_views = 200; $timeframe = 60; // in seconds $num_views = mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PREFIX']}page_views WHERE timestamp >= " . (time() - $timeframe)), 0); if ($num_views > $allowed_page_views) { load_template(); cpg_die(INFORMATION, "Too many page views. Please try again later.", __FILE__, __LINE__); } else { cpg_db_query("DELETE FROM {$CONFIG['TABLE_PREFIX']}page_views WHERE timestamp < " . (time() - $timeframe)); cpg_db_query("INSERT INTO {$CONFIG['TABLE_PREFIX']}page_views VALUES(" . time() . ")"); } } }
function load_library($library, $return = FALSE) { global $libraries; $library = ucfirst(strtolower($library)); $library_file = BASE_DIR . 'plugins' . DS . 'forum' . DS . 'forum' . DS . 'libraries' . DS . $library . '.php'; if (file_exists($library_file)) { if (!$libraries[$library]) { include $library_file; $libaries[$library] = TRUE; } $class_name = ucfirst(strtolower($library)); if ($return === TRUE) { return new $class_name(); } } else { cpg_die(ERROR, sprintf(Lang::item('error.missing_li_file'), $library_file), __FILE__, __LINE__); } }
function flv_player_uninstall() { $superCage = Inspekt::makeSuperCage(); if (!$superCage->post->keyExists('drop')) { return 1; } if (!checkFormToken()) { global $lang_errors; cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } if ($superCage->post->getInt('drop') == 1) { global $CONFIG; $allowed_mov_types = str_replace('/flv', '', $CONFIG['allowed_mov_types']); $allowed_mov_types = str_replace('flv/', '', $allowed_mov_types); $allowed_mov_types = str_replace('flv', '', $allowed_mov_types); cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '{$allowed_mov_types}' WHERE name = 'allowed_mov_types'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_FILETYPES']} WHERE extension = 'flv'"); return true; } }
function copperad_install() { global $CONFIG, $lang_plugin_copperad, $lang_plugin_copperad_config, $thisplugin; require 'plugins/copper_ad/include/init.inc.php'; if ($_POST['submit'] == $lang_plugin_copperad_config['button_install']) { if (!isset($CONFIG['cpa_enable'])) { require 'include/sql_parse.php'; $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('cpa_enable', '1');"; cpg_db_query($query); // Copy needed file and ADV directory ===If you can't CHMODE you gallery then comment these line 40~46 and after installation copy "banner.php.sample" and "bannermgr.php.sample" to your gallery root and remove ".sample" extention. copy($thisplugin->fullpath . "/banner.php.sample", "banner.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); copy($thisplugin->fullpath . "/bannermgr.php.sample", "bannermgr.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); mkdir('adv') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); mkdir('adv/pic') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); mkdir('adv/flash') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); copy($thisplugin->fullpath . "/adv/pic/copperad.jpg", "adv/pic/copperad.jpg") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); copy($thisplugin->fullpath . "/adv/flash/copperad.swf", "adv/flash/copperad.swf") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__); // create table $db_schema = $thisplugin->fullpath . '/schema.sql'; $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema)); $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query); $sql_query = remove_remarks($sql_query); $sql_query = split_sql_file($sql_query, ';'); foreach ($sql_query as $q) { cpg_db_query($q); } // Put default setting $db_schema = $thisplugin->fullpath . '/basic.sql'; $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema)); $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query); $sql_query = remove_remarks($sql_query); $sql_query = split_sql_file($sql_query, ';'); foreach ($sql_query as $q) { cpg_db_query($q); } } return true; } else { return 1; } }
function remote_videos_save_value($name) { if (!GALLERY_ADMIN_MODE) { global $lang_errors; cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); } global $CONFIG; $superCage = Inspekt::makeSuperCage(); if ($name == 'remote_video_vine_mode') { $new_value = $superCage->post->getAlpha($name); } else { $new_value = $superCage->post->getInt($name); } if ($new_value >= 0) { if (!isset($CONFIG[$name])) { cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES('{$name}', '{$new_value}')"); $CONFIG[$name] = $new_value; } elseif ($new_value != $CONFIG[$name]) { cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '{$new_value}' WHERE name = '{$name}'"); $CONFIG[$name] = $new_value; } } }
function album_fav_boxes_uninstall() { global $CONFIG; $superCage = Inspekt::makeSuperCage(); if (!checkFormToken()) { global $lang_errors; cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } // Delete the plugin config records cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_regular'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_search'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_favpics'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lastcom'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lastcomby'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lastup'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lastupby'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_topn'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_toprated'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lasthits'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_random'"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'plugin_album_fav_boxes_lastalb'"); return true; }
function update_user($user_id) { global $CONFIG; global $lang_usermgr_php, $lang_register_php, $icon_array; $superCage = Inspekt::makeSuperCage(); $user_name = $superCage->post->getEscaped('user_name'); $user_password = $superCage->post->getEscaped('user_password'); $user_email = $superCage->post->getEscaped('user_email'); $profile1 = $superCage->post->getEscaped('user_profile1'); $profile2 = $superCage->post->getEscaped('user_profile2'); $profile3 = $superCage->post->getEscaped('user_profile3'); $profile4 = $superCage->post->getEscaped('user_profile4'); $profile5 = $superCage->post->getEscaped('user_profile5'); $profile6 = $superCage->post->getEscaped('user_profile6'); $user_active = $superCage->post->getAlpha('user_active'); $user_group = $superCage->post->getInt('user_group'); $group_list = $superCage->post->keyExists('group_list') ? $superCage->post->getInt('group_list') : ''; if ($user_id == 'new_user') { cpg_db_query("INSERT INTO {$CONFIG['TABLE_USERS']} (user_regdate, user_profile6) VALUES (NOW(), '')"); $user_id = mysql_insert_id(); log_write('New user "' . $user_name . '" created', CPG_ACCESS_LOG); // Create a personal album if corresponding option is enabled if ($CONFIG['personal_album_on_registration'] == 1) { $catid = $user_id + FIRST_USER_CAT; cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('{$user_name}', {$catid})"); } } $sql = "SELECT user_id FROM {$CONFIG['TABLE_USERS']} WHERE user_name = '{$user_name}' AND user_id != {$user_id}"; $result = cpg_db_query($sql); if (mysql_num_rows($result)) { cpg_die(ERROR, $lang_register_php['err_user_exists'], __FILE__, __LINE__); return false; } mysql_free_result($result); if (utf_strlen($user_name) < 2) { cpg_die(ERROR, $lang_register_php['username_warning2'], __FILE__, __LINE__); } if ($user_password && utf_strlen($user_password) < 2) { cpg_die(ERROR, $lang_register_php['password_warning1'], __FILE__, __LINE__); } // Save old user data (we need it later to determine if we need to send the activation confirmation email) $user_data = mysql_fetch_assoc(cpg_db_query("SELECT user_name, user_active, user_email, user_actkey FROM {$CONFIG['TABLE_USERS']} WHERE user_id = '{$user_id}'")); if (is_array($group_list)) { $user_group_list = ''; foreach ($group_list as $group) { $user_group_list .= $group != $user_group ? $group . ',' : ''; } $user_group_list = substr($user_group_list, 0, -1); } else { $user_group_list = ''; } $sql_update = "UPDATE {$CONFIG['TABLE_USERS']} SET " . "user_name = '{$user_name}', " . "user_email = '{$user_email}', " . "user_active = '{$user_active}', " . "user_group = '{$user_group}', " . "user_profile1 = '{$profile1}', " . "user_profile2 = '{$profile2}', " . "user_profile3 = '{$profile3}', " . "user_profile4 = '{$profile4}', " . "user_profile5 = '{$profile5}', " . "user_profile6 = '{$profile6}', " . "user_group_list = '{$user_group_list}'"; if (!empty($user_password)) { require 'include/passwordhash.inc.php'; $sql_update .= ', ' . cpg_password_create_update_string($user_password); } if ($user_active == 'YES') { $sql_update .= ", user_actkey = ''"; } $sql_update .= " WHERE user_id = '{$user_id}'"; cpg_db_query($sql_update); // Update comments' author name cpg_db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_author = '{$user_name}' WHERE author_id = {$user_id}"); // If send login data checkbox is checked then send the username and password to the user in an email if ($superCage->post->keyExists('send_login_data') && trim($user_email)) { require 'include/mailer.inc.php'; $template_vars = array('{SITE_NAME}' => $CONFIG['gallery_name'], '{SITE_LINK}' => $CONFIG['site_url'], '{USER_NAME}' => trim($user_name), '{USER_PASS}' => trim($user_password)); if (!cpg_mail(trim($user_email), $lang_usermgr_php['send_login_email_subject'], nl2br(strtr($lang_usermgr_php['send_login_data_email'], $template_vars)))) { cpg_die(CRITICAL_ERROR, $lang_usermgr_php['failed_sending_email'], __FILE__, __LINE__); } } elseif ($user_data['user_actkey'] && $user_data['user_active'] == 'NO' && $user_active == 'YES') { // send activation confirmation email (only once) require 'include/mailer.inc.php'; $template_vars = array('{SITE_LINK}' => $CONFIG['site_url'], '{USER_NAME}' => $user_data['user_name'], '{SITE_NAME}' => $CONFIG['gallery_name']); cpg_mail($user_data['user_email'], sprintf($lang_register_php['notify_user_email_subject'], $CONFIG['gallery_name']), nl2br(strtr($lang_register_php['activated_email'], $template_vars))); } }
require_once "./plugins/limit_upload/lang/english.php"; if ($CONFIG['lang'] != 'english' && file_exists("./plugins/limit_upload/lang/{$CONFIG['lang']}.php")) { require_once "./plugins/limit_upload/lang/{$CONFIG['lang']}.php"; } $plugin_limit_upload_icon_array['submit'] = cpg_fetch_icon('ok', 1); if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) { $JS['includes'][] = 'js/jquery.spinbutton.js'; } $JS['includes'][] = 'plugins/limit_upload/script.js'; pageheader($lang_plugin_limit_upload['limit_upload'] . " - " . $lang_gallery_admin_menu['admin_lnk']); $superCage = Inspekt::makeSuperCage(); global $lang_common; if ($superCage->post->keyExists('submit')) { if (!checkFormToken()) { global $lang_errors; cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__); } if (is_numeric($superCage->post->getInt('upload_limit'))) { if ($superCage->post->getInt('upload_limit') >= 0) { cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getInt('upload_limit') . "' WHERE name = 'limit_upload_upload_limit'"); } } if (array_key_exists($superCage->post->getAlpha('time_limit'), $lang_plugin_limit_upload['upload_limit_values'])) { cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '" . $superCage->post->getAlpha('time_limit') . "' WHERE name = 'limit_upload_time_limit'"); } starttable("100%", $lang_common['information']); echo <<<EOT <tr> <td class="tableb" width="200"> {$lang_plugin_limit_upload['saved']} </td>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.5.0 $HeadURL$ $Revision$ $LastChangedBy$ $Date$ **********************************************/ define('IN_COPPERMINE', true); define('LOGIN_PHP', true); require 'include/init.inc.php'; if (USER_ID) { cpg_die(ERROR, $lang_login_php['err_already_logged_in'], __FILE__, __LINE__); } if (defined('UDB_INTEGRATION')) { $cpg_udb->login_page(); } //$referer = $superCage->get->keyExists('referer') ? $superCage->get->getRaw('referer') : 'index.php'; if (strpos($CPG_REFERER, "logout.php") !== false) { $CPG_REFERER = "index.php"; } $login_failed = ''; $cookie_warning = ''; if ($superCage->post->keyExists('submitted')) { if ($USER_DATA = $cpg_udb->login($superCage->post->getEscaped('username'), $superCage->post->getEscaped('password'), $superCage->post->getInt('remember_me'))) { //$referer=preg_replace("'&'","&",$referer); cpgRedirectPage($CPG_REFERER, $lang_login_php['login'], sprintf($lang_login_php['welcome'], $USER_DATA['user_name']), 3); exit;
} //Using getRaw() since we need the actual name of the file uploaded by the user if (is_uploaded_file($superCage->files->getRaw('plugin/tmp_name'))) { //$file =& $_FILES['plugin']; $file = $superCage->files->getRaw('plugin'); $info = pathinfo($file['name']); if (strtolower($info['extension'] != 'zip')) { cpg_die(CRITICAL_ERROR, $lang_pluginmgr_php['not_plugin_package'], __FILE__, __LINE__); } if (!is_dir('./plugins/receive')) { $mask = umask(0); mkdir('./plugins/receive', 0777); umask($mask); } if (!move_uploaded_file($superCage->files->getRaw('plugin/tmp_name'), './plugins/receive/' . $file['name'])) { cpg_die(CRITICAL_ERROR, $lang_pluginmgr_php['copy_error'], __FILE__, __LINE__); } require_once './include/zip.lib.php'; $zip = new Zip(); $zip->Extract('./plugins/receive/' . $file['name'], './plugins', array(-1)); unlink('./plugins/receive/' . $file['name']); } break; } pageheader($lang_pluginmgr_php['pmgr']); if (isset($lang_pluginmgr_php['confirm_version']) != TRUE) { $lang_pluginmgr_php['confirm_version'] = 'Could not determine the version requirements for this plugin. This is usually an indicator that the plugin was not designed for your version of coppermine and might therefore crash your gallery. Continue anway (not recommended)?'; } echo <<<EOT <script language="javascript" type="text/javascript">
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 3 of the License, or (at your option) any later version. ******************************************** $HeadURL$ $Revision$ $LastChangedBy$ $Date$ **************************************************/ require_once 'include/init.inc.php'; require './plugins/slider/include/init.inc.php'; $slider_superCage = Inspekt::makeSuperCage(); global $CONFIG, $lang_plugin_slider; if (!GALLERY_ADMIN_MODE) { cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); } if ($lang_text_dir == 'ltr') { $align = "left"; $direction = "ltr"; } else { $align = "right"; $direction = "rtl"; } pageheader($lang_plugin_slider['display_name']); if ($slider_superCage->post->keyExists('update')) { $slider_width = $slider_superCage->post->getInt('slider_width'); $slider_numberofpics = $slider_superCage->post->getInt('slider_numberofpics'); $slider_speed = $slider_superCage->post->getInt('slider_speed'); if ($enl_matches = $slider_superCage->post->getMatched('slider_bgcolor', '/^[a-zA-Z0-9#]+$/')) { $slider_bgcolor = $enl_matches[0];
$nb_com_del = 0; if (isset($_POST['cid_array'])) { $cid_array = $_POST['cid_array']; $cid_set = ''; foreach ($cid_array as $cid) { $cid_set .= $cid_set == '' ? '(' . $cid : ', ' . $cid; } $cid_set .= ')'; cpg_db_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE msg_id IN {$cid_set}"); $nb_com_del = mysql_affected_rows(); } $result = cpg_db_query("SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1"); $nbEnr = mysql_fetch_array($result); $comment_count = $nbEnr[0]; if (!$comment_count) { cpg_die(INFORMATION, $lang_reviewcom_php['no_comment'], __FILE__, __LINE__); } $start = isset($_GET['start']) ? (int) $_GET['start'] : 0; $count = isset($_GET['count']) ? $_GET['count'] : 25; $next_target = $_SERVER['PHP_SELF'] . '?start=' . ($start + $count) . '&count=' . $count; $prev_target = $_SERVER['PHP_SELF'] . '?start=' . max(0, $start - $count) . '&count=' . $count; $s50 = $count == 50 ? 'selected' : ''; $s75 = $count == 75 ? 'selected' : ''; $s100 = $count == 100 ? 'selected' : ''; if ($start + $count < $comment_count) { $next_link = "<a href=\"{$next_target}\" class=\"admin_menu\">{$lang_reviewcom_php['see_next']}»</a> - "; } else { $next_link = ''; } if ($start > 0) { $prev_link = "<a href=\"{$prev_target}\" class=\"admin_menu\">«{$lang_reviewcom_php['see_prev']}</a> - ";
$pid = $pos < 0 ? -$pos : $pid; $result = cpg_db_query("SELECT aid from {$CONFIG['TABLE_PICTURES']} WHERE pid='{$pid}' {$ALBUM_SET} LIMIT 1"); if (mysql_num_rows($result) == 0) { cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__); } $row = mysql_fetch_array($result); $album = $row['aid']; $pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false); for ($pos = 0; $pic_data[$pos]['pid'] != $pid && $pos < $pic_count; $pos++) { } $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false); $CURRENT_PIC_DATA = $pic_data[0]; } elseif (isset($_GET['pos'])) { $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false); if ($pic_count == 0) { cpg_die(INFORMATION, $lang_errors['no_img_to_display'], __FILE__, __LINE__); } elseif (count($pic_data) == 0 && $pos >= $pic_count) { $pos = $pic_count - 1; $human_pos = $pos + 1; $pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false); } $CURRENT_PIC_DATA = $pic_data[0]; } $enl_img = isset($_GET['enl_img']) ? $_GET['enl_img'] : 'wurst'; echo '<table cellspacing="1" style="width:100%;height:100%">'; echo '<tr>'; echo '<td colspan="2" class="enl_infotablehead" align="center"><b>' . $lang_rate_pic['rate_this_pic'] . '</b><br />'; if ($CURRENT_PIC_DATA['votes'] > 0) { echo sprintf($lang_picinfo['Rating'], $CURRENT_PIC_DATA['votes']) . ': ' . round($CURRENT_PIC_DATA['pic_rating'] / 2000, 2) . '/5'; } echo '</td>';
<?php /*This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** AndroidCPG version: 1.5.30.1 **********************************************/ if (!defined('IN_COPPERMINE')) { die('Not in Coppermine...'); } if ($CONFIG['enable_plugins'] == 1) { $not_enabled = true; foreach ($CPG_PLUGINS as $thisplugin) { if ($thisplugin->name == 'AndroidCPG') { $not_enabled = false; break; } } if ($not_enabled) { cpg_die(ERROR, 'plugin not enabled', __FILE__, __LINE__); } } else { cpg_die(ERROR, 'plugin not enabled', __FILE__, __LINE__); }
foreach ($superCage->post->getInt('user_groups') as $key) { cpg_db_query("INSERT INTO {$CONFIG['TABLE_CATMAP']} (cid, group_id) VALUES ({$cid}, {$key})"); } } break; case 'deletecat': if (!$superCage->get->keyExists('cid')) { cpg_die(CRITICAL_ERROR, sprintf($lang_catmgr_php['miss_param'], 'deletecat'), __FILE__, __LINE__); } $cid = $superCage->get->getInt('cid'); if ($cid == 1) { cpg_die(ERROR, $lang_catmgr_php['usergal_cat_ro'], __FILE__, __LINE__); } $result = cpg_db_query("SELECT parent FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = {$cid}"); if (!$result->numRows()) { cpg_die(ERROR, $lang_catmgr_php['unknown_cat'], __FILE__, __LINE__); } $del_category = $result->fetchAssoc(true); $parent = $del_category['parent']; cpg_db_query("UPDATE {$CONFIG['TABLE_CATEGORIES']} SET parent = {$parent}, lft = 0 WHERE parent = {$cid}"); cpg_db_query("UPDATE {$CONFIG['TABLE_ALBUMS']} SET category = {$parent} WHERE category = {$cid}"); cpg_db_query("DELETE FROM {$CONFIG['TABLE_CATEGORIES']} WHERE cid = {$cid}"); //delete from categorymap cpg_db_query("DELETE FROM {$CONFIG['TABLE_CATMAP']} WHERE cid = {$cid}"); break; } if ($op) { check_rebuild_tree(); } get_subcat_data(0); pageheader($lang_catmgr_php['manage_cat']);
function validate_comment() { global $CONFIG, $USER_DATA, $hdr_ip; $superCage = Inspekt::makeSuperCage(); require_once RECAPTCHAPATH . '/recaptchalib.php'; $resp = recaptcha_check_answer($CONFIG['sawey_recaptcha_privkey'], $superCage->server->getEscaped('REMOTE_ADDR'), $superCage->post->getRaw('recaptcha_challenge_field'), $superCage->post->getRaw('recaptcha_response_field')); if (!$resp->is_valid) { if ($CONFIG['log_mode'] != 0) { log_write('Captcha authentication for Comment failed for user ' . $USER_DATA['user_name'] . ' at ' . $hdr_ip, CPG_SECURITY_LOG); } //load language $file_lang = RECAPTCHAPATH . '/lang/' . $CONFIG['lang'] . '.php'; include file_exists($file_lang) ? $file_lang : RECAPTCHAPATH . '/lang/english.php'; cpg_die(ERROR, $recap_lang['incorrect-captcha-comment'], __FILE__, __LINE__); } }
$CONFIG['TABLE_FAVPICS'] = $CONFIG['TABLE_PREFIX'] . "favpics"; $CONFIG['TABLE_BRIDGE'] = $CONFIG['TABLE_PREFIX'] . "bridge"; $CONFIG['TABLE_VOTE_STATS'] = $CONFIG['TABLE_PREFIX'] . "vote_stats"; $CONFIG['TABLE_HIT_STATS'] = $CONFIG['TABLE_PREFIX'] . "hit_stats"; // Connect to database ($CONFIG['LINK_ID'] = cpg_db_connect()) || die("<b>Coppermine critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said: <b>" . mysql_error() . "</b>"); // Retrieve DB stored configuration $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_CONFIG']}"); while ($row = mysql_fetch_array($results)) { $CONFIG[$row['name']] = $row['value']; } // while mysql_free_result($results); define('USER_GAL_CAT', 1); define('FIRST_USER_CAT', 10000); // We load the chosen language file require "../lang/english.php"; require 'cpgAPIerrors.php'; // Check for GD GIF Create support if ($CONFIG['thumb_method'] == 'im' || function_exists('imagecreatefromgif')) { $CONFIG['GIF_support'] = 1; } else { $CONFIG['GIF_support'] = 0; } require 'cpgAPIAuth.php'; $auth = new cpgAPIAuth(); if (!$auth->authenticate()) { cpg_die(18); } // Reference 'site_url' to 'ecards_more_pic_target' $CONFIG['site_url'] =& $CONFIG['ecards_more_pic_target'];
function flf_histotag_configure() { global $CONFIG, $thisplugin, $lang_common, $thumb_rotate_icon_array, $lang_errors, $flf_lang_var, $imagerotate_exist; $superCage = Inspekt::makeSuperCage(); if (!GALLERY_ADMIN_MODE) { cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__); } // Populate the form fields and run the queries for the submit form $config_changes_counter = 0; $dump_cache = 0; // plugin_flf_histotag_histoquality if ($superCage->post->keyExists('plugin_flf_histotag_histoquality') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_histoquality') >= 0 && $superCage->post->getInt('plugin_flf_histotag_histoquality') <= 100 && $CONFIG['plugin_flf_histotag_histoquality'] != $superCage->post->getInt('plugin_flf_histotag_histoquality')) { $CONFIG['plugin_flf_histotag_histoquality'] = $superCage->post->getInt('plugin_flf_histotag_histoquality'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histoquality']}' WHERE name='plugin_flf_histotag_histoquality'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // bgcolor if ($superCage->post->keyExists('plugin_flf_histotag_histocolor') == TRUE) { $temp = $superCage->post->getRaw('plugin_flf_histotag_histocolor'); // Usually, we would not use that method, but we'll sanitize later. $temp = '#' . strtoupper(ltrim($temp, '#')); if (preg_match('/^#(?:(?:[a-f\\d]{3}){1,2})$/i', $temp)) { if ($CONFIG['plugin_flf_histotag_histocolor'] != $temp) { $CONFIG['plugin_flf_histotag_histocolor'] = $temp; $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histocolor']}' WHERE name='plugin_flf_histotag_histocolor'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } } // Map Width if ($superCage->post->keyExists('plugin_flf_histotag_mapwidth') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_mapwidth') >= 0 && $superCage->post->getInt('plugin_flf_histotag_mapwidth') <= 1280 && $CONFIG['plugin_flf_histotag_mapwidth'] != $superCage->post->getInt('plugin_flf_histotag_mapwidth')) { $CONFIG['plugin_flf_histotag_mapwidth'] = $superCage->post->getInt('plugin_flf_histotag_mapwidth'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_mapwidth']}' WHERE name='plugin_flf_histotag_mapwidth'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Map Height if ($superCage->post->keyExists('plugin_flf_histotag_mapheight') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_mapheight') >= 0 && $superCage->post->getInt('plugin_flf_histotag_mapheight') <= 1024 && $CONFIG['plugin_flf_histotag_mapheight'] != $superCage->post->getInt('plugin_flf_histotag_mapheight')) { $CONFIG['plugin_flf_histotag_mapheight'] = $superCage->post->getInt('plugin_flf_histotag_mapheight'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_mapheight']}' WHERE name='plugin_flf_histotag_mapheight'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Map Box Width if ($superCage->post->keyExists('plugin_flf_histotag_mapboxwidth') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_mapboxwidth') >= 0 && $superCage->post->getInt('plugin_flf_histotag_mapboxwidth') <= 1280 && $CONFIG['plugin_flf_histotag_mapboxwidth'] != $superCage->post->getInt('plugin_flf_histotag_mapboxwidth')) { $CONFIG['plugin_flf_histotag_mapboxwidth'] = $superCage->post->getInt('plugin_flf_histotag_mapboxwidth'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_mapboxwidth']}' WHERE name='plugin_flf_histotag_mapboxwidth'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Map Height if ($superCage->post->keyExists('plugin_flf_histotag_mapboxheight') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_mapboxheight') >= 0 && $superCage->post->getInt('plugin_flf_histotag_mapboxheight') <= 1024 && $CONFIG['plugin_flf_histotag_mapboxheight'] != $superCage->post->getInt('plugin_flf_histotag_mapboxheight')) { $CONFIG['plugin_flf_histotag_mapboxheight'] = $superCage->post->getInt('plugin_flf_histotag_mapboxheight'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_mapboxheight']}' WHERE name='plugin_flf_histotag_mapboxheight'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // API key if ($superCage->post->keyExists('plugin_flf_histotag_apikey') == TRUE) { $temp = $superCage->post->getRaw('plugin_flf_histotag_apikey'); if ($CONFIG['plugin_flf_histotag_apikey'] != $temp) { $CONFIG['plugin_flf_histotag_apikey'] = $temp; $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_apikey']}' WHERE name='plugin_flf_histotag_apikey'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } if ($superCage->post->keyExists('plugin_flf_histotag_mapmode') == TRUE && $superCage->post->getInt('plugin_flf_histotag_mapmode') != $CONFIG['plugin_flf_histotag_mapmode']) { $CONFIG['plugin_flf_histotag_mapmode'] = $superCage->post->getInt('plugin_flf_histotag_mapmode'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_mapmode']}' WHERE name='plugin_flf_histotag_mapmode'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } switch ($CONFIG['plugin_flf_histotag_mapmode']) { case 1: $option_output['plugin_flf_histotag_mapmode_2'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = ''; $option_output['plugin_flf_histotag_mapmode_1'] = 'checked="checked"'; break; case 2: $option_output['plugin_flf_histotag_mapmode_1'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = ''; $option_output['plugin_flf_histotag_mapmode_2'] = 'checked="checked"'; break; case 3: $option_output['plugin_flf_histotag_mapmode_2'] = ''; $option_output['plugin_flf_histotag_mapmode_1'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = 'checked="checked"'; break; case 4: $option_output['plugin_flf_histotag_mapmode_2'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = ''; $option_output['plugin_flf_histotag_mapmode_1'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = 'checked="checked"'; break; case 5: $option_output['plugin_flf_histotag_mapmode_2'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = ''; $option_output['plugin_flf_histotag_mapmode_1'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = 'checked="checked"'; break; default: $option_output['plugin_flf_histotag_mapmode_2'] = ''; $option_output['plugin_flf_histotag_mapmode_3'] = ''; $option_output['plugin_flf_histotag_mapmode_4'] = ''; $option_output['plugin_flf_histotag_mapmode_5'] = ''; $option_output['plugin_flf_histotag_mapmode_1'] = 'checked="checked"'; } if ($superCage->post->keyExists('plugin_flf_histotag_geosupport') == TRUE && $superCage->post->getInt('plugin_flf_histotag_geosupport') != $CONFIG['plugin_flf_histotag_geosupport']) { $CONFIG['plugin_flf_histotag_geosupport'] = $superCage->post->getInt('plugin_flf_histotag_geosupport'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_geosupport']}' WHERE name='plugin_flf_histotag_geosupport'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } switch ($CONFIG['plugin_flf_histotag_geosupport']) { case 1: $option_output['plugin_flf_histotag_geosupport_2'] = ''; $option_output['plugin_flf_histotag_geosupport_3'] = ''; $option_output['plugin_flf_histotag_geosupport_1'] = 'checked="checked"'; break; case 2: $option_output['plugin_flf_histotag_geosupport_1'] = ''; $option_output['plugin_flf_histotag_geosupport_3'] = ''; $option_output['plugin_flf_histotag_geosupport_2'] = 'checked="checked"'; break; case 3: $option_output['plugin_flf_histotag_geosupport_2'] = ''; $option_output['plugin_flf_histotag_geosupport_1'] = ''; $option_output['plugin_flf_histotag_geosupport_3'] = 'checked="checked"'; break; default: $option_output['plugin_flf_histotag_geosupport_2'] = ''; $option_output['plugin_flf_histotag_geosupport_3'] = ''; $option_output['plugin_flf_histotag_geosupport_1'] = 'checked="checked"'; break; } if ($superCage->post->keyExists('plugin_flf_histotag_imagesource') == TRUE && $superCage->post->getInt('plugin_flf_histotag_imagesource') != $CONFIG['plugin_flf_histotag_imagesource']) { $CONFIG['plugin_flf_histotag_imagesource'] = $superCage->post->getInt('plugin_flf_histotag_imagesource'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_imagesource']}' WHERE name='plugin_flf_histotag_imagesource'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } switch ($CONFIG['plugin_flf_histotag_imagesource']) { case 1: $option_output['plugin_flf_histotag_imagesource_2'] = ''; $option_output['plugin_flf_histotag_imagesource_3'] = ''; $option_output['plugin_flf_histotag_imagesource_1'] = 'checked="checked"'; break; case 2: $option_output['plugin_flf_histotag_imagesource_1'] = ''; $option_output['plugin_flf_histotag_imagesource_3'] = ''; $option_output['plugin_flf_histotag_imagesource_2'] = 'checked="checked"'; break; case 3: $option_output['plugin_flf_histotag_imagesource_2'] = ''; $option_output['plugin_flf_histotag_imagesource_1'] = ''; $option_output['plugin_flf_histotag_imagesource_3'] = 'checked="checked"'; break; default: $option_output['plugin_flf_histotag_imagesource_2'] = ''; $option_output['plugin_flf_histotag_imagesource_3'] = ''; $option_output['plugin_flf_histotag_imagesource_1'] = 'checked="checked"'; break; } if ($superCage->post->keyExists('plugin_flf_histotag_histosupport') == TRUE && $superCage->post->getInt('plugin_flf_histotag_histosupport') != $CONFIG['plugin_flf_histotag_histosupport']) { $CONFIG['plugin_flf_histotag_histosupport'] = $superCage->post->getInt('plugin_flf_histotag_histosupport'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histosupport']}' WHERE name='plugin_flf_histotag_histosupport'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } switch ($CONFIG['plugin_flf_histotag_histosupport']) { case 1: $option_output['plugin_flf_histotag_histosupport_2'] = ''; $option_output['plugin_flf_histotag_histosupport_3'] = ''; $option_output['plugin_flf_histotag_histosupport_4'] = ''; $option_output['plugin_flf_histotag_histosupport_1'] = 'checked="checked"'; break; case 2: $option_output['plugin_flf_histotag_histosupport_1'] = ''; $option_output['plugin_flf_histotag_histosupport_3'] = ''; $option_output['plugin_flf_histotag_histosupport_4'] = ''; $option_output['plugin_flf_histotag_histosupport_2'] = 'checked="checked"'; break; case 3: $option_output['plugin_flf_histotag_histosupport_1'] = ''; $option_output['plugin_flf_histotag_histosupport_2'] = ''; $option_output['plugin_flf_histotag_histosupport_4'] = ''; $option_output['plugin_flf_histotag_histosupport_3'] = 'checked="checked"'; break; case 4: $option_output['plugin_flf_histotag_histosupport_1'] = ''; $option_output['plugin_flf_histotag_histosupport_2'] = ''; $option_output['plugin_flf_histotag_histosupport_3'] = ''; $option_output['plugin_flf_histotag_histosupport_4'] = 'checked="checked"'; break; default: $option_output['plugin_flf_histotag_histosupport_2'] = ''; $option_output['plugin_flf_histotag_histosupport_3'] = ''; $option_output['plugin_flf_histotag_histosupport_4'] = ''; $option_output['plugin_flf_histotag_histosupport_1'] = 'checked="checked"'; break; } // UseHistogram function upon upload of images if ($superCage->post->keyExists('plugin_flf_histotag_createonupload') == TRUE && $superCage->post->getInt('plugin_flf_histotag_createonupload') == 1) { $temp = 1; } elseif ($superCage->post->keyExists('submit') == TRUE) { $temp = 0; } else { $temp = $CONFIG['plugin_flf_histotag_createonupload']; } if ($CONFIG['plugin_flf_histotag_createonupload'] != $temp) { $CONFIG['plugin_flf_histotag_createonupload'] = $temp; $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_createonupload']}' WHERE name='plugin_flf_histotag_createonupload'"; cpg_db_query($query); $config_changes_counter++; } if ($CONFIG['plugin_flf_histotag_createonupload'] == '1') { $option_output['plugin_flf_histotag_createonupload'] = 'checked="checked"'; } if ($superCage->post->keyExists('plugin_flf_histotag_histotype') == TRUE && $superCage->post->getInt('plugin_flf_histotag_histotype') != $CONFIG['plugin_flf_histotag_histotype']) { $CONFIG['plugin_flf_histotag_histotype'] = $superCage->post->getInt('plugin_flf_histotag_histotype'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histotype']}' WHERE name='plugin_flf_histotag_histotype'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } if ($CONFIG['plugin_flf_histotag_histotype'] == '2') { $option_output['plugin_flf_histotag_histotype_combined'] = ''; $option_output['plugin_flf_histotag_histotype_separate'] = 'checked="checked"'; } else { // default is "combined" $option_output['plugin_flf_histotag_histotype_combined'] = 'checked="checked"'; $option_output['plugin_flf_histotag_histotype_separate'] = ''; } // Histogram Box Width if ($superCage->post->keyExists('plugin_flf_histotag_histoboxwidth') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_histoboxwidth') >= 0 && $superCage->post->getInt('plugin_flf_histotag_histoboxwidth') <= 1280 && $CONFIG['plugin_flf_histotag_histoboxwidth'] != $superCage->post->getInt('plugin_flf_histotag_histoboxwidth')) { $CONFIG['plugin_flf_histotag_histoboxwidth'] = $superCage->post->getInt('plugin_flf_histotag_histoboxwidth'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histoboxwidth']}' WHERE name='plugin_flf_histotag_histoboxwidth'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Histogram Box Height if ($superCage->post->keyExists('plugin_flf_histotag_histoboxheight') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_histoboxheight') >= 0 && $superCage->post->getInt('plugin_flf_histotag_histoboxheight') <= 1024 && $CONFIG['plugin_flf_histotag_histoboxheight'] != $superCage->post->getInt('plugin_flf_histotag_histoboxheight')) { $CONFIG['plugin_flf_histotag_histoboxheight'] = $superCage->post->getInt('plugin_flf_histotag_histoboxheight'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histoboxheight']}' WHERE name='plugin_flf_histotag_histoboxheight'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Histogram Width if ($superCage->post->keyExists('plugin_flf_histotag_histowidth') == TRUE) { if ($superCage->post->getInt('plugin_flf_histotag_histowidth') >= 0 && $superCage->post->getInt('plugin_flf_histotag_histowidth') <= 1024 && $CONFIG['plugin_flf_histotag_histowidth'] != $superCage->post->getInt('plugin_flf_histotag_histowidth')) { $CONFIG['plugin_flf_histotag_histowidth'] = $superCage->post->getInt('plugin_flf_histotag_histowidth'); $query = "UPDATE {$CONFIG['TABLE_CONFIG']} SET value='{$CONFIG['plugin_flf_histotag_histowidth']}' WHERE name='plugin_flf_histotag_histowidth'"; cpg_db_query($query); $config_changes_counter++; $dump_cache++; } } // Form submit? if ($superCage->post->keyExists('submit') == TRUE) { if ($config_changes_counter > 0) { $additional_submit_information = '<div class="cpg_message_success">' . $flf_lang_var['changes_saved'] . '</div>'; } else { $additional_submit_information = '<div class="cpg_message_validation">' . $flf_lang_var['no_changes'] . '</div>'; } } // TODO: Create the table row that is displayed during initial install $install_section = ''; // Start the actual output echo <<<EOT <style type="text/css" media="screen"> .farbtastic { position: relative; } .farbtastic * { position: absolute; cursor: crosshair; } .farbtastic, .farbtastic .wheel { width: 195px; height: 195px; } .farbtastic .color, .farbtastic .overlay { top: 47px; left: 47px; width: 101px; height: 101px; } .farbtastic .wheel { background: url(plugins/flf_histotag/images/wheel.png) no-repeat; width: 195px; height: 195px; } .farbtastic .overlay { background: url(plugins/flf_histotag/images/mask.png) no-repeat; } .farbtastic .marker { width: 17px; height: 17px; margin: -8px 0 0 -8px; overflow: hidden; background: url(plugins/flf_histotag/images/marker.png) no-repeat; } </style> <script type="text/javascript"> \$(document).ready(function() { \$('#colorpicker_bgcolor').farbtastic('#plugin_flf_histotag_histocolor'); \$("#plugin_flf_histotag_histoquality").SpinButton({min: 0,max: 100}); \$("#plugin_flf_histotag_mapwidth").SpinButton({min: 200,max: 1280}); \$("#plugin_flf_histotag_mapheight").SpinButton({min:100,max: 1024}); \$("#plugin_flf_histotag_mapboxwidth").SpinButton({min: 200,max: 1280}); \$("#plugin_flf_histotag_mapboxheight").SpinButton({min:100,max: 1024}); \$("#plugin_flf_histotag_histoboxwidth").SpinButton({min: 100,max: 1280}); \$("#plugin_flf_histotag_histoboxheight").SpinButton({min:100,max: 1024}); \$("#plugin_flf_histotag_histowidth").SpinButton({min:256,max: 1024}); }); </script> <form action="" method="post" name="thumb_rotate_config" id="thumb_rotate_config"> EOT; starttable('100%', $thumb_rotate_icon_array['config'] . $flf_lang_var['config'], 2); echo <<<EOT <tr> <td valign="top" class ="tableh1"> {$flf_lang_var['configure_geo']} </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['geosupport']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="radio" name="plugin_flf_histotag_geosupport" id="plugin_flf_histotag_geosupport_1" class="checkbox" value="1" {$option_output['plugin_flf_histotag_geosupport_1']} /> <label for="plugin_flf_histotag_geosupport_1"> {$flf_lang_var['geosupport_1']}</label> <br /> <input type="radio" name="plugin_flf_histotag_geosupport" id="plugin_flf_histotag_geosupport_2" class="checkbox" value="2" {$option_output['plugin_flf_histotag_geosupport_2']} /> <label for="plugin_flf_histotag_geosupport_2"> {$flf_lang_var['geosupport_2']}</label> <br /> <input type="radio" name="plugin_flf_histotag_geosupport" id="plugin_flf_histotag_geosupport_3" class="checkbox" value="3" {$option_output['plugin_flf_histotag_geosupport_3']} /> <label for="plugin_flf_histotag_geosupport_3"> {$flf_lang_var['geosupport_3']}</label> <br /> </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['maptype']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="radio" name="plugin_flf_histotag_mapmode" id="plugin_flf_histotag_mapmode_1" class="checkbox" value="1" {$option_output['plugin_flf_histotag_mapmode_1']} /> <label for="plugin_flf_histotag_mapmode_1"> {$flf_lang_var['maptype_1']}</label> <br /> <input type="radio" name="plugin_flf_histotag_mapmode" id="plugin_flf_histotag_mapmode_2" class="checkbox" value="2" {$option_output['plugin_flf_histotag_mapmode_2']} /> <label for="plugin_flf_histotag_mapmode_2"> {$flf_lang_var['maptype_2']}</label> <br /> <input type="radio" name="plugin_flf_histotag_mapmode" id="plugin_flf_histotag_mapmode_3" class="checkbox" value="3" {$option_output['plugin_flf_histotag_mapmode_3']} /> <label for="plugin_flf_histotag_mapmode_3"> {$flf_lang_var['maptype_3']}</label> <br /> <input type="radio" name="plugin_flf_histotag_mapmode" id="plugin_flf_histotag_mapmode_4" class="checkbox" value="4" {$option_output['plugin_flf_histotag_mapmode_4']} /> <label for="plugin_flf_histotag_mapmode_4"> {$flf_lang_var['maptype_4']}</label> <br /> <input type="radio" name="plugin_flf_histotag_mapmode" id="plugin_flf_histotag_mapmode_5" class="checkbox" value="5" {$option_output['plugin_flf_histotag_mapmode_5']} /> <label for="plugin_flf_histotag_mapmode_5"> {$flf_lang_var['maptype_5']}</label> </td> </tr> <tr> <td valign="top" class ="tableb"> {$flf_lang_var['configmap']} </td> </tr> <td valign="top" class="tableb"> {$flf_lang_var['mapwidth']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_mapwidth" id="plugin_flf_histotag_mapwidth" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_mapwidth']}" /> px </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['mapheight']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_mapheight" id="plugin_flf_histotag_mapheight" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_mapheight']}" /> px <br /> <br /> </td> </tr> <tr> <td valign="top" class ="tableb"> {$flf_lang_var['configmapbox']} </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['mapwidth']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_mapboxwidth" id="plugin_flf_histotag_mapboxwidth" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_mapboxwidth']}" /> px </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['mapheight']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_mapboxheight" id="plugin_flf_histotag_mapboxheight" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_mapboxheight']}" /> px <br /> <br /> </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['setapi']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_apikey" id="plugin_flf_histotag_apikey" class="textinput" size="50" maxlength="200" value="{$CONFIG['plugin_flf_histotag_apikey']}" /> <br /> <br /> </td> </tr> <tr> <td valign="top" class ="tableh1"> <br> {$flf_lang_var['configure_histo']} <br> </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['histosupport']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="radio" name="plugin_flf_histotag_histosupport" id="plugin_flf_histotag_histosupport_1" class="checkbox" value="1" {$option_output['plugin_flf_histotag_histosupport_1']} /> <label for="plugin_flf_histotag_histosupport_1"> {$flf_lang_var['histosupport_1']}</label> <br /> <input type="radio" name="plugin_flf_histotag_histosupport" id="plugin_flf_histotag_histosupport_2" class="checkbox" value="2" {$option_output['plugin_flf_histotag_histosupport_2']} /> <label for="plugin_flf_histotag_histosupport_2"> {$flf_lang_var['histosupport_2']}</label> <br /> <input type="radio" name="plugin_flf_histotag_histosupport" id="plugin_flf_histotag_histosupport_3" class="checkbox" value="3" {$option_output['plugin_flf_histotag_histosupport_3']} /> <label for="plugin_flf_histotag_histosupport_3"> {$flf_lang_var['histosupport_3']}</label> <br /> <input type="radio" name="plugin_flf_histotag_histosupport" id="plugin_flf_histotag_histosupport_4" class="checkbox" value="4" {$option_output['plugin_flf_histotag_histosupport_4']} /> <label for="plugin_flf_histotag_histosupport_4"> {$flf_lang_var['histosupport_4']}</label> <br /> </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['imagesource']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="radio" name="plugin_flf_histotag_imagesource" id="plugin_flf_histotag_imagesource_1" class="checkbox" value="1" {$option_output['plugin_flf_histotag_imagesource_1']} /> <label for="plugin_flf_histotag_imagesource_1"> {$flf_lang_var['imagesource_1']}</label> <br /> <input type="radio" name="plugin_flf_histotag_imagesource" id="plugin_flf_histotag_imagesource_2" class="checkbox" value="2" {$option_output['plugin_flf_histotag_imagesource_2']} /> <label for="plugin_flf_histotag_imagesource_2"> {$flf_lang_var['imagesource_2']}</label> <br /> <input type="radio" name="plugin_flf_histotag_imagesource" id="plugin_flf_histotag_imagesource_3" class="checkbox" value="3" {$option_output['plugin_flf_histotag_imagesource_3']} /> <label for="plugin_flf_histotag_imagesource_3"> {$flf_lang_var['imagesource_3']}</label> <br /> </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['createonupload']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="checkbox" name="plugin_flf_histotag_createonupload" id="plugin_flf_histotag_createonupload" class="checkbox" value="1" {$option_output['plugin_flf_histotag_createonupload']} /> {$flf_lang_var['activated']} </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['histcol']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="text" name="plugin_flf_histotag_histocolor" id="plugin_flf_histotag_histocolor" class="textinput" size="8" maxlength="7" value="{$CONFIG['plugin_flf_histotag_histocolor']}" style="text-transform:uppercase;" /> <span class="detail_head_collapsed">{$flf_lang_var['toggle_color_picker']}</span> <div id="colorpicker_bgcolor" class="detail_body"></div> </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['histo_quality']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_histoquality" id="plugin_flf_histotag_histoquality" class="textinput spin-button" size="3" maxlength="3" value="{$CONFIG['plugin_flf_histotag_histoquality']}" /> % <br /> <br /> </td> </tr> <tr> <td valign="top" class="tableb tableb_alternate"> {$flf_lang_var['histtype']} </td> <td valign="top" class="tableb tableb_alternate"> <input type="radio" name="plugin_flf_histotag_histotype" id="plugin_flf_histotag_histotype_combined" class="checkbox" value="1" {$option_output['plugin_flf_histotag_histotype_combined']} /> <label for="plugin_flf_histotag_histotype_combined"> ({$flf_lang_var['histo_type_combined']})</label> <br /> <input type="radio" name="plugin_flf_histotag_histotype" id="plugin_flf_histotag_histotype_separate" class="checkbox" value="2" {$option_output['plugin_flf_histotag_histotype_separate']} /> <label for="plugin_flf_histotag_histotype_separate"> ({$flf_lang_var['histo_type_separate']})</label> </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['histowidth']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_histowidth" id="plugin_flf_histotag_histowidth" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_histowidth']}" /> px <br /> <br /> </td> </tr> <tr> <td valign="top" class ="tableb"> {$flf_lang_var['configmapbox']} </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['mapwidth']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_histoboxwidth" id="plugin_flf_histotag_histoboxwidth" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_histoboxwidth']}" /> px </td> </tr> <tr> <td valign="top" class="tableb"> {$flf_lang_var['mapheight']} </td> <td valign="top" class="tableb"> <input type="text" name="plugin_flf_histotag_histoboxheight" id="plugin_flf_histotag_histoboxheight" class="textinput spin-button" size="4" maxlength="4" value="{$CONFIG['plugin_flf_histotag_histoboxheight']}" /> px <br /> <br /> </td> </tr> {$install_section} <tr> <td valign="middle" class="tablef"> </td> <td valign="middle" class="tablef"> <button type="submit" class="button" name="submit" value="{$lang_common['ok']}">{$thumb_rotate_icon_array['ok']}{$lang_common['ok']}</button> </td> </tr> EOT; endtable(); echo <<<EOT {$additional_submit_information} </form> EOT; }
$cid_array = $_POST['cid_array']; $cid_set = ''; foreach ($cid_array as $cid) { $cid_set .= $cid_set == '' ? '(' . $cid : ', ' . $cid; } $cid_set .= ')'; $db->sql_query("DELETE FROM {$CONFIG['TABLE_COMMENTS']} WHERE msg_id IN {$cid_set}", false, __FILE__, __LINE__); $nb_com_del = $db->sql_affectedrows(); } /*$result = $db->sql_query("SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']}",false, __FILE__, __LINE__); $nbEnr = $db->sql_fetchrow($result); $comment_count = $nbEnr[0]; */ $comment_count = cpg_tablecount($CONFIG['TABLE_COMMENTS'], "count(*)", __FILE__, __LINE__); if (!$comment_count) { cpg_die(INFO, NO_COMMENT, __FILE__, __LINE__); } $start = isset($_GET['start']) ? $_GET['start'] : 0; $start = intval($start); $count = isset($_GET['count']) ? $_GET['count'] : 25; $count = intval($count); $next_target = URL::index('&file=reviewcom&start=' . ($start + $count) . '&count=' . $count); $prev_target = URL::index('&file=reviewcom&start=' . max(0, $start - $count) . '&count=' . $count); $s50 = $count == 50 ? 'selected' : ''; $s75 = $count == 75 ? 'selected' : ''; $s100 = $count == 100 ? 'selected' : ''; if ($start + $count < $comment_count) { $next_link = "<a href=\"{$next_target}\"><b>" . R_SEE_NEXT . "</b></a> - "; } else { $next_link = ''; }
function get_post_var($var) { global $lang_errors; $superCage = Inspekt::makeSuperCage(); if (!$superCage->post->keyExists($var)) { cpg_die(CRITICAL_ERROR, $lang_errors['param_missing'] . " ({$var})", __FILE__, __LINE__); } return $superCage->post->getInt($var); }