本文整理汇总了PHP中XWB_plugin类的典型用法代码示例。如果您正苦于以下问题:PHP XWB_plugin类的具体用法?PHP XWB_plugin怎么用?PHP XWB_plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XWB_plugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: gc
function gc()
{
$db = XWB_plugin::getDB();
$table = XWB_S_TBPRE . 'common_cache';
$timestamp = time() - 15 * 60;
$sql = "DELETE FROM `{$table}` WHERE `cachekey` LIKE 'xipct_%' AND `dateline` < '{$timestamp}' ";
$db->query($sql);
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:8,代码来源:xwbIpCount.class.php
示例2: xwbSiteUserRegister
/**
* 资源初始化
* @access public
* @return xwbSiteUserRegister
*/
function xwbSiteUserRegister()
{
global $_G;
loaducenter();
$this->db = XWB_plugin::getDB();
$this->ip = (string) $_G['clientip'];
$this->timestamp = TIMESTAMP;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:13,代码来源:xwbSiteUserRegister.class.php
示例3: switchMode
function switchMode($LTXCfg = 1, $UTXCfg = '', $BTXCfg = '')
{
$FTParams = 1 == $LTXCfg ? array('nbool_LTXCfg' => $LTXCfg, 'http_UTXCfg' => $UTXCfg, 'http_BTXCfg' => $BTXCfg) : array('nbool_LTXCfg' => $LTXCfg);
if ($this->_FTHelper($FTParams)) {
$config = 1 == $LTXCfg ? array('switch_to_xweibo' => (int) $LTXCfg, 'url_to_xweibo' => $UTXCfg, 'baseurl_to_xweibo' => $BTXCfg) : array('switch_to_xweibo' => (int) $LTXCfg);
XWB_plugin::setPCfg($config) || $this->_ERHelper('4021001');
$this->rst = TRUE;
}
$this->_LogHelper($this->apiRoute . '/switchMode');
return array('rst' => $this->rst, 'errno' => $this->errno, 'err' => $this->err);
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:11,代码来源:apiSystem.xapi.php
示例4: xwb_setSiteRegister
function xwb_setSiteRegister($nickname, $email, $pwd = false)
{
$db = XWB_plugin::getDB();
$uid = 0;
$password = $pwd ? $pwd : rand(100000, 999999);
$regstatus = jsg_member_register_check_status();
if ($regstatus['normal_enable'] || true === JISHIGOU_FORCED_REGISTER) {
$uid = jsg_member_register($nickname, $password, $email);
}
$rst = array('uid' => $uid, 'password' => $password);
return $rst;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:12,代码来源:xwbSite.inc.php
示例5: _validate
function _validate($A, $P, $T, $F)
{
/// 超时检测
if (XWB_REMOTE_API_TIME_VALIDATY < time() - $T) {
$this->_ERHelper('4010004');
}
$secret = md5(sprintf("#%s#%s#%s#%s#%s#", XWB_APP_KEY, $A, $P, $T, XWB_plugin::pCfg('encrypt_key')));
if (0 !== strcasecmp($F, $secret)) {
$this->_ERHelper('4010003', TRUE, 'load');
}
return;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:12,代码来源:apiLoader.php
示例6: sinaUidFilter
/**
* 过滤已经绑定到新浪微博的discuz!帐号
* @version $Id: sinaUidFilter.function.php 817 2011-06-02 07:38:51Z yaoying $
* @param array $uid 要过滤的uid号码数组。传参前,请自行保证里面的全是int。此处不作检查
* @param bool $remote 是否也进行远程api查询?默认为否
* @return array
*/
function sinaUidFilter($uid, $remote = false)
{
$sina_uid = array();
if (empty($uid)) {
return $sina_uid;
}
$rs = XWB_plugin::getBatchBindUser($uid, $remote);
//远程API
foreach ($rs as $row) {
$sina_uid[$row['uid']] = $row['sina_uid'];
}
return $sina_uid;
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:20,代码来源:sinaUidFilter.function.php
示例7: step1
function step1()
{
$tokenhash = '';
if (!xwb_token::checkInput('g', 'xwbuninstall', false)) {
echo 'XWB_TOKEN_HASH_CHECK_FAILURE!';
exit;
}
$cfg = $this->getCfg();
$tips = array();
$st = true;
if (!empty($_GET['delete_data'])) {
//delete db data
$db = XWB_plugin::getDB();
foreach ($cfg['db_data'] as $name => $format) {
$tbSql = sprintf($format, DB::table($name));
$db->query($tbSql);
$tips[] = array(1, "删除数据表 [PRE_]{$name} 成功");
}
$_GET['delete_data'] = 1;
} else {
$tips[] = array(1, "已保留微博插件数据");
$_GET['delete_data'] = 0;
}
$lock_file_output = '论坛目录' . str_replace(dirname(dirname(XWB_P_DATA)), '', $this->v['lock_file']);
if (false == @unlink($this->v['lock_file'])) {
$tips[] = array(1, "无法删除或找不到安装锁定文件(位于:{$lock_file_output})。如果文件存在,请自行删除。");
}
$showTab = 'uninstall';
$btn_enable = 'class="btn"';
$btn_name = $st ? '完成' : '重试';
if ($st) {
//根据安装来源给出完成跳转链接
if ($this->_sess->getInfo('boot_referer') == 'admincp') {
$installtype = 'SC_' . XWB_S_CHARSET;
if (version_compare(XWB_S_VERSION, '2', '<')) {
//X1.5
$link = '../../admin.php?action=plugins&operation=pluginuninstall&dir=sina_xweibo&installtype=' . $installtype . '&finish=1';
} else {
//X2
$link = '../../admin.php?action=plugins&operation=pluginuninstall&dir=sina_xweibo_x2&installtype=' . $installtype . '&finish=1';
}
} else {
$link = '../../index.php';
}
} else {
$link = 'uninstall.php?step=1&delete_data=' . $_GET['delete_data'];
}
$image_file = $st ? 'sucess.png' : "icon.gif";
include $this->tpl_dir . '/uninstall.php';
exit;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:51,代码来源:xwb_uninstall.class.php
示例8: closeApi
/**
* 关闭远程API
*/
function closeApi()
{
$stx = XWB_plugin::pCfg('switch_to_xweibo');
if (XWB_plugin::setPCfg(array('switch_to_xweibo' => 0))) {
$api = XWB_plugin::N('apixwb');
$response = $api->setNotice(0, '', FALSE);
// if( !is_array($response) || 0 != $response['errno']) {
// XWB_plugin::setPCfg(array('switch_to_xweibo' => $stx));
// }
exit(json_encode($response));
} else {
exit(json_encode(array('errno' => 1, 'err' => '配置文件无法写入')));
}
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:17,代码来源:xwbApiInterface.mod.php
示例9: verify
/**
* 进行身份验证
* 请保证传参所用字符集和论坛字符集一致,否则请先自行转换再传参
* @param string $username
* @param string $password
* @param int $questionid
* @param string $answer
* @param boolen $isuid 使用UID验证么?
* @return array
* 第一个数组下标($return[0])若大于0,则表示验证成功的登录uid。否则为错误信息:
* -1:UC用户不存在,或者被删除
* -2:密码错
* -3:安全提问错
* -4:用户没有在dz注册
* 第二个数组下标($return[1])若大于等于0,则表示验证成功的adminid;
* 否则为-1,表示验证失败
*/
function verify($username, $password, $questionid = '', $answer = '', $isuid = 0)
{
$return = array(0 => -1, 1 => -1);
$ip = XWB_plugin::getIP();
/**
* 校验用户输入错误密码的次数
*/
$failedlogins = $this->db->fetch_first("select * from " . XWB_S_TBPRE . "failedlogins where `ip`='{$ip}'");
if ($failedlogins && $failedlogins['count'] >= 5) {
$return[0] = -5;
return $return;
}
/**
* 校验用户输入的用户名和密码是否正确
*/
if (true === UCENTER) {
//加载Ucenter客户端文件
include_once ROOT_PATH . './api/uc_client/client.php';
$uc_result = uc_user_login($username, $password, $isuid, 0, $questionid, $answer);
$ucuid = $uc_result[0];
if ($ucuid < 1) {
$return[0] = $ucuid;
return $return;
}
}
$member = $this->db->fetch_first("SELECT `uid`, `password`, `nickname`, `username`, `role_type`, `salt` FROM " . XWB_S_TBPRE . "members WHERE `nickname`='{$username}'");
if ($member) {
/**
* 在记事狗系统中比对用户输入的密码
*/
if ($member['password'] == jsg_member_password($password, $member['salt'])) {
$return[0] = (int) $member['uid'];
$return[1] = 'admin' == $member['role_type'] ? 1 : 0;
} else {
$return[0] = -2;
/**
* 更新密码输入错误的次数
*/
if ($failedlogins) {
$this->db->query("update " . XWB_S_TBPRE . "failedlogins set `count`='" . (max(1, (int) $failedlogins['count']) + 1) . "', `lastupdate`='" . time() . "' where `ip`='{$ip}'");
} else {
$this->db->query("insert into " . XWB_S_TBPRE . "failedlogins (`ip`,`count`,`lastupdate`) values ('{$ip}','1','" . time() . "')");
}
}
}
return $return;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:64,代码来源:siteUserVerifier.class.php
示例10: closeApi
/**
* 关闭远程API
*/
function closeApi()
{
if (!xwb_token::checkInput('p', $this->tokehash, true)) {
exit(json_encode(array('errno' => 1, 'err' => '令牌验证失败,请返回重试')));
}
$stx = XWB_plugin::pCfg('switch_to_xweibo');
if (XWB_plugin::setPCfg(array('switch_to_xweibo' => 0))) {
$api = XWB_plugin::N('apixwb');
$response = $api->setNotice(0, '', FALSE);
// if( !is_array($response) || 0 != $response['errno']) {
// XWB_plugin::setPCfg(array('switch_to_xweibo' => $stx));
// }
exit(json_encode($response));
} else {
exit(json_encode(array('errno' => 1, 'err' => '配置文件无法写入')));
}
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:20,代码来源:xwbApiInterface.mod.php
示例11: _session_start
/**
* 启动session
*/
function _session_start()
{
$operatorType = defined('XWB_P_SESSION_OPERATOR') ? strtolower(XWB_P_SESSION_OPERATOR) : 'native';
$storageType = defined('XWB_P_SESSION_STORAGE_TYPE') ? strtolower(XWB_P_SESSION_STORAGE_TYPE) : '';
//session操作器初始化
$this->_operator = XWB_plugin::O('session/session_operator_' . $operatorType);
//session存储器注册到session操作器中
if (!empty($storageType)) {
$sessStorage = XWB_plugin::O('session/session_storage_' . $storageType);
$this->_operator->setStorageHandler($sessStorage);
//模拟操作器必须要有一个session存储器
} elseif ('simulator' == $operatorType) {
//XWB_plugin::showError('管理员设置错误,导致程序被终止。请联系管理员解决。<br />错误原因:You have defined SIMULATOR session operator but does not define a session STORAGE type! SYSTEM HALTED!');
trigger_error('You have defined SIMULATOR session operator but does not define a session STORAGE type! SYSTEM HALTED!', 256);
}
$this->_operator->session_start();
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:20,代码来源:clientUser.class.php
示例12: xwb_setSiteUserLogin
function xwb_setSiteUserLogin($uid)
{
global $_G;
if (empty($uid)) {
return false;
}
$db = XWB_plugin::getDB();
//登录
$member = DB::fetch_first("SELECT * FROM " . DB::table('common_member') . " WHERE uid='" . $uid . "'");
if (!$member) {
return false;
}
setloginstatus($member, time() + 60 * 60 * 24 ? 2592000 : 0);
DB::query("UPDATE " . DB::table('common_member_status') . " SET lastip='" . $_G['clientip'] . "', lastvisit='" . time() . "' WHERE uid='{$uid}'");
include_once libfile('function/stat');
updatestat('login');
updatecreditbyaction('daylogin', $uid);
checkusergroup($uid);
return true;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:20,代码来源:xwbSite.inc.php
示例13: xwb_format_signature
/**
* 新浪微博签名替换函数
* @version $Id: xwb_format_signature.function.php 1004 2012-06-11 10:32:46Z yaoying $
* @param string $s
*/
function xwb_format_signature($s)
{
static $xweibourl = null;
if (null == $xweibourl) {
$xweibourl = rtrim(strval(XWB_plugin::pCfg('baseurl_to_xweibo')), '/');
}
if (XWB_plugin::pCfg('switch_to_xweibo') && !empty($xweibourl)) {
$xweibourl_ta = $xweibourl . '/index.php?m=ta&id=';
} else {
$xweibourl_ta = 'http://weibo.com/u/';
}
$p = "#<-sina_sign,(\\d+),([a-z0-9]+),(\\d+)->#sim";
$rp = '<a href="' . $xweibourl_ta . '\\1" target="_blank"><img border="0" src="http://service.t.sina.com.cn/widget/qmd/\\1/\\2/\\3.png"/></a>';
//$p = XWB_plugin::convertEncoding($p,'UTF8', XWB_S_CHARSET);
//$rp= XWB_plugin::convertEncoding($rp,'UTF8', XWB_S_CHARSET);
if (!empty($s) && preg_match($p, $s, $m)) {
return preg_replace($p, $rp, $s);
}
return $s;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:25,代码来源:xwb_format_signature.function.php
示例14:
?>
<div class="users">
<a href="<?php
echo XWB_plugin::getWeiboProfileLink($value['sina_uid']);
?>
" target="_blank"><?php
echo $value['avatar'];
?>
</a>
<div class="user-info">
<p><?php
echo XWB_plugin::convertEncoding($value['username'], XWB_S_CHARSET, 'UTF-8');
?>
</p>
<a class="addfollow-btn" href="<?php
echo XWB_plugin::getWeiboProfileLink($value['sina_uid']);
?>
" target="_blank"></a>
<a class="already-addfollow-btn hidden" href="javascript:void(0)#"></a>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
<?php
}
?>
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:31,代码来源:xwb_ubind.tpl.php
示例15: exit
<?php
/*
* @version $Id: viewthread.hack.php 673 2011-05-03 02:06:05Z yaoying $
*/
if (!defined('IS_IN_XWB_PLUGIN')) {
exit('Access Denied!');
}
global $_G;
$uids = array();
$sina_uid = array();
foreach ($GLOBALS['postlist'] as $key => $row) {
$uids[] = (int) $row['authorid'];
//签名替换
$GLOBALS['postlist'][$key]['signature'] = isset($row['signature']) ? XWB_plugin::F('xwb_format_signature', $row['signature']) : '';
if ($row['first'] && XWB_plugin::pCfg('is_rebutton_display')) {
$this->viewthread_subject = $row['subject'];
}
}
$sina_uid = XWB_plugin::F('sinaUidFilter', $uids, false);
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:20,代码来源:viewthread.hack.php
示例16: _LogHelper
function _LogHelper($apiRoute)
{
if (!defined('XWB_LOCAL_API_LOG') || XWB_LOCAL_API_LOG != TRUE) {
return;
}
$data = array("\r\n" . str_repeat('-', 45), "[REQUEST_URI]:\t\t" . ($_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : '_UNKNOWN_'), "[API_ROUTE]:\t\t" . $apiRoute, "[ERROR_NO]:\t\t" . $this->errno, "[ERROR_MSG]:\t\t" . ($this->err ? $this->err : '_EMPTY_'), "[API_RESULT]:\t\t" . ($this->rst && !is_bool($this->rst) ? "\r\n" . print_r($this->rst, TRUE) : (is_bool($this->rst) ? $this->rst ? 'TRUE' : 'false' : '_EMPTY_')), str_repeat('-', 45) . "\r\n\r\n");
$logFile = XWB_P_DATA . '/api/api_local_log_' . date("Y-m-d_H") . '.txt';
XWB_plugin::LOG(implode("\r\n", $data), $logFile);
return;
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:10,代码来源:apiBase.php
示例17:
<td colspan="3">
<em id="regErrorTips" class="xwb-plugin-error" style="display:none;"></em>
</td>
</tr>
</table>
</form>
<?php
}
?>
</div>
<div id="bindBox" class="xwb-plugin-form" style="display:none;">
<form action="<?php
echo XWB_plugin::URL("xwbSiteInterface.doBindAtNotLog");
?>
" id="siteBindFrom" method="post" target="xwbSiteRegister" >
<input type="hidden" name="FORMHASH" value="<?php
echo FORMHASH;
?>
" />
<table class="xwb-plugin-table">
<tr class="xwb-plugin-tr">
<td class="xwb-plugin-td-msg"><label for="bindPwd">帐号昵称:</label></td>
<td class="xwb-plugin-td-input">
<input type="text" name="siteBindName" id="siteBindName" class="xwb-plugin-input-a" value="" />
<br />请输入您在 <?php
echo XWB_S_TITLE;
?>
的昵称
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:31,代码来源:register.tpl.php
示例18: runhooks
runhooks();
//dx的设置文件中有个['output']['forceheader'],为1时会强制输出一个header编码,故只能如此处理,防止干扰插件,但不能做到100%完美
if (0 != $discuz->config['output']['forceheader'] && 'UTF-8' != strtoupper($discuz->config['output']['charset'])) {
@header("Content-type: text/html; charset=utf-8");
}
//在钩子环境中,可能无法读取$discuz实例,因此要做如此处理
} elseif (!isset($discuz) || !is_a($discuz, 'discuz_core')) {
$discuz =& discuz_core::instance();
}
$GLOBALS[XWB_SITE_GLOBAL_V_NAME]['site_db'] =& DB::object();
// 附属站点所用的字符集 UTF8 GBK BIG5
define('XWB_S_CHARSET', str_replace("-", "", strtoupper($discuz->config['output']['charset'])));
// 附属站点所用的表前缀
define('XWB_S_TBPRE', $discuz->db->tablepre);
// 附属站点 的版本号
define('XWB_S_VERSION', substr($discuz->var['setting']['version'], 1));
// 附属站点 的类型名称
define('XWB_S_NAME', 'DiscuzX');
// 附属站点 的标题名称
define('XWB_S_TITLE', XWB_plugin::convertEncoding($discuz->var['setting']['bbname'], XWB_S_CHARSET, 'UTF-8'));
// 附属站点 的用户UID
define('XWB_S_UID', (int) $discuz->var['uid']);
define('XWB_S_IS_ADMIN', (int) $discuz->var['adminid'] == 1 ? true : false);
if (!defined('CURSCRIPT') || CURSCRIPT == '') {
$XWB_S_CURSCRIPT = isset($_SERVER['SCRIPT_FILENAME']) ? substr(basename($_SERVER['SCRIPT_FILENAME']), 0, -4) : 'unknown';
define('XWB_S_CURSCRIPT', $XWB_S_CURSCRIPT);
} else {
define('XWB_S_CURSCRIPT', CURSCRIPT);
}
//echo '<pre>';print_r(get_defined_constants());echo '</pre>';exit;
define('XWB_PLUGIN_SITE_ENV_LOADED', true);
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:31,代码来源:site.env.php
示例19: array
<!--安装失败的信息:给出提示信息-->
<div class="mainTxt">
<hr />
<div class="con red"><p><strong>安装失败,安装数据已全部回退。</strong></p></div>
<div class="con red"><p>如果您能将“初始化程序以及数据”提示信息,以及论坛地址、论坛版本和论坛字符编码等信息反馈给我们(比如<a href="http://bbs.x.weibo.com/forum/forumdisplay.php?fid=9" target="_blank">官方论坛</a>),将有助于我们的产品改进,感谢您的支持!</p></div>
<div class="con red"><p>联系邮箱:<a href="mailto:[email protected]">mailto:[email protected]</a> | 技术支持:<a href="http://x.weibo.com/" target="_blank">Xweibo官网</a></p></div>
</div>
<div class="clear"></div>
<?php
}
?>
<div class="footer">Copyright © 1996-2010 SINA</div>
</div>
</div>
<?php
//统计上报[安装]
$xwb_statType = 'in';
$xwb_statArgs = array();
$xwb_statArgs['akey'] = $appkey;
$xwb_statArgs['uid'] = 0;
$xwb_statArgs['domain'] = str_replace(array('http://', 'https://'), '', XWB_plugin::baseUrl());
$xwb_statArgs['qq'] = $qq;
echo XWB_plugin::statUrl($xwb_statType, $xwb_statArgs, true);
?>
</body>
</html>
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:30,代码来源:step3.php
示例20: getWeiboProfileLink
/**
* 获取新浪微博或者xweibo的个人主页link
* @param bigint $sina_uid
* @return string
*/
function getWeiboProfileLink($sina_uid = 0)
{
$xweibourl = rtrim(XWB_plugin::pCfg('baseurl_to_xweibo'), '/');
if (XWB_plugin::pCfg('switch_to_xweibo') && !empty($xweibourl)) {
$xweibourl_ta = $xweibourl . '/index.php?m=ta&id=' . $sina_uid;
} else {
$xweibourl_ta = 'http://weibo.com/' . $sina_uid;
}
return $xweibourl_ta;
}
开发者ID:chibimiku,项目名称:xweibo_for_discuz_x2_php7,代码行数:15,代码来源:core.class.php
注:本文中的XWB_plugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论