当前位置: 首页>>代码示例>>PHP>>正文


PHP module_fetch函数代码示例

本文整理汇总了PHP中module_fetch函数的典型用法代码示例。如果您正苦于以下问题:PHP module_fetch函数的具体用法?PHP module_fetch怎么用?PHP module_fetch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了module_fetch函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: respond

 public function respond()
 {
     global $_W;
     $content = $this->message['content'];
     $reply = pdo_fetch('SELECT * FROM ' . tablename('cover_reply') . ' WHERE `rid`=:rid', array(':rid' => $this->rule));
     if (!empty($reply)) {
         load()->model('module');
         $module = module_fetch($reply['module']);
         if (empty($module) && !in_array($reply['module'], array('site', 'mc', 'card'))) {
             return '';
         }
         $url = $reply['url'];
         if (empty($reply['url'])) {
             $entry = pdo_fetch("SELECT eid FROM " . tablename('modules_bindings') . " WHERE module = :module AND do = :do", array(':module' => $reply['module'], ':do' => $reply['do']));
             $url = url('entry', array('eid' => $entry['eid']));
         }
         if (!strexists($url, '&j=') && !empty($_W['acid'])) {
             $url = str_replace("?i={$_W['uniacid']}&", "?i={$_W['uniacid']}&j={$_W['acid']}&", $url);
         }
         $news = array();
         $news[] = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => $reply['thumb'], 'url' => $url);
         return $this->respNews($news);
     }
     return '';
 }
开发者ID:6662680,项目名称:qday_wx,代码行数:25,代码来源:processor.php

示例2: buildframes

function buildframes($types = array('platform'), $modulename = '')
{
    global $_W;
    $ms = (include IA_ROOT . '/web/common/frames.inc.php');
    load()->model('module');
    $frames = array();
    $modules = uni_modules();
    //print_r($module);die();
    if (!empty($modules)) {
        $sysmods = system_modules();
        foreach ($modules as $m) {
            if (in_array($m['name'], $sysmods)) {
                continue;
            }
            $frames[$m['type']][] = $m;
        }
    }
    $types = module_types();
    if (!empty($frames)) {
        foreach ($frames as $type => $fs) {
            $items = array();
            if (!empty($fs)) {
                foreach ($fs as $m) {
                    $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                }
            }
            $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
        }
    }
    if (in_array('solution', $types)) {
        load()->model('module');
        $error = module_solution_check($modulename);
        if (is_error($error)) {
        } else {
            $module = module_fetch($modulename);
            $entries = module_entries($modulename, array('menu'));
            if ($_W['role'] == 'operator') {
                foreach ($entries as &$entry1) {
                    foreach ($entry1 as $index2 => &$entry2) {
                        $url_arr = parse_url($entry2['url']);
                        $url_query = $url_arr['query'];
                        parse_str($url_query, $query_arr);
                        $eid = intval($query_arr['eid']);
                        $data = pdo_fetch('SELECT * FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
                        $ixes = pdo_fetchcolumn('SELECT id FROM ' . tablename('solution_acl') . ' WHERE uid = :uid AND module = :module AND do = :do AND state = :state', array('uid' => $_W['uid'], ':module' => $modulename, ':do' => $data['do'], 'state' => $data['state']));
                        if (empty($ixes)) {
                            unset($entry1[$index2]);
                        }
                    }
                }
            }
            if ($entries['menu']) {
                $menus = array('title' => '业务功能菜单');
                foreach ($entries['menu'] as $menu) {
                    $menus['items'][] = array('title' => $menu['title'], 'url' => $menu['url']);
                }
                $ms['solution'][] = $menus;
            }
        }
    }
    if (empty($_W['isfounder'])) {
        $urls = array();
        $permurls = pdo_fetchall("SELECT url FROM " . tablename('users_permission') . " WHERE uid = :uid AND uniacid = :uniacid", array(':uid' => $_W['uid'], ':uniacid' => $_W['uniacid']));
        if (!empty($permurls)) {
            foreach ($permurls as $row) {
                $urls[] = $row['url'];
            }
        }
        if (!empty($urls)) {
            foreach ($ms as $name => $section) {
                $hassection = false;
                foreach ($section as $i => $menus) {
                    $hasitems = false;
                    foreach ($menus['items'] as $j => $menu) {
                        $_W['setting']['permurls']['menus'][] = ltrim($menu['url'], './index.php?');
                        if (!in_array(rtrim(ltrim($menu['url'], './index.php?'), '&'), $urls)) {
                            unset($ms[$name][$i]['items'][$j]);
                        } else {
                            $hasitems = true;
                            $hassection = true;
                        }
                    }
                    if (!$hasitems) {
                        unset($ms[$name][$i]);
                    }
                }
                if (!$hassection) {
                    unset($ms[$name]);
                } else {
                    $_W['setting']['permurls']['sections'][] = $name;
                }
            }
        }
    }
    $_W['setting']['permurls']['urls'] = $urls;
    return $ms;
}
开发者ID:6662680,项目名称:qday_wx,代码行数:97,代码来源:common.func.php

示例3: module_solution_check

function module_solution_check($name)
{
    global $_W;
    $module = module_fetch($name);
    if (empty($module)) {
        return error(-1, '您访问的模块不存在');
    }
    if ($module['issolution'] != 1) {
        return error(-1, '您访问的模块不是行业解决方案');
    }
    if ($module['target'] != $_W['uniacid']) {
        return error(-1, '当前公众号没有使用该行业模块的权限');
    }
    return true;
}
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:15,代码来源:module.mod.php

示例4: load

             if (pdo_fetchcolumn($sql, $pars) > 0) {
                 $solutions[] = $module;
             }
         } 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']);
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:welcome.ctrl.php

