/** * 发送消息给关注图集的用户 * @param null $rt 返回参数,此处为空 * @param int $gid 图集ID * @param int $g_uid 图集用户ID * @param int $uid 关注的用户ID * @param string[] $data 图集数据 * @return null */ public function message_follow_gallery($rt, $gid, $g_uid, $uid, $data) { try { if ($this->notice($g_uid, 'message', 'follow_gallery')) { $user = User::getUser($uid); $follow_user = User::getUser($g_uid); $mt = new MailTemplate("message_notice/follow_gallery.md"); $mt->setUserInfo($follow_user->getInfo()); if ($gid != $data['gallery_id']) { $data = []; } $mt->setValues(array_merge($data, ['follow_user_aliases' => $user->getAliases(), 'follow_user_url' => user_link($user->getName()), 'follow_user_name' => $user->getName(), 'gallery_page_url' => gallery_link($gid)])); $this->message->addNoticeMsg($mt->getTitle(), $mt->getContent(), $g_uid); } } catch (\Exception $ex) { Log::write(_("NoticeApply message_follow_gallery create a Exception.") . "EX:[" . $ex->getCode() . "]:" . $ex->getMessage(), Log::NOTICE); } return $rt; }
$follow = $v['follow']; ?> <tr id="Follow_tr_<?php echo $follow['gallery_id']; ?> "> <td style="width: 40px"> <img src="<?php echo $user->getAvatar(40); ?> " width="40" height="40"> </td> <td> <div> <p>图集标题:<a rel="external" href="<?php echo gallery_link($follow['gallery_id']); ?> "><?php echo $follow['gallery_title']; ?> </a> <?php if ($follow['gallery_front_cover'] > 0) { ?> 【<a title="查看封面" href="#" onclick="return view_front_cover(<?php echo $follow['gallery_front_cover']; ?> )" class="glyphicon glyphicon-eye-open"></a>】 <?php } ?>
function show_path($dir) { echo '<a href="?gallery=/" title="Index">Index</a>'; $link = ''; $full_path = ''; if ($dir != '') { $path = explode('/', $dir); foreach ($path as $step) { $link .= $step . '/'; // last step, assemble and apply gallery_link $full_path .= ' / <a href="?gallery=' . link_safe(gallery_link($link)) . '" title="' . link_safe($step) . '">' . html_safe($step) . '</a>'; } } echo $full_path; }
?> </td> <td><?php echo $v['gallery_comment_count']; ?> </td> <td><?php echo $v['gallery_like_count']; ?> </td> <td><?php echo $v['gallery_status'] ? "已发布" : "草稿"; ?> </td> <td><a href="<?php echo gallery_link($v['gallery_id']); ?> " class="glyphicon glyphicon-eye-open"></a></td> <td class="text-right"><input type="checkbox" name="gallery_id_checked[]" value="<?php echo $v['gallery_id']; ?> "></td> </tr> <?php } ?> </tbody> </table> <script> $(function () { $("input[name='check_all']").click(function () {
?> " href="<?php echo gallery_link($__info['previous_and_next']['previous']['id']); ?> ">← 上一个图集</a></li> <?php } if ($__info['previous_and_next']['next']['id'] > 0 && $__info['previous_and_next']['next']['id'] > $__info['gallery_id']) { ?> <li class="next"><a title="<?php echo $__info['previous_and_next']['next']['gallery_title']; ?> " href="<?php echo gallery_link($__info['previous_and_next']['next']['id']); ?> ">下一个图集 →</a></li> <?php } ?> </ul> <?php } display_comment($__CommentData); ?> </div> <script> $(function () { $(".follow_gallery").click(function () { $.post("<?php
<form method="post" action="<?php echo get_url("UserApi", "gallery_edit_info"); ?> "> <div class="row"> <div class="col-md-8"> <div class="form-group"> <label class="control-label sr-only" for="InputTitle">标题</label> <input type="text" name="gallery_title" class="form-control input-lg" placeholder="一个个性的标题" id="InputTitle" value="<?php echo $__info['gallery_title']; ?> "> <p class="help-block">固定连接:<?php $link = gallery_link($__info['gallery_id']); ?> <a href="<?php echo $link; ?> " rel="external"><?php echo $link; ?> </a></p> </div> <div class="form-group"> <label for="InputDescription" class="control-label">简易的描述: <small class="text-warning">仅支持纯文本</small> </label> <textarea class="form-control" placeholder="简要的描述" rows="3" id="InputDescription"
/** * 获取评论类型信息 * @param string $type * @param int|int[] $id * @return array|false */ public function getCommentTypeInfo($type, $id) { if (!isset($this->type_list[$type])) { return false; } $rt = []; switch ($type) { case 'pictures': $s = $this->db->select("pictures", ['id', 'pic_name', 'users_id'], ['id' => $id]); if (isset($s[0]['users_id'])) { foreach ($s as $v) { $i = []; $i['title'] = ($v['pic_name'] ?: _("Number of ") . $v['id']) . " [" . _("PICTURE") . "]"; $i['link'] = picture_link($v['id']); $i['user_id'] = $v['users_id']; $rt[$v['id']] = $i; } } break; case 'gallery': $s = $this->db->select("gallery", ['id', 'gallery_title', 'users_id'], ['id' => $id]); if (isset($s[0]['users_id'])) { foreach ($s as $v) { $i = []; $i['title'] = $v['gallery_title'] . " [" . _("GALLERY") . "]"; $i['link'] = gallery_link($v['id']); $i['user_id'] = $v['users_id']; $rt[$v['id']] = $i; } } break; case 'posts': $s = $this->db->select("posts", ['id', 'post_title', 'post_name', 'users_id'], ['id' => $id]); if (isset($s[0]['users_id'])) { foreach ($s as $v) { $i = []; $i['title'] = $v['post_title'] . " [" . _("POST") . "]"; $i['link'] = post_link($v['post_name']); $i['user_id'] = $v['users_id']; $rt[$v['id']] = $i; } } break; default: return false; } if (!is_array($id)) { $rt = reset($rt); if (empty($rt['title'])) { Log::write(_("Comment get type data error.")); return false; } } else { if (($v = reset($id)) === false || !isset($rt[$id[$v]]['user_id'])) { return false; } } return $rt; }
<?php } ?> </div> </div> <div id="H-Gallery"> <div class="row"> <?php $i = 0; foreach ($__gallery_list as $v) { ++$i; ?> <div class="col-sm-3"> <div class="thumbnail"> <a href="<?php echo $link = gallery_link($v['gallery_id']); ?> "> <img src="<?php echo $v['pic_thumbnails_url']; ?> " alt="<?php echo $v['pic_description']; ?> "></a> <h4><a href="<?php echo $link; ?> "><?php echo $v['gallery_title'];
?> </div> <?php if (isset($list['folder']) && sizeof($list['folder']) !== 0) { ?> <div class="gallery_list"> <h3><?php echo $messages['subgalleries']; ?> </h3> <?php // show link to images foreach ($list['folder'] as $fol) { // test to avoid one more slash $path = $subdir == '' ? $fol : $subdir . '/' . $fol; echo '<a href="?gallery=' . gallery_link($path) . '" title="' . link_safe($fol) . '">' . '<div class="thumb" style="background-image: url("' . link_safe($dir . '/' . $fol . '/' . get_thumbnail($dir . '/' . $fol)) . '");">' . '<div class="text">' . html_safe($fol) . '</div></div></a>' . "\n"; } ?> <br clear="all" /> </div> <?php } ?> <div class="footer"> <?php // display the comment only if there's a gallery if (isset($list['picture']) && sizeof($list['picture']) !== 0) { ?> <span class="white"><?php echo $messages['keyboards_shortcuts']; ?>
/** * 获取对应的信息,用于解析 * @return array */ public function getInfo() { return ['title' => $this->title, 'desc' => $this->desc, 'front_cover' => $this->front_cover, 's_uid' => (int) $this->s_uid, 'o_uid' => (int) $this->o_uid, 'time' => $this->time, 'gid' => $this->gid, 'action' => $this->getAction(), 'link' => gallery_link($this->gid)]; }