本文整理汇总了PHP中wcf\system\WCF::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP WCF::getPath方法的具体用法?PHP WCF::getPath怎么用?PHP WCF::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wcf\system\WCF
的用法示例。
在下文中一共展示了WCF::getPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getImage
/**
* Returns full path to specified image.
*
* @param string $image
* @return string
*/
public function getImage($image) {
if ($this->imagePath && file_exists(WCF_DIR.$this->imagePath.$image)) {
return WCF::getPath().$this->imagePath.$image;
}
return WCF::getPath().'images/'.$image;
}
示例2: getURL
/**
* Returns the url to this picture.
*
* @return string
*/
public function getURL()
{
if ($this->pictureID) {
return WCF::getPath('news') . 'images/news/' . ($this->categoryID ? $this->categoryID . '/' : '') . $this->getFilename();
}
return WCF::getPath('news') . 'images/news/dummyPicture.png';
}
示例3: Inflector
/**
* Creates a Member
*
* A Single Wow Member
*
* @param array $data
*
* @link http://dev.battle.net
*/
function __construct(array $data)
{
$this->baseUrl = WCF::getPath('cms');
$this->data = $data;
$inflector = new Inflector();
$this->inflector = $inflector;
}
示例4: getURL
/**
* @see \wcf\data\user\avatar\IUserAvatar::getURL()
*/
public function getURL($size = null)
{
if ($size === null) {
$size = $this->size;
}
return WCF::getPath() . 'images/avatars/avatar-default.svg';
}
示例5: calCfg
/**
* calculate the final config of $this->cfg through $this->cfg default value and MbqMain::$customConfig and MbqMain::$oMbqAppEnv and the plugin support degree
*/
public function calCfg()
{
$url = WCF::getPath();
MbqMain::$oMbqAppEnv->siteRootUrl = substr($url, 0, strlen($url) - 4);
//init user
$oUser = DefaultUserAuthentication::getInstance()->loginAutomatically(true);
if ($oUser && $oUser->userID) {
MbqMain::$oMbqAppEnv->oCurrentUser = $oUser;
$oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser');
$oMbqRdEtUser->initOCurMbqEtUser();
}
if (MbqMain::hasLogin()) {
//!!!
header('Mobiquo_is_login: true');
} else {
header('Mobiquo_is_login: false');
}
$oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
MbqMain::$oMbqAppEnv->exttForumTree = $oMbqRdEtForum->getForumTree();
//!!!
parent::calCfg();
/* calculate the final config */
$this->cfg['base']['sys_version']->setOriValue(PACKAGE_VERSION);
if (OFFLINE) {
$this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.no'));
} else {
$this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.yes'));
}
if (!MODULE_CONVERSATION || !WCF::getSession()->getPermission('user.conversation.canUseConversation')) {
$this->cfg['pc']['module_enable']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.module_enable.range.disable'));
$this->cfg['pc']['conversation']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.notSupport'));
}
}
示例6: getImage
/**
* Returns full path to specified image.
*
* @param string $image
* @return string
*/
public function getImage($image)
{
if (preg_match('~^https?://~', $image)) {
return $image;
}
if ($this->imagePath && file_exists(WCF_DIR . $this->imagePath . $image)) {
return WCF::getPath() . $this->imagePath . $image;
}
return WCF::getPath() . 'images/' . $image;
}
示例7: getImage
/**
* Returns the image of this user rank.
*
* @return string html code
*/
public function getImage()
{
if ($this->rankImage) {
$image = '<img src="' . (!preg_match('~^(/|https?://)~i', $this->rankImage) ? WCF::getPath() : '') . StringUtil::encodeHTML($this->rankImage) . '" alt="" />';
if ($this->repeatImage > 1) {
$image = str_repeat($image, $this->repeatImage);
}
return $image;
}
return '';
}
示例8: getSchemeURL
private function getSchemeURL(&$location)
{
$params = array();
$baseUrl = str_replace(RouteHandler::getProtocol(), 'tapatalk://', WCF::getPath('wbb')) . '?';
$routeData = RouteHandler::getInstance()->getRouteData();
$controller = strtolower(isset($routeData['controller']) ? $routeData['controller'] : '');
$userID = WCF::getUser()->userID;
if ($userID) {
$params['user_id'] = $userID;
}
if (!empty($this->eventObj->pageNo)) {
$params['page'] = intval($this->eventObj->pageNo);
}
if (!empty($this->eventObj->itemsPerPage)) {
$params['perpage'] = intval($this->eventObj->itemsPerPage);
}
switch ($controller) {
case 'thread':
$params['location'] = $location = 'topic';
$params['tid'] = intval($this->eventObj->threadID);
$params['fid'] = intval($this->eventObj->board->boardID);
break;
case 'board':
$params['location'] = $location = 'forum';
$params['fid'] = intval($this->eventObj->boardID);
break;
case 'user':
$params['location'] = $location = 'profile';
$params['uid'] = intval($this->eventObj->userID);
break;
case 'conversation':
$params['location'] = $location = 'message';
$params['mid'] = intval($this->eventObj->conversationID);
break;
case 'users-online-list':
case 'usersonlinelist':
$params['location'] = $location = 'online';
break;
case 'search-result':
case 'searchresult':
$params['location'] = $location = 'search';
$params['search_id'] = intval($this->eventObj->searchID);
break;
case 'login':
$params['location'] = $location = 'login';
break;
default:
$params['location'] = $location = 'home';
break;
}
return $baseUrl . http_build_query($params, '&');
}
示例9: __construct
public function __construct()
{
parent::__construct($this);
$this->oDb = WCF::getDB();
$oUser = WCF::getUser();
if ($oUser && $oUser->userID) {
$this->oUser = $oUser;
}
$this->loadImActive();
$this->loadPushStatus();
$this->loadSlug();
$this->siteUrl = WCF::getPath('wbb');
$this->pushKey = WBB_TAPATALK_API_KEY;
$this->pushNotification = WBB_TAPATALK_PUSH_NOTIFICATION_TYPE;
}
示例10: calCfg
/**
* calculate the final config of $this->cfg through $this->cfg default value and MbqMain::$customConfig and MbqMain::$oMbqAppEnv and the plugin support degree
*/
public function calCfg()
{
$url = WCF::getPath();
MbqMain::$oMbqAppEnv->siteRootUrl = substr($url, 0, strlen($url) - 4);
//init current user
//$oUser = DefaultUserAuthentication::getInstance()->loginAutomatically(true);
//$oUser = WCF::getSession()->getUser();
$oUser = WCF::getUser();
if ($oUser && $oUser->userID) {
MbqMain::$oMbqAppEnv->oCurrentUser = $oUser;
$oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser');
$oMbqRdEtUser->initOCurMbqEtUser($oUser->userID);
}
if (MbqMain::hasLogin()) {
//!!!
header('Mobiquo_is_login: true');
} else {
header('Mobiquo_is_login: false');
}
$oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
MbqMain::$oMbqAppEnv->exttForumTree = $oMbqRdEtForum->getForumTree();
//!!!
MbqMain::$oMbqAppEnv->accessibleBoardIds = Board::getAccessibleBoardIDs(array('canViewBoard', 'canEnterBoard', 'canReadThread'));
parent::calCfg();
/* calculate the final config */
$this->cfg['base']['sys_version']->setOriValue(PACKAGE_VERSION);
if (OFFLINE) {
$this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.no'));
} else {
$this->cfg['base']['is_open']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.is_open.range.yes'));
}
//if (!MODULE_CONVERSATION || !WCF::getSession()->getPermission('user.conversation.canUseConversation')) {
if (!MODULE_CONVERSATION) {
$this->cfg['pc']['module_enable']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.module_enable.range.disable'));
$this->cfg['pc']['conversation']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.pc.conversation.range.notSupport'));
}
if (!MbqMain::$oMbqAppEnv->accessibleBoardIds) {
$this->cfg['user']['guest_okay']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.user.guest_okay.range.notSupport'));
$this->cfg['forum']['guest_search']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.forum.guest_search.range.notSupport'));
}
if ($this->getCfg('base.push')->oriValue == MbqBaseFdt::getFdt('MbqFdtConfig.base.push.range.support') && !OFFLINE && (@ini_get('allow_url_fopen') || function_exists('curl_init'))) {
$this->cfg['base']['push']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.push.range.support'));
} else {
$this->cfg['base']['push']->setOriValue(MbqBaseFdt::getFdt('MbqFdtConfig.base.push.range.notSupport'));
}
}
示例11: getURL
/**
* Returns the url of the compiled css file. The stylesheet will be
* compiled automatically in case it doesn't exist yet.
*
* @param integer $styleID
* @param boolean $rtl
* @return string
*/
public function getURL($styleID = null, $rtl = null)
{
// default values
if ($styleID === null) {
$styleID = StyleCacheBuilder::getInstance()->getData(array(), 'default');
}
if ($rtl === null) {
$rtl = WCF::getLanguage()->get('wcf.global.pageDirection') == 'rtl';
}
// compile stylesheet if necessary
if (!file_exists($this->getLocation($styleID, $rtl))) {
$this->compile($styleID);
}
//return filename with appended caching parameter
$filename = 'style/style-' . $styleID . '-' . $this->stylesheetID . ($rtl ? '-rtl' : '') . '.css';
return WCF::getPath('cms') . $filename . '?m=' . filemtime(CMS_DIR . $filename);
}
示例12: getStylesheet
/**
* Returns the HTML tag to include current stylesheet.
*
* @todo Add RTL support
*
* @return string
*/
public function getStylesheet() {
if (RequestHandler::getInstance()->isACPRequest()) {
// ACP
$filename = 'acp/style/style.css';
if (!file_exists(WCF_DIR.$filename)) {
StyleCompiler::getInstance()->compileACP();
}
}
else {
// frontend
$filename = 'style/style-'.$this->getStyle()->styleID.'.css';
if (!file_exists(WCF_DIR.$filename)) {
StyleCompiler::getInstance()->compile($this->getStyle()->getDecoratedObject());
}
}
return '<link rel="stylesheet" type="text/css" href="'.WCF::getPath().$filename.'?m='.filemtime(WCF_DIR.$filename).'" />';
}
示例13: uploadLogo
/**
* Handles logo upload.
*
* @return array<string>
*/
public function uploadLogo()
{
// save files
$files = $this->parameters['__files']->getFiles();
$file = $files[0];
try {
if (!$file->getValidationErrorType()) {
// shrink avatar if necessary
$fileLocation = $file->getLocation();
// move uploaded file
if (@copy($fileLocation, WCF_DIR . 'images/styleLogo-' . $this->parameters['tmpHash'] . '.' . $file->getFileExtension())) {
@unlink($fileLocation);
// store extension within session variables
WCF::getSession()->register('styleLogo-' . $this->parameters['tmpHash'], $file->getFileExtension());
// return result
return array('url' => WCF::getPath() . 'images/styleLogo-' . $this->parameters['tmpHash'] . '.' . $file->getFileExtension());
} else {
throw new UserInputException('image', 'uploadFailed');
}
}
} catch (UserInputException $e) {
$file->setValidationErrorType($e->getType());
}
return array('errorType' => $file->getValidationErrorType());
}
示例14: getFractionBackground
/**
* Get Fraction Background
*
* @return string
*/
public function getFractionBackground()
{
$basePath = WCF::getPath('cms');
$fraction = $this->getHordeOrAlliance() === static::HORDE ? 'horde' : 'alliance';
return $basePath . "/images/wowrooster/background/{$fraction}.png";
}
示例15: getIconPath
/**
* Returns language icon path.
*
* @return string
*/
public function getIconPath() {
return WCF::getPath() . 'icon/flag/'.$this->countryCode.'.svg';
}