Пример #1
0
    public function run()
    {
        echo '<div class="popular-topics">
						<div id="topics" class="gradient-bg"><span style="float:left; padding-top:5px; padding-left:10px;">Topics</span></div>
						 <div class="popular-topics-content">
						 
						 
						  <ul>';
        $criteria = new CDbCriteria();
        $criteria->limit = 10;
        $criteria->order = 'created_date DESC';
        $criteria->group = 'blog_post_under';
        $BlogPostedUnder = Blogs::model()->findAll($criteria);
        foreach ($BlogPostedUnder as $posts) {
            $coutning = Blogs::model()->findAllByAttributes(array('blog_post_under' => $posts->blog_post_under));
            $counts = count($coutning);
            if ($posts->type == "blogs") {
                echo '<div id="populartags">';
                echo '<input type="hidden" id="blogid-' . $posts->blog_id . '" value="' . $posts->blog_id . '" />';
                echo '<div class="orange-link"><a class="blue-link font-12px" onclick="showpost(' . $posts->blog_id . ')">' . ucfirst($posts->blog_post_under) . '&nbsp;(' . $counts . ')</a></div>';
                // echo "(".count($tagcount).")";
                echo '<br>';
                echo '</div>';
            }
        }
        // $criteria->with = 'Blogs';
        echo '</ul></div></div>';
    }
Пример #2
0
<?php

foreach ($comments as $eachcmnt) {
    ?>
	
	<?php 
    $var = Yii::app()->session['login']['id'];
    ?>
	<?php 
    $blogid = Blogs::model()->findAllByAttributes(array('blog_id' => $eachcmnt->goal_id));
    foreach ($blogid as $blogtype) {
        ?>
 
	<!------------------------------ Start of Blog Comments ---------------------->
	 <?php 
        if ($blogtype->type == "blogs") {
            ?>
	<div class="comment-tab" style="position:relative;">
    	<div class="comment-tab-left"><img src="<?php 
            echo $eachcmnt->commentAuthor->profile_image != "" ? Yii::app()->baseUrl . "/images/uploads/parentimages/" . $eachcmnt->commentAuthor->profile_image : Yii::app()->baseUrl . "/images/default-photo.png";
            ?>
" width="25"/></div>
       
	    <div class="comment-tab-right">
        <div class="run-text font-12px"><span  class="blue-font12"><?php 
            $name = $eachcmnt->commentAuthor->fname . ' ' . $eachcmnt->commentAuthor->lname;
            echo $name;
            ?>
&nbspcommented as:</span></br>
		<span class="blue-font11">
		<?php