function picture_navigation_page_start() { $superCage = Inspekt::makeSuperCage(); if (!$superCage->get->keyExists('slideshow')) { js_include('plugins/picture_navigation/picture_navigation.js'); } }
function social_bookmarks_initialize() { global $CONFIG, $JS, $lang_plugin_social_bookmarks, $social_bookmarks_icon_array; $superCage = Inspekt::makeSuperCage(); if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) { $JS['includes'][] = 'js/jquery.spinbutton.js'; } if (in_array('plugins/social_bookmarks/script.js', $JS['includes']) != TRUE) { $JS['includes'][] = 'plugins/social_bookmarks/script.js'; } require_once "./plugins/social_bookmarks/lang/english.php"; if ($CONFIG['lang'] != 'english' && file_exists("./plugins/social_bookmarks/lang/{$CONFIG['lang']}.php")) { require_once "./plugins/social_bookmarks/lang/{$CONFIG['lang']}.php"; } if ($CONFIG['enable_menu_icons'] >= 1) { $social_bookmarks_icon_array['configure'] = '<img src="./plugins/social_bookmarks/images/icons/configure.png" border="0" width="16" height="16" alt="" class="icon" />'; $social_bookmarks_icon_array['menu'] = '<img src="./plugins/social_bookmarks/images/icons/social_bookmarks.png" border="0" width="16" height="16" alt="" class="icon" />'; } else { $social_bookmarks_icon_array['configure'] = ''; $social_bookmarks_icon_array['menu'] = ''; } if ($CONFIG['enable_menu_icons'] == 2) { $social_bookmarks_icon_array['page'] = '<img src="./plugins/social_bookmarks/images/icons/social_bookmarks.png" border="0" width="16" height="16" alt="" class="icon" />'; } else { $social_bookmarks_icon_array['page'] = ''; } $social_bookmarks_icon_array['announcement'] = cpg_fetch_icon('announcement', 1); $social_bookmarks_icon_array['ok'] = cpg_fetch_icon('ok', 0); $social_bookmarks_icon_array['cancel'] = cpg_fetch_icon('cancel', 0); $social_bookmarks_icon_array['stop'] = cpg_fetch_icon('stop', 0); $return['language'] = $lang_plugin_social_bookmarks; $return['icon'] = $social_bookmarks_icon_array; return $return; }
function getDateLink($day, $month, $year) { global $CONFIG, $lang_calendar_php; $superCage = Inspekt::makeSuperCage(); $date = sprintf('%s-%02s-%02s', $year, $month, $day); $query = "SELECT COUNT(pid) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' AND substring(from_unixtime(ctime),1,10) = '" . substr($date, 0, 10) . "' {$META_ALBUM_SET}"; $result = cpg_db_query($query); $nb_pics = mysql_result($result, 0, 0); if ($matches = $superCage->get->getMatched('action', '/^[a-z]+$/')) { $action = $matches[0]; } elseif ($matches = $superCage->post->getMatched('action', '/^[a-z]+$/')) { $action = $matches[0]; } else { $action = ''; } if ($action == 'browsebydate') { if ($nb_pics) { $link = '<a href="#" onclick="sendDate(\'' . $month . '\', \'' . $day . '\', \'' . $year . '\');" class="user_thumb_infobox" title="' . $nb_pics . ' ' . $lang_calendar_php['files'] . '">'; } else { $link = ''; } } else { $link = "<a href=\"#\" onclick=\"sendDate('" . $month . "', '" . $day . "', '" . $year . "');\" class=\"user_thumb_infobox\" >"; } return $link; }
function flv_player_cleanup($action) { $superCage = Inspekt::makeSuperCage(); $cleanup = $superCage->server->getEscaped('REQUEST_URI'); if ($action == 1) { global $lang_common; list($timestamp, $form_token) = getFormToken(); echo <<<EOT <table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="tableb"> Playback of existing flv files won't work anymore! </td> <td class="tableb"> <form action="pluginmgr.php" method="post"> <input type="submit" name="submit" value="{$lang_common['back']}" class="button" /> </form> </td> <td class="tableb"> <form action="{$cleanup}" method="post"> <input type="hidden" name="drop" value="1" /> <input type="hidden" name="form_token" value="{$form_token}" /> <input type="hidden" name="timestamp" value="{$timestamp}" /> <input type="submit" name="submit" value="{$lang_common['continue']}" class="button" /> </form> </td> </tr> </table> EOT; } }
function album_share_codes_main() { $superCage = Inspekt::makeSuperCage(); if ($superCage->get->testInt('album')) { global $CONFIG; $aid = $superCage->get->getInt('album'); $result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = '{$aid}'"); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $url = $CONFIG['ecards_more_pic_target'] . 'displayimage.php?pid=' . $row['pid']; $thumb = $CONFIG['ecards_more_pic_target'] . get_pic_url($row, 'thumb'); $content1 .= '[url=' . $url . '][img]' . $thumb . '[/img][/url]' . "\n"; $content2 .= '<a href="' . $url . '"><img src="' . $thumb . ' /></a>' . "\n"; } starttable(-1, 'Share codes for <i>all files</i> in this album'); echo <<<EOT <tr> <td class="tableb"> <tt>[url][img][/url]</tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content1}</textarea> <br /> <tt><a><img></a></tt>: <textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">{$content2}</textarea> </td> </tr> EOT; endtable(); } } }
function token_modifier_criteria($criteria) { global $raw_ip; $superCage = Inspekt::makeSuperCage(); $criteria['ip_addr'] = $raw_ip; $criteria['browser'] = $superCage->server->getRaw('HTTP_USER_AGENT'); return $criteria; }
function album_addfav_html($html) { $superCage = Inspekt::makeSuperCage(); if ($superCage->get->getInt('album') > 0) { $addfav_button = ' <a href="index.php?file=album_addfav/add&aid=' . $superCage->get->getInt('album') . '" onclick="return confirm(\'Do you really want to add all files of this album to your favorites?\');" title="Add all pictures of this album to your favorites"><img src="images/icons/favorites.png" border="0" style="display:inline" /></a>'; $html = preg_replace('/(<td style="vertical-align:top" class="statlink">.*<h2>)(.*)(<\\/h2>.*<\\/td>)/Usi', '\\1\\2' . $addfav_button . '\\3', $html, 1); } return $html; }
function get_post_var($name, $default = '') { $superCage = Inspekt::makeSuperCage(); if ($superCage->post->keyExists($name)) { return get_magic_quotes_gpc() ? stripslashes($superCage->post->noTags($name)) : $superCage->post->noTags($name); } else { return $default; } }
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; }
function fullsize_check_user() { global $CONFIG; $superCage = Inspekt::makeSuperCage(); if (USER_ID && $superCage->cookie->getInt($CONFIG['cookie_name'] . '_agb') === 1) { return true; } else { return false; } }
function downloadZip_header($html) { $lang_plugin_albumdownload = albumdownload_language(); $superCage = Inspekt::makeSuperCage(); if ($superCage->get->getInt('album') > 0) { $imgcode = '<img src="plugins/albumdownload/ico/ziparrow.png" alt="' . $lang_plugin_albumdownload['albumDownload'] . '" title="' . $lang_plugin_albumdownload['albumDownload'] . '" style="vertical-align:text-top;" />'; $html['{ALBUM_NAME}'] = $html['{ALBUM_NAME}'] . ' <a href="index.php?file=albumdownload/zip&aid=' . $superCage->get->getInt('album') . '">' . $imgcode . '</a>'; } return $html; }
function psc_check_captcha($name) { global $CONFIG; $superCage = Inspekt::makeSuperCage(); if ($superCage->post->getRaw('comment') == '' && strtolower(trim($superCage->post->getRaw($name))) == strtolower(trim($CONFIG[PSC_ANSWER_PREFIX . $superCage->post->getInt('captcha_id')]))) { return true; } else { return false; } }
function newsletter_initialize() { global $CONFIG, $JS, $lang_plugin_newsletter, $newsletter_icon_array; $superCage = Inspekt::makeSuperCage(); if (in_array('js/jquery.spinbutton.js', $JS['includes']) != TRUE) { $JS['includes'][] = 'js/jquery.spinbutton.js'; } if (in_array('plugins/newsletter/js/script.js', $JS['includes']) != TRUE) { $JS['includes'][] = 'plugins/newsletter/js/script.js'; } require "./plugins/newsletter/lang/english.php"; if ($CONFIG['lang'] != 'english' && file_exists("./plugins/newsletter/lang/{$CONFIG['lang']}.php")) { require "./plugins/newsletter/lang/{$CONFIG['lang']}.php"; } if ($CONFIG['enable_menu_icons'] == 2) { $newsletter_icon_array['config'] = '<img src="./plugins/newsletter/images/icons/config.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['newsletter'] = '<img src="./plugins/newsletter/images/icons/newsletter.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['catlist'] = '<img src="./plugins/newsletter/images/icons/catlist.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['subscribe'] = '<img src="./plugins/newsletter/images/icons/subscribe.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['mailing'] = '<img src="./plugins/newsletter/images/icons/mailing.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['archive'] = '<img src="./plugins/newsletter/images/icons/archive.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['locked'] = '<img src="./plugins/newsletter/images/icons/locked.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['unlocked'] = '<img src="./plugins/newsletter/images/icons/unlocked.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['search'] = '<img src="./plugins/newsletter/images/icons/search.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['send'] = '<img src="./plugins/newsletter/images/icons/send.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['queue'] = '<img src="./plugins/newsletter/images/icons/delete.png" width="16" height="16" border="0" alt="" class="icon" />'; } else { $newsletter_icon_array['config'] = ''; $newsletter_icon_array['announcement'] = ''; $newsletter_icon_array['catlist'] = ''; $newsletter_icon_array['subscribe'] = ''; $newsletter_icon_array['mailing'] = ''; $newsletter_icon_array['archive'] = ''; $newsletter_icon_array['locked'] = '<img src="./plugins/newsletter/images/icons/locked.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['unlocked'] = '<img src="./plugins/newsletter/images/icons/unlocked.png" width="16" height="16" border="0" alt="" class="icon" />'; $newsletter_icon_array['search'] = ''; $newsletter_icon_array['send'] = ''; $newsletter_icon_array['queue'] = ''; } $newsletter_icon_array['announcement'] = cpg_fetch_icon('announcement', 1); $newsletter_icon_array['plugin_manager'] = cpg_fetch_icon('plugin_mgr', 2); $newsletter_icon_array['ok'] = cpg_fetch_icon('ok', 2); $newsletter_icon_array['success'] = cpg_fetch_icon('ok', 0); $newsletter_icon_array['failure'] = cpg_fetch_icon('cancel', 0); $newsletter_icon_array['cancel'] = cpg_fetch_icon('cancel', 2); $newsletter_icon_array['edit'] = cpg_fetch_icon('edit', 0); $newsletter_icon_array['delete'] = cpg_fetch_icon('delete', 0); $newsletter_icon_array['add'] = cpg_fetch_icon('add', 2); $newsletter_icon_array['visible'] = cpg_fetch_icon('online', 0); $newsletter_icon_array['invisible'] = cpg_fetch_icon('offline', 0); $return['language'] = $lang_plugin_newsletter; $return['icon'] = $newsletter_icon_array; return $return; }
function cookie_extraction() { $superCage = Inspekt::makeSuperCage(); $id = 0; $pass = ''; if ($superCage->cookie->keyExists('member_id') && $superCage->cookie->keyExists('pass_hash')) { $id = $superCage->cookie->getInt('member_id'); $pass = substr($superCage->cookie->getEscaped('pass_hash'), 0, 32); } return $id ? array($id, $pass) : false; }
function cookie_extraction() { $superCage = Inspekt::makeSuperCage(); //if (isset($_COOKIE[$this->cookie_name . '_un']) && isset($_COOKIE[$this->cookie_name . '_pw'])){ // return array($this->get_user_id($_COOKIE[$this->cookie_name . '_un']), $_COOKIE[$this->cookie_name . '_pw']); //} if ($superCage->cookie->keyExists($this->cookie_name . '_un') && $superCage->cookie->keyExists($this->cookie_name . '_pw')) { return array($this->get_user_id($superCage->cookie->getRaw($this->cookie_name . '_un')), $superCage->cookie->getRaw($this->cookie_name . '_pw')); } return false; }
function Controller() { $this->validate = Inspekt::makeSuperCage(); $this->db = Database::getInstance(array('conn_id' => Config::item('LINK_ID'))); $this->view = new View(); // auto load helper load_helper(array('php', 'time', 'html', 'form', 'table', 'forum')); // load forum model load_model('forum', FALSE); load_model('check', FALSE); $this->forum = forum_model::getInstance(); }
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 album_voting_thumbnails_title($param) { $superCage = Inspekt::makeSuperCage(); $aid = $superCage->get->getInt('album'); if ($aid > 0) { $param['{ALBUM_NAME}'] .= ' | '; if (USER_ID) { $param['{ALBUM_NAME}'] .= album_voting_vote_button($aid, 1) . " "; } $param['{ALBUM_NAME}'] .= album_voting_voting_stats($aid, 1); } return $param; }
function cookie_extraction() { $superCage = Inspekt::makeSuperCage(); $id = 0; $pass_hash = ''; //if (isset($_COOKIE[$this->cookie_name])){ // list($id, $pass_hash) = unserialize($_COOKIE[$this->cookie_name]); //} if ($superCage->cookie->keyExists($this->cookie_name)) { list($id, $pass_hash) = unserialize($superCage->cookie->getRaw($this->cookie_name)); } return $id ? array($id, $pass_hash) : false; }
function panorama_viewer_save_config_value($name) { global $CONFIG; $superCage = Inspekt::makeSuperCage(); $new_value = $superCage->post->getRaw($name); 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 cookie_extraction() { $superCage = Inspekt::makeSuperCage(); $id = 0; $pass = ''; //if (isset($_COOKIE['member_id']) && isset($_COOKIE['pass_hash'])) { //$id = (int)$_COOKIE['member_id']; //$pass = substr(addslashes($_COOKIE['pass_hash']), 0, 32); if ($superCage->cookie->keyExists('member_id') && $superCage->cookie->keyExists('pass_hash')) { $id = $superCage->cookie->getInt('member_id'); $pass = substr($superCage->cookie->getEscaped('pass_hash'), 0, 32); } return $id ? array($id, $pass) : false; }
function favorite_mailer_form($html) { $superCage = Inspekt::makeSuperCage(); if ($superCage->get->keyExists('fm_mail')) { global $CONFIG, $FAVPICS; foreach ($FAVPICS as $pid) { $fav_pics .= $CONFIG['ecards_more_pic_target'] . "displayimage.php?pid={$pid} \n\n"; } if ($fav_pics) { $html = str_replace('<textarea name="message" cols="50" rows="10" class="textinput"></textarea>', '<textarea name="message" cols="50" rows="10" class="textinput">' . $fav_pics . '</textarea>', $html); } } return $html; }
/** * a wrapper to retrieve input from either the get or post Inspekt cages * * @param string $key the key you're trying to retrieve * @param string $accessor the name of the accessor method to use * @return mixed null if key does not exist * @author Ed Finkler */ function getInputGP($key, $accessor) { /* this returns the singleton */ $sc = Inspekt::makeSuperCage(); if ($sc->get->keyExists($key)) { return $sc->get->{$accessor}($key); } elseif ($sc->post->keyExists($key)) { return $sc->post->{$accessor}($key); } else { return null; } }
/** * Initialize Inspekt * * @return object */ function init_inspekt_cage() { $cage = Inspekt::makeSuperCage(); // Add Hotaru custom methods $cage->addAccessor('testAlnumLines'); $cage->addAccessor('testPage'); $cage->addAccessor('testUsername'); $cage->addAccessor('testPassword'); $cage->addAccessor('getFriendlyUrl'); $cage->addAccessor('sanitizeAll'); $cage->addAccessor('sanitizeTags'); $cage->addAccessor('getHtmLawed'); return $cage; }
/** * Constructor * Instantiates all neede libraries and makes them available */ public function __construct() { $this->loadSessionTokens(); //Wrap all input in Inspekt $input = \Inspekt::makeSuperCage(); \Zend_Registry::set('input', $input); //Get a Mustache Factory up $tplEngine = new Template\Engine(); \Zend_Registry::set('tplengine', $tplEngine); //Singleton our facebook interface if (\defined('FACEBOOK_APP_ID') && \defined('FACEBOOK_APP_SECRET')) { $facebook = new Facebook\Client(array('appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_APP_SECRET)); \Zend_Registry::set('facebook', $facebook); } }
function hidden_features_only_empty_albums_button() { global $CONFIG, $CPG_PHP_SELF, $lang_plugin_hidden_features; $superCage = Inspekt::makeSuperCage(); if ($CONFIG['only_empty_albums'] == 1 || $CONFIG['only_empty_albums'] == 2 && GALLERY_ADMIN_MODE) { $sep = strpos($superCage->server->getRaw('REQUEST_URI'), '?') ? '&' : '?'; if ($superCage->get->keyExists('only_empty_albums')) { $only_empty_albums = '<a href="' . preg_replace('/[\\?&]only_empty_albums/', '', $superCage->server->getRaw('REQUEST_URI')) . '" class="button">' . $lang_plugin_hidden_features['only_empty_albums_button_all'] . '</a>'; } else { $only_empty_albums = '<a href="' . $superCage->server->getRaw('REQUEST_URI') . $sep . 'only_empty_albums" class="button">' . $lang_plugin_hidden_features['only_empty_albums_button_empty'] . '</a>'; } } else { $only_empty_albums = ''; } return $only_empty_albums; }
function session_extraction() { $superCage = Inspekt::makeSuperCage(); if ($superCage->cookie->keyExists($this->cookie_name . '_sid')) { $this->session_id = $superCage->cookie->getEscaped($this->cookie_name . '_sid'); $sql = "SELECT user_id, user_password, group_id FROM {$this->sessionstable} INNER JOIN {$this->usertable} ON session_user_id = user_id WHERE session_id = '{$this->session_id}'"; $result = cpg_db_query($sql, $this->link_id); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $this->primary_group = array_pop($row); return $row['user_id'] == 1 ? false : $row; } else { return false; } } }
function fullsize_install() { global $CONFIG; // Install $superCage = Inspekt::makeSuperCage(); if ($superCage->post->getAlpha('test') == 'true') { require_once 'create_cpg_hist.php'; create_hist_table(); $sql = "INSERT IGNORE INTO {$CONFIG['TABLE_CONFIG']} (name, value)" . " VALUES" . "('plugin_ks_fullsize_filesecure','0')" . ",('plugin_ks_fullsize_history','1')" . ",('plugin_ks_fullsize_sendemail','0')" . ",('plugin_ks_fullsize_allowed','1')" . ",('plugin_ks_fullsize_to_email','*****@*****.**')" . ",('plugin_ks_fullsize_from_email','*****@*****.**')" . ",('plugin_ks_fullsize_mailcustomer','0')" . ",('plugin_ks_fullsize_message_for_customer','Thank you for downloading this image!')" . ",('plugin_ks_fullsize_zip','1')"; cpg_db_query($sql); return true; // Loop again } else { return 1; } }
function flf_histotag_initialize() { global $CONFIG, $flf_lang_var; $superCage = Inspekt::makeSuperCage(); if (GALLERY_ADMIN_MODE) { global $JS; $JS['includes'][] = 'plugins/flf_histotag/js/farbtastic.js'; $JS['includes'][] = 'js/jquery.spinbutton.js'; } require "./plugins/flf_histotag/lang/english.php"; if ($CONFIG['lang'] != 'english' && file_exists("./plugins/flf_histotag/lang/{$CONFIG['lang']}.php")) { require "./plugins/flf_histotag/lang/{$CONFIG['lang']}.php"; } $return['language'] = $flf_lang_var; return $return; }
function session_extraction() { $superCage = Inspekt::makeSuperCage(); $row = false; //array('id' => 0, 'username' => 'Guest', 'status' => -1); //if (isset($_COOKIE[$this->cookie_name])) { // list($username, $pass_hash) = unserialize($_COOKIE[$this->cookie_name]); if ($superCage->cookie->keyExists($this->cookie_name)) { list($username, $pass_hash) = unserialize($superCage->cookie->getRaw($this->cookie_name)); if (strcasecmp($username, 'Guest')) { $result = cpg_db_query("SELECT id, username, status+100 AS status FROM {$this->usertable} WHERE username = '******' AND password = '******'", $this->link_id); $row = mysql_fetch_assoc($result); } } return $row; }