本文整理汇总了PHP中XCube_Root类的典型用法代码示例。如果您正苦于以下问题:PHP XCube_Root类的具体用法?PHP XCube_Root怎么用?PHP XCube_Root使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XCube_Root类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('member_id')) !== null) {
$this->mNavi->addExtra('member_id', $value);
$this->_mCriteria->add(new Criteria('member_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('uid')) !== null) {
$this->mNavi->addExtra('uid', $value);
$this->_mCriteria->add(new Criteria('uid', $value));
}
if (($value = $root->mContext->mRequest->getRequest('status')) !== null) {
$this->mNavi->addExtra('status', $value);
$this->_mCriteria->add(new Criteria('status', $value));
}
if (($value = $root->mContext->mRequest->getRequest('since')) !== null) {
$this->mNavi->addExtra('since', $value);
$this->_mCriteria->add(new Criteria('since', $value));
}
if (($value = $root->mContext->mRequest->getRequest('rank')) !== null) {
$this->mNavi->addExtra('rank', $value);
$this->_mCriteria->add(new Criteria('rank', $value));
}
if (($value = $root->mContext->mRequest->getRequest('posttime')) !== null) {
$this->mNavi->addExtra('posttime', $value);
$this->_mCriteria->add(new Criteria('posttime', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
开发者ID:kilica,项目名称:playermap,代码行数:41,代码来源:MemberFilterForm.class.php
示例2: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('policy_id')) !== null) {
$this->mNavi->addExtra('policy_id', $value);
$this->_mCriteria->add(new Criteria('policy_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('dirname')) !== null) {
$this->mNavi->addExtra('dirname', $value);
$this->_mCriteria->add(new Criteria('dirname', $value));
}
if (($value = $root->mContext->mRequest->getRequest('dataname')) !== null) {
$this->mNavi->addExtra('dataname', $value);
$this->_mCriteria->add(new Criteria('dataname', $value));
}
if (($value = $root->mContext->mRequest->getRequest('action')) !== null) {
$this->mNavi->addExtra('action', $value);
$this->_mCriteria->add(new Criteria('action', $value));
}
if (($value = $root->mContext->mRequest->getRequest('rank')) !== null) {
$this->mNavi->addExtra('rank', $value);
$this->_mCriteria->add(new Criteria('rank', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
开发者ID:mambax7,项目名称:legroup,代码行数:37,代码来源:PolicyFilterForm.class.php
示例3: prepare
public function prepare()
{
$root = XCube_Root::getSingleton();
$handler = xoops_gethandler('config');
$xoopsMailerConfig = $handler->getConfigsByCat(XOOPS_CONF_MAILER);
$this->reset();
if ($xoopsMailerConfig['from'] == '') {
$this->From = $root->mContext->mXoopsConfig['adminmail'];
} else {
$this->From = $xoopsMailerConfig['from'];
}
$this->Sender = $root->mContext->mXoopsConfig['adminmail'];
$this->SetLanguage(LEGACY_MAIL_LANG, XOOPS_ROOT_PATH . '/class/mail/phpmailer/language/');
$this->CharSet = LEGACY_MAIL_CHAR;
$this->Encoding = LEGACY_MAIL_ENCO;
switch ($xoopsMailerConfig['mailmethod']) {
case 'smtpauth':
$this->IsSMTP();
$this->SMTPAuth = true;
$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
$this->Username = $xoopsMailerConfig['smtpuser'];
$this->Password = $xoopsMailerConfig['smtppass'];
break;
case 'smtp':
$this->IsSMTP();
$this->SMTPAuth = false;
$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
break;
case 'sendmail':
$this->IsSendmail();
$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
break;
}
return true;
}
开发者ID:hiro1173,项目名称:legacy,代码行数:35,代码来源:MyMailer.class.php
示例4: _uninstallTables
/**
* Drop table because this class is uninstaller.
*
* @protected
*/
function _uninstallTables()
{
$root =& XCube_Root::getSingleton();
$db =& $root->mController->getDB();
$dirname = $this->_mXoopsModule->get('dirname');
$t_search = array('{prefix}', '{dirname}', '{Dirname}', '{_dirname_}');
$t_replace = array(XOOPS_DB_PREFIX, strtolower($dirname), ucfirst(strtolower($dirname)), $dirname);
$tables = $this->_mXoopsModule->getInfo('tables');
if ($tables != false && is_array($tables)) {
foreach ($tables as $table) {
//
// TODO Do we need to check reserved core tables?
//
$t_tableName = $table;
if (isset($this->_mXoopsModule->modinfo['cube_style']) && $this->_mXoopsModule->modinfo['cube_style'] == true) {
$t_tableName = str_replace($t_search, $t_replace, $table);
} else {
$t_tableName = $db->prefix($table);
}
$sql = "DROP TABLE " . $t_tableName;
if ($db->query($sql)) {
$this->mLog->addReport(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_DROP_TABLE, $t_tableName));
} else {
$this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_DROP_TABLE, $t_tableName));
}
}
}
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:33,代码来源:ModuleUninstaller.class.php
示例5: smarty_function_xoops_optionsArray
function smarty_function_xoops_optionsArray($params, &$smarty)
{
//
// We should check more.
//
$tags = '';
$objectArr =& $params['from'];
$default = isset($params['default']) ? $params['default'] : null;
$id = isset($params['id']) ? XOOPS_INPUT_DEFID_PREFIX . $params['id'] . '_' : null;
static $textFilter;
if (!isset($textFilter)) {
$root =& XCube_Root::getSingleton();
$textFilter = $root->getTextFilter();
}
$vname = $params['value'];
$lname = $params['label'];
$isarr = is_array($default);
foreach ($objectArr as $object) {
$value = $object->get($vname);
$selected = $isarr ? in_array($value, $default) : $value == $default ? ' selected="selected"' : '';
$value = $textFilter->toShow($value);
$label = $textFilter->toShow($object->get($lname));
$tags .= $id ? "<option id=\"{$id}{$value}\" value=\"{$value}\"{$selected}>{$label}</option>\n" : "<option value=\"{$value}\"{$selected}>{$label}</option>\n";
}
print $tags;
}
开发者ID:hiro1173,项目名称:legacy,代码行数:26,代码来源:function.xoops_optionsArray.php
示例6: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('title')) !== null) {
$this->mNavi->addExtra('title', $value);
$this->_mCriteria->add(new Criteria('title', $value));
}
if (($value = $root->mContext->mRequest->getRequest('publicity')) !== null) {
$this->mNavi->addExtra('publicity', $value);
$this->_mCriteria->add(new Criteria('publicity', $value));
}
if (($value = $root->mContext->mRequest->getRequest('approval')) !== null) {
$this->mNavi->addExtra('approval', $value);
$this->_mCriteria->add(new Criteria('approval', $value));
}
if (($value = $root->mContext->mRequest->getRequest('description')) !== null) {
$this->mNavi->addExtra('description', $value);
$this->_mCriteria->add(new Criteria('description', $value));
}
if (($value = $root->mContext->mRequest->getRequest('posttime')) !== null) {
$this->mNavi->addExtra('posttime', $value);
$this->_mCriteria->add(new Criteria('posttime', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
开发者ID:mambax7,项目名称:legroup,代码行数:37,代码来源:GroupFilterForm.class.php
示例7: fetch
function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
$rank_special = $root->mContext->mRequest->getRequest('rank_special');
$option_field = $root->mContext->mRequest->getRequest('option_field');
$search = $root->mContext->mRequest->getRequest('search');
if (isset($_REQUEST['rank_special'])) {
$this->mNavi->addExtra('rank_special', xoops_getrequest('rank_special'));
$this->_mCriteria->add(new Criteria('rank_special', xoops_getrequest('rank_special')));
}
if (isset($_REQUEST['option_field'])) {
$this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
$this->mOptionField = $option_field;
if ($this->mOptionField == "special") {
//only system avatar
$this->_mCriteria->add(new Criteria('rank_special', '1'));
} elseif ($this->mOptionField == "normal") {
//only custom avatar
$this->_mCriteria->add(new Criteria('rank_special', '0'));
} else {
//all
}
}
//
if (!empty($search)) {
$this->mKeyword = $search;
$this->mNavi->addExtra('search', $this->mKeyword);
$this->_mCriteria->add(new Criteria('rank_title', '%' . $this->mKeyword . '%', 'LIKE'));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
开发者ID:hiro1173,项目名称:legacy,代码行数:32,代码来源:RanksFilterForm.class.php
示例8: smarty_function_xoops_optionsArray
function smarty_function_xoops_optionsArray($params, &$smarty)
{
//
// We should check more.
//
$tags = "";
$objectArr =& $params['from'];
$default = isset($params['default']) ? $params['default'] : null;
$id = isset($params['id']) ? $params['id'] : null;
$root =& XCube_Root::getSingleton();
$textFilter =& $root->getTextFilter();
foreach ($objectArr as $object) {
$value = $textFilter->toShow($object->get($params['value']));
$label = $textFilter->toShow($object->get($params['label']));
$selected = "";
if (is_array($default) && in_array($object->get($params['value']), $default)) {
$selected = " selected=\"selected\"";
} elseif (!is_array($default) && $object->get($params['value']) == $default) {
$selected = " selected=\"selected\"";
}
if ($id) {
$t_id = XOOPS_INPUT_DEFID_PREFIX . $id . "_" . $value;
$tags .= "<option id=\"{$t_id}\" value=\"{$value}\"{$selected}>{$label}</option>\n";
} else {
$tags .= "<option value=\"{$value}\"{$selected}>{$label}</option>\n";
}
}
print $tags;
}
开发者ID:nouphet,项目名称:rata,代码行数:29,代码来源:function.xoops_optionsArray.php
示例9: getckconfig
/**
* getckconfig
*/
function getckconfig($params)
{
$mydirname = basename(dirname(dirname(__FILE__)));
$mydirPath = dirname(dirname(__FILE__));
//add ckconfig start
$ckconfig = '';
//-- set CKEdtior Option customConfig --//
$root = XCube_Root::getSingleton();
$ckconfigdirname = $root->mContext->mXoopsConfig['language'];
if (!empty($ckconfigdirname) && !file_exists($mydirPath . '/language/' . $ckconfigdirname . '/config.js')) {
$ckconfigdirname = '';
}
if (!empty($ckconfigdirname)) {
$ckconfig .= "customConfig:'" . XOOPS_MODULE_URL . "/" . $mydirname . "/language/" . $ckconfigdirname . "/config.js'";
} else {
$ckconfig .= "customConfig:''";
}
if (isset($params['toolbar'])) {
if (!empty($params['toolbar'])) {
$ckconfig .= ",toolbar:'" . $params['toolbar'] . "'";
}
}
//--------------------------------------//
//set CKEdtior Option start from second
//-- set CKEdtior Option Smailey for XoopsSmailey --//
$ckconfig .= $this->_getCkconfig4XoopsSmailey();
return $ckconfig;
//add EXTconfig end
}
开发者ID:nouphet,项目名称:rata,代码行数:32,代码来源:makescript.php
示例10: checkLogin
function checkLogin(&$xoopsUser)
{
$root =& XCube_Root::getSingleton();
if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
return;
}
$root->mLanguageManager->loadModuleMessageCatalog('user');
$userHandler =& xoops_getmodulehandler('users', 'user');
$criteria = new CriteriaCompo();
if (xoops_getrequest('uname') != "" && strpos(xoops_getrequest('uname'), '@') !== false) {
$criteria->add(new Criteria('email', xoops_getrequest('uname')));
} else {
$criteria->add(new Criteria('uname', xoops_getrequest('uname')));
// use for both e-mail or uname logiin
// $criteria->add(new Criteria('uname','')); // use for only e-mail logiin
}
$criteria->add(new Criteria('pass', md5(xoops_getrequest('pass'))));
$userArr =& $userHandler->getObjects($criteria);
if (count($userArr) != 1) {
return;
}
if ($userArr[0]->get('level') == 0) {
return;
}
$handler =& xoops_gethandler('user');
$user =& $handler->get($userArr[0]->get('uid'));
$xoopsUser = $user;
require_once XOOPS_ROOT_PATH . '/include/session.php';
xoops_session_regenerate();
$_SESSION = array();
$_SESSION['xoopsUserId'] = $xoopsUser->get('uid');
$_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
}
开发者ID:nouphet,项目名称:rata,代码行数:33,代码来源:Emaillogin.class.php
示例11: smarty_function_legacy_map_edit
function smarty_function_legacy_map_edit($params, &$smarty)
{
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$dataId = isset($params['data_id']) ? $params['data_id'] : null;
$addressId = isset($params['geocode']) ? $params['geocode'] : null;
$template = isset($params['template']) ? $params['template'] : 'legacy_inc_map_edit.html';
$places = array();
XCube_DelegateUtils::call('Legacy_Map.GetPlaces', new XCube_Ref($places), $dirname, $dataname, $dataId);
$root = XCube_Root::getSingleton();
$latitude = $root->mContext->mRequest->getRequest('latitude');
$longitude = $root->mContext->mRequest->getRequest('longitude');
$request = null;
if (isset($latitude) && isset($longitude)) {
$request = array('latitude' => $latitude, 'longitude' => $longitude, 'zoom' => 10);
}
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype', XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('places', $places);
$render->setAttribute('geocode', $geocode);
$render->setAttribute('request', $request);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
开发者ID:mambax7,项目名称:xcck,代码行数:26,代码来源:function.legacy_map_edit.php
示例12: prepare
/**
* prepare
*
* @param string $dirname
*
* @return void
**/
public static function prepare($dirname)
{
$root =& XCube_Root::getSingleton();
$instance = new Lecat_AssetPreloadBase($root->mController);
$instance->mDirname = $dirname;
$root->mController->addActionFilter($instance);
}
开发者ID:nouphet,项目名称:rata,代码行数:14,代码来源:AssetPreload.class.php
示例13: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root = XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('definition_id')) !== null) {
$this->mNavi->addExtra('definition_id', $value);
$this->_mCriteria->add(new Criteria('definition_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('field_name')) !== null) {
$this->mNavi->addExtra('field_name', $value);
$this->_mCriteria->add(new Criteria('field_name', $value));
}
if (($value = $root->mContext->mRequest->getRequest('label')) !== null) {
$this->mNavi->addExtra('label', $value);
$this->_mCriteria->add(new Criteria('label', $value));
}
if (($value = $root->mContext->mRequest->getRequest('field_type')) !== null) {
$this->mNavi->addExtra('field_type', $value);
$this->_mCriteria->add(new Criteria('field_type', $value));
}
if (($value = $root->mContext->mRequest->getRequest('validation')) !== null) {
$this->mNavi->addExtra('validation', $value);
$this->_mCriteria->add(new Criteria('validation', $value));
}
if (($value = $root->mContext->mRequest->getRequest('required')) !== null) {
$this->mNavi->addExtra('required', $value);
$this->_mCriteria->add(new Criteria('required', $value));
}
if (($value = $root->mContext->mRequest->getRequest('weight')) !== null) {
$this->mNavi->addExtra('weight', $value);
$this->_mCriteria->add(new Criteria('weight', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
开发者ID:mambax7,项目名称:xcck,代码行数:41,代码来源:DefinitionFilterForm.class.php
示例14: loadRolesByModule
/**
* Loads roles of the specific module with $module, and set loaded roles to
* the current principal.
* @static
* @param XoopsModule $module
*/
function loadRolesByModule(&$module)
{
static $cache;
$root =& XCube_Root::getSingleton();
$context =& $root->mContext;
if ($module == null) {
return;
}
if (isset($cache[$module->get('mid')])) {
return;
}
$groups = is_object($context->mXoopsUser) ? $context->mXoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
$handler =& xoops_gethandler('groupperm');
if ($handler->checkRight('module_read', $module->get('mid'), $groups)) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.Visitor');
}
if (is_object($context->mXoopsUser) && $handler->checkRight('module_admin', $module->get('mid'), $groups)) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.Admin');
}
$handler =& xoops_getmodulehandler('group_permission', 'legacy');
$roleArr = $handler->getRolesByModule($module->get('mid'), $groups);
foreach ($roleArr as $role) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.' . $role);
}
$cache[$module->get('mid')] = true;
}
开发者ID:hiro1173,项目名称:legacy,代码行数:32,代码来源:Legacy_RoleManager.class.php
示例15: smarty_function_ck4dhtmltarea
function smarty_function_ck4dhtmltarea($params, &$smarty)
{
if (isset($params['name'])) {
$js = Ckeditor4_Utils::getJS($params);
if ($js) {
if (version_compare(LEGACY_BASE_VERSION, '2.2', '>=')) {
// Add script into HEAD
$root =& XCube_Root::getSingleton();
$jQuery = $root->mContext->getAttribute('headerScript');
$jQuery->addScript($js);
$jQuery->addLibrary('/modules/ckeditor4/ckeditor/ckeditor.js');
$addScript = '';
} else {
$xoopsURL = XOOPS_URL;
$addScript = <<<EOD
<script type="text/javascript">
if (typeof jQuery != 'undefined') {
\tjQuery(function(\$){
\t\t{$js}
\t});
}
</script>
<script type="text/javascript" src="{$xoopsURL}/modules/ckeditor4/ckeditor/ckeditor.js"></script>
EOD;
//$smarty->assign( 'xoops_module_header', $smarty->get_template_vars( 'xoops_module_header' ) . $addScript );
}
}
//
// Build the object for output.
//
print '<textarea name="' . $params['name'] . '" class="' . $params['class'] . '" style="' . $params['style'] . '" cols="' . $params['cols'] . '" rows="' . $params['rows'] . '" id="' . $params['id'] . '">' . $params['value'] . '</textarea>' . $addScript;
}
}
开发者ID:digideskio,项目名称:ckeditor4,代码行数:33,代码来源:function.ck4dhtmltarea.php
示例16: viewDefaultOp
function viewDefaultOp()
{
$root =& XCube_Root::getSingleton();
$controller =& $root->mController;
$action = new NBFrame_PreferenceEditAction();
if ($action->prepare($controller, $controller->mRoot->mContext->mXoopsUser) === false) {
die;
//< TODO
}
if (!$action->hasPermission($controller, $controller->mRoot->mContext->mXoopsUser)) {
if ($this->mAdminFlag) {
$controller->executeForward(XOOPS_URL . "/admin.php");
} else {
$controller->executeForward(XOOPS_URL);
}
}
$this->mXoopsTpl->assign('actionForm', $action->mActionForm);
$this->mXoopsTpl->assign('objectArr', $action->mObjects);
$this->mXoopsTpl->assign('category', $action->mCategory);
$this->mXoopsTpl->assign('module', $action->mModule);
$handler =& xoops_gethandler('timezone');
$timezoneArr =& $handler->getObjects();
$this->mXoopsTpl->assign('timezoneArr', $timezoneArr);
$handler =& xoops_gethandler('group');
$groupArr =& $handler->getObjects();
$this->mXoopsTpl->assign('groupArr', $groupArr);
$handler =& xoops_gethandler('member');
$userArr = $handler->getUserList();
$this->mXoopsTpl->assign('userArr', $userArr);
}
开发者ID:nobunobuta,项目名称:xoopscube_NBFrame,代码行数:30,代码来源:NBFramePreferenceAction.class.php
示例17: update041
function update041()
{
$this->mLog->addReport(_AD_LEGACY_MESSAGE_UPDATE_STARTED);
//Add Table
$sqlfileInfo = $this->_mTargetXoopsModule->getInfo('sqlfile');
$dirname = $this->_mTargetXoopsModule->getVar('dirname');
$sqlfile = $sqlfileInfo[XOOPS_DB_TYPE];
$sqlfilepath = XOOPS_MODULE_PATH . '/' . $dirname . '/' . $sqlfile;
require_once XOOPS_MODULE_PATH . '/legacy/admin/class/Legacy_SQLScanner.class.php';
$scanner = new Legacy_SQLScanner();
$scanner->setDB_PREFIX(XOOPS_DB_PREFIX);
$scanner->setDirname($this->_mTargetXoopsModule->get('dirname'));
if (!$scanner->loadFile($sqlfilepath)) {
$this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_SQL_FILE_NOT_FOUND, $sqlfile));
return false;
}
$scanner->parse();
$sqls = $scanner->getSQL();
$root = XCube_Root::getSingleton();
$db = $root->mController->getDB();
foreach ($sqls as $sql) {
if (strpos($sql, '_message_users') !== false) {
if (!$db->query($sql)) {
$this->mLog->addError($db->error());
return false;
}
}
}
$this->mLog->addReport(_AD_LEGACY_MESSAGE_DATABASE_SETUP_FINISHED);
//add table
$this->updatemain();
return true;
}
开发者ID:nouphet,项目名称:rata,代码行数:33,代码来源:myUpdater.class.php
示例18: _processScript
function _processScript()
{
$root = XCube_Root::getSingleton();
$db = $root->mController->getDB();
/*
$INBOX = "INSERT INTO `".$db->prefix('message_inbox')."` (`inbox_id`, `uid`, `from_uid`, `title`, `message`, `utime`, `is_read`) SELECT 0, to_userid, from_userid, subject, msg_text, msg_time, read_msg FROM `".$db->prefix('priv_msgs')."`";
$OUTBOX = "INSERT INTO `".$db->prefix('message_outbox')."` (`outbox_id`, `uid`, `to_uid`, `title`, `message`, `utime`) SELECT 0, from_userid, to_userid, subject, msg_text, msg_time FROM `".$db->prefix('priv_msgs')."`";
if ( $db->queryF($INBOX) ) {
$this->mLog->addReport('Update to inbox.');
if ( $db->queryF($OUTBOX) ) {
$this->mLog->addReport('Update to outbox.');
}
}
*/
//--- Start ---
$INBOX = "INSERT INTO `" . $db->prefix('message_inbox') . "` (`inbox_id`, `uid`, `from_uid`, `title`, `message`, `utime`, `is_read`) VALUES (0, %d, %d, '%s', '%s', %d, %d)";
$OUTBOX = "INSERT INTO `" . $db->prefix('message_outbox') . "` (`outbox_id`, `uid`, `to_uid`, `title`, `message`, `utime`) VALUES (0, %d, %d, '%s', '%s', %d)";
$num = 0;
$sql = "SELECT * FROM `" . $db->prefix('priv_msgs') . "` ORDER BY `msg_id`";
$result = $db->query($sql);
while ($val = $db->fetchArray($result)) {
$sql = sprintf($INBOX, $val['to_userid'], $val['from_userid'], mysql_real_escape_string($val['subject']), mysql_real_escape_string($val['msg_text']), $val['msg_time'], $val['read_msg']);
$result = $db->queryF($sql);
$sql = sprintf($OUTBOX, $val['from_userid'], $val['to_userid'], mysql_real_escape_string($val['subject']), mysql_real_escape_string($val['msg_text']), $val['msg_time']);
$result = $db->queryF($sql);
$num++;
}
$this->mLog->addReport('Update to ' . $num . ' records.');
//--- End ---
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:30,代码来源:myInstaller.class.php
示例19: smarty_function_legacy_comment
function smarty_function_legacy_comment($params, &$smarty)
{
$cDirname = $params['cDirname'];
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$dataId = isset($params['data_id']) ? $params['data_id'] : 0;
$categoryId = isset($params['category_id']) ? $params['category_id'] : 0;
$comments = null;
XCube_DelegateUtils::call('Legacy_Comment.'.$cDirname.'.GetComments',
new XCube_Ref($comments),
$cDirname,
$dirname,
$dataname,
$dataId,
$categoryId,
$params
);
$template = isset($params['template']) ? $params['template'] : $comments['template'];
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype',XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('comments', $comments);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:30,代码来源:function.legacy_comment.php
示例20: execute
function execute(&$controller, &$xoopsUser)
{
if (XCube_Root::getSingleton()->mContext->mRequest->getRequest('_form_control_cancel') != null) {
return USER_FRAME_VIEW_CANCEL;
}
$memberHandler =& xoops_gethandler('member');
$this->mNewUser =& $memberHandler->createUser();
$this->mRegistForm->update($this->mNewUser);
$this->mNewUser->set('uorder', $controller->mRoot->mContext->getXoopsConfig('com_order'), true);
$this->mNewUser->set('umode', $controller->mRoot->mContext->getXoopsConfig('com_mode'), true);
if ($this->mConfig['activation_type'] == 1) {
$this->mNewUser->set('level', 1, true);
}
if (!$memberHandler->insertUser($this->mNewUser)) {
$this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
return USER_FRAME_VIEW_ERROR;
}
if (!$memberHandler->addUserToGroup(XOOPS_GROUP_USERS, $this->mNewUser->get('uid'))) {
$this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
return USER_FRAME_VIEW_ERROR;
}
$this->_clearRegistForm($controller);
$this->_processMail($controller);
$this->_eventNotifyMail($controller);
XCube_DelegateUtils::call('Legacy.Event.RegistUser.Success', new XCube_Ref($this->mNewUser));
return USER_FRAME_VIEW_SUCCESS;
}
开发者ID:nouphet,项目名称:rata,代码行数:27,代码来源:UserRegister_confirmAction.class.php
注:本文中的XCube_Root类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论