本文整理汇总了PHP中L::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP L::loadClass方法的具体用法?PHP L::loadClass怎么用?PHP L::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::loadClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getElement
function _getElement()
{
if (!$this->_element) {
$this->_element = L::loadClass('element');
}
return $this->_element;
}
示例2: getAtFeedByUserNames
function getAtFeedByUserNames($usernames)
{
$data = array();
if (!S::isArray($usernames)) {
return $data;
}
$userService = L::loadClass('userservice', 'user');
$users = $userService->getByUserNames($usernames);
if (S::isArray($users)) {
$userIds = array();
foreach ($users as $k => $v) {
$userIds[$v['uid']] = $v['username'];
}
$ouserdataDb = $this->_getOuserdataDB();
$atFeeds = (array) $ouserdataDb->findUserAtPrivacy(array_keys($userIds));
if (S::isArray($atFeeds)) {
foreach ($atFeeds as $v) {
$data[$v['uid']] = array('at_isfeed' => $v['at_isfeed'], 'username' => $userIds[$v['uid']]);
}
}
foreach ($userIds as $uid => $username) {
$data[$uid] or $data[$uid] = array('at_isfeed' => 0, 'username' => $username);
}
}
return $data;
}
示例3: topicPost
function topicPost($tid, $postdata)
{
global $timestamp, $winduid, $windid;
if (!$this->info) {
return false;
}
$this->_db->update("INSERT INTO pw_argument SET " . S::sqlSingle(array('tid' => $tid, 'cyid' => $this->info['id'], 'postdate' => $timestamp, 'lastpost' => $timestamp)));
if ($postdata['ifcheck'] > 0) {
require_once R_P . 'u/require/core.php';
//tnum加一
//* $this->_db->update("UPDATE pw_colonys SET tnum=tnum+'1',pnum=pnum+'1',todaypost=todaypost+'1' WHERE id=" . S::sqlEscape($this->cyid));
$this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET tnum=tnum+1,pnum=pnum+1,todaypost=todaypost+1 WHERE id=:id", array('pw_colonys', $this->cyid)));
$this->info['tnum']++;
$this->info['pnum']++;
updateGroupLevel($this->cyid, $this->info);
if ($this->info['ifopen']) {
$weiboService = L::loadClass('weibo', 'sns');
/* @var $weiboService PW_Weibo */
$weiboContent = substrs(stripWindCode($postdata['content']), 125);
$weiboExtra = array('cyid' => $this->cyid, 'title' => stripslashes($postdata['title']), 'cname' => $this->info['cname']);
$weiboService->send($winduid, $weiboContent, 'group_article', $tid, $weiboExtra);
}
}
//更新群成员表里面的最后发言时间
$this->_db->update("UPDATE pw_cmembers SET lastpost=" . S::sqlEscape($timestamp) . " WHERE uid=" . S::sqlEscape($winduid));
}
示例4: CheckUserTool
function CheckUserTool($uid, $tooldb)
{
global $db, $groupid, $credit;
if (!$tooldb['state']) {
Showmsg('tool_close');
}
$condition = unserialize($tooldb['conditions']);
if ($condition['group'] && strpos($condition['group'], ",{$groupid},") === false) {
Showmsg('tool_grouplimit');
}
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userdb = $userService->get($uid, false, true);
require_once R_P . 'require/credit.php';
$creditdb = $credit->get($uid, 'CUSTOM');
foreach ($condition['credit'] as $key => $value) {
if ($value) {
if (is_numeric($key)) {
$creditdb[$key] < $value && Showmsg('tool_creditlimit');
} elseif ($userdb[$key] < $value) {
Showmsg('tool_creditlimit');
}
}
}
}
示例5: syncredit
function syncredit($arr)
{
if (is_array($arr)) {
foreach ($arr as $uid => $setv) {
$updateMemberData = array();
foreach ($setv as $cid => $value) {
if (is_numeric($cid)) {
$value = intval($value);
/**
$this->db->pw_update(
"SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"UPDATE pw_membercredit SET value=" . S::sqlEscape($value) . ' WHERE uid=' . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid),
"INSERT INTO pw_membercredit SET " . S::sqlSingle(array('uid' => $uid, 'cid' => $cid, 'value' => $value))
);
**/
$this->db->pw_update("SELECT uid FROM pw_membercredit WHERE uid=" . S::sqlEscape($uid) . ' AND cid=' . S::sqlEscape($cid), pwQuery::updateClause('pw_membercredit', 'uid=:uid AND cid=:cid', array($uid, $cid), array('value' => $value)), pwQuery::insertClause('pw_membercredit', array('uid' => $uid, 'cid' => $cid, 'value' => $value)));
} elseif (in_array($cid, array('money', 'rvrc', 'credit', 'currency'))) {
$cid == 'rvrc' && ($value *= 10);
$updateMemberData[$cid] = intval($value);
}
}
if ($updateMemberData) {
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$userService->update($uid, array(), $updateMemberData);
}
}
}
return new ApiResponse(1);
}
示例6: _getDataAnalyseService
function _getDataAnalyseService()
{
if (!$this->_dataAnalyseService) {
$this->_dataAnalyseService = L::loadClass('datanalyseService', 'datanalyse');
}
return $this->_dataAnalyseService;
}
示例7: update
function update($uploaddb)
{
$fieldService = L::loadClass('ActivityField', 'activity');
if ($this->tid) {
$defaultAttach = $userAttach = array();
foreach ($uploaddb as $key => $value) {
if ($value['id']) {
$attach = array();
$attach = $fieldService->getField($value['id']);
$this->attachs[$attach['fieldname']] = $value['fileuploadurl'];
if ($attach['fieldname'] && $attach['ifdel'] == 1) {
$userAttach[$attach['fieldname']] = $value['fileuploadurl'];
} elseif ($attach['fieldname'] && !$attach['ifdel']) {
$defaultAttach[$attach['fieldname']] = $value['fileuploadurl'];
}
}
}
$defaultValueTableName = getActivityValueTableNameByActmid();
$userDefinedValueTableName = getActivityValueTableNameByActmid($this->actmid, 1, 1);
if ($defaultAttach) {
$this->db->update("UPDATE {$defaultValueTableName} SET " . S::sqlSingle($defaultAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
if ($userAttach) {
$this->db->update("UPDATE {$userDefinedValueTableName} SET " . S::sqlSingle($userAttach) . " WHERE tid=" . S::sqlEscape($this->tid));
}
} else {
foreach ($uploaddb as $key => $value) {
$this->attachs['fileuploadurl'] = $value['fileuploadurl'];
}
}
return true;
}
示例8: _uploadCsv
/**
* 上传csv文件到服务器端
*
*/
function _uploadCsv()
{
L::loadClass('csvupload', 'upload', false);
$csvupload = new CsvUpload($this->_uid);
PwUpload::upload($csvupload);
$this->_filename = $csvupload->pathname;
}
示例9: update
function update($uploaddb)
{
global $windid, $winduid, $timestamp, $pintro;
foreach ($uploaddb as $key => $value) {
$this->attachs[] = array('aid' => $this->aid, 'pintro' => $pintro[$value['id']] ? $pintro[$value['id']] : substr($value['name'], 0, strrpos($value['name'], '.')), 'path' => $value['fileuploadurl'], 'uploader' => $windid, 'uptime' => $timestamp, 'ifthumb' => $value['ifthumb']);
}
if ($this->attachs) {
$this->db->update("INSERT INTO pw_cnphoto (aid,pintro,path,uploader,uptime,ifthumb) VALUES " . S::sqlMulti($this->attachs));
$this->pid = $this->db->insert_id();
$cnalbum = $this->db->get_one("SELECT * FROM pw_cnalbum WHERE aid=" . S::sqlEscape($this->aid));
if ($this->atype) {
if (!$cnalbum['private']) {
updateDatanalyse($this->pid, 'groupPicNew', $timestamp);
}
} else {
$statistics = L::loadClass('Statistics', 'datanalyse');
$statistics->photouser($winduid, count($this->attachs));
}
if (isset($cnalbum['lastphoto']) && !$cnalbum['lastphoto']) {
$lastphoto = $this->getLastPhotoThumb();
$lastphotosqlAdd = ",lastphoto= " . S::sqlEscape($lastphoto);
}
$this->db->update("UPDATE pw_cnalbum SET photonum=photonum+" . S::sqlEscape(count($this->attachs)) . ",lasttime=" . S::sqlEscape($timestamp) . $lastphotosqlAdd . " WHERE aid=" . S::sqlEscape($this->aid));
}
return true;
}
示例10: getSendToUsernames
function getSendToUsernames($type, $tid)
{
global $windid, $db;
$usernames = array();
if (!$type || !$tid) {
return $usernames;
}
$remindUsernames = $db->get_value("SELECT db_value FROM pw_config WHERE db_name = 'report_remind'");
$remindUsernames = $remindUsernames ? unserialize($remindUsernames) : array();
foreach ($remindUsernames as $key => $value) {
if ($value['username'] == $windid) {
continue;
}
$usernames[] = $value['username'];
}
if ($type != 'topic') {
return $usernames;
}
$_cacheService = Perf::gatherCache('pw_threads');
$threads = $_cacheService->getThreadByThreadId($tid);
$fid = $threads['fid'];
L::loadClass('forum', 'forum', false);
$forumService = new PwForum($fid);
$foruminfo = $forumService->foruminfo;
$forumadmins = $foruminfo['forumadmin'];
$forumadmins = explode(',', $forumadmins);
foreach ($forumadmins as $forumadmin) {
if (!$forumadmin || $forumadmin == $windid) {
continue;
}
$usernames[] = $forumadmin;
}
return $usernames;
}
示例11: _render
function _render()
{
$layoutService = L::loadClass('layout', 'framework');
$layoutService->init($this->_viewPath, $this->_layoutFile, $this->_layoutExt);
$layoutService->setPartial($this->_partial);
$layoutService->setTemplate($this->_template ? $this->_template : $this->_controller . '.' . $this->_action);
$layoutService->display($this->_layoutFile, $this->_viewer);
}
示例12: run
function run()
{
$tid = $this->getVar('tid');
$uid = $this->getVar('winduid');
$pid = $this->getVar('pid');
$replyRewardRecordService = L::loadClass('ReplyRewardRecord', 'forum');
$GLOBALS['isReplyRewardSuccess'] = $replyRewardRecordService->rewardReplyUser($uid, $tid, $pid);
}
示例13: _getDataByTags
/**
* 根据日志ID数组获得日志信息
* @return array
*/
function _getDataByTags()
{
if (empty($this->tags)) {
return array();
}
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
return $userService->getUsersWithMemberDataByUserIds($this->tags);
}
示例14: _getExtendActions
/**
* 获得根据类别评价类型
* @return array
*/
function _getExtendActions()
{
global $db_ratepower;
$rateSets = unserialize($db_ratepower);
if ($rateSets[2]) {
$rate = L::loadClass('rate', 'rate');
$_tmp = $rate->getRateDiaryHotTypes();
}
return is_array($_tmp) ? array_keys($_tmp) : array();
}
示例15: _getExtendActions
/**
* 获得类别评价类型
* 1 帖子评价
* 2 日志评价
* 3 相片评价
* @return array
*/
function _getExtendActions()
{
global $db_ratepower;
$rateSets = unserialize($db_ratepower);
if ($rateSets[1]) {
$rate = L::loadClass('rate', 'rate');
$_tmp = $rate->getRatePictureHotTypes();
}
return array_keys($_tmp);
}