本文整理汇总了PHP中bu函数的典型用法代码示例。如果您正苦于以下问题:PHP bu函数的具体用法?PHP bu怎么用?PHP bu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderContent
protected function renderContent()
{
if (isset($this->block) && $this->block != null) {
if (isset($_POST['ResetAvatar'])) {
//So we will start to check the info from the user
$current_user = User::model()->findByPk(user()->id);
if ($current_user) {
if ($current_user->avatar != null && $current_user->avatar != '') {
//We will delete the old avatar here
$old_avatar_path = $current_user->avatar;
if (file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $old_avatar_path)) {
@unlink(AVATAR_FOLDER . DIRECTORY_SEPARATOR . 'root' . DIRECTORY_SEPARATOR . $old_avatar_path);
}
//Delete old file Sizes
$sizes = AvatarSize::getSizes();
foreach ($sizes as $size) {
if (file_exists(AVATAR_FOLDER . DIRECTORY_SEPARATOR . $size['id'] . DIRECTORY_SEPARATOR . $old_avatar_path)) {
@unlink(AVATAR_FOLDER . DIRECTORY_SEPARATOR . $size['id'] . DIRECTORY_SEPARATOR . $old_avatar_path);
}
}
$current_user->avatar = '';
if ($current_user->save()) {
echo "1";
Yii::app()->end();
}
}
} else {
throw new CHttpException('403', 'Wrong Link!');
}
}
Yii::app()->controller->redirect(bu() . '/profile');
}
}
示例2: actionImagelist
public function actionImagelist($attr)
{
$attribute = strtolower($attr);
$uploadPath = Yii::app()->basePath . '/../images';
$uploadUrl = bu('images');
if ($uploadPath === null) {
$path = Yii::app()->basePath . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'uploads';
$uploadPath = realpath($path);
if ($uploadPath === false) {
exit;
}
}
if ($uploadUrl === null) {
$uploadUrl = Yii::app()->request->baseUrl . '/uploads';
}
$attributePath = $uploadPath . DIRECTORY_SEPARATOR . $attribute;
$attributeUrl = $uploadUrl . '/' . $attribute . '/';
$files = CFileHelper::findFiles($attributePath, array('fileTypes' => array('gif', 'png', 'jpg', 'jpeg'), 'level' => 0));
$data = array();
if ($files) {
foreach ($files as $file) {
$data[] = array('thumb' => $attributeUrl . basename($file), 'image' => $attributeUrl . basename($file));
}
}
echo CJSON::encode($data);
exit;
}
示例3: getSelect
public static function getSelect($menu)
{
date_default_timezone_set('America/Bogota');
setlocale(LC_ALL, 'es_ES.UTF-8');
$base = bu('programacion');
$hoy = mktime(0, 0, 0, date('m'), date('j'), date('Y'));
$html = '';
$manana = $hoy + 86400;
$ya = false;
$ruri = Yii::app()->request->requestUri;
$html .= '<select name="dia_programacion" id="dia_programacion">';
foreach ($menu as $item) {
$selected = '';
$url = $base . '?dia=' . date('j', $item) . '&mes=' . date('m', $item) . '&anio=' . date('Y', $item);
if (!$ya) {
if ($url == $ruri) {
$selected = " selected='selected'";
$ya = true;
} elseif ($item >= $hoy && $item < $manana) {
$selected = " selected='selected'";
} else {
$selected = '';
}
}
$html .= '<option value="' . $url . '"' . $selected . '>';
$html .= ucfirst(strftime("%A", $item)) . ' ' . strftime("%e", $item);
$html .= '</option>';
}
$html .= '</select>';
return $html;
}
示例4: actionSalir
public function actionSalir()
{
Yii::app()->user->logout();
Yii::app()->session->clear();
Yii::app()->session->destroy();
$this->redirect(bu('/'));
}
示例5: run
/** Render widget */
public function run()
{
/** @var $cs CClientScript */
$cs = Yii::app()->clientScript;
$cs->registerCssFile($this->assets . '/galleryManager.css');
$cs->registerCoreScript('jquery');
$cs->registerCoreScript('jquery.ui');
if (YII_DEBUG) {
$cs->registerScriptFile($this->assets . '/jquery.iframe-transport.js', CClientScript::POS_END);
$cs->registerScriptFile($this->assets . '/jquery.galleryManager.js', CClientScript::POS_END);
} else {
$cs->registerScriptFile($this->assets . '/jquery.iframe-transport.min.js', CClientScript::POS_END);
$cs->registerScriptFile($this->assets . '/jquery.galleryManager.min.js', CClientScript::POS_END);
}
if ($this->controllerRoute === null) {
throw new CException('$controllerRoute must be set.', 500);
}
$photos = array();
foreach ($this->gallery->galleryPhotos as $photo) {
$af = AlbumFoto::model()->findByPk($photo->album_foto_id);
$photos[] = array('id' => $photo->id, 'rank' => $photo->orden, 'nombre' => (string) $photo->nombre, 'descripcion' => (string) $photo->descripcion, 'preview' => bu('images/galeria/' . $af->directorio . $photo->thumb));
}
$opts = array('hasName' => true, 'hasDesc' => true, 'uploadUrl' => Yii::app()->createUrl($this->controllerRoute . '/ajaxUpload', array('album_foto_id' => $this->gallery->id)), 'deleteUrl' => Yii::app()->createUrl($this->controllerRoute . '/delete'), 'updateUrl' => Yii::app()->createUrl($this->controllerRoute . '/changeData'), 'arrangeUrl' => Yii::app()->createUrl($this->controllerRoute . '/order'), 'nameLabel' => Yii::t('galleryManager.main', 'Name'), 'descriptionLabel' => Yii::t('galleryManager.main', 'Description'), 'photos' => $photos);
if (Yii::app()->request->enableCsrfValidation) {
$opts['csrfTokenName'] = Yii::app()->request->csrfTokenName;
$opts['csrfToken'] = Yii::app()->request->csrfToken;
}
$opts = CJavaScript::encode($opts);
$cs->registerScript('galleryManager#' . $this->id, "\$('#{$this->id}').galleryManager({$opts});");
$this->htmlOptions['id'] = $this->id;
$this->htmlOptions['class'] = 'GalleryEditor';
$this->render('galleryManager');
}
示例6: del
function del($id)
{
$this->db->where($this->idkey, $id);
$this->db->delete($this->table);
echo "<script type='text/javascript'>alert ('Запись Удалена!');</script>";
echo "<html><head><meta HTTP-EQUIV='REFRESH' CONTENT='0;URL=" . bu() . "'></head></html>";
}
示例7: display_seo
public function display_seo($title = '')
{
$base = 'http://telemedellin.tv';
$bu = Yii::app()->request->baseUrl;
$ru = Yii::app()->request->requestUri;
$titulo = $title != '' ? h($title) . ' - ' : '';
$titulo .= 'Telemedellín, aquí te ves';
echo '<meta charset="utf-8">' . PHP_EOL;
//Pilas con el icono para Apple y esos metas
echo "\t" . '<meta name="viewport" content="width=device-width, initial-scale=1">' . PHP_EOL;
echo "\t" . '<link rel="canonical" href="' . $base . $ru . '">' . PHP_EOL;
echo "\t" . '<link rel="shortcut icon" href="' . bu('/favicon.ico') . '">' . PHP_EOL;
if ($this->pageRobotsIndex == false) {
// Option for NoIndex
echo "\t" . '<meta name="robots" content="noindex">' . PHP_EOL;
}
echo "\t" . '<title>' . $titulo . '</title>' . PHP_EOL;
echo "\t" . '<meta name="description" content="', h(trim(substr(strip_tags($this->pageDesc), 0, 160))), '">' . PHP_EOL;
echo "\t" . '<meta property="og:title" content="' . $titulo . '">' . PHP_EOL;
echo "\t" . '<meta property="og:type" content="website">' . PHP_EOL;
echo "\t" . '<meta property="og:url" content="' . $base . $ru . '">' . PHP_EOL;
echo "\t" . '<meta property="og:image" content="' . $base . $this->pageImg . '">' . PHP_EOL;
echo "\t" . '<meta name="twitter:card" content="summary_large_image">' . PHP_EOL;
echo "\t" . '<meta name="twitter:site" content="@telemedellin">' . PHP_EOL;
echo "\t" . '<meta name="twitter:creator" content="@telemedellin">' . PHP_EOL;
echo "\t" . '<meta name="twitter:title" content="' . $titulo . '">' . PHP_EOL;
echo "\t" . '<meta name="twitter:description" content="' . h(trim(substr(strip_tags($this->pageDesc), 0, 160))) . '">' . PHP_EOL;
echo "\t" . '<meta name="twitter:image:src" content="' . $base . $this->pageImg . '">' . PHP_EOL;
}
示例8: registerBootstrap3CoreAssets
public function registerBootstrap3CoreAssets()
{
//bootstrap css
app()->params['bootswatch3_skin'] == "none" ? cs()->registerCssFile(bu() . '/libs/bootstrap/dist/css/bootstrap.css') : cs()->registerCssFile(bu() . '/libs/bootswatch/' . app()->params['bootswatch3_skin'] . '/bootstrap.min.css');
//bootstrap js
cs()->registerScriptFile(bu() . '/libs/bootstrap/dist/js/bootstrap.min.js', CClientScript::POS_END);
}
示例9: buildLink
public static function buildLink($obj)
{
if ($obj->object_id) {
return bu() . "/page?slug=post&id=" . $obj->object_id . "&pslug=" . $obj->object_slug;
} else {
return null;
}
}
示例10: run
public function run()
{
if (!user()->isGuest) {
$this->renderContent();
} else {
user()->setFlash('error', t('Bạn cần đăng nhập để sử dụng tính năng này!'));
Yii::app()->controller->redirect(bu() . '/sign-in');
}
}
示例11: getAssetsUrl
/**
* Returns the URL to the assets folder.Override to avoid publishing.
* @return string the URL
*/
public function getAssetsUrl()
{
if (isset($this->_assetsUrl)) {
return $this->_assetsUrl;
} else {
$assetsUrl = bu() . '/yiibooster_assets';
return $this->_assetsUrl = $assetsUrl;
}
}
示例12: logout
function logout()
{
$CI =& get_instance();
$ses = array();
$ses['admin_logined'] = '';
$ses['admin_hash'] = '';
$CI->session->unset_userdata($ses);
redirect(bu() . 'CI_lunit/login');
}
示例13: regCssFile
/**
* This is the shortcut to Yii::app()->clientScript->registerCssFile
*/
function regCssFile($files, $url = 'css', $addBaseUrl = true)
{
if (!is_array($files)) {
$files = array($files);
}
foreach ($files as $file) {
$file = $addBaseUrl ? bu($url) . '/' . $file . '.css' : $url . '/' . $file . '.css';
cs()->registerCssFile($file);
}
}
示例14: getAssetsUrl
protected function getAssetsUrl()
{
if (isset($this->_assetsUrl)) {
return $this->_assetsUrl;
} else {
$assetsPath = Yii::getPathOfAlias('webroot.yiistrap_assets');
$assetsUrl = bu() . '/yiistrap_assets';
return $this->_assetsUrl = $assetsUrl;
}
}
示例15: completar_slug
private function completar_slug($pathInfo)
{
$slugs = array('programas/' . $pathInfo, 'especiales/' . $pathInfo, 'concursos/' . $pathInfo, 'documentales/' . $pathInfo, 'telemedellin/' . $pathInfo, 'recorrido-canal-parque/' . $pathInfo, '15-años-con-vos/' . $pathInfo);
foreach ($slugs as $slug) {
if ($this->verificar_slug($slug)) {
Yii::app()->request->redirect(bu($slug), true, 301);
}
}
return false;
}