本文整理匯總了PHP中Wekit::getGlobal方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wekit::getGlobal方法的具體用法?PHP Wekit::getGlobal怎麽用?PHP Wekit::getGlobal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Wekit
的用法示例。
在下文中一共展示了Wekit::getGlobal方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$array = array();
$url = Wekit::getGlobal('url', 'res') . '/images/emotion/';
$type = $this->getInput('type', 'get');
if (empty($type)) {
$type = 'bbs';
}
$catList = $this->_getCategoryDs()->getCategoryList($type, 1);
!is_array($catList) && ($catList = array());
$categoryIds = array_keys($catList);
$list = $this->_getEmotionDs()->fetchEmotionByCatid($categoryIds);
foreach ($list as $emotion) {
$_emotion['sign'] = '[s:' . ($emotion['emotion_name'] ? $emotion['emotion_name'] : $emotion['emotion_id']) . ']';
$_emotion['url'] = $url . $emotion['emotion_folder'] . '/' . $emotion['emotion_icon'];
$_emotion['name'] = $emotion['emotion_name'];
$array[$emotion['category_id']]['category'] = $catList[$emotion['category_id']]['category_name'];
$array[$emotion['category_id']]['emotion'][] = $_emotion;
}
foreach ($catList as $k => $v) {
if (!$array[$k]) {
continue;
}
$_array[] = $array[$k];
}
$this->setOutput($_array, 'data');
$this->showMessage('success');
}
示例2: readCss
public function readCss()
{
echo '<style>
.floor_info .operate .dongta {
background: url("' . Wekit::getGlobal('url', 'extres') . '/dongta/images/dongta.png") no-repeat scroll -4px 2px transparent;
margin-right: 9px;
padding-left: 16px;
}
</style>' . "\n";
}
示例3: getAttachInfo
public function getAttachInfo()
{
$array = current($this->attachs);
$path = Wekit::getGlobal('url', 'attach') . '/' . $array['path'];
//list($path) = geturl($array['attachurl'], 'lf', $array['ifthumb']&1);
return array('aid' => $array['aid'], 'path' => $path);
}
示例4: emotionAction
public function emotionAction()
{
$catId = (int) $this->getInput('catid', 'get');
$category = $this->_getEmotionCategoryDs()->getCategory($catId);
if (!($folder = $category['emotion_folder'])) {
$this->showError('ADMIN:fail');
}
$emotionList = $this->_getEmotionDs()->getListByCatid($catId);
$folderEmotion = $this->_getEmotionService()->getFolderIconList($folder);
foreach ($emotionList as $key => $emotion) {
$emotionList[$key]['sign'] = '[s:' . ($emotion['emotion_name'] ? $emotion['emotion_name'] : $emotion['emotion_id']) . ']';
foreach ($folderEmotion as $k => $val) {
if ($emotion['emotion_icon'] == $val) {
unset($folderEmotion[$k]);
}
}
}
$url = Wekit::getGlobal('url', 'res') . '/images/emotion/';
$this->setOutput($emotionList, 'emotionList');
$this->setOutput($folderEmotion, 'folderEmotion');
$this->setOutput($folder, 'folder');
$this->setOutput($catId, 'catid');
$this->setOutput($url, 'iconUrl');
}
示例5: sharePageAction
/**
* 分享到其它平台使用的鏈接
*
* @access public
* @return void
* @example
* <pre>
* /index.php?m=native&c=read&a=sharePage&tid=21
* </pre>
*/
public function sharePageAction()
{
$tid = intval($this->getInput('tid', 'get'));
list($page, $uid, $desc) = $this->getInput(array('page', 'uid', 'desc'), 'get');
$threadDisplay = new PwThreadDisplay($tid, $this->loginUser);
$this->runHook('c_read_run', $threadDisplay);
if (($result = $threadDisplay->check()) !== true) {
$this->showError($result->getError());
}
$_cache = Wekit::cache()->fetch(array('level', 'group_right'));
$pwforum = $threadDisplay->getForum();
if ($pwforum->foruminfo['password']) {
if (!$this->uid) {
$this->forwardAction('u/login/run', array('backurl' => WindUrlHelper::createUrl('bbs/cate/run', array('fid' => ${$pwforum}->fid))));
} elseif (Pw::getPwdCode($pwforum->foruminfo['password']) != Pw::getCookie('fp_' . $pwforum->fid)) {
$this->forwardAction('bbs/forum/password', array('fid' => $pwforum->fid));
}
}
Wind::import('SRV:forum.srv.threadDisplay.PwCommonRead');
$dataSource = new PwCommonRead($threadDisplay->thread);
//數據分頁
$perpage = $pwforum->forumset['readperpage'] ? $pwforum->forumset['readperpage'] : Wekit::C('bbs', 'read.perpage');
$dataSource->setPage($page)->setPerpage($perpage)->setDesc($desc);
$threadDisplay->setImgLazy(Wekit::C('bbs', 'read.image_lazy'));
$threadDisplay->execute($dataSource);
//主題的信息
$threadInfo = $threadDisplay->getThreadInfo();
$threadInfo['content'] = preg_replace('/onload="([^"]+)"/i', '', $threadInfo['content']);
$threadInfo['content'] = preg_replace('/onclick="([^"]+)"/i', '', $threadInfo['content']);
$threadInfo['content'] = str_replace('style="max-width:700px;"', '', $threadInfo['content']);
preg_match_all('/<div class="J_video" data-url="(.+?\\.swf.*?)".*?><\\/div>/i', $threadInfo['content'], $matches);
if (isset($matches[0]) && $matches[0]) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i++) {
$vedio = '<embed src="' . $matches[1][$i] . '" allowFullScreen="true" quality="high" width="240" height="200" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed><br>';
// echo $vedio."<br>";
$threadInfo['content'] = str_replace($matches[0][$i], $vedio, $threadInfo['content']);
}
}
//帖子內容音頻資源
preg_match_all('/<div class="J_audio".*?data-url="(.+?)".*?><\\/div>/i', $threadInfo['content'], $matches);
if (isset($matches[0]) && $matches[0]) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i++) {
$audio = '<br><audio controls="controls" src="' . $matches[1][$i] . '">不支持音樂</audio><br>';
$threadInfo['content'] = str_replace($matches[0][$i], $audio, $threadInfo['content']);
}
}
//帖子數據列表
$threadList = $threadDisplay->getList();
$threadList = array_slice($threadList, 1, 3);
foreach ($threadList as $k => $v) {
preg_match_all('/<div class="J_video" data-url="(.+?\\.swf.*?)".*?><\\/div>/i', $v['content'], $matches);
if (isset($matches[0]) && $matches[0]) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i++) {
$vedio = '<embed src="' . $matches[1][$i] . '" allowFullScreen="true" quality="high" width="240" height="200" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed><br>';
// echo $vedio."<br>";
$threadList[$k]['content'] = str_replace($matches[0][$i], $vedio, $v['content']);
}
}
preg_match_all('/<div class="J_audio".*?data-url="(.+?)".*?><\\/div>/i', $v['content'], $matches);
if (isset($matches[0]) && $matches[0]) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i++) {
$audio = '<br><audio controls="controls" src="' . $matches[1][$i] . '">不支持音樂</audio><br>';
$threadList[$k]['content'] = str_replace($matches[0][$i], $audio, $v['content']);
}
}
}
//var_dump($threadList);exit;
$this->setOutput(Wekit::getGlobal('url', 'res'), 'resPath');
$this->setOutput($threadInfo, 'threadInfo');
$this->setOutput($threadList, 'threadList');
$this->setOutput($threadDisplay, 'threadDisplay');
$this->setOutput(PwCreditBo::getInstance(), 'creditBo');
}
示例6: createShare
/**
* 解析分享
*
* @param mixed $link
* @param mixed $img
* @param mixed $title
* @static
* @access public
* @return void
*/
public static function createShare($link, $img, $title)
{
$link = self::escapeUrl(urldecode($link));
if ($img == "") {
$img = Wekit::getGlobal('url', 'res') . '/images/editor/link.png';
} else {
$img = self::escapeUrl(urldecode($img));
}
$html = '
<div class="shareCanvas">
<img src="' . $img . '" align="absmiddle" />
<a href="' . $link . '" target="_blank">' . $title . '</a>
</div>';
return self::_pushCode($html);
}