示例5: defined

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
$_W['page']['title'] = '常用接入服务 - 常用接入服务 - 高级功能';
load()->model('module');
load()->model('reply');
$m = module_fetch('userapi');
$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;
}
开发者ID:legeng,项目名称:project-2,代码行数:31,代码来源:service.ctrl.php

示例6: createModuleSite

 public static function createModuleSite($name)
 {
     global $_W;
     static $file;
     $classname = "{$name}ModuleSite";
     if (!class_exists($classname)) {
         $file = IA_ROOT . "/addons/{$name}/site.php";
         if (!is_file($file)) {
             $file = IA_ROOT . "/framework/builtin/{$name}/site.php";
         }
         if (!is_file($file)) {
             trigger_error('ModuleSite Definition File Not Found ' . $file, E_USER_WARNING);
             return null;
         }
         require $file;
     }
     if (!class_exists($classname)) {
         trigger_error('ModuleSite Definition Class Not Found', E_USER_WARNING);
         return null;
     }
     $o = new $classname();
     $o->uniacid = $o->weid = $_W['uniacid'];
     $o->modulename = $name;
     load()->model('module');
     $o->module = module_fetch($name);
     $o->__define = $file;
     $o->inMobile = defined('IN_MOBILE');
     if ($o instanceof WeModuleSite) {
         return $o;
     } else {
         trigger_error('ModuleReceiver Class Definition Error', E_USER_WARNING);
         return null;
     }
 }
开发者ID:ruige123456,项目名称:dataMining,代码行数:34,代码来源:account.class.php

示例7: load

<?php

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
load()->model('reply');
load()->model('module');
$dos = array('display', 'post', 'delete');
$do = in_array($do, $dos) ? $do : 'display';
$m = $_GPC['m'];
if (empty($m)) {
    message('错误访问.');
}
$module = module_fetch($m);
if (empty($module) || empty($module['isrulefields'])) {
    message('访问无权限.');
}
if (!in_array($m, $sysmods)) {
    if ($module['issolution']) {
        $solution = $module;
        define('FRAME', 'solution');
    } else {
        define('FRAME', 'ext');
        $types = module_types();
        define('ACTIVE_FRAME_URL', url('home/welcome/ext', array('m' => $m)));
    }
    $frames = buildframes(array(FRAME), $m);
    $frames = $frames[FRAME];
}
$_W['page']['title'] = $module['title'];
开发者ID:legeng,项目名称:project-2,代码行数:31,代码来源:reply.ctrl.php

