function fans_search($user, $fields = array())
{
    global $_W;
    $struct = cache_load('fansfields');
    if (empty($fields)) {
        $select = '*';
    } else {
        foreach ($fields as $field) {
            if (!in_array($field, $struct)) {
                unset($fields[$field]);
            }
        }
        $select = '`from_user`, `' . implode('`,`', $fields) . '`';
    }
    $result = pdo_fetchall("SELECT {$select} FROM " . tablename('fans') . " WHERE from_user IN ('" . implode("','", is_array($user) ? $user : array($user)) . "')", array(), 'from_user');
    if (!empty($result)) {
        foreach ($result as &$row) {
            if (!empty($row['avatar'])) {
                if (strexists($row['avatar'], 'avatar_')) {
                    $row['avatar'] = $_W['siteroot'] . 'resource/image/avatar/' . $row['avatar'];
                } elseif (strexists($row['avatar'], 'http')) {
                } else {
                    $row['avatar'] = $_W['attachurl'] . $row['avatar'];
                }
            }
        }
        if (is_array($user)) {
            return $result;
        } else {
            return $result[$user];
        }
    } else {
        return array();
    }
}
Exemple #2
0
 public function getCardTicket()
 {
     $cachekey = "cardticket:{$this->account['acid']}";
     $cache = cache_load($cachekey);
     if (!empty($cache) && !empty($cache['ticket']) && $cache['expire'] > TIMESTAMP) {
         $this->account['card_ticket'] = $cache;
         return $cache['token'];
     }
     load()->func('communication');
     $access_token = $this->getAccessToken();
     if (is_error($access_token)) {
         return $access_token;
     }
     $url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$access_token}&type=wx_card";
     $content = ihttp_get($url);
     if (is_error($content)) {
         return error(-1, '调用接口获取微信公众号 card_ticket 失败, 错误信息: ' . $content['message']);
     }
     $result = @json_decode($content['content'], true);
     if (empty($result) || intval($result['errcode']) != 0 || $result['errmsg'] != 'ok') {
         return error(-1, '获取微信公众号 card_ticket 结果错误, 错误信息: ' . $result['errmsg']);
     }
     $record = array();
     $record['ticket'] = $result['ticket'];
     $record['expire'] = TIMESTAMP + $result['expires_in'] - 200;
     $this->account['card_ticket'] = $record;
     cache_write($cachekey, $record);
     return $record['ticket'];
 }
Exemple #3
0
 private function getAccessToken()
 {
     global $_W, $_GPC;
     load()->func('cache');
     $api = cache_load("ewei.money.api_share.json::" . $_W['uniacid'], true);
     $new = false;
     if (empty($api['appid']) || $api['appid'] !== $this->appId) {
         $new = true;
     }
     if (empty($api['appsecret']) || $api['appsecret'] !== $this->appSecret) {
         $new = true;
     }
     $data = cache_load("ewei.money.access_token.json::" . $_W['uniacid'], true);
     if (empty($data['expire_time']) || $data['expire_time'] < time() || $new) {
         $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appId}&secret={$this->appSecret}";
         $res = json_decode($this->httpGet($url));
         $access_token = $res->access_token;
         if ($access_token) {
             $data['expire_time'] = time() + 7000;
             $data['access_token'] = $access_token;
             cache_write("ewei.money.access_token.json::" . $_W['uniacid'], iserializer($data));
             cache_write("ewei.money.api_share.json::" . $_W['uniacid'], iserializer(array("appid" => $this->appId, "appsecret" => $this->appSecret)));
         }
     } else {
         $access_token = $data['access_token'];
     }
     return $access_token;
 }
Exemple #4
0
function setting_load($key = '')
{
    global $_W;
    $cachekey = "setting";
    $settings = cache_load($cachekey);
    if (empty($settings)) {
        $settings = pdo_fetchall('SELECT * FROM ' . tablename('core_settings'), array(), 'key');
        if (is_array($settings)) {
            foreach ($settings as $k => &$v) {
                $settings[$k] = iunserializer($v['value']);
            }
        }
        cache_write($cachekey, $settings);
    }
    if (!is_array($_W['setting'])) {
        $_W['setting'] = array();
    }
    $_W['setting'] = array_merge($_W['setting'], $settings);
    return $settings;
}
Exemple #5
0
function mc_fetch($uid, $fields = array())
{
    global $_W;
    $uid = mc_openid2uid($uid);
    if (empty($uid)) {
        return array();
    }
    $struct = (array) cache_load('usersfields');
    if (empty($fields)) {
        $select = '*';
    } else {
        foreach ($fields as $field) {
            if (!in_array($field, $struct)) {
                unset($fields[$field]);
            }
            if ($field == 'birth') {
                $fields[] = 'birthyear';
                $fields[] = 'birthmonth';
                $fields[] = 'birthday';
            }
            if ($field == 'reside') {
                $fields[] = 'resideprovince';
                $fields[] = 'residecity';
                $fields[] = 'residedist';
            }
        }
        unset($fields['birth'], $fields['reside']);
        $select = '`uid`, `' . implode('`,`', $fields) . '`';
    }
    if (is_array($uid)) {
        $result = pdo_fetchall("SELECT {$select} FROM " . tablename('mc_members') . " WHERE uid IN ('" . implode("','", is_array($uid) ? $uid : array($uid)) . "')", array(), 'uid');
        foreach ($result as &$row) {
            if (isset($row['avatar']) && !empty($row['avatar'])) {
                $row['avatar'] = tomedia($row['avatar']);
            }
        }
    } else {
        $result = pdo_fetch("SELECT {$select} FROM " . tablename('mc_members') . " WHERE `uid` = :uid", array(':uid' => $uid));
        if (isset($result['avatar']) && !empty($result['avatar'])) {
            $result['avatar'] = tomedia($result['avatar']);
        }
    }
    return $result;
}
function account_weixin_remark($fakeid, $remark, $groupid = 0)
{
    //备注
    if (account_weixin_login()) {
        global $_W;
        $username = $_W['account']['username'];
        if (empty($_W['cache']['wxauth'][$username])) {
            cache_load('wxauth:' . $username . ':');
        }
        $auth = $_W['cache']['wxauth'][$username];
        $url = WEIXIN_ROOT . '/cgi-bin/modifycontacts';
        $post = array('remark' => $remark, 'tofakeuin' => $fakeid, 'token' => $auth['token'], 'lang' => 'zh_CN', 'action' => 'setremark', 't' => 'ajax-response');
        $response = ihttp_request($url, $post, array('CURLOPT_COOKIE' => $auth['cookie'], 'CURLOPT_REFERER' => WEIXIN_ROOT . '/cgi-bin/contactmanage?t=user/index&pagesize=10&pageidx=0&type=0&groupid=' . $groupid . '&token=' . $auth['token'] . '&lang=zh_CN'));
        $result = json_decode($response['content'], 1);
        return $result;
    }
    return false;
}
Exemple #7
0
function account_yixin_basic($username)
{
    global $wechat;
    $auth = cache_load('yxauth:' . $username . ':');
    $response = ihttp_request(YIXIN_ROOT . '/set', '', array('CURLOPT_COOKIE' => $auth['cookie']));
    if (is_error($response)) {
        return array();
    }
    $info = array();
    preg_match('/icon\\:\\"(.*?)\\"/', $response['content'], $match);
    $image = ihttp_request($match[1]);
    file_write('headimg_' . $wechat['weid'] . '.jpg', $image['content']);
    preg_match('/qrCodeMix\\:\\"(.*?)\\"/', $response['content'], $match);
    $image = ihttp_request($match[1]);
    file_write('qrcode_' . $wechat['weid'] . '.jpg', $image['content']);
    preg_match('/signature\\:\\"(.*?)\\"/', $response['content'], $match);
    $info['signature'] = $match[1];
    preg_match('/帐号名称<\\/div>(.*?)<\\/div>/', $response['content'], $match);
    $info['username'] = strip_tags($match[1]);
    return $info;
}
Exemple #8
0
/**
 * @FreeGo Team 智慧游
 * @url http://www.cninone.com/
 */
