|
@@ -32,11 +32,13 @@ class tpl_group_home
|
|
|
$this->mod_room = Model('room');
|
|
|
$this->room_id = $room_id;
|
|
|
$this->cur_user = intval($user);
|
|
|
+
|
|
|
$room = $this->mod_room->getRoom($room_id);
|
|
|
- if(!empty($room)) $this->room_info = new room_info($room);
|
|
|
- if(empty($this->room_info)){
|
|
|
- throw new Exception("聊天参数有误");
|
|
|
- }
|
|
|
+ if(empty($room)) throw new Exception("房间不存在");
|
|
|
+
|
|
|
+ $this->room_info = new room_info($room);
|
|
|
+ if(empty($this->room_info)) throw new Exception("聊天参数有误");
|
|
|
+
|
|
|
$this->participants = factory::participants($this->room_id);
|
|
|
}
|
|
|
|
|
@@ -44,65 +46,52 @@ class tpl_group_home
|
|
|
{
|
|
|
$html = "";
|
|
|
$url = RESOURCE_SITE_URL. "/mobile/talk/images/cover.png";
|
|
|
- $html .= "
|
|
|
- <div class=\"cover\">
|
|
|
- <img src=\" {$url} \" alt=\"cover\">
|
|
|
- </div>";
|
|
|
+ $html .= "<div class=\"cover\">
|
|
|
+ <img src=\" {$url} \" alt=\"cover\">
|
|
|
+ </div>";
|
|
|
|
|
|
echo $html;
|
|
|
}
|
|
|
|
|
|
public function show_group_header()
|
|
|
{
|
|
|
- $html = '';
|
|
|
- if (!empty($this->room_info))
|
|
|
- {
|
|
|
-
|
|
|
- $name = $this->room_info->has_name();
|
|
|
- if($name){
|
|
|
- $name = $this->room_info->name();
|
|
|
- }else{
|
|
|
- $name = "未命名";
|
|
|
- }
|
|
|
+ if($this->room_info->has_name()){
|
|
|
+ $name = $this->room_info->name();
|
|
|
+ }else{
|
|
|
+ $name = "未命名";
|
|
|
+ }
|
|
|
|
|
|
- $avartar = $this->room_info->avatar();
|
|
|
- $desc = $this->room_info->room_desc();
|
|
|
+ $avartar = $this->room_info->avatar();
|
|
|
+ $desc = $this->room_info->room_desc();
|
|
|
|
|
|
- $html .= "
|
|
|
- <div class=\"group_avatar\">
|
|
|
+ $html = '';
|
|
|
+ $html .= "<div class=\"group_avatar\">
|
|
|
<img src=\"{$avartar}\" class='g_avatar' alt=\"group_avatar\">
|
|
|
- </div>
|
|
|
- <div class=\"group_name\">
|
|
|
+ </div>
|
|
|
+ <div class=\"group_name\">
|
|
|
<h3>{$name}</h3>
|
|
|
<p>{$desc}</p>
|
|
|
- </div>
|
|
|
- <div class='qrcode_btn'></div>
|
|
|
- ";
|
|
|
- }
|
|
|
+ </div>
|
|
|
+ <div class='qrcode_btn'></div>";
|
|
|
echo $html;
|
|
|
}
|
|
|
|
|
|
public function show_group_notice()
|
|
|
{
|
|
|
$html = "";
|
|
|
- if (!empty($this->room_info))
|
|
|
- {
|
|
|
- $notice = $this->room_info->notice();
|
|
|
|
|
|
- if(empty($notice))
|
|
|
- {
|
|
|
- $html.= "
|
|
|
- <div class=\"group_notice_board\" style=\"display: none;\">
|
|
|
- <p class=\"text_overflow\"></p>
|
|
|
- </div>";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- $html.= "
|
|
|
- <div class=\"group_notice_board\">
|
|
|
- <p class=\"text_overflow\">【公告】{$notice}</p>
|
|
|
- </div>";
|
|
|
- }
|
|
|
+ $notice = $this->room_info->notice();
|
|
|
+ if(empty($notice))
|
|
|
+ {
|
|
|
+ $html.= "<div class=\"group_notice_board\" style=\"display: none;\">
|
|
|
+ <p class=\"text_overflow\"></p>
|
|
|
+ </div>";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $html.= "<div class=\"group_notice_board\">
|
|
|
+ <p class=\"text_overflow\">【公告】{$notice}</p>
|
|
|
+ </div>";
|
|
|
}
|
|
|
|
|
|
echo $html;
|
|
@@ -115,6 +104,7 @@ class tpl_group_home
|
|
|
public function show_members()
|
|
|
{
|
|
|
$html = '';
|
|
|
+
|
|
|
if (!empty($this->participants))
|
|
|
{
|
|
|
$i = 1;
|
|
@@ -129,17 +119,16 @@ class tpl_group_home
|
|
|
|
|
|
if($this->isManager($uids))
|
|
|
{
|
|
|
- $head = "
|
|
|
- <img src=\"{$member['avatar']}\" alt=\"\">
|
|
|
- <p>{$member['nickname']}</p>
|
|
|
- <span class=\"admin\">管理员</span>
|
|
|
- </div>";
|
|
|
+ $head = "<img src=\"{$member['avatar']}\" alt=\"\">
|
|
|
+ <p>{$member['nickname']}</p>
|
|
|
+ <span class=\"admin\">管理员</span>
|
|
|
+ </div>";
|
|
|
|
|
|
- $html = $div_head.$head.$html;
|
|
|
+ $html = $div_head . $head . $html;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- $html .=$div_head;
|
|
|
+ $html .= $div_head;
|
|
|
$html .= "
|
|
|
<img src=\"{$member['avatar']}\" alt=\"\">
|
|
|
<p>{$member['nickname']}</p>
|
|
@@ -148,7 +137,6 @@ class tpl_group_home
|
|
|
|
|
|
$i++;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
if (isset($this->participants[$this->cur_user]))
|
|
@@ -171,61 +159,56 @@ class tpl_group_home
|
|
|
{
|
|
|
$html = "";
|
|
|
|
|
|
- if (!empty($this->room_info))
|
|
|
- {
|
|
|
- $avartar = $this->room_info->avatar();
|
|
|
- $name = $this->room_info->has_name();
|
|
|
- if($name){
|
|
|
- $name = $this->room_info->name();
|
|
|
- }else{
|
|
|
- $name = "未命名";
|
|
|
- }
|
|
|
-
|
|
|
- $notice = empty($this->room_info->notice()) ? "未设置" : "已设置";
|
|
|
- $desc = empty($this->room_info->room_desc()) ? "未设置" : "已设置";
|
|
|
- $level = $this->room_info->level() == 0 ? "未认证" : "已认证";
|
|
|
-
|
|
|
- $html .= "
|
|
|
- <a class=\"weui-cell weui-cell_access\" id='edit_group_name' href=\"javascript:;\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群名称</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\">{$name}</div>
|
|
|
- </a>
|
|
|
-
|
|
|
- <a class=\"weui-cell weui-cell_access\" id=\"edit_group_avatar\" href=\"javascript:;\" onclick='uploader.click()'>
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群头像</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\">
|
|
|
- <img src='{$avartar}' class='g_avatar' alt=''>
|
|
|
- <input type='file' name='file' enctype='multipart/form-data' id='uploader' style=\"display: none;\">
|
|
|
- </div>
|
|
|
- </a>
|
|
|
-
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>企业认证</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\">{$level}</div>
|
|
|
- </a>";
|
|
|
+ if($this->room_info->has_name()){
|
|
|
+ $name = $this->room_info->name();
|
|
|
+ }else{
|
|
|
+ $name = "未命名";
|
|
|
}
|
|
|
+ $avartar = $this->room_info->avatar();
|
|
|
+ $notice = empty($this->room_info->notice()) ? "未设置" : "已设置";
|
|
|
+ $desc = empty($this->room_info->room_desc()) ? "未设置" : "已设置";
|
|
|
+ $level = $this->room_info->level() == 0 ? "未认证" : "已认证";
|
|
|
+
|
|
|
+ $html .= "<a class=\"weui-cell weui-cell_access\" id='edit_group_name' href=\"javascript:;\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群名称</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$name}</div>
|
|
|
+ </a>
|
|
|
+
|
|
|
+ <a class=\"weui-cell weui-cell_access\" id=\"edit_group_avatar\" href=\"javascript:;\" onclick='uploader.click()'>
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群头像</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">
|
|
|
+ <img src='{$avartar}' class='g_avatar' alt=''>
|
|
|
+ <input type='file' name='file' enctype='multipart/form-data' id='uploader' style=\"display: none;\">
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+
|
|
|
+ <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>企业认证</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\">{$level}</div>
|
|
|
+ </a>";
|
|
|
|
|
|
if($this->isManager($this->cur_user))
|
|
|
{
|
|
|
- $html .= "<a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_notice\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群公告</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\" id=\"room-notice-btn\">{$notice}</div>
|
|
|
- </a>
|
|
|
- <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_desc\">
|
|
|
- <div class=\"weui-cell__bd\">
|
|
|
- <p>群介绍</p>
|
|
|
- </div>
|
|
|
- <div class=\"weui-cell__ft\" id=\"room-desc-btn\">{$desc}</div>
|
|
|
- </a>";
|
|
|
+ $html .= "<a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_notice\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群公告</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\" id=\"room-notice-btn\">{$notice}</div>
|
|
|
+ </a>
|
|
|
+ <a class=\"weui-cell weui-cell_access\" href=\"javascript:;\" id=\"edit_room_desc\">
|
|
|
+ <div class=\"weui-cell__bd\">
|
|
|
+ <p>群介绍</p>
|
|
|
+ </div>
|
|
|
+ <div class=\"weui-cell__ft\" id=\"room-desc-btn\">{$desc}</div>
|
|
|
+ </a>";
|
|
|
}
|
|
|
+
|
|
|
echo $html;
|
|
|
}
|
|
|
|
|
@@ -285,39 +268,34 @@ class tpl_group_home
|
|
|
|
|
|
public function show_qrcode()
|
|
|
{
|
|
|
- $html = "";
|
|
|
- if(!empty($this->room_info))
|
|
|
- {
|
|
|
- $name = $this->room_info->name();
|
|
|
- $avatar = $this->room_info->avatar();
|
|
|
- $desc = $this->room_info->room_desc();
|
|
|
+ $name = $this->room_info->name();
|
|
|
+ $avatar = $this->room_info->avatar();
|
|
|
+ $desc = $this->room_info->room_desc();
|
|
|
|
|
|
- $url = url_helper::room_invite_url($this->room_id,$this->cur_user);
|
|
|
- $save_path = BASE_UPLOAD_PATH."/room/qrcodes/{$this->room_id}_{$this->cur_user}.png";
|
|
|
+ $url = url_helper::room_invite_url($this->room_id,$this->cur_user);
|
|
|
+ $save_path = BASE_UPLOAD_PATH."/room/qrcodes/{$this->room_id}_{$this->cur_user}.png";
|
|
|
|
|
|
- if(!file_exists($save_path)) {
|
|
|
- util::qrcode_path($url, $save_path);
|
|
|
- }
|
|
|
-
|
|
|
- $qrcode_path = BASE_SITE_URL."/data/upload/room/qrcodes/{$this->room_id}_{$this->cur_user}.png";
|
|
|
+ if(!file_exists($save_path)) {
|
|
|
+ util::qrcode_path($url, $save_path);
|
|
|
+ }
|
|
|
|
|
|
- $html = "<div class=\"qrcode\">
|
|
|
- <div class=\"qrcode_info\">
|
|
|
- <img src=\"$avatar\" class=\"qrcode_avatar_img\" alt=\"\">
|
|
|
- <div class=\"group_name\">
|
|
|
- <p>$name</p>
|
|
|
- <p>$desc</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class=\"group_qrcode\">
|
|
|
- <img src=\"$qrcode_path\" alt=\"\">
|
|
|
+ $qrcode_path = BASE_SITE_URL."/data/upload/room/qrcodes/{$this->room_id}_{$this->cur_user}.png";
|
|
|
+ $html = "<div class=\"qrcode\">
|
|
|
+ <div class=\"qrcode_info\">
|
|
|
+ <img src=\"{$avatar}\" class=\"qrcode_avatar_img\" alt=\"\">
|
|
|
+ <div class=\"group_name\">
|
|
|
+ <p>{$name}</p>
|
|
|
+ <p>{$desc}</p>
|
|
|
</div>
|
|
|
- <p class=\"prompt\">
|
|
|
- 扫一扫上面的二维码图案。加入群聊
|
|
|
- </p>
|
|
|
- <span class=\"close_btn\"></span>
|
|
|
- </div>";
|
|
|
- }
|
|
|
+ </div>
|
|
|
+ <div class=\"group_qrcode\">
|
|
|
+ <img src=\"{$qrcode_path}\" alt=\"\">
|
|
|
+ </div>
|
|
|
+ <p class=\"prompt\">
|
|
|
+ 扫一扫上面的二维码图案。加入群聊
|
|
|
+ </p>
|
|
|
+ <span class=\"close_btn\"></span>
|
|
|
+ </div>";
|
|
|
|
|
|
echo $html;
|
|
|
}
|