示例8: array

} else {
    $entry = array('module' => $_GPC['m'], 'do' => $_GPC['do'], 'state' => $_GPC['state'], 'direct' => 0);
}
if (empty($entry) || empty($entry['do'])) {
    message('非法访问.');
}
load()->model('module');
$sql = 'SELECT `issolution` FROM ' . tablename('modules') . ' WHERE `name`=:module';
$module = pdo_fetch($sql, array(':module' => $entry['module']));
if (empty($module)) {
    message('你访问的功能不存在.');
}
if (!$entry['direct']) {
    checklogin();
    load()->model('module');
    $module = module_fetch($entry['module']);
    if (empty($module)) {
        message("访问非法, 没有操作权限. (module: {$entry['module']})");
    }
    if ($module['issolution']) {
        $error = module_solution_check($entry['module']);
        if (is_error($error)) {
            message($error['message']);
        } else {
            $solution = $module;
            define('IN_SOLUTION', true);
            define('FRAME', 'solution');
            $solutions = array();
            $modules = uni_modules();
            foreach ($modules as $modulename => $module) {
                if (!is_error(module_solution_check($modulename))) {
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:31,代码来源:entry.ctrl.php

示例9: url

                    $menu['memberid'] = $uid;
                    $menu['acid'] = $_W['weid'];
                    $menu['title'] = $callmenu['title'];
                    $menu['url'] = url('site', $queryarr);
                    $allmenus[] = $menu;
                }
            }
        }
    }
}
if ($do == 'management') {
    $eid = intval($_GPC['eid']);
    $eid = json_decode(base64_decode($_GPC['eid']), true);
    $modulename = $eid['module'];
    $_W['weid'] = $eid['weid'];
    $mod = module_fetch($modulename);
    if (empty($mod)) {
        message('抱歉,该功能未被启用或是您没有使用该功能的权限!');
    }
    load()->model('extension');
    if (ext_module_checkupdate($modulename)) {
        message('系统检测到该模块有更新,请点击“<a href="' . url('extension/module/upgrade', array('id' => $modulename)) . '">更新模块</a>”后继续使用!', '', 'error');
    }
    if (!empty($_W['isfounder'])) {
        $menus = array();
        $bindings = pdo_fetchall('SELECT * FROM ' . tablename('modules_bindings') . " WHERE module = :module ORDER BY eid ASC", array(':module' => $modulename));
        if (!empty($bindings) && is_array($bindings)) {
            foreach ($bindings as $opt) {
                if (!empty($opt['call'])) {
                    $site = WeUtility::createModuleSite($modulename);
                    if (method_exists($site, $opt['call'])) {
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:solution.ctrl.php

示例10: template

                            }
                        }
                    }
                }
            }
        }
    }
    template('site/style');
}
if ($do == 'createtemplate') {
    if (empty($_W['isfounder'])) {
        exit('require founder');
    }
    $name = $_GPC['name'];
    load()->model('module');
    $module = module_fetch($name);
    if (empty($module)) {
        exit('invalid module');
    }
    $file = $_GPC['file'];
    $setting = uni_setting($_W['uniacid'], array('default_site'));
    $styleid = pdo_fetchcolumn("SELECT styleid FROM " . tablename('site_multi') . " WHERE id = :id", array(':id' => $setting['default_site']));
    $templateid = pdo_fetchcolumn("SELECT templateid FROM " . tablename('site_styles') . " WHERE id = :id", array(':id' => $styleid));
    $ts = uni_templates();
    $currentTemplate = !empty($ts[$templateid]) ? $ts[$templateid]['name'] : 'default';
    $targetfile = IA_ROOT . '/app/themes/' . $currentTemplate . '/' . $module['name'] . '/' . $file;
    if (!file_exists($targetfile)) {
        load()->func('file');
        mkdirs(dirname($targetfile));
        file_put_contents($targetfile, '<!-- 原始文件:addons/modules/' . $module['name'] . '/template/mobile/' . $file . ' -->');
        @chmod($targetfile, $_W['config']['setting']['filemode']);
开发者ID:6662680,项目名称:qday_wx,代码行数:31,代码来源:style.ctrl.php

示例11: ext_module_checkupdate

function ext_module_checkupdate($modulename)
{
    $manifest = ext_module_manifest($modulename);
    if (!empty($manifest) && is_array($manifest)) {
        $version = $manifest['application']['version'];
        load()->model('module');
        $module = module_fetch($modulename);
        if ($version > $module['version']) {
            return true;
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:hahamy,项目名称:we7,代码行数:16,代码来源:extension.mod.php

示例12: buildframes

function buildframes($types = array('platform'), $modulename = '')
{
    global $_W;
    $ms = (include IA_ROOT . '/web/common/frames.inc.php');
    $ms = array_elements($types, $ms);
    if (in_array('ext', $types)) {
        load()->model('module');
        $frames = array();
        $modules = uni_modules();
        if (!empty($modules)) {
            foreach ($modules as $m) {
                if (in_array($m['name'], array('basic', 'news', 'music', 'userapi'))) {
                    continue;
                }
                $frames[$m['type']][] = $m;
            }
        }
        $types = module_types();
        if (!empty($frames)) {
            foreach ($frames as $type => $fs) {
                $items = array();
                if (!empty($fs)) {
                    foreach ($fs as $m) {
                        $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                    }
                }
                $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
            }
        }
    }
    if (in_array('solution', $types)) {
        load()->model('module');
        $module = module_fetch($modulename);
        $entries = module_entries($modulename, array('menu'));
        if ($_W['role'] == 'operator') {
            foreach ($entries as &$entry1) {
                foreach ($entry1 as $index2 => &$entry2) {
                    $url_arr = parse_url($entry2['url']);
                    $url_query = $url_arr['query'];
                    parse_str($url_query, $query_arr);
                    $eid = intval($query_arr['eid']);
                    $data = pdo_fetch('SELECT * FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
                    $ixes = pdo_fetchcolumn('SELECT id FROM ' . tablename('solution_acl') . ' WHERE uid = :uid AND module = :module AND do = :do AND state = :state', array('uid' => $_W['uid'], ':module' => $modulename, ':do' => $data['do'], 'state' => $data['state']));
                    if (empty($ixes)) {
                        unset($entry1[$index2]);
                    }
                }
            }
        }
        if ($entries['menu']) {
            $menus = array('title' => $module['title']);
            foreach ($entries['menu'] as $menu) {
                $menus['items'][] = array('title' => $menu['title'], 'url' => $menu['url']);
            }
            $ms['solution'][] = $menus;
        }
    }
    return $ms;
}
开发者ID:ruige123456,项目名称:dataMining,代码行数:59,代码来源:common.func.php

示例13: buildframes

function buildframes($frame = array('platform'))
{
    global $_W, $_GPC;
    if ($_W['role'] == 'clerk') {
        return false;
    }
    $GLOBALS['top_nav'] = pdo_fetchall('SELECT name, title, append_title FROM ' . tablename('core_menu') . ' WHERE pid = 0 AND is_display = 1 ORDER BY displayorder DESC');
    $ms = cache_load('system_frame');
    if (empty($ms)) {
        cache_build_frame_menu();
        $ms = cache_load('system_frame');
    }
    load()->model('module');
    $frames = array();
    $modules = uni_modules(false);
    $modules_temp = array_keys($modules);
    $status = uni_user_permission_exist();
    if (is_error($status)) {
        $modules_temp = pdo_fetchall('SELECT type FROM ' . tablename('users_permission') . ' WHERE uniacid = :uniacid AND uid = :uid AND type != :type', array(':uniacid' => $_W['uniacid'], ':uid' => $_W['uid'], ':type' => 'system'), 'type');
        if (!empty($modules_temp)) {
            $modules_temp = array_keys($modules_temp);
        } else {
            $modules = array();
        }
    }
    if (!empty($modules)) {
        $sysmods = system_modules();
        foreach ($modules as $m) {
            if (in_array($m['name'], $sysmods)) {
                $_W['setting']['permurls']['modules'][] = $m['name'];
                continue;
            }
            if (in_array($m['name'], $modules_temp)) {
                if ($m['enabled']) {
                    $frames[$m['type']][] = $m;
                }
                $_W['setting']['permurls']['modules'][] = $m['name'];
            }
        }
    }
    if (is_error($status)) {
        $system = array();
        $system = uni_user_permission('system');
        if (!empty($system) || !empty($modules_temp)) {
            foreach ($ms as $name => $section) {
                $hassection = false;
                foreach ($section as $i => $menus) {
                    $hasitems = false;
                    if (empty($menus['items'])) {
                        continue;
                    }
                    foreach ($menus['items'] as $j => $menu) {
                        if (!in_array($menu['permission_name'], $system)) {
                            unset($ms[$name][$i]['items'][$j]);
                        } else {
                            $hasitems = true;
                            $hassection = true;
                        }
                    }
                    if (!$hasitems) {
                        unset($ms[$name][$i]);
                    }
                }
                if (!$hassection) {
                    unset($ms[$name]);
                } else {
                    $_W['setting']['permurls']['sections'][] = $name;
                }
            }
        }
    }
    $types = module_types();
    if (!empty($frames)) {
        foreach ($frames as $type => $fs) {
            $items = array();
            if (!empty($fs)) {
                foreach ($fs as $m) {
                    $items[] = array('title' => $m['title'], 'url' => url('home/welcome/ext', array('m' => $m['name'])));
                }
            }
            $ms['ext'][] = array('title' => $types[$type]['title'], 'items' => $items);
        }
        if (is_error($status)) {
            $_W['setting']['permurls']['sections'][] = 'ext';
        }
    }
    $GLOBALS['ext_type'] = 0;
    $m = trim($_GPC['m']);
    $eid = intval($_GPC['eid']);
    if (FRAME == 'ext' && (!empty($m) || !empty($eid)) && $GLOBALS['ext_type'] != 2) {
        if (empty($_COOKIE['ext_type'])) {
            setcookie('ext_type', 1, TIMESTAMP + 8640000, "/");
            $_COOKIE['ext_type'] = 1;
        }
        $GLOBALS['ext_type'] = $_COOKIE['ext_type'];
        if (empty($m)) {
            $m = pdo_fetchcolumn('SELECT module FROM ' . tablename('modules_bindings') . ' WHERE eid = :eid', array(':eid' => $eid));
        }
        $module = module_fetch($m);
        $entries = module_entries($m);
//.........这里部分代码省略.........
开发者ID:weikit,项目名称:wechat-addon,代码行数:101,代码来源:common.func.php

示例14: createModuleCron

 public static function createModuleCron($name)
 {
     global $_W;
     static $file;
     $classname = "{$name}ModuleCron";
     if (!class_exists($classname)) {
         $file = IA_ROOT . "/addons/{$name}/cron.php";
         if (!is_file($file)) {
             $file = IA_ROOT . "/framework/builtin/{$name}/cron.php";
         }
         if (!is_file($file)) {
             trigger_error('ModuleCron Definition File Not Found ' . $file, E_USER_WARNING);
             return error(-1006, 'ModuleCron Definition File Not Found');
         }
         require $file;
     }
     if (!class_exists($classname)) {
         trigger_error('ModuleCron Definition Class Not Found', E_USER_WARNING);
         return error(-1007, 'ModuleCron Definition Class Not Found');
     }
     $o = new $classname();
     $o->uniacid = $o->weid = $_W['uniacid'];
     $o->modulename = $name;
     load()->model('module');
     $o->module = module_fetch($name);
     $o->__define = $file;
     self::defineConst($o);
     if ($o instanceof WeModuleCron) {
         return $o;
     } else {
         trigger_error('ModuleCron Class Definition Error', E_USER_WARNING);
         return error(-1008, 'ModuleCron Class Definition Error');
     }
 }
开发者ID:zhang19960118,项目名称:html11,代码行数:34,代码来源:account.class.php

示例15: trim

        $qids .= $message['qid'] . ',';
    }
    if (!empty($qids)) {
        $qids = trim($qids, ',');
        $sql = 'DELETE FROM ' . tablename('core_queue') . " WHERE `qid` IN ({$qids})";
        pdo_query($sql);
    }
    load()->model('module');
    $modules = uni_modules();
    $core = array();
    $core['name'] = 'core';
    $core['subscribes'] = array('core');
    array_unshift($modules, $core);
    foreach ($messages as $msg) {
        foreach ($modules as $m) {
            if (!empty($m['subscribes'])) {
                if ($m['name'] == 'core' || in_array($msg['message']['type'], $m['subscribes'])) {
                    $obj = WeUtility::createModuleReceiver($m['name']);
                    $obj->message = iunserializer($msg['message']);
                    $obj->params = iunserializer($msg['params']);
                    $obj->response = iunserializer($msg['response']);
                    $obj->keyword = iunserializer($msg['keyword']);
                    $obj->module = module_fetch($msg['module']);
                    if (method_exists($obj, 'receive')) {
                        $obj->receive();
                    }
                }
            }
        }
    }
}
开发者ID:ruige123456,项目名称:dataMining,代码行数:31,代码来源:subscribe.ctrl.php


注:本文中的module_fetch函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。