当前位置: 首页>>代码示例>>PHP>>正文


PHP StringHelper::generateUrlImage方法代码示例

本文整理汇总了PHP中StringHelper::generateUrlImage方法的典型用法代码示例。如果您正苦于以下问题:PHP StringHelper::generateUrlImage方法的具体用法?PHP StringHelper::generateUrlImage怎么用?PHP StringHelper::generateUrlImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringHelper的用法示例。


在下文中一共展示了StringHelper::generateUrlImage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addComment

 public function addComment($user_id, $post_id, $content)
 {
     $model = new Comments();
     $model->post_id = $post_id;
     $model->created_by = $user_id;
     $model->updated_at = time();
     $model->comment_content = $content;
     $model->status = 1;
     $model->created_at = time();
     $model->updated_at = time();
     $model->save(FALSE);
     $post = Posts::model()->findByPk($post_id);
     $post->post_comment_count++;
     $user = User::model()->findByPk($model->created_by);
     $user_commented = User::model()->findByPk($post->user_id);
     if ($user_commented) {
         if ($user->id != $post->user_id) {
             $users_have_commented = $this->getListUserCommentedOnPost($post_id);
             if ($users_have_commented) {
                 foreach ($users_have_commented as $item) {
                     if ($user_id != $item->created_by && $post->user_id != $item->created_by) {
                         $arr_noti_others = array('user_id' => $user->id, 'content' => "{$user->username} cũng đã bình luận bài viết của {$user_commented->username}", 'type' => 'comment_also', 'recipient_id' => $item->created_by, 'url' => Yii::app()->createAbsoluteUrl('post/viewPost', array('post_id' => $post_id, array('ref' => 'noti'))));
                         Notifications::model()->add($arr_noti_others);
                     }
                 }
             }
             $arr_noti = array('user_id' => $user->id, 'content' => "{$user->username} vừa bình luận bài viết của bạn", 'type' => 'comment', 'recipient_id' => $user_commented->id, 'url' => Yii::app()->createAbsoluteUrl('post/viewPost', array('post_id' => $post_id, array('ref' => 'noti'))));
             Notifications::model()->add($arr_noti);
         } else {
             $users_have_commented = $this->getListUserCommentedOnPost($post_id);
             if ($users_have_commented) {
                 foreach ($users_have_commented as $item) {
                     if ($user_id != $item->created_by) {
                         $arr_noti_others = array('user_id' => $user->id, 'content' => "{$user->username} cũng đã bình luận bài viết của họ", 'type' => 'comment_also', 'recipient_id' => $item->created_by, 'url' => Yii::app()->createAbsoluteUrl('post/viewPost', array('post_id' => $post_id, array('ref' => 'noti'))));
                         Notifications::model()->add($arr_noti_others);
                     }
                 }
             }
         }
     }
     if ($model->save(FALSE) && $post->save(FALSE)) {
         $returnArr = array();
         $returnArr['created_by'] = $model->created_by;
         $returnArr['username'] = $user->username;
         $returnArr['photo'] = StringHelper::generateUrlImage($user->photo);
         $returnArr['created_at'] = Util::time_elapsed_string($model->created_at);
         $returnArr['comment_content'] = $model->comment_content;
         return $returnArr;
     }
     return FALSE;
 }
开发者ID:huynt57,项目名称:fashion,代码行数:51,代码来源:Comments.php

示例2: getImagePreviewByPostId

 public function getImagePreviewByPostId($post_id)
 {
     $criteria = new CDbCriteria();
     $criteria->limit = 1;
     $criteria->condition = "post_id = {$post_id}";
     $data = Images::model()->find($criteria);
     if ($data) {
         $url = $data->img_url;
         return StringHelper::generateUrlImage($url);
         //Yii::app()->request->getBaseUrl(true) . '/' . $url;
     } else {
         return '';
     }
 }
开发者ID:huynt57,项目名称:fashion,代码行数:14,代码来源:Images.php

示例3: url

