本文整理汇总了PHP中WeUtility类的典型用法代码示例。如果您正苦于以下问题:PHP WeUtility类的具体用法?PHP WeUtility怎么用?PHP WeUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WeUtility类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: template
public function template($filename, $flag = TEMPLATE_INCLUDEPATH)
{
global $_W, $_GPC;
$_W['template'] = $_W['account']['template'];
$_W['template']['source'] = $_W['account']['template'];
$source = IA_ROOT . "/addons/quicktemplate/{$this->mn}/{$_W['template']}/{$filename}.html";
$compile = IA_ROOT . "/data/tpl/app/{$_W['template']}/{$this->mn}/{$filename}.tpl.php";
if (!empty($_GPC['__template'])) {
$source = IA_ROOT . "/addons/quicktemplate/{$this->mn}/{$_GPC['__template']}/{$filename}.html";
if (!is_file($source)) {
die('invalid debug template ' . $_GPC['__template']);
}
}
if (!is_file($source)) {
$source = IA_ROOT . "/addons/{$this->mn}/template/mobile/{$filename}.html";
if (!is_file($source)) {
$source = "{$_W['template']['source']}/mobile/default/{$this->mn}/{$filename}.html";
if (!is_file($source)) {
$source = "{$_W['template']['source']}/mobile/{$_W['account']['template']}/{$filename}.html";
if (!is_file($source)) {
$source = "{$_W['template']['source']}/mobile/default/{$filename}.html";
if (!is_file($source)) {
exit("Error: template source '{$filename}' is not exist!");
}
}
}
}
}
WeUtility::logging('compile source', array($source, $compile));
if (DEVELOPMENT || !is_file($compile) || filemtime($source) > filemtime($compile)) {
template_compile($source, $compile, true);
}
return $compile;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:34,代码来源:template.class.inc.php
示例2: fans_search
private function fans_search($user, $fields = array())
{
global $_W;
$fields_str = self::$select_fields;
$sql = "SELECT {$fields_str} FROM " . tablename(self::$t_sys_fans) . " a, " . tablename(self::$t_sys_member) . " b WHERE a.openid = :openid AND a.uniacid= :uniacid AND a.uid = b.uid";
$fans = pdo_fetch($sql, array(':openid' => $user, ':uniacid' => $_W['uniacid']));
WeUtility::logging('sql', $fans);
return $fans;
}
开发者ID:aspnmy,项目名称:weizan,代码行数:9,代码来源:fans.class.inc.php
示例3: receive
public function receive()
{
if ($this->message['msgtype'] == 'event') {
if ($this->message['event'] == 'subscribe' && !empty($this->message['ticket'])) {
$scene_id = $this->message['eventkey'];
WeUtility::logging("Receiver:SUBSCRIBE", $scene_id);
} elseif ($this->message['event'] == 'SCAN') {
$scene_id = $this->message['eventkey'];
WeUtility::logging("Receiver:SCAN", $scene_id);
}
}
}
开发者ID:aspnmy,项目名称:weizan,代码行数:12,代码来源:receiver.php
示例4: refreshUserInfo
private function refreshUserInfo($from_user)
{
$follower = $from_user;
$qr_mgr = new UserManager('');
$userInfo = $qr_mgr->getUserInfo($follower);
if (empty($userInfo) or empty($userInfo['nickname']) or empty($userInfo['avatar'])) {
$weapi = new WechatAPI();
$userInfo = $weapi->getUserInfo($follower);
$qr_mgr->saveUserInfo($userInfo);
}
WeUtility::logging('refresh', $userInfo);
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:12,代码来源:site.php
示例5: moduleInit
function moduleInit($name, $params = array())
{
if (empty($name)) {
return false;
}
$site = WeUtility::createModuleSite($name);
if (!is_error($site)) {
$method = 'shareResult';
if (method_exists($site, $method)) {
$site->{$method}($params);
exit('success');
}
}
}
开发者ID:6662680,项目名称:qday_wx,代码行数:14,代码来源:share.ctrl.php
示例6: respond
public function respond() {
global $_W, $engine;
$level = array();
if (!empty($_W['account']['modules'])) {
foreach ($_W['account']['modules'] as $row) {
if (!empty($row['displayorder']) && $row['displayorder'] < 127) {
$level[$row['displayorder']] = $row;
}
}
}
if (!empty($level)) {
$response = '';
for ($i = 1; $i <= 5; $i++) {
if (!empty($response)) {
$engine->response['module'] = $_W['module'];
return $response;
break;
}
if (empty($level[$i])) {
continue;
}
$_W['module'] = $level[$i]['name'];
$processor = WeUtility::createModuleProcessor($_W['module']);
$processor->message = $this->message;
$processor->inContext = false;
$processor->rule = $this->rule;
$engine->response['rule'] = $default['id'];
$response = $processor->respond();
}
}
if (!empty($_W['account']['default_period']) && empty($_W['cache']['default_period'])) {
return;
}
$response['FromUserName'] = $this->message['to'];
$response['ToUserName'] = $this->message['from'];
$response['MsgType'] = 'text';
$default = pdo_fetchcolumn("SELECT `default` FROM " . tablename('wechats') . " WHERE `weid`=:weid", array(':weid' => $_W['weid']));
if (is_array(iunserializer($default))) {
$default = iunserializer($default);
$_W['module'] = $default['module'];
$processor = WeUtility::createModuleProcessor($default['module']);
$processor->message = $this->message;
$processor->inContext = $this->inContext;
$processor->rule = $default['id'];
return $processor->respond();
}
$response['Content'] = stripslashes($default);
return $response;
}
开发者ID:royalwang,项目名称:saivi,代码行数:49,代码来源:processor.php
示例7: curl_file_get_contents
public static function curl_file_get_contents($durl)
{
$r = null;
if (function_exists('curl_init') && function_exists('curl_exec')) {
WeUtility::logging("using curl");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $durl);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$r = curl_exec($ch);
curl_close($ch);
}
return $r;
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:15,代码来源:wechatutil.php
示例8: respond
public function respond()
{
global $_W, $engine;
$sql = "SELECT `welcome` FROM " . tablename('wechats') . " WHERE `weid`=:weid";
$default = pdo_fetchcolumn($sql, array(':weid' => $_W['weid']));
if (is_array(iunserializer($default))) {
$default = iunserializer($default);
$_W['module'] = $default['module'];
$processor = WeUtility::createModuleProcessor($default['module']);
$processor->message = $this->message;
$processor->inContext = $this->inContext;
$processor->rule = $default['id'];
$processor->module = $_W['account']['modules'][$default['module']];
$engine->response['rule'] = $default['id'];
return $processor->respond();
}
return $this->respText($default);
}
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:18,代码来源:processor.php
示例9: fsock_http_request
public static function fsock_http_request($url, $timeout = 30)
{
$parsed = parse_url($url);
$host = $parsed['host'];
$path = $parsed['path'] . '?' . $parsed['query'];
$cookie = '';
$fp = fsockopen($host, 80, $errno, $errstr, $timeout);
WeUtility::logging('fsockopen', array($url, $errno, $errstr, $fp));
if (!$fp) {
return -1;
}
$out = "GET " . $path . " HTTP/1.1\r\n";
$out .= "Host: " . $host . "\r\n";
$out .= "Connection: Close\r\n";
$out .= "Cookie: " . $cookie . "\r\n\r\n";
fwrite($fp, $out);
fclose($fp);
}
开发者ID:aspnmy,项目名称:weizan,代码行数:18,代码来源:wechatutil.class.inc.php
示例10: doWebDelete
public function doWebDelete()
{
global $_GPC, $_W;
$rid = intval($_GPC['rid']);
$rule = pdo_fetch("SELECT id, module FROM " . tablename('rule') . " WHERE id = :id and uniacid=:uniacid", array(':id' => $rid, ':uniacid' => $_W['uniacid']));
if (empty($rule)) {
message('抱歉,要修改的规则不存在或是已经被删除!');
}
if (pdo_delete('rule', array('id' => $rid))) {
pdo_delete('rule_keyword', array('rid' => $rid));
//删除统计相关数据
pdo_delete('stat_rule', array('rid' => $rid));
pdo_delete('stat_keyword', array('rid' => $rid));
//调用模块中的删除
$module = WeUtility::createModule($rule['module']);
if (method_exists($module, 'ruleDeleted')) {
$module->ruleDeleted($rid);
}
}
message('规则操作成功!', $this->createWebUrl('manage'), 'success');
}
开发者ID:6662680,项目名称:qday_wx,代码行数:21,代码来源:site.php
示例11:
<div><span style="display:inline-block; width:150px; font-weight:600;">[to]</span>当前公众号的OpenID</div>
<div><span style="display:inline-block; width:150px; font-weight:600;">[rule]</span>当前回复的回复编号</div>
</div>
<span class="help-block hide adv-setting" style="margin:5px 0;">可在回复内容的任何地方使用预定义标记来表示特定内容</span>
<div id="module-form">
<?php
if (!empty($rid)) {
?>
<?php
$rule['reply']->fieldsFormDisplay($rule['rule']['id']);
?>
<?php
} else {
?>
<?php
WeUtility::createModule($defaultmodule)->fieldsFormDisplay();
?>
</script>
<?php
}
?>
</div>
</td>
</tr>
<tr>
<th></th>
<td>
<button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
<input type="hidden" name="token" value="<?php
echo $_W['token'];
?>
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:31,代码来源:post.tpl.php
示例12: reply_search
$cfg = $m['config'];
$ds = reply_search("`uniacid` = 0 AND module = 'userapi' AND `status`=1");
$apis = array();
foreach ($ds as $row) {
$apis[$row['id']] = $row;
}
if ($_W['ispost'] && $_W['isajax']) {
$rids = explode(',', $_GPC['rids']);
if (is_array($rids)) {
$cfg = array();
foreach ($rids as $rid) {
if (!empty($apis[$rid])) {
$cfg[intval($rid)] = true;
}
}
$module = WeUtility::createModule('userapi');
$module->saveSettings($cfg);
}
exit;
}
$ds = array();
foreach ($apis as $row) {
$reply = pdo_fetch('SELECT * FROM ' . tablename('userapi_reply') . ' WHERE `rid`=:rid', array(':rid' => $row['id']));
$r = array();
$r['title'] = $row['name'];
$r['rid'] = $row['id'];
$r['description'] = $reply['description'];
$r['switch'] = $cfg[$r['rid']] ? ' checked="checked"' : '';
$ds[] = $r;
}
template('platform/service');
开发者ID:legeng,项目名称:project-2,代码行数:31,代码来源:service.ctrl.php
示例13: doWebDeleteAll
public function doWebDeleteAll()
{
global $_GPC, $_W;
foreach ($_GPC['idArr'] as $k => $rid) {
$rid = intval($rid);
if ($rid == 0) {
continue;
}
$rule = pdo_fetch("SELECT id, module FROM " . tablename('rule') . " WHERE id = :id and uniacid=:uniacid", array(':id' => $rid, ':uniacid' => $_W['uniacid']));
if (empty($rule)) {
$this->webmessage('抱歉,要修改的规则不存在或是已经被删除!');
}
if (pdo_delete('rule', array('id' => $rid))) {
pdo_delete('rule_keyword', array('rid' => $rid));
//删除统计相关数据
pdo_delete('stat_rule', array('rid' => $rid));
pdo_delete('stat_keyword', array('rid' => $rid));
//调用模块中的删除
$module = WeUtility::createModule($rule['module']);
if (method_exists($module, 'ruleDeleted')) {
$module->ruleDeleted($rid);
}
}
}
$this->webmessage('选择中的活动删除成功!', '', 0);
}
开发者ID:6662680,项目名称:qday_wx,代码行数:26,代码来源:site.php
示例14: process
private function process($param)
{
global $_W;
if (empty($param['module']) || !in_array($param['module'], $this->modules)) {
return false;
}
$processor = WeUtility::createModuleProcessor($param['module']);
$processor->message = $param['message'];
$processor->rule = $param['rule'];
$processor->priority = intval($param['priority']);
$processor->inContext = $param['context'] === true;
$response = $processor->respond();
if (empty($response)) {
return false;
}
return $response;
}
开发者ID:ChainBoy,项目名称:wxfx,代码行数:17,代码来源:api.php
示例15: message
}
if (checksubmit('submit')) {
if (empty($_GPC['name'])) {
message('必须填写服务名称.');
}
$keywords = @json_decode(htmlspecialchars_decode($_GPC['keywords']), true);
if (empty($keywords)) {
message('必须填写有效的触发关键字.');
}
$rule = array('uniacid' => 0, 'name' => $_GPC['name'], 'module' => $m, 'status' => intval($_GPC['status']));
if (!empty($_GPC['istop']) && $_GPC['istop'] == 'true') {
$rule['displayorder'] = 255;
} else {
$rule['displayorder'] = range_limit($_GPC['displayorder'], 0, 254);
}
$module = WeUtility::createModule($m);
if (empty($module)) {
message('抱歉,模块不存在请重新其它模块!');
}
$msg = $module->fieldsFormValidate();
if (is_string($msg) && trim($msg) != '') {
message($msg);
}
if (!empty($rid)) {
$result = pdo_update('rule', $rule, array('id' => $rid));
} else {
$result = pdo_insert('rule', $rule);
$rid = pdo_insertid();
}
if (!empty($rid)) {
$sql = 'DELETE FROM ' . tablename('rule_keyword') . ' WHERE `rid`=:rid AND `uniacid`=:uniacid';
开发者ID:ChainBoy,项目名称:wxfx,代码行数:31,代码来源:service.ctrl.php
示例16: pdo_fetch
$log = pdo_fetch($sql, $pars);
if (!empty($log) && $log['status'] == '0') {
if ($log['is_usecard'] == 1 && $log['card_type'] == 1 && !empty($log['encrypt_code']) && $_W['acid']) {
load()->classs('coupon');
$acc = new coupon($_W['acid']);
$codearr['encrypt_code'] = $log['encrypt_code'];
$codearr['module'] = $log['module'];
$codearr['card_id'] = $log['card_id'];
$acc->PayConsumeCode($codearr);
}
if ($log['is_usecard'] == 1 && $log['card_type'] == 2) {
$now = time();
$log['card_id'] = intval($log['card_id']);
pdo_query('UPDATE ' . tablename('activity_coupon_record') . " SET status = 2, usetime = {$now}, usemodule = '{$log['module']}' WHERE uniacid = :aid AND couponid = :cid AND uid = :uid AND status = 1 LIMIT 1", array(':aid' => $_W['uniacid'], ':uid' => $log['openid'], ':cid' => $log['card_id']));
}
$site = WeUtility::createModuleSite($log['module']);
if (!is_error($site)) {
$site->weid = $_W['weid'];
$site->uniacid = $_W['uniacid'];
$site->inMobile = true;
$method = 'payResult';
if (method_exists($site, $method)) {
$ret = array();
$ret['result'] = 'failed';
$ret['type'] = $log['type'];
$ret['from'] = 'return';
$ret['tid'] = $log['tid'];
$ret['user'] = $log['openid'];
$ret['fee'] = $log['fee'];
$ret['weid'] = $log['weid'];
$ret['uniacid'] = $log['uniacid'];
开发者ID:zhang19960118,项目名称:html11,代码行数:31,代码来源:cash.ctrl.php
示例17: load
}
} else {
$solutions[] = $module;
}
}
}
$m = $_GPC['m'];
if (!empty($m)) {
load()->model('module');
$error = module_solution_check($m);
if (is_error($error)) {
message($error['message']);
}
$solution = module_fetch($m);
$title = ' 行业解决方案 - ' . $solution['title'];
$site = WeUtility::createModuleSite($m);
if (!is_error($site)) {
$method = 'doWebWelcome';
$welcome = @$site->{$method}();
}
if (empty($welcome)) {
$entries = module_entries($m, array('menu', 'home', 'profile', 'shortcut', 'cover'));
if ($_W['role'] == 'operator') {
foreach ($entries as $index1 => &$entry1) {
if ($index1 == 'cover') {
continue;
}
foreach ($entry1 as $index2 => &$entry2) {
$url_arr = parse_url($entry2['url']);
$url_query = $url_arr['query'];
parse_str($url_query, $query_arr);
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:welcome.ctrl.php
示例18: defined
*/
defined('IN_IA') or exit('Access Denied');
if ($_GPC['type'] == 'rule') {
$rid = intval($_GPC['id']);
$rule = pdo_fetch("SELECT id, module FROM " . tablename('rule') . " WHERE id = :id", array(':id' => $rid));
if (empty($rule)) {
message('抱歉,要修改的规则不存在或是已经被删除!');
}
//删除回复,关键字及规则
if (pdo_delete('rule', array('id' => $rid))) {
pdo_delete('rule_keyword', array('rid' => $rid));
//删除统计相关数据
pdo_delete('stat_rule', array('rid' => $rid));
pdo_delete('stat_keyword', array('rid' => $rid));
//调用模块中的删除
$module = WeUtility::createModule($rule['module']);
if (method_exists($module, 'ruleDeleted')) {
$module->ruleDeleted($rid);
}
}
message('规则操作成功!', create_url('rule/display', array('module' => $rule['module'])));
} elseif ($_GPC['type'] == 'keyword') {
$rid = intval($_GPC['rid']);
$kid = intval($_GPC['kid']);
$rule = pdo_fetch("SELECT id, module FROM " . tablename('rule') . " WHERE id = :id", array(':id' => $rid));
if (empty($rule)) {
message('抱歉,要修改的规则不存在或是已经被删除!');
}
pdo_delete('rule_keyword', array('rid' => $rid, 'id' => $kid));
pdo_delete('stat_keyword', array('kid' => $kid));
message('关键字删除成功!', '', 'success');
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:31,代码来源:delete.ctrl.php
示例19: array
}
} else {
$row['items'][] = array($opt['title'], create_url("rule/cover", array('eid' => $opt['eid'])));
}
}
}
if (!empty($m['rule']) || $mg['isrulefields']) {
$row['items'][] = array('关键字触发列表', create_url('rule/display', array('module' => $row['name'])), 'childItems' => array('<i class="icon-plus"></i>', create_url('rule/post', array('module' => $row['name']))));
}
if (!empty($m['home']) || !empty($m['profile']) || !empty($m['shortcut'])) {
$row['items'][] = array('微站导航设置', create_url('site/nav', array('name' => $row['name'])));
}
if (!empty($m['menu']) && is_array($m['menu'])) {
foreach ($m['menu'] as $opt) {
if (!empty($opt['call'])) {
$site = WeUtility::createModuleSite($row['name']);
if (method_exists($site, $opt['call'])) {
$ret = $site->{$opt}['call']();
if (is_array($ret)) {
foreach ($ret as $et) {
$row['items'][] = array($et['title'], $et['url']);
}
}
}
} else {
$row['items'][] = array($opt['title'], create_url("site/entry", array('eid' => $opt['eid'])));
}
}
}
if ($mg['settings']) {
$row['items'][] = array('参数设置', create_url('member/module/setting', array('mid' => $mg['mid'])));
开发者ID:yunsite,项目名称:my-we7,代码行数:31,代码来源:frame.ctrl.php
示例20: define
<?php
/**
* 微站管理
* [WDL] Copyright (c) 2013 B2CTUI.COM
*/
define('IN_SYS', true);
require '../framework/bootstrap.inc.php';
require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
load()->web('common');
load()->web('template');
header('Content-Type: text/html; charset=GBK');
$modulename = 'weisrc_dish';
$site = WeUtility::createModuleSite($modulename);
if (!is_error($site)) {
$method = 'doWebPrint';
//$site->module = array_merge($_W['modules'][$modulename], $_W['account']['modules'][$_W['modules'][$modulename]['mid']]);
$site->weid = $_W['uniacid'];
$site->inMobile = false;
if (method_exists($site, $method)) {
exit($site->{$method}());
}
}
exit("访问的方法 {$method} 不存在.");
开发者ID:nsoff,项目名称:wdlcms,代码行数:24,代码来源:print.php
注:本文中的WeUtility类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论