Beispiel #1
0
 public function getDateWithTooltip()
 {
     return '<span rel="tooltip" title="' . $this->getDateString() . '">' . AlexBond::time_since(time() - strtotime($this->when)) . '</span>';
 }
Beispiel #2
0
        echo $this->createUrl("/support/support/view", ["id" => $item->id]);
        ?>
">
                                        <span
                                            class="photo"><?php 
        echo Users::model()->getAvatar($item->user->username, 40);
        ?>
</span>
									<span class="subject">
									<span class="from"><?php 
        echo $item->user->username;
        ?>
</span>
									<span
                                        class="time"><?php 
        echo AlexBond::time_since(time() - $item->dateCreated);
        ?>
</span>
									</span>
									<span class="message">
									<?php 
        echo CHtml::encode($item->subject);
        ?>
									</span>
                                        </a>
                                    </li>
                                <?php 
    }
}
?>
                        </ul>
Beispiel #3
0
    /**
     * This gets rendered in the forum table.
     * Showing last post subject, with link to it, time of post, and name of poster, with link.
     */
    public function renderLastpostCell()
    {
        $lastpost = $this->lastPost;
        if (null == $lastpost) {
            return '<div style="text-align:center;">-</div>';
        }
        $thread = $lastpost->thread;
        $threadlink = CHtml::link(CHtml::encode($thread->subject), $thread->url);
        $authorlink = Users::model()->getUsernameWithLink($lastpost->author_id);
        return '<div style="position:relative; text-align: left;">
<a class="pull-left" style="position:relative; margin: 4px 5px 0 0;">
' . Users::model()->getAvatar($lastpost->author->username, 32) . '
</a>
' . Users::model()->getUsernameWithLink($lastpost->author_id, true) . '
<div>
<small>' . CHtml::link(AlexBond::time_since(time() - $lastpost->created), $thread->url) . '</small>
</div>
</div>';
    }
Beispiel #4
0
    $i++;
}
?>
                    </div>
                    <div class="col-md-6">
                        <?php 
$i = 1;
foreach ($data as $key => $item) {
    echo "<p>";
    if ($item['by'] == $model->id) {
        echo Users::model()->getUsernameAvatarWithLink($model->id, 16) . " убил " . Users::model()->getUsernameWithAvatarAndLink($item['to'], 16);
    } else {
        echo Users::model()->getUsernameWithAvatarAndLink($item['by'], 16) . " убил " . Users::model()->getUsernameAvatarWithLink($model->id, 16);
    }
    echo " в " . CHtml::link(Yii::app()->params['gameTypes'][$item['in']]["name"], Yii::app()->createUrl("/stats/" . Yii::app()->params['gameTypes'][$item['in']]["url"] . "/view", ["id" => $item['inId']]));
    echo " <span rel='tooltip' title='" . date("d.m.Y H:m:i", $item['when']) . "'>" . AlexBond::time_since(time() - $item['when']) . "</span>";
    echo "</p>";
    unset($data[$key]);
    if ($i == 25) {
        break;
    }
    $i++;
}
?>
                    </div>
                </div>
            </div>
            <div class="tab-pane fade" id="bans">
                <?php 
$bans = BanLog::model()->getLogOfUser($model->id);
if (count($bans) == 0) {
Beispiel #5
0
    public function renderLastpostCell()
    {
        //$lastpost = $this->lastPost;
        //if (null == $lastpost) return '<div style="text-align:center;">-</div>';
        return '<div style="position:relative; text-align: left;">
<a class="pull-left" style="position:relative; margin: 4px 5px 0 0;">
' . Users::model()->getAvatar(Users::model()->getUserNameFromID($this->lastPost_user_id), 32) . '
</a>
' . Users::model()->getUsernameWithLink($this->lastPost_user_id, true) . '
<div>
<small>' . AlexBond::time_since(time() - $this->lastPost_time) . '</small>
</div>
</div>';
    }
Beispiel #6
0
                    <?php 
echo Users::model()->getUsernameWithLink($data->author_id, true);
?>
                    <?php 
echo $data->author->getBadges();
?>
                    <div>
                        <a data-container="body" data-placement="right"
                           rel="tooltip" title=""
                           data-original-title="<?php 
echo Yii::app()->controller->module->format_date($data->created, 'long');
?>
">
                            <small>
                                написал <?php 
echo AlexBond::time_since(time() - $data->created);
?>
 назад.
                            </small>
                        </a>
                    </div>
                </div>
                <?php 
?>
                <?php 
if ($isAdmin) {
    $deleteConfirm = "Ты уверен? Сообщение будет удалено навсегда!";
    echo CHtml::ajaxLink('Удалить', array('/forum/post/delete', 'id' => $data->id), array('type' => 'POST', 'success' => 'function(){document.location.reload(true);}'), array('confirm' => $deleteConfirm, 'id' => 'post' . $data->id, "class" => "btn btn-danger btn-sm pull-right", "style" => "margin-left: 5px")) . " ";
}
if ($isAdmin || Yii::app()->user->id == $data->author_id) {
    ?>