<li class="notifi-item" noti-id="<?php 
echo $data->id;
?>
" onclick="markSeen('<?php 
echo $data->id;
?>
')">
    <a href="<?php 
echo $data->url;
?>
" class="notifi-link">
        <?php 
$user = User::model()->findByPk($data->user_id);
?>
        <div class="image bg-cover" style="background-image: url('<?php 
echo StringHelper::generateUrlImage($user->photo);
?>
');"></div>

        <div class="content"><?php 
echo $data->content;
?>
</div>
        <div class="info">
            <span class="icon"><i class="fa fa-heart notifi-like"></i></span>
            <span class="date"><?php 
echo date('d/m/Y', $data->created_at);
?>
</span>
        </div>
    </a>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:like.php

示例4: array

                                <?php 
    }
    ?>
                            </a>
                        </div>				
                    </div>
                    <div class="c-header">
                        <div class="user-image">
                            <?php 
    if (!empty($item['user_id'])) {
        ?>
                                <a href="<?php 
        echo Yii::app()->createUrl('user/profile', array('ref_web' => 'ref_web', 'user_id' => $item['user_id']));
        ?>
" class="user-avatar" style="background-image: url('<?php 
        echo StringHelper::generateUrlImage($item['user'][0]['photo']);
        ?>
');"></a>
                            <?php 
    }
    ?>
                            <?php 
    if (!empty($item['celeb_id'])) {
        ?>
                                <a href="<?php 
        echo Yii::app()->createUrl('user/profileCeleb', array('ref_web' => 'ref_web', 'celeb_id' => $item['celeb_id']));
        ?>
" class="user-avatar" style="background-image: url('<?php 
        echo '/' . $item['photo_celeb'];
        ?>
');"></a>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:index.php

示例5: foreach

foreach ($data as $item) {
    ?>
            <div class="card-single">
                <div class="card-single-inner">
                    <div class="c-image">
                        <div class="post-image">
                            <img src="" alt="" class="hidden">
                            <a href="<?php 
    echo Yii::app()->createUrl('user/listPostAlbums', array('album_id' => $item['album_id']));
    ?>
" class="post-link album-link">
                                <?php 
    foreach ($item['images_preview'] as $image) {
        ?>
                                    <div class="album-image bg-cover" style="background-image: url('<?php 
        echo StringHelper::generateUrlImage($image);
        ?>
');"></div>
                                <?php 
    }
    ?>
                            </a>
                        </div>				

                    </div>
                    <div class="c-body">
                        <div class="album-info">
                            <span class="single-info">Album gồm <?php 
    echo $item['number_posts'];
    ?>
 bài</span>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:albums.php

示例6: url

<div class="qh-user-page-header z-depth-1">
    <div class="image-cover bg-cover" style="background-image: url('<?php 
echo Yii::app()->theme->baseUrl;
?>
/assets/stock/cover1.jpg');">
        <div class="cover-gradient"></div>
        <div class="user-info">
            <div class="avatar" style="background-image: url('<?php 
echo StringHelper::generateUrlImage($profile->celeb_image);
?>
');"></div>
            <div class="username"><?php 
echo $profile->celeb_name;
?>
</div>
            <div class="description">24 | HCMC | Fashionista | Vegatarian | Love Cats</div>
            <?php 
if ($is_followed == FALSE) {
    ?>
                <div class="user-follow-btn">
                    <button class="qh-btn qh-btn-normal qh-btn-sm qh-btn-icon left-icon" id="follow" onclick="follow()"><i class="fa fa-user"></i>Theo dõi</button>
                    <!-- <button class="qh-btn qh-btn-normal qh-btn-sm qh-btn-icon left-icon"><i class="fa fa-check"></i>Đang theo dõi</button> -->
                </div>
            <?php 
}
?>
            <?php 
if ($is_followed == TRUE) {
    ?>
                <div class="user-follow-btn">
                    <button class="qh-btn qh-btn-normal qh-btn-sm qh-btn-icon left-icon" id="unfollow" onclick="unfollow()"><i class="fa fa-user"></i>Bỏ theo dõi</button>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:header_celeb.php

示例7:

                    <label class="qh-form-label">Ảnh cover</label>
                </div>
                <div class="col-xs-10">
                    <div class="user-cover-upload" id="cover-reader">
                        <?php 
if (empty($profile->cover)) {
    ?>
                            <img src="<?php 
    echo Yii::app()->theme->baseUrl;
    ?>
/assets/stock/cover1.jpg" alt="">
                        <?php 
} else {
    ?>
                            <img src="<?php 
    echo StringHelper::generateUrlImage($profile->cover);
    ?>
" alt="">
                        <?php 
}
?>
                    </div>
                    <input name="user_cover" type="file" id="inputCoverUpload" class="hidden"><label for="inputCoverUpload" class="qh-btn qh-btn-normal qh-btn-sm">Chọn ảnh</label>
                </div>
            </div>
            <hr>
            <div class="qh-form-row">
                <div class="col-xs-10 col-xs-offset-2">
                    <button class="qh-btn qh-btn-red600" type="submit">Lưu thông tin</button>
                </div>
            </div>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:editProfile.php

示例8: foreach

                        <input id="post-id" name="post_id" type="hidden" value="<?php 
    echo $data['post_id'];
    ?>
" />
                        <span class="loading" id="loading-comment" style="display: none"><i class="fa fa-spinner fa-pulse"></i></span>
                        <button type="button" class="comment-post-submit qh-btn qh-btn-red600 qh-btn-sm" id="submit-comment" onclick="comment()">Đăng</button>
                    </div>
                </form>
                <div class="comment-list">
                    <ul class="list" id="list-comment">
                        <?php 
    foreach ($data['comments'] as $comment) {
        ?>
                            <li class="single-comment">
                                <div class="avatar" style="background-image: url('<?php 
        echo StringHelper::generateUrlImage($comment['photo']);
        ?>
');"></div>
                                <div class="user-name"><a href="<?php 
        echo Yii::app()->createUrl('user/profile', array('user_id' => $comment['created_by'], 'ref_web' => 'ref_web'));
        ?>
"><?php 
        echo $comment['username'];
        ?>
</a></div>
                                <div class="time"><?php 
        echo Util::time_elapsed_string($comment['created_at']);
        ?>
</div>
                                <?php 
        //echo $comment['created_at']
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:post_modal.php

示例9: url

    ?>
/assets/stock/cover1.jpg');">
        <?php 
} else {
    ?>
            <div class="image-cover bg-cover" style="background-image: url('<?php 
    echo Yii::app()->request->getBaseUrl(true) . '/' . $profile->cover;
    ?>
');">
            <?php 
}
?>
            <div class="cover-gradient"></div>
            <div class="user-info">
                <div class="avatar" style="background-image: url('<?php 
echo StringHelper::generateUrlImage($profile->photo);
?>
');"></div>
                <div class="username"><?php 
echo $profile->username;
?>
</div>
                <?php 
if (empty($profile->description)) {
    ?>
                    <div class="description">24 | HCMC | Fashionista | Vegatarian | Love Cats</div>
                <?php 
} else {
    ?>
                    <div class="description"><?php 
    echo $profile->description;
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:header.php

示例10: url

                                </div>
                            </li>
                        </ul>
                    </div>
                    <!-- <div class="login-btn">
                            <a href="#" class="facebook-login-btn qh-btn qh-btn-icon left-icon qh-btn-facebook qh-btn-md"><i class="fa fa-facebook"></i> Đăng nhập với Facebook</a>
                    </div> -->
                    <div class="user-nav">
                        <ul class="list">
                            <li class="user-profile-link">
                                <a href="<?php 
echo Yii::app()->createUrl('user/profile');
?>
">
                                    <div class="user-avatar bg-cover" style="background-image: url('<?php 
echo StringHelper::generateUrlImage(Yii::app()->session['user_avatar']);
?>
');"></div>
                                    <div class="user-name"><?php 
echo Yii::app()->session['username'];
?>
</div>
                                </a>
                            </li>
                            <li>
                                <a href="#"><i class="fa fa-caret-down"></i></a>
                                <ul class="inner-list pull-right">
                                    <li><a href="#">Về FitMe</a></li>
                                    <li><a href="#">Điều khoản</a></li>
                                    <li><a href="#">Bảo mật</a></li>
                                    <li><a href="#">Quảng cáo</a></li>
开发者ID:huynt57,项目名称:fashion,代码行数:31,代码来源:main.php


注:本文中的StringHelper::generateUrlImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。