本文整理匯總了PHP中Inspekt類的典型用法代碼示例。如果您正苦於以下問題:PHP Inspekt類的具體用法?PHP Inspekt怎麽用?PHP Inspekt使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Inspekt類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: social_bookmarks_initialize
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;
}
示例2: Factory
public static function Factory(&$source, $conf_file = NULL, $conf_section = NULL, $strict = TRUE)
{
if (!is_array($source)) {
user_error('$source ' . $source . ' is not an array', E_USER_NOTICE);
}
$cage = new Inspekt_Cage_Session();
$cage->_setSource($source);
$cage->_parseAndApplyAutoFilters($conf_file);
if (ini_get('session.use_cookies') || ini_get('session.use_only_cookies')) {
if (isset($_COOKIE) && isset($_COOKIE[session_name()])) {
session_id($_COOKIE[session_name()]);
} elseif ($cookie = Inspekt::makeSessionCage()) {
session_id($cookie->getAlnum(session_name()));
}
} else {
// we're using session ids passed via GET
if (isset($_GET) && isset($_GET[session_name()])) {
session_id($_GET[session_name()]);
} elseif ($cookie = Inspekt::makeSessionCage()) {
session_id($cookie->getAlnum(session_name()));
}
}
if ($strict) {
$source = NULL;
}
return $cage;
register_shutdown_function();
register_shutdown_function(array($this, '_repopulateSession'));
}
示例3: picture_navigation_page_start
function picture_navigation_page_start()
{
$superCage = Inspekt::makeSuperCage();
if (!$superCage->get->keyExists('slideshow')) {
js_include('plugins/picture_navigation/picture_navigation.js');
}
}
示例4: album_share_codes_main
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();
}
}
}
示例5: getDateLink
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;
}
示例6: flv_player_cleanup
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;
}
}
示例7: token_modifier_criteria
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;
}
示例8: get_post_var
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;
}
}
示例9: album_addfav_html
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;
}
示例10: fullsize_check_user
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;
}
}
示例11: psc_check_captcha
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;
}
}
示例12: template_uninstall
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;
}
示例13: downloadZip_header
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;
}
示例14: testScoping2
/**
* second level of scoping
*
*/
function testScoping2()
{
$cage_POST = Inspekt::makePostCage();
echo "<pre>In " . __FUNCTION__ . "(): ";
echo var_dump($cage_POST->testAlnum('/funky,_+=_\\|;:!@#$%^&*~time/0/0/`~foo,.+=_\\|;:!@#$%^&*~-bar'));
echo "</pre>\n";
echo "<pre>POST is not accessible here: ";
echo var_dump($_POST);
echo "</pre>\n";
}
示例15: cookie_extraction
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;
}