defined('IN_IA') or exit('Access Denied');
set_time_limit(0);
load()->model('cloud');
load()->func('communication');
load()->model('extension');
$r = cloud_prepare();
if (is_error($r)) {
    message($r['message'], url('cloud/profile'), 'error');
}
$do = !empty($_GPC['do']) && in_array($do, array('module', 'system')) ? $_GPC['do'] : exit('Access Denied');
if ($do == 'system') {
    $lock = cache_load('checkupgrade:system');
    if (empty($lock) || TIMESTAMP - 3600 > $lock['lastupdate']) {
        $upgrade = cloud_build();
        if (!is_error($upgrade) && !empty($upgrade['upgrade'])) {
            $upgrade = array('version' => $upgrade['version'], 'release' => $upgrade['release'], 'upgrade' => 1, 'lastupdate' => TIMESTAMP);
            cache_write('checkupgrade:system', $upgrade);
            message($upgrade, '', 'ajax');
        } else {
            $upgrade = array('lastupdate' => TIMESTAMP);
            cache_write('checkupgrade:system', $upgrade);
        }
    } else {
        message($lock, '', 'ajax');
    }
} elseif ($do == 'module') {
    $modulename = $_GPC['m'];
Exemple #9
0
$do = in_array($do, $dos) ? $do : 'upgrade';
if ($do == 'upgrade') {
    $_W['page']['title'] = '一键更新 - 云服务';
    if (checksubmit('submit')) {
        $upgrade = cloud_build();
        if (is_error($upgrade)) {
            message($upgrade['message'], '', 'error');
        }
        if ($upgrade['upgrade']) {
            message("检测到新版本: <strong>{$upgrade['version']} (Release {$upgrade['release']})</strong>, 请立即更新.", 'refresh');
        } else {
            cache_delete('checkupgrade:system');
            message('检查结果: 恭喜, 你的程序已经是最新版本. ', 'refresh');
        }
    }
    cache_load('upgrade');
    if (!empty($_W['cache']['upgrade'])) {
        $upgrade = $_W['cache']['upgrade'];
    }
    if (empty($upgrade) || TIMESTAMP - $upgrade['lastupdate'] >= 3600 * 24 || $upgrade['upgrade']) {
        $upgrade = cloud_build();
    }
    if (!empty($upgrade['schemas'])) {
        $upgrade['database'] = array();
        foreach ($upgrade['schemas'] as $remote) {
            $row = array();
            $row['tablename'] = $remote['tablename'];
            $name = substr($remote['tablename'], 4);
            $local = db_table_schema(pdo(), $name);
            unset($remote['increment']);
            unset($local['increment']);
Exemple #10
0
<?php

require 'include/core/common.php';
require PATHS_INCLUDE . 'libraries/register.lib.php';
$ui_options['menu_path'] = array('hamsterpaj');
$ui_options['stylesheets'][] = 'rounded_corners_tabs.css';
$ui_options['title'] = 'Bli medlem på Hamsterpaj.net';
$ui_options['stylesheets'][] = 'register.css';
ui_top($ui_options);
$register_suspend = cache_load('register_suspend');
if ($register_suspend == 'disabled') {
    echo '<h1>Registreringsfunktionen är tillfälligt avstängd</h1>' . "\n";
    echo '<p>Det här händer jäkligt sällan, men nu har vi stängt av registreringen - det går inte att skapa konton på Hamsterpaj just nu. Funktionen är antagligen igång inom en timma, titta hit igen då!</p>' . "\n";
    ui_bottom();
    exit;
}
if (login_checklogin()) {
    echo '<h1>Du kan inte skapa en ny användare när du redan är inloggad!</h1>';
    ui_bottom();
    exit;
}
if (isset($_POST['username'])) {
    $data_ok = register_check($_POST);
    if ($data_ok !== true) {
        regform_header_fail();
        register_form($_POST, $data_ok);
    } else {
        event_log_log('classic_reg_form_sign_up');
        /* Input from user is OK, create rows in required tables */
        $query = 'INSERT INTO login(username, password, regtimestamp, regip, lastlogon) ';
        $query .= 'VALUES ("' . $_POST['username'] . '", "' . md5(utf8_decode($_POST['password'])) . '", "';
Exemple #11
0
<?php

$threads = cache_load('latest_forum_posts');
$return .= '<ul>' . "\n";
foreach ($threads as $thread) {
    $thread['title'] = mb_strlen($thread['title'], 'UTF8') > 22 ? mb_substr($thread['title'], 0, 19, 'UTF8') . '...' : $thread['title'];
    $info = 'I ' . $thread['category_title'] . ' av ' . $thread['username'];
    $return .= '<li>' . date('H:i', $thread['last_post_timestamp']) . ' <a title="' . $info . '" href="' . $thread['url'] . '">' . $thread['title'] . '</a></li>' . "\n";
}
$return .= '</ul>' . "\n";
Exemple #12
0
 private function getRedirectInfos()
 {
     global $_W, $_GPC;
     $sql = 'SELECT * FROM ' . tablename('modules_bindings') . " WHERE `entry` IN ('home', 'profile')";
     $es = pdo_fetchall($sql);
     $_W['account']['modules'] = account_module();
     cache_load('modules');
     $ds = array();
     if (is_array($es)) {
         foreach ($es as $entry) {
             $mid = $_W['modules'][$entry['module']]['mid'];
             if (empty($mid) || !isset($_W['account']['modules'][$mid])) {
                 continue;
             }
             if (!empty($entry['call'])) {
                 //echo "<p>{$entry['module']}</p>";
                 // BUGFIX::XXX
                 // sns、exam这两个模块的方法有bug,调用会导致出错。暂时先回避。
                 if (in_array($entry['module'], array('vote', 'bigwheel', 'exam', 'sns', 'hotel2'))) {
                     continue;
                 }
                 if (true) {
                     continue;
                 }
                 $site = WeUtility::createModuleSite($entry['module']);
                 if (method_exists($site, $entry['call'])) {
                     $ret = $site->{$entry}['call']();
                     if (is_array($ret)) {
                         foreach ($ret as $et) {
                             $ds[] = array('module' => $entry['module'], 'from' => 'call', 'title' => $et['title'], 'url' => $et['url']);
                         }
                     }
                 }
             } else {
                 $et = array('title' => $entry['title'], 'url' => create_url("mobile/entry", array('eid' => $entry['eid'], 'weid' => $_W['weid'])));
                 $ds[] = array('module' => $entry['module'], 'from' => 'define', 'title' => $et['title'], 'url' => $et['url']);
             }
         }
     }
     return $ds;
 }
<?php

$threads = cache_load('latest_forum_open_source_threads');
$return .= '<ul>' . "\n";
foreach ($threads as $thread) {
    $thread['title'] = strlen($thread['title']) > 22 ? substr($thread['title'], 0, 19) . '...' : $thread['title'];
    $info = 'I ' . $thread['category_title'] . ' av ' . $thread['username'];
    $return .= '<li>' . date('H:i', $thread['timestamp']) . ' <a title="' . $info . '" href="' . $thread['url'] . '">' . $thread['title'] . '</a></li>' . "\n";
}
$return .= '</ul>' . "\n";
Exemple #14
0
$noCache = $_GET["nocache"];
if ($noCache) { $cfg["cacheEnabled"] = false; }

$force = $_GET["force"]; // ignore errors;

// ----------------------------------------------------------------------------
	
// File name + extension
$imgName = substr($imgFile, strrpos($imgFile,"/")+1);
$imgSrcExtension = strtolower(substr($imgFile, strrpos($imgFile,".")+1));

// Check Cache
if ($cfg["cacheEnabled"]) { 
	
	// Check if image is available from cache, if so: show it
		$imgCache = cache_load($imgFile, $thWidth, $thHeight); 
		if ($imgCache) { //header("location: $imgCache");
			$content = fr($imgCache);
			if (strtolower($imgSrcExtension)=="jpg") { $type = "jpeg"; }
			else { $type = strtolower($imgSrcExtension); }
			header("Content-Disposition: filename=\"{$imgName}\"");
			header("Content-type: image/{$type}");
			echo $content;
			setIdle();
			die();
			}
		
	}

// Handle if image is located on remote server
if ($imgIsRemote) {
Exemple #15
0
<?php

require '../include/core/common.php';
require_once PATHS_LIBRARIES . 'schedule.lib.php';
$ui_options['menu_path'] = array('admin', 'registrering');
if (!is_privilegied('register_suspend_admin')) {
    header('location: /');
    die;
}
ui_top($ui_options);
if (isset($_POST)) {
    cache_save('register_suspend', $_POST['reg_status']);
}
$reg_status = cache_load('register_suspend');
if ($reg_status == 'disabled') {
    echo '<h1>Användarregistreringen är avstängd</h1>' . "\n";
} else {
    echo '<h1>Användarregistreringen är aktiv</h1>' . "\n";
}
echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . "\n";
echo '<input type="submit" value="disabled" name="reg_status" />' . "\n";
echo '<input type="submit" value="enabled" name="reg_status" />' . "\n";
echo '</form>' . "\n";
ui_bottom();
Exemple #16
0
 private function receive($par, $keyword, $response)
 {
     global $_W;
     $subscribe = cache_load('module_receive_enable');
     $modules = uni_modules();
     $obj = WeUtility::createModuleReceiver('core');
     $obj->message = $this->message;
     $obj->params = $par;
     $obj->response = $response;
     $obj->keyword = $keyword;
     $obj->module = 'core';
     $obj->uniacid = $_W['uniacid'];
     $obj->acid = $_W['acid'];
     if (method_exists($obj, 'receive')) {
         @$obj->receive();
     }
     if (!empty($subscribe['subscribe']) && ($this->message['event'] == 'subscribe' || $this->message['type'] == 'subscribe')) {
         foreach ($subscribe['subscribe'] as $modulename) {
             $obj = WeUtility::createModuleReceiver($modulename);
             $obj->message = $this->message;
             $obj->params = $par;
             $obj->response = $response;
             $obj->keyword = $keyword;
             $obj->module = $modules[$modulename];
             $obj->uniacid = $_W['uniacid'];
             $obj->acid = $_W['acid'];
             if (method_exists($obj, 'receive')) {
                 @$obj->receive();
             }
         }
     } elseif (!empty($subscribe['unsubscribe']) && ($this->message['event'] == 'unsubscribe' || $this->message['type'] == 'unsubscribe')) {
         foreach ($subscribe['unsubscribe'] as $modulename) {
             $obj = WeUtility::createModuleReceiver($modulename);
             $obj->message = $this->message;
             $obj->params = $par;
             $obj->response = $response;
             $obj->keyword = $keyword;
             $obj->module = $modules[$modulename];
             $obj->uniacid = $_W['uniacid'];
             $obj->acid = $_W['acid'];
             if (method_exists($obj, 'receive')) {
                 @$obj->receive();
             }
         }
     } else {
         $modules = $subscribe[$this->message['type']];
         if (!empty($modules)) {
             foreach ($modules as $modulename) {
                 $row = array();
                 $row['uniacid'] = $_W['uniacid'];
                 $row['acid'] = $_W['acid'];
                 $row['dateline'] = $_W['timestamp'];
                 $row['message'] = iserializer($this->message);
                 $row['keyword'] = iserializer($keyword);
                 $row['params'] = iserializer($par);
                 $row['response'] = iserializer($response);
                 $row['module'] = $modulename;
                 $row['type'] = 1;
                 pdo_insert('core_queue', $row);
             }
         }
         if (date('N') == '1') {
             pdo_query("DELETE FROM " . tablename('core_queue') . " WHERE dateline < '" . ($_W['timestamp'] - 2592000) . "'");
         }
     }
 }
Exemple #17
0
		men vi jobbar hårt med att få Firefox-stöd till mars 2009.
	</p>
	<p style="font-size: 15px;">
		Ta chansen att få en försmak på <a href="http://en.wikipedia.org/wiki/Cloud_computing" target="_blank"><b style="color:black;background-color:#a0ffff">cloud</b> <b style="color:black;background-color:#99ff99">computing</b></a> och framtiden! Delta i tävlingen 
		och du kan bli en av tre lyckliga vinnare. Vi har lagt upp ett gäng bilder i icloud, ditt uppdrag är att gissa vart i världen bilderna är tagna. De som placerar pilarna närmast på vår världskarta vinner!
	</p>
	<a href="http://www.icloud.com/hamsterpaj/" style="margin-top: -5px; margin-bottom: 5px;"><img src="http://xcerion.com/images/stories/company/lcloud_logo200.jpg" /></a>
	<br style="clear: both;" />

	<h1 style="font-family: verdana, arial; background: black; margin: -10px; margin-bottom: 10px; margin-top: 0px; text-style: italic; font-size: 35px; font-weight: bold; padding: 10px;"><a style="color: white;" href="http://www.icloud.com/hamsterpaj/">Kolla in <b style="color:black;background-color:#ffff66">Hamsterpaj</b>-grundarens nya jobb &raquo;</a></h1>	
	</div>
		</div>';
*/
$fp_modules = cache_load('fp_module_order');
foreach ($fp_modules as $filename) {
    $module = cache_load('fp_module_' . $filename);
    if ($module['display'] != 1) {
        continue;
    }
    if ($module['phpenabled'] == 1) {
        include PATHS_INCLUDE . 'fp_modules/' . $filename;
    } else {
        $output .= file_get_contents(PATHS_INCLUDE . 'fp_modules/' . $filename);
    }
    foreach ($module['stylesheets'] as $css) {
        if (!empty($css)) {
            $ui_options['stylesheets'][] = $css;
        }
    }
}
$ui_opions['stylesheets'] = array_unique($ui_options['stylesheets']);
Exemple #18
0
/**
 * 运行模块勾子
 * @param string $hookname
 */
function runhook($hookname) {
	global $_W;
	$hooks = $_W['cache']['hooks'][$_W['weid']];
	if (empty($hooks)) {
		cache_build_hook($_W['uid']);
		$hooks = cache_load("hooks:{$_W['weid']}");
	}
	if (!empty($hooks[$hookname])) {
		foreach ($hooks[$hookname] as $hook) {
			$hookobj = WeUtility::createModuleProcessor($hook[0]);
			if (method_exists($hookobj, $hook[1])) {
				call_user_func(array($hookobj, $hook[1]));
			}
		}
	}
}
Exemple #19
0
function ui_bottom($options = array())
{
    $output .= '<br style="clear: both;" />' . "\n";
    $output .= '</div>' . "\n";
    $output .= '<div id="ui_modulebar">' . "\n";
    if ($options['ui_modules_hide'] == true) {
        $modules = $options['ui_modules'];
    } else {
        #$modules['google_adsense'] = 'Överlevnadsmodul';
        $modules['ad_module'] = 'Admodul';
        $query = 'SELECT rs.id FROM radio_schedule AS rs, login AS l, radio_programs AS rp WHERE l.id = rp.user_id AND rp.id = rs.program_id AND NOW() BETWEEN rs.starttime AND rs.endtime ORDER BY rs.starttime DESC LIMIT 0, 1';
        $ui_module_radio_sending = query_cache(array('query' => $query, 'max_delay' => 60));
        if (count($ui_module_radio_sending) > 0) {
            $modules['radio_sending'] = 'Radio';
        }
        $modules['multisearch'] = 'Multi-sök';
        $modules['n24'] = 'Nyheter';
        if (isset($options['ui_modules']) && is_array($options['ui_modules'])) {
            $modules = array_merge($modules, $options['ui_modules']);
        }
        if (login_checklogin()) {
            $modules['friends_online'] = 'Vänner online';
            $modules['friends_notices'] = 'Vänner(s)notiser';
            $modules['profile_visitors'] = 'Besökare';
        }
        $modules['latest_threads'] = 'Forumtrådar';
        $modules['latest_posts'] = 'Inlägg i forumet';
        $modules['site_stats'] = 'Statistik';
        foreach (array('discussion_forum_remove_posts', 'discussion_forum_edit_posts', 'discussion_forum_rename_threads', 'discussion_forum_lock_threads', 'discussion_forum_sticky_threads', 'discussion_forum_move_thread', 'discussion_forum_post_addition', 'gb_autoreport') as $privilegie) {
            if (is_privilegied($privilegie)) {
                $ui_administration_module_show = true;
            }
        }
        if ($ui_administration_module_show === true) {
            $modules['administration'] = 'Administration';
        }
        $modules['online_ovs'] = 'Inloggade ordningsvakter';
    }
    if (is_array($_SESSION['module_order']) && $options['ui_modules_hide'] == false) {
        // Merging together all coded modules and those in the SESSION so no modules are missed
        $show_modules = $_SESSION['module_order'];
        foreach ($modules as $handle => $module) {
            if (!in_array($handle, $show_modules)) {
                $show_modules[] = $handle;
            }
        }
        foreach ($show_modules as $order => $handle) {
            if (isset($modules[$handle])) {
                $output .= ui_module_render(ui_module_fetch(array('header' => $modules[$handle], 'handle' => $handle)));
            }
        }
    } else {
        foreach ($modules as $handle => $header) {
            $output .= ui_module_render(ui_module_fetch(array('header' => $header, 'handle' => $handle)));
        }
    }
    $output .= '		</div>' . "\n";
    $output .= '	<div id="ui_break"></div> ' . "\n";
    $output .= '	</div>' . "\n";
    $output .= '<div id="skyscraper">' . "\n";
    $output .= '<div><script type="text/javascript">CM8ShowAd("Skyscraper");</script></div>' . "\n";
    $output .= '<iframe src="http://nyheter24.se/special/hamsterpaj-ads.html" style="border: 0; overflow: hidden; width: 142px; height: 352px;" scrolling="no" frameborder="0"></iframe>';
    $output .= '</div>' . "\n";
    $output .= '<div id="fiskpinne" style="background: none;">' . "\n";
    $output .= '<script type="text/javascript"><!-- google_ad_client = "pub-3110640362329253"; /* hamsterpaj 160x600, skapad 2009-06-08 */ google_ad_slot = "0695149486"; google_ad_width = 160; google_ad_height = 600; //--></script><script type="text/javascript"src=" http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>' . "\n";
    $output .= '<br style="clear: both;" />' . "\n";
    $output .= '</div>' . "\n";
    // Close id="ad_wrapper"
    $output .= '</div>' . "\n";
    if (!login_checklogin()) {
        $output .= '<div id="tiny_reg_form">' . "\n";
        $regform_suspended = cache_load('register_suspend');
        if ($regform_suspended == 'disabled') {
            $output .= '<h1>Du måste vara inloggad för att kunna göra detta!</h1>' . "\n";
            $output .= '<p>Just nu är registreringen avstängd, detta är extremt ovanligt. Om du väntar någon timme så borde den vara öppen igen!</p>' . "\n";
        } else {
            $output .= login_tiny_reg_form_generate();
        }
        $output .= '</div>' . "\n";
    }
    if (ENVIRONMENT == 'production') {
        $output .= '<script type="text/javascript">
			var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
			document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E"));
			</script>
			<script type="text/javascript">
			try {
			var pageTracker = _gat._getTracker("UA-7987100-1");
			pageTracker._trackPageview();
			} catch(err) {}
		</script>';
        $output .= '<img src="http://sifomedia.nyheter24.se/RealMedia/ads/adstream_nx.ads/nyheter24/123645@TopRight?XE&Sajt=hamsterpaj&Grupp1=nyheter24natverket&XE" border="0" alt="" />';
    }
    $output .= '</body>' . "\n";
    $output .= '</html>' . "\n";
    if (isset($options['return']) && $options['return'] == true) {
        return $output;
    } else {
        echo $output;
    }
}
Exemple #20
0
			'description' => '用户进行微信交谈时,对话中包含上述关键字就执行这条规则。',
		),
		3 => array(
			'name' => '正则表达式匹配',
			'description' => "用户进行微信交谈时,对话内容符合述关键字中定义的模式才会执行这条规则。<br /><b>/^微擎/</b>匹配以“微擎”开头的语句<br /><b>/微擎$/</b>匹配以“微擎”结尾的语句<br /><b>/^微擎$/</b>匹配等同“微擎”的语句<br /><b>/微擎/</b>匹配包含“微擎”的语句<br /><b>/[0-9\.\-]/</b>匹配所有的数字,句号和减号<br /><b>/^[a-zA-Z_]$/</b>所有的字母和下划线<br /><b>/^[[:alpha:]]{3}$/</b>所有的3个字母的单词<br /><b>/^a{4}$/</b>aaaa<br /><b>/^a{2,4}$/</b>aa,aaa或aaaa<br /><b>/^a{2,}$/</b>匹配多于两个a的字符串",
		)
	);
	$defaultmodule = !empty($_GPC['module']) ? $_GPC['module'] : 'basic';
	$typeslabel = "'".implode("','", $types)."'";
	$rid = intval($_GPC['id']);
	if (!empty($rid)) {
		$rule = rule_single($rid);
		if (empty($rule['rule'])) {
			message('抱歉,您操作的规则不在存或是已经被删除!', create_url('rule/display'), 'error');
		}
		$module = $rule['rule']['module'];
		$module = module($module);
		$rule['reply'] = $module;
	}
	$category = cache_load('category:'.$_W['weid']);
	if (!empty($category)) {
		$children = '';
		foreach ($category as $cid => $cate) {
			if (!empty($cate['parentid'])) {
				$children[$cate['parentid']][] = array($cate['id'], $cate['name']);
			}
		}
	}
	template('rule/post');
}
require PATHS_LIBRARIES . 'photos.lib.php';
$ui_options['javascripts'][] = 'fp_module_rearrange.js';
$ui_options['stylesheets'][] = 'fp_module_rearrange.css';
$ui_options['title'] = 'Sortera förstasidesmoduler';
$ui_options['menu_path'] = array('hamsterpaj');
$ui_options['adtoma_category'] = 'start';
if (!is_privilegied('fp_module_rearrange')) {
    ui_top($ui_options);
    echo '<div class="error">';
    echo '<strong>Nu äter hamstern upp dig! :)</strong>';
    echo '</div>';
    ui_bottom();
    exit;
}
ui_top($ui_options);
$filenames = cache_load('fp_module_order');
$dir = opendir(PATHS_DYNAMIC_CONTENT . 'fp_modules/');
while ($filename = readdir($dir)) {
    if ($filename != '.' && $filename != '..' && !in_array($filename, $filenames)) {
        $filenames[] = $filename;
    }
}
$output .= '<ul id="fp_module_rearrange_list">';
foreach ($filenames as $filename) {
    $output .= '<li id="' . $filename . '">' . "\n";
    $output .= '<h3>' . $filename . '</h3>' . "\n";
    $output .= '<a href="/admin/fp_module_customize.php?filename=' . $filename . '">Redigera</a>' . "\n";
    $output .= '</li>' . "\n";
}
$output .= '</ul>';
$output .= '<button id="fp_moudle_rearrange_save">Spara</button>' . "\n";
Exemple #22
0
function uni_is_multi_acid($uniacid = 0)
{
    global $_W;
    if (!$uniacid) {
        $uniacid = $_W['uniacid'];
    }
    $cachekey = "unicount:{$uniacid}";
    $nums = cache_load($cachekey);
    $nums = intval($nums);
    if (!$nums) {
        $nums = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('account_wechats') . ' WHERE uniacid = :uniacid', array(':uniacid' => $_W['uniacid']));
        cache_write($cachekey, $nums);
    }
    if ($nums == 1) {
        return false;
    }
    return true;
}
$_W['account']['siteinfo'] = iunserializer($_W['account']['siteinfo']);
$_W['weid'] = $_W['account']['weid'];
$_W['uid'] = $_W['account']['uid'];
$_W['account']['modules'] = array();
$_W['isfounder'] = in_array($_W['uid'], (array) explode(',', $_W['config']['setting']['founder'])) ? true : false;
if (!empty($_W['account']['key']) && !empty($_W['account']['secret'])) {
    require_once IA_ROOT . '/source/class/account.class.php';
    $acc = WeAccount::create($_W['weid']);
    $_W['account']['jssdkconfig'] = $acc->getJssdkConfig();
    $accountInfo = $acc->fetchAccountInfo();
    $_W['account']['access_token'] = $accountInfo['access_token'];
    $_W['account']['jsapi_ticket'] = $accountInfo['jsapi_ticket'];
}
$template = pdo_fetchcolumn("SELECT name FROM " . tablename('site_templates') . " WHERE id = '{$_W['account']['styleid']}';");
$_W['account']['template'] = !empty($template) ? $template : 'default';
$_W['setting'] = (array) cache_load("setting");
$rs = pdo_fetchall("SELECT mid,settings,enabled FROM " . tablename('wechats_modules') . " WHERE weid = '{$_W['weid']}'", array(), 'mid');
$accountmodules = array();
$disabledmodules = array();
foreach ($rs as $k => &$m) {
    if (!$m['enabled']) {
        $disabledmodules[$m['mid']] = $m['mid'];
        continue;
    } else {
        $accountmodules[$m['mid']] = array('mid' => $m['mid'], 'config' => iunserializer($m['settings']));
    }
}
if ($_W['isfounder']) {
    $membermodules = pdo_fetchall("SELECT mid, name, issystem FROM " . tablename('modules') . (!empty($disabledmodules) ? " WHERE mid NOT IN (" . implode(',', array_keys($disabledmodules)) . ")" : '') . " ORDER BY issystem DESC, mid ASC", array(), 'mid');
} else {
    $membermodules = pdo_fetchall("SELECT resourceid FROM " . tablename('members_permission') . " WHERE uid = :uid AND type = '1'" . (!empty($disabledmodules) ? " AND resourceid NOT IN (" . implode(',', array_keys($disabledmodules)) . ")" : '') . " ORDER BY resourceid ASC", array(':uid' => $_W['uid']), 'resourceid');
    $module_save_path = realpath(PATHS_DYNAMIC_CONTENT . 'fp_modules/') . '/';
    if (!file_exists($module_save_path . $_GET['filename']) || strncmp(realpath($module_save_path . $_GET['filename']), $module_save_path, strlen($module_save_path)) != 0) {
        echo 'Tjockis!';
        ui_bottom();
        exit;
    }
    if (isset($_POST['code'])) {
        $module['display'] = $_POST['display'] == 1 ? 1 : 0;
        $module['phpenabled'] = $_POST['phpenabled'] == 1 ? 1 : 0;
        $module['stylesheets'] = explode(' ', $_POST['stylesheets']);
        cache_save('fp_module_' . $_GET['filename'], $module);
        $code = stripslashes(html_entity_decode($_POST['code']));
        file_put_contents(PATHS_DYNAMIC_CONTENT . 'fp_modules/' . $_GET['filename'], $code);
        $output .= '<h1>Sparat! - <a href="/site_admin/fp_module_rearrange.php">sortera moduler</a></h1>';
    }
    $module = cache_load('fp_module_' . $_GET['filename']);
    $module['display'] = $module['display'] == 1 ? ' checked="true"' : '';
    $module['phpenabled'] = $module['phpenabled'] == 1 ? ' checked="true"' : '';
    $module['code'] = file_get_contents(PATHS_DYNAMIC_CONTENT . 'fp_modules/' . $_GET['filename']);
    $output .= '<form method="post">' . "\n";
    $output .= '<input name="display" type="checkbox"' . $module['display'] . ' id="view_control" value="1" /><label for="view_control">Visa på förstasidan</label><br />';
    $output .= '<input name="phpenabled" type="checkbox"' . $module['phpenabled'] . ' id="php_control" value="1" /><label for="php_control">Kör som PHP-fil (script = kryssa, enkel HTML = kryssa inte)</label><br />';
    $output .= '<br /><label>CSS-filer (ange bara filnamn, inklusive filändelse, separera med mellanslag)<br /><strong>Stilmallarna ska ligga i stylesheets/fp_modules/</strong> Lef kommer att ge dig spö annars. Srsly. Den mappen är gitignorad. Sedan hämtas stilmallen med fp_modules/stilmallsnamn.css</label><br />' . "\n";
    $output .= '<input type="text" name="stylesheets" style="width: 600px;" value="' . implode(' ', $module['stylesheets']) . '" /><br />';
    $output .= '<textarea name="code" style="width: 630px; height: 500px; font-size: 11px;">' . htmlspecialchars($module['code']) . '</textarea>' . "\n";
    $output .= '<input type="submit" value="Spara" />' . "\n";
    $output .= '</form>' . "\n";
    $output .= '<a href="/site_admin/fp_module_preview.php?filename=' . $_GET['filename'] . '">Förhandsgranska</a>' . "\n";
}
echo $output;
ui_bottom();
<?php

$threads = cache_load('latest_forum_threads');
$options['output'] .= '<ul>' . "\n";
foreach ($threads as $thread) {
    if (forum_category_access($thread['read_threads'])) {
        $thread['title'] = mb_strlen($thread['title'], 'UTF8') > 22 ? htmlspecialchars(mb_substr(htmlspecialchars_decode($thread['title']), 0, 19, 'UTF8')) . '...' : $thread['title'];
        $info = 'I ' . $thread['category_title'] . ' av ' . $thread['username'] . ': ' . $thread['title'];
        $options['output'] .= '<li>' . date('H:i', $thread['timestamp']) . ' <a title="' . $info . '" href="' . $thread['url'] . '"' . ($thread['read_threads'] == 'joshua' ? 'style="color: orange;"' : '') . '>' . $thread['title'] . '</a></li>' . "\n";
    }
}
$options['return'] .= '</ul>' . "\n";
if (!(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0') || $_SESSION['disablesteve'] == 1)) {
    $options['output'] .= '<img src="' . IMAGE_URL . 'steve/icon_gun.gif" id="steve_gun" />' . "\n";
}
function recurse_forum_category_specialgrej($categories, $depth)
{
    foreach ($categories as $category) {
        if ($category['handle'] == 'hamsterpajs_artiklar' || $category['handle'] == 'forum_error') {
            continue;
        }
        $indent = '';
        for ($i = 0; $i < $depth; $i++) {
            $indent .= '&nbsp;&nbsp;';
        }
        $category['title'] = strlen($category['title']) > 21 ? substr($category['title'], 0, 19) . '...' : $category['title'];
        $style = $depth == 0 ? ' style="font-weight: bold;"' : '';
        $output .= '<option value="' . $category['handle'] . '"' . $style . '>' . $indent . $category['title'] . '</option>' . "\n";
        $output .= recurse_forum_category_specialgrej($category['children'], $depth + 1);
    }
    return $output;
Exemple #26
0
<?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');
define('IN_GW', true);
if (checksubmit()) {
    _login($_GPC['referer']);
}
cache_load('setting');
template('user/login');
function _login($forward = '')
{
    global $_GPC, $_W;
    load()->model('user');
    $member = array();
    $username = trim($_GPC['username']);
    if (empty($username)) {
        message('请输入要登录的用户名');
    }
    $member['username'] = $username;
    $member['password'] = $_GPC['password'];
    if (empty($member['password'])) {
        message('请输入密码');
    }
    $record = user_single($member);
    if (!empty($record)) {
        if ($record['status'] == 1) {
            message('您的账号正在审核或是已经被系统禁止,请联系网站管理员解决!');
Exemple #27
0
                    $moduleids[] = $manifest['application']['identifie'];
                }
            }
        }
    }
    $prepare_module = json_encode(array_keys($localUninstallModules_noso));
    $prepare_module_title = json_encode($localUninstallModules_title);
    template('extension/module');
}
if ($do == 'permission') {
    load()->model('module');
    $id = $_GPC['id'];
    $module = pdo_fetch("SELECT mid, name FROM " . tablename('modules') . " WHERE name = :name", array(':name' => $id));
    $isinstall = false;
    $from = '';
    cache_load('modules');
    if (!empty($module)) {
        $module = $_W['modules'][$module['name']];
        $bindings = pdo_fetchall('SELECT * FROM ' . tablename('modules_bindings') . ' WHERE `module`=:module', array(':module' => $id));
        if (!empty($bindings)) {
            foreach ($bindings as $entry) {
                $module[$entry['entry']][] = array_elements(array('title', 'do', 'direct', 'state'), $entry);
            }
        }
        $manifest = ext_module_manifest($module['name']);
        if (is_array($manifest) && ver_compare($module['version'], $manifest['application']['version']) == -1) {
            $module['upgrade'] = 1;
        }
        $isinstall = true;
        $from = 'installed';
        if (in_array($module['name'], $sysmodules)) {
 private function getAuthRefreshToken()
 {
     $auth_refresh_token = cache_load('account:auth:refreshtoken:' . $this->account['key']);
     if (empty($auth_refresh_token)) {
         $auth_refresh_token = $this->account['auth_refresh_token'];
         cache_write('account:auth:refreshtoken:' . $this->account['key'], $auth_refresh_token);
     }
     return $auth_refresh_token;
 }
function Menu_show($b)
{
    global $PAGEDATA;
    if (!$PAGEDATA->id) {
        return '';
    }
    $md5 = md5('ww_menudisplay|' . print_r($b, true));
    $cache = cache_load('menus', $md5);
    if ($cache) {
        return $cache;
    }
    if (is_array($b)) {
        $align = isset($b['direction']) && $b['direction'] == 'vertical' ? 'Left' : 'Top';
        $vals = $b;
    } else {
        $arr = explode('|', $b);
        $b = $arr[0];
        $vals = array();
        if (count($arr) > 1) {
            $d = split(',', $arr[1]);
        } else {
            $d = array();
        }
        foreach ($d as $e) {
            $f = split('=', $e);
            if (count($f) > 1) {
                $vals[$f[0]] = $f[1];
            } else {
                $vals[$f[0]] = 1;
            }
        }
        $c = '';
        $align = $b == 'vertical' ? 'Left' : 'Top';
    }
    $parent = 0;
    $classes = '';
    if (isset($vals['mode'])) {
        if ($vals['mode'] == 'accordian' || $vals['mode'] == 'accordion') {
            $classes .= ' click_required accordion';
        } else {
            if ($vals['mode'] == 'two-tier') {
                $classes .= ' two-tier';
            }
        }
    } else {
        $vals['mode'] = 'default';
    }
    if (isset($vals['preopen_menu'])) {
        $classes .= ' preopen_menu';
    }
    if (isset($vals['close']) && $vals['close'] == 'no') {
        $classes .= ' noclose';
    }
    if (isset($vals['parent'])) {
        $r = Page::getInstanceByName($vals['parent']);
        if ($r) {
            $parent = $r->id;
        }
    }
    if (isset($vals['spans'])) {
        $vals['spans'] = (int) $vals['spans'];
    } else {
        $vals['spans'] = 1;
    }
    $search_options = 0;
    $ajaxmenu = $vals['nodropdowns'] ? '' : ' ajaxmenu ';
    $c = '<div id="ajaxmenu' . $parent . '" class="menuBar' . $align . $ajaxmenu . $classes . ' parent' . $parent . '">';
    $rs = Menu_getChildren($parent, $PAGEDATA->id, 0, $parent, $search_options);
    $links = 0;
    if ($vals['spans']) {
        $spanl = '<span class="l"></span>';
        $spanr = '<span class="r"></span>';
    } else {
        $spanl = '';
        $spanr = '';
    }
    if (count($rs)) {
        foreach ($rs as $r) {
            $page = Page::getInstance($r['id']);
            if (!$links) {
                $r['classes'] .= ' first';
            }
            $c .= '<a id="ajaxmenu_link' . $r['id'] . '" class="' . $r['classes'] . '" href="' . $page->getRelativeURL() . '">' . $spanl . htmlspecialchars($page->name) . $spanr . '</a>';
            $links++;
        }
    }
    if (!@$GLOBALS['DBVARS']['disable-hidden-sitemap']) {
        $c .= '<a class="menuItemTop nojs" href="' . $PAGEDATA->getRelativeURL() . '?webmespecial=sitemap">' . __('Site Map') . '</a>';
    }
    $c .= '</div>';
    if ($vals['mode'] == 'two-tier') {
        $pid = $PAGEDATA->getTopParentId();
        if ($pid != 2 && $pid != 3 && $pid != 17 && $pid != 32 && $pid != 33 && $pid != 34) {
            $pid = 2;
        }
        $rs = Menu_getChildren($pid, $PAGEDATA->id, 0, $parent, $search_options);
        $c .= '<div id="ajaxmenu' . $pid . '" class="menu tier-two">';
        if (count($rs)) {
            foreach ($rs as $r) {
                $page = Page::getInstance($r['id']);
                $c .= '<a id="ajaxmenu_link' . $r['id'] . '" class="' . $r['classes'] . '" href="' . $page->getRelativeURL() . '">' . $spanl . htmlspecialchars($page->name) . $spanr . '</a>';
            }
        } else {
            $c .= '<a><span class="l"></span>&nbsp;<span class="r"></span></a>';
        }
        $c .= '</div>';
    }
    cache_save('menus', $md5, $c);
    return $c;
}
Exemple #30
0
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);
        if (is_error($status)) {
            $permission = uni_user_permission($m);
            if ($permission[0] != 'all') {
                if (!in_array($m . '_rule', $permission)) {
                    unset($module['isrulefields']);
                }
                if (!in_array($m . '_settings', $permission)) {
                    unset($module['settings']);
                }
                if (!in_array($m . '_home', $permission)) {
                    unset($entries['home']);
                }
                if (!in_array($m . '_profile', $permission)) {
                    unset($entries['profile']);
                }
                if (!in_array($m . '_shortcut', $permission)) {
                    unset($entries['shortcut']);
                }
                if (!empty($entries['cover'])) {
                    foreach ($entries['cover'] as $k => $row) {
                        if (!in_array($m . '_cover_' . $row['do'], $permission)) {
                            unset($entries['cover'][$k]);
                        }
                    }
                }
                if (!empty($entries['menu'])) {
                    foreach ($entries['menu'] as $k => $row) {
                        if (!in_array($m . '_menu_' . $row['do'], $permission)) {
                            unset($entries['menu'][$k]);
                        }
                    }
                }
            }
        }
        $entries_filter = array_elements(array('cover', 'menu', 'mine'), $entries);
        $navs = array(array('title' => "模块列表", 'items' => array(array('title' => "<i class='fa fa-reply-all'></i> &nbsp;&nbsp;返回模块列表", 'url' => url('home/welcome/ext', array('a' => 0))), array('title' => "<i class='fa fa-reply-all'></i> &nbsp;&nbsp;返回{$module['title']}", 'url' => url('home/welcome/ext', array('m' => $m, 't' => 1))))));
        if ($module['isrulefields'] || $module['settings']) {
            $navs['rule'] = array('title' => "回复规则");
            if ($module['isrulefields']) {
                $navs['rule']['items'][] = array('title' => "<i class='fa fa-comments'></i> &nbsp;&nbsp;回复规则列表", 'url' => url('platform/reply', array('m' => $m)));
            }
            if ($module['settings']) {
                $navs['rule']['items'][] = array('title' => "<i class='fa fa-cog'></i> &nbsp;&nbsp;参数设置", 'url' => url('profile/module/setting', array('m' => $m)));
            }
        }
        if ($entries['home'] || $entries['profile'] || $entries['shortcut']) {
            $navs['nav'] = array('title' => "导航菜单");
            if ($entries['home']) {
                $navs['nav']['items'][] = array('title' => "<i class='fa fa-home'></i> &nbsp;&nbsp;微站首页导航", 'url' => url('site/nav/home', array('m' => $m)));
            }
            if ($entries['profile']) {
                $navs['nav']['items'][] = array('title' => "<i class='fa fa-user'></i> &nbsp;&nbsp;个人中心导航", 'url' => url('site/nav/profile', array('m' => $m)));
            }
            if ($entries['shortcut']) {
                $navs['nav']['items'][] = array('title' => "<i class='fa fa-plane'></i> &nbsp;&nbsp;快捷菜单", 'url' => url('site/nav/shortcut', array('m' => $m)));
            }
        }
        $menus = array('menu' => "业务菜单", 'cover' => "封面入口", 'mine' => "自定义菜单");
        foreach ($entries_filter as $key => $row) {
            if (empty($row)) {
                continue;
            }
            if (!isset($navs[$key])) {
                $navs[$key] = array('title' => $menus[$key]);
            }
            foreach ($row as $li) {
                $navs[$key]['items'][] = array('title' => "<i class='{$li["icon"]}'></i> &nbsp;&nbsp;{$li['title']}", 'url' => $li['url']);
            }
        }
    }
    if ($GLOBALS['ext_type'] == 1) {
        $ms['ext'] = $navs;
    } elseif ($GLOBALS['ext_type'] == 3) {
        $ms['ext'] = array_merge($navs, $ms['ext']);
    }
    return $ms;
}