本文整理匯總了PHP中CUrlHelper::coverURI方法的典型用法代碼示例。如果您正苦於以下問題:PHP CUrlHelper::coverURI方法的具體用法?PHP CUrlHelper::coverURI怎麽用?PHP CUrlHelper::coverURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CUrlHelper
的用法示例。
在下文中一共展示了CUrlHelper::coverURI方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCover
/**
* Get current Group cover
* @return [string] [url]
*/
public function getCover()
{
if (empty($this->cover)) {
$this->cover = '';
} else {
/* if not local than get remote storage */
$storage = CStorage::getStorage($this->storage);
return $storage->getURI($this->cover);
}
return CUrlHelper::coverURI($this->cover, 'cover-group-default.png');
}
示例2: getCover
/**
* Get Event current cover
* @return [string] [URL]
*/
public function getCover()
{
if (empty($this->cover)) {
$this->cover = '';
}
return CUrlHelper::coverURI($this->cover, 'cover-event.png');
}
示例3:
?>
<tr>
<td align="center">
<?php
echo $i + 1;
?>
</td>
<td>
<?php
echo JHTML::_('grid.id', $i++, $row->id);
?>
<span class="lbl"></span>
</td>
<td>
<img width="90" src="<?php
echo CUrlHelper::coverURI($row->cover, 'cover-event.png');
?>
" />
</td>
<td>
<a href="javascript:void(0);" onclick="azcommunity.editEvent('<?php
echo $row->id;
?>
');">
<?php
echo $row->title;
?>
</a>
</td>
<td>
<?php
示例4: getCover
/**
* Get user cover Url
* @return string
*/
public function getCover()
{
$config = CFactory::getConfig();
$storage = CStorage::getStorage($config->get('user_avatar_storage'));
$storages['file'] = 'file';
$storages['s3'] = 's3';
if (!$storage->exists($this->_cover)) {
unset($storages[$config->get('user_avatar_storage')]);
$storages = array_pop($storages);
$storage = CStorage::getStorage($storages);
}
if (empty($this->_cover) || !$storage->exists($this->_cover)) {
$profileModel = CFactory::getModel('Profile');
$gender = $profileModel->getGender($this->id);
$tGender = strtoupper($gender);
/* Not use translate string yet */
if (strpos($tGender, 'COM_COMMUNITY_') === false) {
/* But it must be default English string */
$tGender = 'COM_COMMUNITY_' . $tGender;
/* Adding prefix translate string */
}
/* Now we have translate string already. Let's determine gender ( No shemale here ) */
// theme designer files first
switch ($tGender) {
case 'COM_COMMUNITY_MALE':
$gender = 'male-default';
$td_cover = 'default-cover-male';
break;
case 'COM_COMMUNITY_FEMALE':
$gender = 'female-default';
$td_cover = 'default-cover-female';
break;
default:
$gender = 'undefined-default';
$td_cover = 'default-cover';
break;
}
$template = new CTemplateHelper();
// Theme designer cover
if (file_exists(COMMUNITY_PATH_ASSETS . $td_cover . '.png')) {
return JUri::root() . str_replace(JPATH_ROOT, '', COMMUNITY_PATH_ASSETS) . "{$td_cover}.png";
}
if (file_exists(COMMUNITY_PATH_ASSETS . $td_cover . '.jpg')) {
return JUri::root() . str_replace(JPATH_ROOT, '', COMMUNITY_PATH_ASSETS) . "{$td_cover}.jpg";
}
// Default cover
if (file_exists(COMMUNITY_PATH_ASSETS . 'cover-' . $gender . '.png')) {
return JUri::root() . str_replace(JPATH_ROOT, '', COMMUNITY_PATH_ASSETS) . 'cover-' . $gender . '.png';
}
if (file_exists(COMMUNITY_PATH_ASSETS . 'cover-' . $gender . '.jpg')) {
return JUri::root() . str_replace(JPATH_ROOT, '', COMMUNITY_PATH_ASSETS) . 'cover-' . $gender . '.jpg';
}
// Template cover
$asset = $template->getTemplateAsset('cover-' . $gender . '.jpg', 'images');
$uri = $asset->url;
if (strlen($uri)) {
return $uri;
}
$asset = $template->getTemplateAsset('cover-' . $gender . '.png', 'images');
$uri = $asset->url;
if (strlen($uri)) {
return $uri;
}
} else {
/* if not local storage than get remote storage */
$storage = CStorage::getStorage($this->_storage);
return $storage->getURI($this->_cover);
}
$avatar = CUrlHelper::coverURI($this->_cover, '');
return $avatar;
}