} echo '<li class="list-group-item">'; switch ($objCol) { case "gender": echo "Gender: " . User::getGenderName($user->gender); break; case "registerTime": echo "Register time: " . $user->registerTime . "<br/>"; break; case "qq": echo "QQ: " . $user->qq . "<br/>"; break; case "roleId": echo "Role: " . User::$roles[$user->roleId - 1] . " "; if ($user->roleId == Role::AUTHENTICATED_ID) { echo RHtml::linkAction('user', 'Apply for VIP', 'applyVIP', null, ['class' => 'btn btn-xs btn-info']); } echo "<br/>"; break; case "intro": echo "Introduction: " . $user->{$objCol} . "<br/>"; break; case "weibo": echo "Webo: " . RHtml::link($user->name, $user->weibo, $user->weibo) . "<br/>"; break; case "homepage": echo "Homepage: " . RHtml::link($user->name, $user->homepage, $user->homepage) . "<br/>"; break; default: echo ucfirst($objCol) . ": " . $user->{$objCol} . "<br/>"; break;
?> <div><br/><b>Select friends to invite:</b></div> <div class="panel panel-default"> <div class="panel-body"> <div class="checkbox friends-list"> <?php foreach ($friends as $friend) { echo '<div class="col-lg-2 friend-item" style="height: 90px;">'; if (!isset($friend->user->picture) || $friend->user->picture == '') { $friend->user->picture = User::$defaults['picture']; } $picture = RImage::styleSrc($friend->user->picture, User::getPicOptions()); echo RHtml::image($picture, $friend->user->name, array('width' => '64px')); echo '<br/>'; echo RForm::input(array('type' => 'checkbox', 'name' => 'select_friends[]', 'value' => $friend->user->id, 'class' => 'btn btn-default')); echo RHtml::linkAction('user', $friend->user->name, 'view', $friend->user->id); echo '</div>'; } ?> </div> </div> </div> <hr> <div><b>Write something as an invitation (optional)</b></div> <?php echo RForm::textarea(array('class' => 'form-control', 'rows' => '3', 'name' => 'invitation', 'placeholder' => 'Say something!')); echo '<br/>'; echo RForm::input(array('class' => 'btn btn-lg btn-primary', 'type' => 'submit', 'value' => 'Invite Now'));
<?php /** * "Add friends" request message content. * @author: Raysmond */ echo '<p>'; echo RHtml::linkAction('user', $user->name, 'view', $user->id); echo ' wants to be your friends. <br/>'; echo '</p>'; echo '<p>'; echo RHtml::linkAction('friend', 'Confirm', 'confirm', $user->id, array('class' => 'btn btn-xs btn-success')); echo ' '; echo RHtml::linkAction('friend', 'Decline', 'decline', $user->id, array('class' => 'btn btn-xs btn-danger')); echo '</p>';
<th>View</th> </tr> </thead> <tbody> <?php foreach ($comments as $comment) { echo '<tr>'; echo '<td>' . RForm::input(array('name' => 'checked_comments[]', 'type' => 'checkbox', 'value' => $comment->id)) . '</td>'; echo '<td>' . RHtml::linkAction('user', $comment->user->name, 'view', $comment->user->id) . '</td>'; echo '<td>' . $comment->createdTime . '</td>'; if (mb_strlen($comment->content) > 140) { $comment->content = mb_substr($comment->content, 0, 140, 'UTF-8') . '...'; } echo '<td>' . RHtml::linkAction('post', $comment->topic->title, 'view', $comment->topic->id) . '</td>'; echo '<td>' . $comment->content . '</td>'; echo '<td>' . RHtml::linkAction('post', 'View', 'view', $comment->topic->id . '#comment-item-' . $comment->id) . '</td>'; echo '</tr>'; } ?> </tbody> </table> <?php echo isset($pager) ? $pager : ""; ?> </div> </div> <?php echo RForm::endForm(); ?>
echo RHtml::image('files/images/category/more.png', '', ['style' => 'width:24px;height:24px;']); ?> 更多... </a> <script> function packCategory() { $('#category-children-level-bar').slideToggle(); } </script> </div> <div id="category-children-level-bar" style="display:none;"> <?php foreach ($categories as $category) { $subCategory = $category->children(); ?> <div class="category-children-container"> <ul> <?php foreach ($subCategory as $cat) { echo '<li>' . RHtml::linkAction('category', $cat->name, 'groups', $cat->id, ['class' => 'btn btn-sm children-category ' . (in_array($cat->id, $cid) ? 'active' : '')]) . '</li>'; } ?> </ul> </div> <?php } ?> </div> </div>
<tbody><?php foreach ($posts as $topic) { ?> <tr> <td class="post-list-td1"><?php echo RHtml::linkAction('post', $topic->title, 'view', $topic->id); ?> </td> <?php if (isset($showAuthor) && $showAuthor) { echo '<td class="post-list-td2">by ' . RHtml::linkAction('user', $topic->user->name, 'view', $topic->user->id) . '</td>'; } ?> <?php if (isset($showGroup) && $showGroup) { echo '<td class="post-list-td3">' . RHtml::linkAction('group', $topic->group->name, 'detail', $topic->group->id) . '</td>'; } ?> <td class="post-list-td4"><?php echo $topic->commentCount; ?> replies</td> <td class="post-list-td5"><?php echo mb_substr($topic->createdTime, 0, 10); ?> </td> </tr> <?php } ?> </tbody>
<th>Host</th> <th>Timestamp</th> </tr> </thead> <tbody> <?php foreach ($logs as $log) { echo '<tr>'; echo '<td>' . $log->type . '</td>'; echo '<td>' . $log->severity . '</td>'; echo '<td>' . $log->message . '</td>'; echo '<td>' . RHtml::link($log->path, $log->path, $log->path) . '</td>'; if ($log->userId == 0) { echo '<td>Anonymous</td>'; } else { echo '<td>' . RHtml::linkAction('user', $log->user->name, 'view', $log->user->id) . '</td>'; } echo '<td>' . $log->host . '</td>'; echo '<td>' . $log->timestamp . '</td>'; echo '</tr>'; } ?> </tbody> </table> </div> <?php echo $pager; ?> </div>
<tr> <td> <?php if ($ad->status != Ads::REMOVED) { ?> <?php echo RForm::input(array('name' => 'checked_ads[]', 'type' => 'checkbox', 'value' => $ad->id)); ?> <?php } else { echo "<span class='glyphicon glyphicon-ban-circle' style='color:red;'></spam>"; } ?> </td> <td><?php echo RHtml::linkAction('user', $ad->publisher->name, 'view', $ad->publisher->id); ?> </td> <td><?php echo $ad->pubTime; ?> </td> <td><?php echo $ad->paidPrice; ?> </td> <td><?php echo $ad->title; ?> </td> <td><?php
continue; } echo '<li class="list-group-item">'; echo '<a href="javascript:markCategoryParent(\'' . $category->id . '\')" class="btn btn-xs btn-info">+</a>'; echo " • <b>" . RHtml::linkAction('category', $category->name, 'groups', $category->id, array('id' => 'category-item-' . $category->id)); echo '</b> '; $subCategories = array(); foreach ($categories as $item) { if ($item->pid == $category->id) { $subCategories[] = $item; } } foreach ($subCategories as $cat) { echo RForm::input(array('name' => 'sub_items[]', 'type' => 'checkbox', 'value' => $cat->id)); echo ' '; echo RHtml::linkAction('category', $cat->name, 'groups', $cat->id) . " "; } echo '<br/>'; echo '</li>'; } ?> </div> </div> </div> <?php echo RForm::endForm(); ?> <div class="panel panel-default"> <div class="panel-heading"><b>Add category</b></div> <div class="panel-body">
public function actionDecline($userId = null) { $uid = Rays::user()->id; $userName = Rays::user()->name; //only request exist can friendship be declined $censor = (new Censor())->addFriendExist($userId, $uid); if ($censor === null) { $this->flash('warning', 'Request already processed'); } else { $censor->fail(); $content = RHtml::linkAction('user', $userName, 'view', $uid) . " has declined your friend request."; Message::sendMessage("system", $uid, $userId, "Friend request declined", $content, ''); $this->flash('message', 'Friend request declined.'); } $this->redirectAction('message', 'view', null); }
?> <td><?php echo RForm::input(array('name' => 'checked_users[]', 'type' => 'checkbox', 'value' => $user->id)); ?> </td><?php foreach (User::$mapping as $objCol => $dbcol) { if (in_array($objCol, $skips)) { continue; } echo '<td>'; switch ($objCol) { case "roleId": echo Role::getRoleNameById($user->{$objCol}); break; case "name": echo RHtml::linkAction('user', $user->{$objCol}, 'view', $user->id); break; case "homepage": echo RHtml::link($user->{$objCol}, $user->{$objCol}, $user->{$objCol}); break; case "gender": echo User::getGenderName($user->gender); break; case "status": if ($user->status == 1) { echo '<span style="color:green">active</span>'; } else { echo '<span style="color:red">blocked</span>'; } break; default:
<?php /** * Friend groups module view * @author: Raysmond */ ?> <div class="panel panel-default"> <div class="panel-heading"><h3 class="panel-title">Friend Groups <?php echo count($friends) > 0 ? " ( " . count($friends) . " )" : ''; ?> </h3></div> <div class="panel-body"> <?php foreach ($friends as $friend) { echo RHtml::linkAction('group', $friend->name, 'detail', $friend->id) . " "; } ?> </div> </div>
public function actionExit($groupId = null) { $groupUser = GroupUser::find(array("groupId", $groupId, "userId", Rays::user()->id))->first(); $group = Group::get($groupId); if ($group == null) { $this->flash("error", "You are not the member of the group!"); } else { if ($group->creator == $groupUser->userId) { // group creator cannot exit the group $this->flash("error", "You cannot exit group " . RHtml::linkAction('group', $group->name, 'detail', $group->id) . " , because you're the group creator!"); } else { $groupUser->delete(); $group->memberCount--; $group->save(); $this->flash("message", "You have exited the group successfully."); } } $this->redirectAction('group', 'mygroups', Rays::user()->id); }
<li><?php echo RHtml::linkAction("user", "Personal Page", "view", $user->id); ?> </li> <li role="presentation" class="divider"></li> <?php if ($countMessages == 0) { echo "<li>" . RHtml::linkAction("message", "Messages", "view", null) . "</li>"; } else { echo '<li><a href="' . RHtml::siteUrl('message/view') . '">'; echo 'Messages <span class="badge">' . $countMessages . '</span></a></li>'; } ?> <li role="presentation" class="divider"></li> <li><?php echo RHtml::linkAction("user", "Logout", "logout", null); ?> </li> </ul> </li> <?php } ?> </ul> <form class="navbar-form navbar-right" role="search" method="post" action="<?php echo RHtml::siteUrl("group/find"); ?> "> <input type="text" id="searchstr" name="searchstr" value="<?php echo isset($_POST['searchstr']) ? $_POST['searchstr'] : "";
echo "© Copyright " . Rays::app()->getName() . " 2013, All Rights Reserved."; ?> </div> <div class="footer-links col-lg-7"> <ul> <li><?php echo RHtml::linkAction('site', 'About us', 'about'); ?> </li> <li><?php echo RHtml::linkAction('site', 'Contact', 'contact'); ?> </li> <li><?php echo RHtml::linkAction('site', 'Help', 'help'); ?> </li> </ul> </div> </div> <div class="site-background"> <?php echo RHtml::image('/public/images/background-' . rand(1, 4) . '.jpg', '', ['style' => 'width: 100%; height: auto; top: -312.5px;']); ?> </div> </div><!--/.container--> <!-- Placed at the end of the document so the pages load faster --> <?php // link custom script files
?> <div class="panel panel-info"> <div class="panel-heading"> <div style="float:right;margin-top: -2px;"> <?php echo $ad->pubTime; ?> Paid <?php echo $ad->paidPrice; ?> Credits <?php echo RHtml::linkAction('ads', 'edit', 'edit', [$ad->id, $data['type']], ['class' => 'btn btn-xs btn-info']); ?> <?php echo RHtml::linkAction('ads', 'remove', 'remove', [$ad->id, $data['type']], ['class' => 'btn btn-xs btn-danger', 'onclick' => "return confirm('Are you sure to remove selected advertisement? (Removed advertisements cannot be recovered, and paid credits will not be returned.)')"]); ?> </div> <h3 class="panel-title"> <?php echo $ad->title; ?> </h3> </div> <div class="panel-body"> <div class="message-meta"> <?php echo RHtml::decode($ad->content); ?> </div> </div>
post in <?php echo RHtml::linkAction('group', $topic->group->name, 'detail', $topic->group->id); ?> <?php echo $topic->createdTime; ?> </div> <div> <?php $topic->content = strip_tags(RHtml::decode($topic->content)); if (mb_strlen($topic->content) > 140) { echo '<p>' . mb_substr($topic->content, 0, 140, 'UTF-8') . '...</p>'; } else { echo '<p>' . $topic->content . '</p>'; } ?> </div> <div> <?php echo RHtml::linkAction('post', 'Reply(' . $topic->commentCount . ')', 'view', $topic->id . '#reply'); ?> </div> </div> </div> <hr> <?php } ?> </div><!--END last-topics-list-->
</div> <h1 class="panel-title"><?php echo $topic->title; ?> </h1> </div> <div class="panel-body"> <div class="post-meta"> <span class="glyphicon glyphicon-user"></span> <?php echo RHtml::linkAction('user', $topic->user->name, 'view', $topic->user->id); ?> <span class="glyphicon glyphicon-th-large"></span> <?php echo RHtml::linkAction('group', $topic->group->name, 'detail', $topic->group->id); ?> <span class="glyphicon glyphicon-search"></span> <?php echo $counter->totalCount; ?> <span class="glyphicon glyphicon-time"></span> <?php echo $topic->createdTime; ?> </div> <div class="post-content"> <?php echo RHtml::decode($topic->content); ?>
<?php /** * Created by PhpStorm. * User: Raysmond * Date: 13-11-23 * Time: PM10:56 */ ?> <div class="panel panel-default"> <div class="panel-heading"> <div class="heading-actions"> <?php echo RHtml::linkAction('ads', 'Back to ads', 'view', null, array('class' => 'btn btn-xs btn-info')); ?> </div> <h1 class="panel-title"> <?php if (isset($edit)) { echo 'Edit Advertisement'; } else { echo 'Ads application'; } ?> </h1> </div> <?php $form = isset($applyForm) ? $applyForm : array();
?> <div class="actions"> <a href="<?php echo RHtml::siteUrl('post/view/' . $topic->id) . '#reply'; ?> "> <span class="glyphicon glyphicon-comment"></span> <?php echo $topic->commentCount; ?> </a> <?php if (isset($enabledDelete) && $enabledDelete) { if ($currentUserId !== 0 && $topic->user->id == $currentUserId) { echo ' '; echo RHtml::linkAction('post', 'Delete', 'delete', $topic->id, array('class' => 'btn btn-xs btn-danger')); } } echo ' '; $self->module("rating_plus", array('id' => 'rating_plus', 'entityType' => Topic::ENTITY_TYPE, 'entityId' => $topic->id, 'count' => $topic->rating->value)); ?> </div> </div> </div> <div class="i"></div> </div> <hr> <?php } ?> </div>
<div class="panel panel-default"> <div class="panel-heading">Friends</div> <div class="panel-body"> <?php echo '<div class="user-list">'; if (empty($friends)) { echo '<div> You don\'t have any friends yet!</div>'; } foreach ($friends as $friend) { echo '<div class="user-item col-lg-4" style="overflow: hidden;height: 80px;">'; $picture = isset($friend->picture) && $friend->picture != '' ? $friend->picture : User::$defaults['picture']; $picture = RImage::styleSrc($picture, User::getPicOptions()); echo '<a href="' . RHtml::siteUrl('user/view/' . $friend->id) . '">' . RHtml::image($picture, $friend->name, array('width' => '58px', 'height' => '58px')) . '</a>'; $name = $friend->name; if (mb_strlen($name) > 7) { $name = mb_substr($name, 0, 7) . ".."; } echo RHtml::linkAction('user', $name, 'view', $friend->id, array('title' => $friend->name)) . " "; echo '</div>'; } // if ($friNumber) { // echo '<div class="clearfix"></div>'.RHtml::linkAction('friend', 'Show all my '.$friNumber.' friends >>', 'myFriend', null, ['id' => 'list-all-friends']); // } echo '</div>'; ?> </div> </div>
<div class="panel panel-default"> <div class="panel-heading"><h1 class="panel-title"><?php echo $group->name; ?> </h1></div> <div class="panel-body"> <div class="row"> <?php echo RHtml::linkAction('group', 'Back to group', 'detail', $group->id, array('class' => 'btn btn-sm btn-info')); ?> <div style="float: right;"> <?php if ($canPost) { echo RHtml::linkAction('post', '+ New post', 'new', $group->id, array('class' => 'btn btn-sm btn-success')); } ?> </div> </div> <hr> <div class="row"> <?php $self->renderPartial("_common._posts_table", array('posts' => $topics, 'showAuthor' => true), false); ?> <?php echo isset($pager) ? $pager : ""; ?> </div> </div>
?> </td> <td><?php echo RHtml::linkAction('user', $users[$count]->name, 'view', $users[$count]->id); ?> </td> <td><?php echo RHtml::decode($apply->content); ?> </td> <td> <?php echo RHtml::linkAction('user', 'Accept', 'processVIP?censorId=' . $apply->id . '&op=0', [], ['class' => 'btn btn-xs btn-success']); ?> <?php echo RHtml::linkAction('user', 'Decline', 'processVIP?censorId=' . $apply->id . '&op=1', [], ['class' => 'btn btn-xs btn-danger']); ?> </td> <?php echo '</tr>'; ++$count; } ?> </tbody> </table> <?php echo isset($pager) ? $pager : ''; ?> <?php
?> </a> </th> </tr> </thead> <tbody> <?php // That's bad to load user names and category names for each group // Need to be fixed. It's better to add "join" support in the database models foreach ($groups as $group) { echo '<tr>'; echo '<td><input name="checked_groups[]" type="checkbox" value="' . $group->id . '" /></td>'; echo "<td>{$group->id}</td>"; echo '<td>' . RHtml::linkAction('user', $group->groupCreator->name, 'view', $group->groupCreator->id) . '</td>'; echo '<td>' . RHtml::linkAction('category', $group->category->name, 'groups', $group->category->id) . '</td>'; echo '<td>' . RHtml::linkAction('group', $group->name, 'detail', $group->id) . '</td>'; echo "<td>{$group->memberCount}</td>"; echo "<td>{$group->createdTime}</td>"; if (isset($group->picture) && $group->picture != '') { $picture = RImage::styleSrc($group->picture, Group::getPicOptions()); echo '<td>' . RHtml::image($picture, $group->name, array("style" => 'width:64px;')) . '</td>'; } else { echo '<td></td>'; } echo $group->counter->totalCount != null ? "<td>" . $group->counter->totalCount . "</td>" : '<td>0</td>'; echo $group->rating->value != null ? "<td>" . $group->rating->value . "</td>" : '<td>0</td>'; echo '</tr>'; } ?> </tbody> </table>
</ul> </li> <li><?php echo RHtml::linkAction('ads', 'Advertisement', 'admin'); ?> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="#">System configurations</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Reports <b class="caret"></b></a> <ul class="dropdown-menu"> <li><?php echo RHtml::linkAction('admin', 'System logs', 'logs'); ?> </li> <li><a href="#">Users accounting</a></li> <li><a href="#">Topics report</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </nav> </div> <div class="row row-offcanvas row-offcanvas-right"> <!--<div class="col-xs-12 col-sm-9"> --> <p class="pull-right visible-xs"> <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>
</h3> </div> <div class="panel-body"> <?php if ($message->type->name == 'system') { echo "From: 系统消息"; } else { $sender = null; if ($message->type->name == "user" || $message->type->name == "private") { $sender = User::get($message->senderId); echo "From: " . RHtml::linkAction('user', $sender->name, 'view', $sender->id); } else { if ($message->type->name == "group") { $sender = Group::get($message->senderId); echo "From: " . RHtml::linkAction('group', $sender->name, 'detail', $sender->id); } else { echo "From: Unknown"; } } } echo ' Delivery time: ' . $message->sendTime; echo ' Status: ' . ($message->status == 0 ? "unread" : "read"); echo "<br/>"; echo '<p>' . RHtml::decode($message->content) . '</p>'; if ($message->status == Message::STATUS_UNREAD && $message->receiverId == Rays::user()->id) { echo RHtml::linkAction('message', "Mark read", 'read', $message->id, array('class' => 'btn btn-sm btn-success')); } ?> </div> </div> </div>
if ($msg->type->name == 'system') { echo "From: 系统消息"; } else { $sender = null; if ($msg->type->name == "user" || $msg->type->name == "private") { $sender = User::get($msg->senderId); if ($sender != null) { echo "From: " . RHtml::linkAction('user', $sender->name, 'view', $sender->id); } else { echo "From: Unknown user"; } } else { if ($msg->type->name == "group") { $sender = Group::get($msg->senderId); if ($sender != null) { echo "From: " . RHtml::linkAction('group', $sender->name, 'detail', $sender->id); } else { echo "From: Unknown group"; } } else { echo "From: Unknown"; } } } echo ' Delivery time: ' . $msg->sendTime; echo ' Status: ' . ($msg->status == 1 ? "unread" : "read"); echo '</div>'; echo '<div class="message-body" messageId="' . $msg->id . '">' . RHtml::decode($msg->content) . '</div>'; echo '</div></div>'; } }
?> </div> <div class="comment-actions"> <?php echo RHtml::linkAction('post', 'Reply', 'view', $commentItem['root']->topicId . '?reply=' . $commentItem['root']->id . '#reply', array('class' => 'btn btn-xs btn-info')); ?> </div> <div class="comment-reply-list"> <?php foreach ($commentItem['reply'] as $reply) { ?> <div class="comment-reply-item"> <?php echo RHtml::linkAction('user', $reply->user->name, 'view', $reply->user->id); ?> <?php echo $reply->createdTime; ?> </div> <div><?php echo RHtml::decode($reply->content); ?> </div> <?php } ?> </div> </div>
<li <?php if ($part == 'likes') { echo 'class="active"'; } ?> ><?php echo RHtml::linkAction('user', 'Favorites', 'view', [$user->id, 'likes']); ?> </li> <li <?php if ($part == 'profile') { echo 'class="active"'; } ?> ><?php echo RHtml::linkAction('user', 'Profile', 'view', [$user->id, 'profile']); ?> </li> </ul> </div> <?php $skip = ['id', 'status', 'picture', 'privacy', 'password', 'credits']; ?> <div class="panel-body"> <?php if ($part == 'profile') { //Profile of a User ?> <ul class="list-group"> <?php foreach (User::$mapping as $objCol => $dbCol) {
<div class="panel panel-default"> <div class="panel-heading"> Follow us </div> <div class="panel-body" style="line-height: 300%;"> <?php echo RHtml::image('public/images/favicon.ico', 'FDUGroup', array('width' => '29px', 'style' => 'border-radius: 20px;margin-left: 2px;margin-right:1px;')); ?> <b><?php echo RHtml::linkAction('site', 'About us', 'about'); ?> </b> <br /> <?php echo RHtml::image('public/images/info.png', 'FDUGroup', array('width' => '32px')); ?> <b><?php echo RHtml::linkAction('site', 'Contact us', 'contact'); ?> </b> <br /> <?php echo RHtml::image("public/images/github.png", "FDUGroup", array('width' => '32px')); ?> <b><a href="https://github.com/Raysmond/FDUGroup"> Follow us on Github</a></b> <br /> </div> </div>