本文整理汇总了PHP中e107::getArrayStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::getArrayStorage方法的具体用法?PHP e107::getArrayStorage怎么用?PHP e107::getArrayStorage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::getArrayStorage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Retrieve menus, check visibility against
* current user classes and current page url
*
*/
public function init()
{
global $_E107;
if (vartrue($_E107['cli'])) {
return;
}
$menu_layout_field = THEME_LAYOUT != e107::getPref('sitetheme_deflayout') ? THEME_LAYOUT : "";
e107::getCache()->CachePageMD5 = md5(e_LANGUAGE . $menu_layout_field);
//FIXME add a function to the cache class for this.
// $menu_data = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE.$menu_layout_field));
$menu_data = e107::getCache()->retrieve_sys("menus_" . USERCLASS_LIST);
$menu_data = e107::getArrayStorage()->ReadArray($menu_data);
$eMenuArea = array();
// $eMenuList = array();
// $eMenuActive = array(); // DEPRECATED
if (!is_array($menu_data)) {
$menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN (' . USERCLASS_LIST . ') AND menu_layout = "' . $menu_layout_field . '" ORDER BY menu_location,menu_order';
if (e107::getDb()->db_Select_gen($menu_qry)) {
while ($row = e107::getDb()->db_Fetch()) {
$eMenuArea[$row['menu_location']][] = $row;
}
}
$menu_data['menu_area'] = $eMenuArea;
$menuData = e107::getArrayStorage()->WriteArray($menu_data, false);
e107::getCache()->set_sys('menus_' . USERCLASS_LIST, $menuData);
// e107::getCache()->set_sys('menus_'.USERCLASS_LIST.'_'.md5(e_LANGUAGE.$menu_layout_field), $menuData);
} else {
$eMenuArea = $menu_data['menu_area'];
}
$total = array();
foreach ($eMenuArea as $area => $val) {
foreach ($val as $row) {
if ($this->isVisible($row)) {
$path = str_replace("/", "", $row['menu_path']);
if (!isset($total[$area])) {
$total[$area] = 0;
}
$this->eMenuActive[$area][] = $row;
$total[$area]++;
}
}
}
e107::getRender()->eMenuTotal = $total;
}
示例2: array
require_once e_HANDLER . 'validator_class.php';
$userMethods = e107::getUserSession();
$mes = e107::getMessage();
$frm = e107::getForm();
if (isset($_POST['update_settings'])) {
if ($_POST['ac'] == md5(ADMINPWCHANGE)) {
$userData = array();
$userData['data'] = array();
if ($_POST['a_password'] != '' && $_POST['a_password2'] != '' && $_POST['a_password'] == $_POST['a_password2']) {
$userData['data']['user_password'] = $sql->escape($userMethods->HashPassword($_POST['a_password'], $currentUser['user_loginname']), FALSE);
unset($_POST['a_password']);
unset($_POST['a_password2']);
if (vartrue($pref['allowEmailLogin'])) {
$user_prefs = e107::getArrayStorage()->unserialize($currentUser['user_prefs']);
$user_prefs['email_password'] = $userMethods->HashPassword($new_pass, $email);
$userData['data']['user_prefs'] = e107::getArrayStorage()->serialize($user_prefs);
}
$userData['data']['user_pwchange'] = time();
$userData['WHERE'] = 'user_id=' . USERID;
validatorClass::addFieldTypes($userMethods->userVettingInfo, $userData, $userMethods->otherFieldTypes);
$check = $sql->update('user', $userData);
if ($check) {
e107::getLog()->add('ADMINPW_01', '', E_LOG_INFORMATIVE, '');
$userMethods->makeUserCookie(array('user_id' => USERID, 'user_password' => $userData['data']['user_password']), FALSE);
// Can't handle autologin ATM
$mes->addSuccess(UDALAN_3 . " " . ADMINNAME);
e107::getEvent()->trigger('adpword');
//@deprecated
$eventData = array('user_id' => USERID, 'user_pwchange' => $userData['data']['user_pwchange']);
e107::getEvent()->trigger('admin_password_update', $eventData);
$ns->tablerender(UDALAN_2, $mes->render());
示例3: e107ExportValue
/**
* Process data values for XML file. If $this->convertFilePaths is TRUE, convert paths
*
* @see replaceFilePaths()
* @param mixed $val
* @param string $key key for the current value. Used for exception processing.
* @return mixed
*/
private function e107ExportValue($val, $key = '')
{
if ($key && isset($this->filePathPrepend[$key])) {
$val = $this->filePathPrepend[$key] . $val;
}
if ($this->convertFilePaths) {
$types = implode("|", $this->convertFileTypes);
$val = preg_replace_callback("#({e_.*?\\.(" . $types . "))#i", array($this, 'replaceFilePaths'), $val);
}
if (is_array($val)) {
return "<![CDATA[" . e107::getArrayStorage()->WriteArray($val, FALSE) . "]]>";
}
if (strpos($val, "<") !== FALSE || strpos($val, ">") !== FALSE || strpos($val, "&") !== FALSE) {
return "<![CDATA[" . $val . "]]>";
}
return $val;
}
示例4: checkUserPassword
/**
* Checks user password againt preferences set etc
* Assumes that $this->userData array already set up
*
* @param string $username - the user name string as entered (might not relate to the intended user at this stage)
* @param string $userpass - as entered
* @param string $response - received string if CHAP used
* @param boolean $forceLogin - TRUE if login is being forced from clicking signup link; normally FALSE
* @return TRUE if valid password
* otherwise FALSE
*/
protected function checkUserPassword($username, $userpass, $response, $forceLogin)
{
$pref = e107::getPref();
if ($forceLogin === 'provider') {
return true;
}
if ($this->lookEmail && vartrue($pref['passwordEncoding'])) {
$tmp = e107::getArrayStorage()->unserialize($this->userData['user_prefs']);
if (!$tmp && $this->userData['user_prefs']) {
$tmp = unserialize($this->userData['user_prefs']);
}
// try old storage type
$requiredPassword = varset($tmp['email_password'], $this->userData['user_password']);
// Use email-specific password if set. Otherwise, 'normal' one might work
unset($tmp);
} else {
$requiredPassword = $this->userData['user_password'];
}
// FIXME - [SecretR] $username is not set and I really can't get the idea.
//$username = $this->userData['user_loginname']; // TODO for Steve - temporary fix, where $username comes from?
// Now check password
if ($forceLogin) {
if (md5($this->userData['user_name'] . $this->userData['user_password'] . $this->userData['user_join']) != $userpass) {
return $this->invalidLogin($username, LOGIN_BAD_PW);
}
} else {
$session = e107::getSession();
$gotChallenge = $session->is('challenge');
//$aLogVal = "U: {$username}, P: ******, C: ".$session->get('challenge')." R:{$response} S: {$this->userData['user_password']} Prf: {$pref['password_CHAP']}/{$gotChallenge}";
if ($pref['password_CHAP'] > 0 && ($response && $gotChallenge) && $response != $session->get('challenge') || $pref['password_CHAP'] == 2) {
// Verify using CHAP
//$this->e107->admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","CHAP login",$aLogVal, FALSE, LOG_TO_ROLLING);
if (($pass_result = $this->userMethods->CheckCHAP($session->get('challenge'), $response, $username, $requiredPassword)) === PASSWORD_INVALID) {
return $this->invalidLogin($username, LOGIN_CHAP_FAIL);
}
} else {
// Plaintext password
//$this->e107->admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","Plaintext login",$aLogVal, FALSE,LOG_TO_ROLLING);
if (($pass_result = $this->userMethods->CheckPassword($userpass, $this->lookEmail ? $this->userData['user_loginname'] : $username, $requiredPassword)) === PASSWORD_INVALID) {
return $this->invalidLogin($username, LOGIN_BAD_PW);
}
}
$this->passResult = $pass_result;
}
return TRUE;
}
示例5: AddSubmitTrigger
/**
* Quick Add user submit trigger
*/
public function AddSubmitTrigger()
{
$e107cache = e107::getCache();
$userMethods = e107::getUserSession();
$mes = e107::getMessage();
$sql = e107::getDb();
$e_event = e107::getEvent();
$admin_log = e107::getAdminLog();
if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
exit;
}
$e107cache->clear('online_menu_member_total');
$e107cache->clear('online_menu_member_newest');
$error = false;
if (isset($_POST['generateloginname'])) {
$_POST['loginname'] = $userMethods->generateUserLogin($pref['predefinedLoginName']);
}
$_POST['password2'] = $_POST['password1'] = $_POST['password'];
// Now validate everything
$allData = validatorClass::validateFields($_POST, $userMethods->userVettingInfo, true);
// Fix Display and user name
if (!check_class($pref['displayname_class'], $allData['data']['user_class'])) {
if ($allData['data']['user_name'] != $allData['data']['user_loginname']) {
$allData['data']['user_name'] = $allData['data']['user_loginname'];
$mes->addWarning(str_replace('[x]', $allData['data']['user_loginname'], USRLAN_237));
//$allData['errors']['user_name'] = ERR_FIELDS_DIFFERENT;
}
}
// Do basic validation
validatorClass::checkMandatory('user_name, user_loginname', $allData);
// Check for missing fields (email done in userValidation() )
validatorClass::dbValidateArray($allData, $userMethods->userVettingInfo, 'user', 0);
// Do basic DB-related checks
$userMethods->userValidation($allData);
// Do user-specific DB checks
if (!isset($allData['errors']['user_password'])) {
// No errors in password - keep it outside the main data array
$savePassword = $allData['data']['user_password'];
// Delete the password value in the output array
unset($allData['data']['user_password']);
}
// Restrict the scope of this
unset($_POST['password2'], $_POST['password1']);
if (count($allData['errors'])) {
$temp = validatorClass::makeErrorList($allData, 'USER_ERR_', '%n - %x - %t: %v', '<br />', $userMethods->userVettingInfo);
$mes->addError($temp);
$error = true;
}
// Always save some of the entered data - then we can redisplay on error
$user_data =& $allData['data'];
if ($error) {
$this->setParam('user_data', $user_data);
return;
}
if (varset($_POST['perms'])) {
$allData['data']['user_admin'] = 1;
$allData['data']['user_perms'] = implode('.', $_POST['perms']);
}
$user_data['user_password'] = $userMethods->HashPassword($savePassword, $user_data['user_login']);
$user_data['user_join'] = time();
if ($userMethods->needEmailPassword()) {
// Save separate password encryption for use with email address
$user_prefs = e107::getArrayStorage()->unserialize($user_data['user_prefs']);
$user_prefs['email_password'] = $userMethods->HashPassword($savePassword, $user_data['user_email']);
$user_data['user_prefs'] = e107::getArrayStorage()->serialize($user_prefs);
unset($user_prefs);
}
$userMethods->userClassUpdate($allData['data'], 'userall');
//FIXME - (SecretR) there is a better way to fix this (missing default value, sql error in strict mode - user_realm is to be deleted from DB later)
$allData['data']['user_realm'] = '';
// Set any initial classes
$userMethods->addNonDefaulted($user_data);
validatorClass::addFieldTypes($userMethods->userVettingInfo, $allData);
$userid = $sql->insert('user', $allData);
if ($userid) {
$sysuser = e107::getSystemUser(false, false);
$sysuser->setData($allData['data']);
$sysuser->setId($userid);
$user_data['user_id'] = $userid;
// Add to admin log
e107::getLog()->add('USET_02', "UName: {$user_data['user_name']}; Email: {$user_data['user_email']}", E_LOG_INFORMATIVE);
// Add to user audit trail
e107::getLog()->user_audit(USER_AUDIT_ADD_ADMIN, $user_data, 0, $user_data['user_loginname']);
e107::getEvent()->trigger('userfull', $user_data);
e107::getEvent()->trigger('admin_user_created', $user_data);
// send everything available for user data - bit sparse compared with user-generated signup
if (isset($_POST['sendconfemail'])) {
$check = false;
// Send confirmation email to user
switch ((int) $_POST['sendconfemail']) {
case 0:
// activate, don't notify
$check = -1;
break;
case 1:
// activate and send password
$check = $sysuser->email('quickadd', array('user_password' => $savePassword, 'mail_subject' => USRLAN_187 . SITENAME, 'activation_url' => USRLAN_238));
//.........这里部分代码省略.........
示例6: storeSysCredentials
public function storeSysCredentials($credentials = null)
{
if (null === $credentials) {
$credentials = array('consumer_key' => $this->eauthConsumerKey, 'consumer_secret' => $this->eauthConsumerSecret, 'access_token' => $this->eauthAccessToken, 'access_secret' => $this->eauthAccessSecret);
}
if (!is_array($credentials)) {
return false;
}
foreach ($credentials as $key => $value) {
switch ($key) {
case 'consumer_key':
case 'consumer_secret':
case 'access_token':
case 'access_secret':
// OK
break;
default:
unset($credentials[$key]);
break;
}
}
return e107::getArrayStorage()->store($credentials, 'eauth');
}
示例7: unset
unset($_POST['SaveValidatedInfo']);
// At this point we know the error status.
// $changedUserData has an array of core changed data, except password, which is in $savePassword if changed (or entered as confirmation).
// $eufData has extended user field data
// $changedEUFData has any changes in extended user field data
$dataToSave = !$error && (isset($changedUserData) && count($changedUserData)) || isset($changedEUFData['data']) && count($changedEUFData['data']) || $savePassword;
if ($dataToSave) {
// Sort out password hashes
if ($savePassword) {
$loginname = $changedUserData['user_loginname'] ? $changedUserData['user_loginname'] : $udata['user_loginname'];
$email = isset($changedUserData['user_email']) && $changedUserData['user_email'] ? $changedUserData['user_email'] : $udata['user_email'];
$changedUserData['user_password'] = $sql->escape($userMethods->HashPassword($savePassword, $loginname), false);
if (varset($pref['allowEmailLogin'], FALSE)) {
$user_prefs = e107::getArrayStorage()->unserialize($udata['user_prefs']);
$user_prefs['email_password'] = $userMethods->HashPassword($savePassword, $email);
$changedUserData['user_prefs'] = e107::getArrayStorage()->serialize($user_prefs);
}
} else {
if (isset($changedUserData['user_loginname']) && $userMethods->isPasswordRequired('user_loginname') || isset($changedUserData['user_email']) && $userMethods->isPasswordRequired('user_email')) {
if ($_uid && ADMIN) {
// Admin is changing it
$error = LAN_USET_20;
} else {
// User is changing their own info
$promptPassword = true;
}
}
}
}
if ($dataToSave && !$promptPassword) {
$inp = intval($inp);
示例8: getDataLegacy
/**
* Function to retrieve Menu data from tables.
*/
private function getDataLegacy()
{
$sql = e107::getDb();
$menu_layout_field = THEME_LAYOUT != e107::getPref('sitetheme_deflayout') ? THEME_LAYOUT : "";
// e107::getCache()->CachePageMD5 = md5(e_LANGUAGE.$menu_layout_field); // Disabled by line 93 of Cache class.
//FIXME add a function to the cache class for this.
$menu_data = e107::getCache()->retrieve_sys("menus_" . USERCLASS_LIST . "_" . md5(e_LANGUAGE . $menu_layout_field));
// $menu_data = e107::getCache()->retrieve_sys("menus_".USERCLASS_LIST);
$menu_data = e107::getArrayStorage()->ReadArray($menu_data);
// $menu_data = e107::getArrayStorage()->ReadArray($menu_data);
$eMenuArea = array();
// $eMenuList = array();
// $eMenuActive = array(); // DEPRECATED
if (!is_array($menu_data)) {
$menu_qry = 'SELECT * FROM #menus WHERE menu_location > 0 AND menu_class IN (' . USERCLASS_LIST . ') AND menu_layout = "' . $menu_layout_field . '" ORDER BY menu_location,menu_order';
if ($sql->gen($menu_qry)) {
while ($row = $sql->fetch()) {
$eMenuArea[$row['menu_location']][] = $row;
}
}
$menu_data['menu_area'] = $eMenuArea;
$menuData = e107::getArrayStorage()->WriteArray($menu_data, false);
// e107::getCache()->set_sys('menus_'.USERCLASS_LIST, $menuData);
e107::getCache()->set_sys('menus_' . USERCLASS_LIST . '_' . md5(e_LANGUAGE . $menu_layout_field), $menuData);
} else {
$eMenuArea = $menu_data['menu_area'];
}
return $eMenuArea;
}
示例9: load
/**
* Load data from user preferences string
* @param boolean $force
* @return e_user_pref
*/
public function load($force = false)
{
if ($force || !$this->hasData()) {
$data = $this->_user->get('user_prefs', '');
if (!empty($data)) {
// BC
$data = substr($data, 0, 5) == "array" ? e107::getArrayStorage()->ReadArray($data) : unserialize($data);
if (!$data) {
$data = array();
}
} else {
$data = array();
}
$this->setData($data);
}
return $this;
}
示例10: e107ImportPrefs
/**
* Return an Array of core preferences from e107 XML Dump data
*
* @param array $XMLData Raw XML e107 Export Data
* @param string $prefType [optional] the type of core pref: core|emote|ipool|menu etc.
* @return array preference array equivalent to the old $pref global;
*/
public function e107ImportPrefs($XMLData, $prefType = 'core')
{
if (!vartrue($XMLData['prefs'][$prefType])) {
return array();
}
//$mes = eMessage::getInstance();
$pref = array();
foreach ($XMLData['prefs'][$prefType] as $val) {
$name = $val['@attributes']['name'];
// if(strpos($val['@value'], 'array (') === 0)
// {
// echo '<pre>'.$val['@value'];
// echo "\n";
// var_dump(e107::getArrayStorage()->ReadArray($val['@value']));
// echo $val['@value'].'</pre>';
// }
$value = strpos($val['@value'], 'array (') === 0 ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value'];
$pref[$name] = $value;
// $mes->add("Setting up ".$prefType." Pref [".$name."] => ".$value, E_MESSAGE_DEBUG);
}
return $pref;
}
示例11: setArray
/**
* Update pref set and cache
*
* - @param string $name -- name of pref row
* - @param string $table -- "core" or "user"
* - @global $$name
* - @access public
*
* set() == core, pref
* set("rowname") == core, rowname
* set("","user") == user, user_pref for current user
* set("","user",uid) == user, user_pref for user uid
* set("fieldname","user") == user, fieldname
*
* all pref sets other than menu_pref get toDB()
*/
function setArray($name = '', $table = 'core', $uid = USERID)
{
$tp = e107::getParser();
if (!strlen($name)) {
switch ($table) {
case 'core':
$name = 'pref';
break;
case 'user':
$name = 'user_pref';
break;
}
}
global ${$name};
if ($name != 'menu_pref') {
foreach (${$name} as $key => $prefvalue) {
${$name}[$key] = $tp->toDB($prefvalue);
}
}
$tmp = e107::getArrayStorage()->WriteArray(${$name}, FALSE);
// $this->set() adds slashes now
// $tmp = serialize($$name);
$this->set($tmp, $name, $table, $uid);
}
示例12: intval
} else {
if ($query[1] == 'p') {
$handler_type = 'plug_handlers';
} else {
exit;
// Illegal value
}
}
$query[2] = $tp->toDB($query[2]);
$search_prefs[$handler_type][$query[2]]['class'] = intval($_POST['class']);
$search_prefs[$handler_type][$query[2]]['chars'] = $tp->toDB($_POST['chars']);
$search_prefs[$handler_type][$query[2]]['results'] = $tp->toDB($_POST['results']);
$search_prefs[$handler_type][$query[2]]['pre_title'] = intval($_POST['pre_title']);
$search_prefs[$handler_type][$query[2]]['pre_title_alt'] = $tp->toDB($_POST['pre_title_alt']);
// $tmp = addslashes(serialize($search_prefs));
$tmp = e107::getArrayStorage()->writeArray($search_prefs, true);
$check = $sql->db_Update("core", "e107_value='" . $tmp . "' WHERE e107_name='search_prefs'");
if ($check) {
$mes->addSuccess(LAN_UPDATED);
e107::getLog()->add('SEARCH_05', $handler_type . ', ' . $query[2], E_LOG_INFORMATIVE, '');
} elseif (0 === $check) {
$mes->addInfo(LAN_NO_CHANGE);
} else {
$mes->addError(LAN_UPDATED_FAILED, E_MESSAGE_ERROR);
$mes->addError(LAN_ERROR . " " . $sql->getLastErrorNumber() . ': ' . $sql->getLastErrorText());
}
}
if (isset($_POST['update_prefs'])) {
unset($temp);
$temp['relevance'] = intval($_POST['relevance']);
$temp['user_select'] = intval($_POST['user_select']);
示例13: getFeed
function getFeed($feedID, $force = FALSE)
{
global $e107, $admin_log;
$tp = e107::getParser();
$sql = e107::getDb();
$eArrayStorage = e107::getArrayStorage();
$this->readFeedList();
// Make sure we've got the feed data.
if (!isset($this->feedList[$feedID])) {
if (NEWSFEED_DEBUG) {
echo "Invalid feed number: {$feedID}<br />";
}
return FALSE;
}
if (strpos($this->newsList[$feedID]['newsfeed_data'], 'MagpieRSS')) {
$force = true;
}
if ($force || !isset($this->newsList[$feedID]['newsfeed_data']) || !$this->newsList[$feedID]['newsfeed_data']) {
// No data already in memory
if ($force || !($this->newsList[$feedID]['newsfeed_data'] = $e107->ecache->retrieve(NEWSFEED_NEWS_CACHE_TAG . $feedID, $this->feedList[$feedID]['newsfeed_updateint'] / 60))) {
// Need to re-read from source - either no cached data yet, or cache expired
if (NEWSFEED_DEBUG) {
$admin_log->e_log_event(10, debug_backtrace(), "DEBUG", "Newsfeed update", "Refresh item: " . $feedID, FALSE, LOG_TO_ROLLING);
}
require_once e_HANDLER . 'xml_class.php';
$xml = new xmlClass();
require_once e_HANDLER . 'magpie_rss.php';
$dbData = array();
// In case we need to update DB
if ($rawData = $xml->getRemoteFile($this->feedList[$feedID]['newsfeed_url'])) {
$rss = new MagpieRSS($rawData);
list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $this->feedList[$feedID]['newsfeed_image']);
$temp['channel'] = $rss->channel;
if ($newsfeed_showmenu == 0 || $newsfeed_showmain == 0) {
$temp['items'] = $rss->items;
// Unlimited items
} else {
$temp['items'] = array_slice($rss->items, 0, max($newsfeed_showmenu, $newsfeed_showmain));
// Limited items
}
$newsfeed_des = FALSE;
if ($this->feedList[$feedID]['newsfeed_description'] == 'default') {
$temp['newsfeed_description'] = 'default';
// This prevents db writes if no better data found
if ($rss->channel['description']) {
$newsfeed_des = $tp->toDB($rss->channel['description']);
$temp['newsfeed_description'] = $newsfeed_des;
} elseif ($rss->channel['tagline']) {
$newsfeed_des = $tp->toDB($rss->channel['tagline']);
$temp['newsfeed_description'] = $newsfeed_des;
}
if ($temp['newsfeed_description'] != $this->feedList[$feedID]['newsfeed_description']) {
// Need to write updated feed name to DB
$this->feedList[$feedID]['newsfeed_description'] = $temp['newsfeed_description'];
$dbData['newsfeed_description'] = $temp['newsfeed_description'];
if ($this->useCache) {
$e107->ecache->clear(NEWSFEED_LIST_CACHE_TAG);
// Clear the newsfeed cache so its re-read next time
}
}
}
if ($newsfeed_image == 'default') {
$temp['newsfeed_image_link'] = "<a href='" . $rss->image['link'] . "' rel='external'><img src='" . $rss->image['url'] . "' alt='" . $rss->image['title'] . "' style='vertical-align: middle;' /></a>";
} else {
$temp['newsfeed_image_link'] = "<img src='" . $this->feedList[$feedID]['newsfeed_image'] . "' alt='' />";
}
$serializedArray = $eArrayStorage->WriteArray($temp, FALSE);
$now = time();
$this->newsList[$feedID]['newsfeed_data'] = $serializedArray;
$this->newsList[$feedID]['newsfeed_timestamp'] = $now;
if ($this->useCache) {
$e107->ecache->set(NEWSFEED_NEWS_CACHE_TAG . $feedID, $serializedArray);
} else {
$dbData['newsfeed_data'] = addslashes($serializedArray);
$dbData['newsfeed_timestamp'] = $now;
}
if (count($dbData)) {
if (FALSE === $sql->db_UpdateArray('newsfeed', $dbData, " WHERE newsfeed_id=" . $feedID)) {
if (NEWSFEED_DEBUG) {
echo NFLAN_48 . "<br /><br />" . var_dump($dbData);
}
}
}
unset($rss);
} else {
if (NEWSFEED_DEBUG) {
echo $xml->error;
}
return FALSE;
}
}
}
return e107::unserialize($this->newsList[$feedID]['newsfeed_data']);
}
示例14: elseif
if (USERID == $row['user_id']) {
$cookieChange = $newData['user_password'];
}
} else {
$cantProcess++;
}
}
if ($emailGen == 1 && $user_info->canConvert($row['user_password'])) {
$user_prefs['email_password'] = $user_info->ConvertPassword($row['user_password'], $row['user_email']);
$emailProcess++;
} elseif ($emailGen == 2) {
unset($user_prefs['email_password']);
$emailProcess++;
}
if (count($user_prefs)) {
$newPrefs = e107::getArrayStorage()->serialize($user_prefs);
} else {
$newPrefs = '';
}
if ($newPrefs != $user_prefs) {
$newData['user_prefs'] = $newPrefs;
}
if (count($newData)) {
$sql->db_UpdateArray('user', $newData, " WHERE `user_id`={$row['user_id']}");
}
}
}
echo str_replace('--TOTAL--', $recordCount, LAN_PCONV_22) . '<br />';
echo str_replace('--TOTAL--', $saltProcess, LAN_PCONV_24) . '<br />';
echo str_replace('--TOTAL--', $emailProcess, LAN_PCONV_23) . '<br />';
echo str_replace('--TOTAL--', $cantProcess, LAN_PCONV_25) . '<br />';
示例15: array
$allData['data']['user_ban'] = USER_REGISTERED_NOT_VALIDATED;
} else {
$allData['data']['user_ban'] = USER_VALIDATED;
}
// Work out data to be written to user audit trail
$signup_data = array('user_name', 'user_loginname', 'user_email', 'user_ip');
// foreach (array() as $f)
foreach ($signup_data as $f) {
$signup_data[$f] = $allData['data'][$f];
// Just copy across selected fields
}
$allData['data']['user_password'] = $userMethods->HashPassword($savePassword, $allData['data']['user_loginname']);
if (vartrue($pref['allowEmailLogin'])) {
// Need to create separate password for email login
//$allData['data']['user_prefs'] = serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['data']['user_email'])));
$allData['data']['user_prefs'] = e107::getArrayStorage()->serialize(array('email_password' => $userMethods->HashPassword($savePassword, $allData['data']['user_email'])));
}
$allData['data']['user_join'] = time();
$allData['data']['user_ip'] = e107::getIPHandler()->getIP(FALSE);
if (!vartrue($allData['data']['user_name'])) {
$allData['data']['user_name'] = $allData['data']['user_loginname'];
$signup_data['user_name'] = $allData['data']['user_loginname'];
}
// The user_class, user_perms, user_prefs, user_realm fields don't have default value,
// so we put apropriate ones, otherwise - broken DB Insert
$allData['data']['user_class'] = '';
$allData['data']['user_perms'] = '';
$allData['data']['user_prefs'] = '';
$allData['data']['user_realm'] = '';
if (empty($allData['data']['user_signature'])) {
$allData['data']['user_signature'] = '';