当前位置: 首页>>代码示例>>PHP>>正文


PHP getSerializedArray函数代码示例

本文整理汇总了PHP中getSerializedArray函数的典型用法代码示例。如果您正苦于以下问题:PHP getSerializedArray函数的具体用法?PHP getSerializedArray怎么用?PHP getSerializedArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSerializedArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: defaultCodeblocks_codebox

function defaultCodeblocks_codebox($current, $object, $number)
{
    if (empty($current) && getOption('defaultCodeblocks_object_' . $object->table)) {
        $defaultCodeBlocks = new defaultCodeblocks();
        $blocks = getSerializedArray($defaultCodeBlocks->getCodeblock());
        if (isset($blocks[$number])) {
            $current = $blocks[$number];
        }
    }
    return $current;
}
开发者ID:rb26,项目名称:zenphoto,代码行数:11,代码来源:defaultCodeblocks.php

示例2: __construct

 /**
  * Creates an instance of a gallery
  *
  * @return Gallery
  */
 function __construct()
 {
     // Set our album directory
     $this->albumdir = ALBUM_FOLDER_SERVERPATH;
     $data = getOption('gallery_data');
     if ($data) {
         $this->data = getSerializedArray($data);
     }
     if (isset($this->data['unprotected_pages'])) {
         $pages = getSerializedArray($this->data['unprotected_pages']);
         if (is_array($pages)) {
             $this->unprotected_pages = $pages;
         }
         //	protect against a failure
     }
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:21,代码来源:class-gallery.php

示例3: handleOption

    static function handleOption($option, $currentValue)
    {
        global $_zp_authority;
        if ($option == 'ldap_group_map_custom') {
            $groups = $_zp_authority->getAdministrators('groups');
            $ldap = getSerializedArray(getOption('ldap_group_map'));
            if (empty($groups)) {
                echo gettext('No groups or templates are defined');
            } else {
                ?>
				<dl>
					<dt><em><?php 
                echo gettext('ZenPhoto20 group');
                ?>
</em></dt>
					<dd><em><?php 
                echo gettext('LDAP group');
                ?>
</em></dd>
					<?php 
                foreach ($groups as $group) {
                    if ($group['name'] != 'template') {
                        if (array_key_exists($group['user'], $ldap)) {
                            $ldapgroup = $ldap[$group['user']];
                        } else {
                            $ldapgroup = $group['user'];
                        }
                        ?>
							<dt>
							<?php 
                        echo html_encode($group['user']);
                        ?>
							</dt>
							<dd>
								<?php 
                        echo '<input type="textbox" name="LDAP_group_for_' . $group['id'] . '" value="' . html_encode($ldapgroup) . '">';
                        ?>
							</dd>
							<?php 
                    }
                }
                ?>
				</dl>
				<?php 
            }
        }
    }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:47,代码来源:LDAP_auth.php

示例4: __construct

 function __construct()
 {
     global $_zp_authority, $_userAddressFields;
     $firstTime = false;
     $tablecols = db_list_fields('administrators');
     foreach ($tablecols as $key => $datum) {
         if ($datum['Field'] == 'custom_data') {
             $firstTime = true;
             enableExtension('userAddressFields', true);
             break;
         }
     }
     parent::constructor('userAddressFields', self::fields());
     if ($firstTime) {
         //	migrate the custom data user data
         $result = query('SELECT * FROM ' . prefix('administrators') . ' WHERE `valid`!=0');
         if ($result) {
             while ($row = db_fetch_assoc($result)) {
                 $custom = getSerializedArray($row['custom_data']);
                 if (!empty($custom)) {
                     $sql = 'UPDATE ' . prefix('administrators') . ' SET ';
                     foreach ($custom as $field => $val) {
                         $sql .= '`' . $field . '`=' . db_quote($val) . ',';
                     }
                     setupQuery($sql);
                 }
             }
             db_free_result($result);
         }
         setupQuery('ALTER TABLE ' . prefix('administrators') . ' DROP `custom_data`');
     }
     $cloneid = bin2hex(FULLWEBPATH);
     if (OFFSET_PATH == 2 && isset($_SESSION['admin'][$cloneid])) {
         $user = unserialize($_SESSION['admin'][$cloneid]);
         $user2 = $_zp_authority->getAnAdmin(array('`user`=' => $user->getUser(), '`pass`=' => $user->getPass(), '`valid`=' => 1));
         if ($user2) {
             foreach (userAddressFields::fields() as $field) {
                 $user2->set($field['name'], $user->get($field['name']));
             }
             $user2->save();
         }
     }
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:43,代码来源:userAddressFields.php

示例5: handleOptionSave

 static function handleOptionSave($themename, $themealbum)
 {
     $x = str_replace(':', '.', getOption('accessThreshold_SENSITIVITY'));
     $sensitivity = 0;
     foreach (explode('.', $x) as $v) {
         if ($v) {
             $sensitivity++;
         } else {
             break;
         }
     }
     if (getOption('accessThreshold_CLEAR')) {
         $recentIP = array();
         setOption('accessThreshold_CLEAR', 0);
     } else {
         $recentIP = getSerializedArray(@file_get_contents(SERVERPATH . '/' . DATA_FOLDER . '/recentIP'));
     }
     $recentIP['config'] = array('accessThreshold_IP_RETENTION' => getOption('accessThreshold_IP_RETENTION'), 'accessThreshold_THRESHOLD' => getOption('accessThreshold_THRESHOLD'), 'accessThreshold_IP_ACCESS_WINDOW' => getOption('accessThreshold_IP_ACCESS_WINDOW'), 'accessThreshold_LocaleCount' => getOption('accessThreshold_LocaleCount'), 'accessThreshold_SENSITIVITY' => $sensitivity);
     file_put_contents(SERVERPATH . '/' . DATA_FOLDER . '/recentIP', serialize($recentIP));
 }
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:20,代码来源:accessThreshold.php

示例6: constructor

 /**
  *
  * This method establishes the current set of database fields. It will add the
  * fields to the database if they are not already present. Fields from previous
  * constructor calls that are no longer in the list will be removed from the
  * database (along with any data associated with them.)
  *
  * @param array $newfields
  */
 function constructor($me, $newfields)
 {
     $previous = getSerializedArray(getOption(get_class($this) . '_addedFields'));
     $current = $fields = array();
     if (extensionEnabled($me)) {
         //need to update the database tables.
         foreach ($newfields as $newfield) {
             $current[$newfield['table']][$newfield['name']] = true;
             unset($previous[$newfield['table']][$newfield['name']]);
             switch (strtolower($newfield['type'])) {
                 default:
                     $dbType = strtoupper($newfield['type']);
                     break;
                 case 'int':
                 case 'varchar':
                     $dbType = strtoupper($newfield['type']) . '(' . min(255, $newfield['size']) . ')';
                     break;
             }
             $sql = 'ALTER TABLE ' . prefix($newfield['table']) . ' ADD COLUMN `' . $newfield['name'] . '` ' . $dbType;
             if (query($sql, false) && in_array($newfield['table'], array('albums', 'images', 'news', 'news_categories', 'pages'))) {
                 $fields[] = strtolower($newfield['name']);
             }
         }
         setOption(get_class($this) . '_addedFields', serialize($current));
     } else {
         purgeOption(get_class($this) . '_addedFields');
     }
     $set_fields = array_flip(explode(',', getOption('search_fields')));
     foreach ($previous as $table => $orpahed) {
         //drop fields no longer defined
         foreach ($orpahed as $field => $v) {
             unset($set_fields[$field]);
             $sql = 'ALTER TABLE ' . prefix($table) . ' DROP `' . $field . '`';
             query($sql, false);
         }
     }
     $set_fields = array_unique(array_merge($fields, array_flip($set_fields)));
     setOption('search_fields', implode(',', $set_fields));
 }
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:48,代码来源:fieldExtender.php

示例7: __construct

 function __construct()
 {
     global $_userAddressFields;
     $firstTime = extensionEnabled('userAddressFields') && is_null(getOption('userAddressFields_addedFields'));
     parent::constructor('userAddressFields', self::fields());
     if ($firstTime) {
         //	migrate the custom data user data
         $result = query('SELECT * FROM ' . prefix('administrators') . ' WHERE `valid`!=0');
         if ($result) {
             while ($row = db_fetch_assoc($result)) {
                 $custom = getSerializedArray($row['custom_data']);
                 if (!empty($custom)) {
                     $sql = 'UPDATE ' . prefix('administrators') . ' SET ';
                     foreach ($custom as $field => $val) {
                         $sql .= '`' . $field . '`=' . db_quote($val) . ',';
                     }
                     $sql .= '`custom_data`=NULL WHERE `id`=' . $row['id'];
                     query($sql);
                 }
             }
             db_free_result($result);
         }
     }
 }
开发者ID:rb26,项目名称:zenphoto,代码行数:24,代码来源:userAddressFields.php

示例8: getCodeblock

/**
 * Gets the content of a codeblock for an image, album or Zenpage newsarticle or page.
 *
 * The priority for codeblocks will be (based on context)
 * 	1: articles
 * 	2: pages
 * 	3: images
 * 	4: albums
 * 	5: gallery.
 *
 * This means, for instance, if we are in ZP_ZENPAGE_NEWS_ARTICLE context we will use the news article
 * codeblock even if others are available.
 *
 * Note: Echoing this array's content does not execute it. Also no special chars will be escaped.
 * Use printCodeblock() if you need to execute script code.
 *
 * @param int $number The codeblock you want to get
 * @param mixed $what optonal object for which you want the codeblock
 *
 * @return string
 */
function getCodeblock($number = 1, $object = NULL)
{
    global $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery, $_zp_gallery_page;
    if (!$number) {
        setOptionDefault('codeblock_first_tab', 0);
    }
    if (!is_object($object)) {
        if ($_zp_gallery_page == 'index.php') {
            $object = $_zp_gallery;
        }
        if (in_context(ZP_ALBUM)) {
            $object = $_zp_current_album;
        }
        if (in_context(ZP_IMAGE)) {
            $object = $_zp_current_image;
        }
        if (in_context(ZP_ZENPAGE_PAGE)) {
            if ($_zp_current_zenpage_page->checkAccess()) {
                $object = $_zp_current_zenpage_page;
            }
        }
        if (in_context(ZP_ZENPAGE_NEWS_ARTICLE)) {
            if ($_zp_current_zenpage_news->checkAccess()) {
                $object = $_zp_current_zenpage_news;
            }
        }
    }
    if (!is_object($object)) {
        return NULL;
    }
    $codeblock = getSerializedArray($object->getcodeblock());
    $codeblock = zp_apply_filter('codeblock', @$codeblock[$number], $object, $number);
    if ($codeblock) {
        $codeblock = applyMacros($codeblock);
    }
    return $codeblock;
}
开发者ID:IliyanGochev,项目名称:zenphoto,代码行数:58,代码来源:template-functions.php

示例9: updateImageProcessorLink

 /**
  * Searches out i.php image links and replaces them with cache links if image is cached
  * @param string $text
  * @return string
  */
 static function updateImageProcessorLink($text)
 {
     if (is_string($text) && preg_match('/^a:[0-9]+:{/', $text)) {
         //	serialized array
         $text = getSerializedArray($text);
         $serial = true;
     } else {
         $serial = false;
     }
     if (is_array($text)) {
         foreach ($text as $key => $textelement) {
             $text[$key] = self::updateImageProcessorLink($textelement);
         }
         if ($serial) {
             $text = serialize($text);
         }
     } else {
         preg_match_all('|<\\s*img.*?\\ssrc\\s*=\\s*"([^"]*)?|', $text, $matches);
         foreach ($matches[1] as $key => $match) {
             preg_match('|.*i\\.php\\?(.*)|', $match, $imgproc);
             if ($imgproc) {
                 $match = preg_split('~\\&[amp;]*~', $imgproc[1]);
                 $set = array();
                 foreach ($match as $v) {
                     $s = explode('=', $v);
                     $set[$s[0]] = $s[1];
                 }
                 $args = getImageArgs($set);
                 $imageuri = getImageURI($args, urldecode($set['a']), urldecode($set['i']), NULL);
                 if (strpos($imageuri, 'i.php') === false) {
                     $text = str_replace($matches[1][$key], $imageuri, $text);
                 }
             }
         }
     }
     return $text;
 }
开发者ID:JoniWeiss,项目名称:JoniWebGirl,代码行数:42,代码来源:functions.php

示例10: getAllTagsFromAlbum_multi_unique

/**
 * Removes duplicate entries in multi dimensional array.
 * From kenrbnsn at rbnsn dot com http://uk.php.net/manual/en/function.array-unique.php#57202
 * @param array $array
 * @return array
 */
function getAllTagsFromAlbum_multi_unique($array)
{
    foreach ($array as $k => $na) {
        $new[$k] = serialize($na);
    }
    $uniq = array_unique($new);
    foreach ($uniq as $k => $ser) {
        $new1[$k] = getSerializedArray($ser);
    }
    return $new1;
}
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:17,代码来源:tag_extras.php

示例11: header

    header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/search_statistics/search_analysis.php');
    exitZP();
}
$zenphoto_tabs['overview']['subtabs'] = array(gettext('Analysis') => '');
printAdminHeader('overview', 'analysis');
echo '</head>';
$sql = 'SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`="search_statistics"';
$data = query($sql);
$ip_maxvalue = $criteria_maxvalue = $criteria_maxvalue_f = $terms_maxvalue = 1;
$results_f = $results = $terms = $sites = array();
$bargraphmaxsize = 400;
$maxiterations = array();
$opChars = array('(', ')', '&', '|', '!', ',');
if ($data) {
    while ($datum = db_fetch_assoc($data)) {
        $element = getSerializedArray($datum['data']);
        $ip = $datum['aux'];
        if (array_key_exists($ip, $sites)) {
            $sites[$ip]++;
            if ($ip_maxvalue < $sites[$ip]) {
                $ip_maxvalue = $sites[$ip];
            }
        } else {
            $sites[$ip] = 1;
        }
        if (is_array($element)) {
            $maxiterations[$element['iteration']] = 1;
            $searchset = $element['data'];
            $type = $element['type'];
            $success = $element['success'];
            $instance = implode(' ', $searchset);
开发者ID:rb26,项目名称:zenphoto,代码行数:31,代码来源:search_analysis.php

示例12: passwordAllowed

 static function passwordAllowed($msg, $pwd, $user)
 {
     if ($id = $user->getID() > 0) {
         $store = query_single_row('SELECT * FROM ' . prefix('plugin_storage') . ' WHERE `type`=' . db_quote('user_expiry_usedPasswords') . ' AND `aux`=' . $id);
         if ($store) {
             $used = getSerializedArray($store['data']);
             if (in_array($pwd, $used)) {
                 if (zp_loggedin(ADMIN_RIGHTS)) {
                     // persons with ADMIN_RIGHTS get to override this so they can reset a passwrod for a user
                     unset($used[$pwd]);
                 } else {
                     return gettext('You have used that password recently. Please choose a different password.');
                 }
             }
             if (count($used) > 9) {
                 $used = array_slice($used, 1);
             }
         } else {
             $used = array();
         }
         array_push($used, $pwd);
         if ($store) {
             query('UPDATE ' . prefix('plugin_storage') . 'SET `data`=' . db_quote(serialize($used)) . ' WHERE `type`=' . db_quote('user_expiry_usedPasswords') . ' AND `aux`=' . $id);
         } else {
             query('INSERT INTO ' . prefix('plugin_storage') . ' (`type`, `aux`, `data`) VALUES (' . db_quote('user_expiry_usedPasswords') . ',' . $id . ',' . db_quote(serialize($used)) . ')');
         }
     }
     return $msg;
 }
开发者ID:Simounet,项目名称:zenphoto,代码行数:29,代码来源:user-expiry.php

示例13: dirname

<?php

/*
 * popup to display IP list for an entry
 *
 * @author Stephen Billard (sbillard)
 *
 * Copyright 2016 by Stephen L Billard for use in {@link https://github.com/ZenPhoto20/ZenPhoto20 ZenPhoto20}
 *
 * @package plugins
 * @subpackage admin
 */
require_once dirname(dirname(dirname(__FILE__))) . '/admin-globals.php';
$ip = sanitize($_GET['selected_ip']);
$recentIP = getSerializedArray(@file_get_contents(SERVERPATH . '/' . DATA_FOLDER . '/recentIP'));
$localeList = $ipList = array();
if (isset($recentIP[$ip])) {
    foreach ($recentIP[$ip]['accessed'] as $instance) {
        $ipList[] = $instance['ip'];
    }
    $ipList = array_unique($ipList);
    foreach ($recentIP[$ip]['locales'] as $instance => $data) {
        foreach ($data['ip'] as $ipl => $time) {
            $localeList[$ipl][$instance] = $time;
        }
    }
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:ip_list.php

示例14: gettext

	<h1><?php 
    echo gettext("edit comment");
    ?>
</h1>
	<?php 
    zp_apply_filter('admin_note', 'comments', 'edit');
    ?>

	<div id="container">
		<div class="box" style="padding: 10px">
			<?php 
    $id = sanitize_numeric($_GET['id']);
    $commentarr = query_single_row("SELECT * FROM " . prefix('comments') . " WHERE id = {$id} LIMIT 1");
    if ($commentarr) {
        extract($commentarr);
        $commentarr = array_merge($commentarr, getSerializedArray($commentarr['custom_data']));
        ?>
				<form class="dirtylistening" onReset="setClean('form_editcomment');" id="form_editcomment" action="?action=savecomment" method="post" autocomplete="off">
					<?php 
        XSRFToken('savecomment');
        ?>
					<input	type="hidden" name="id" value="<?php 
        echo $id;
        ?>
" />
					<span class="buttons">
						<p class="buttons">
							<a href="javascript:if(confirm('<?php 
        echo gettext('Are you sure you want to delete this comment?');
        ?>
')) { window.location='?action=deletecomment&id=<?php 
开发者ID:ariep,项目名称:ZenPhoto20-DEV,代码行数:31,代码来源:admin-comments.php

示例15: setOption

    setOption('pluginEnabler_currentset', serialize(array_keys(getEnabledPlugins())));
    $report = gettext('Current enabled plugins remembered');
}
if (isset($_GET['pluginsEnable'])) {
    $paths = getPluginFiles('*.php');
    $pluginlist = array_keys($paths);
    switch ($setting = sanitize_numeric($_GET['pluginsEnable'])) {
        case 0:
            $report = gettext('Plugins disabled');
            break;
        case 1:
            $report = gettext('Zenphoto plugins enabled');
            break;
        case 2:
            $report = gettext('Remembered plugins enabled');
            $savedlist = getSerializedArray(getOption('pluginEnabler_currentset'));
            break;
        case 3:
            $report = gettext('All plugins enabled');
            break;
    }
    foreach ($pluginlist as $extension) {
        if ($extension != 'pluginEnabler') {
            $opt = 'zp_plugin_' . $extension;
            switch ($setting) {
                case 1:
                    if (strpos($paths[$extension], ZENFOLDER) !== false && $extension != 'show_not_logged-in') {
                        $enable = true;
                        break;
                    }
                case 0:
开发者ID:benuri,项目名称:DevTools,代码行数:31,代码来源:handler.php


注:本文中的getSerializedArray函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。