/** * 获取评论类型信息 * @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; }
public function message_like_pic($rt, $pid, $uid) { try { if (!is_array($rt)) { lib()->load('Picture'); $pic = new Picture(); $rt = $pic->get_simple_pic($pid); } if (!isset($rt['pic_id']) || $rt['user_id'] == $uid || !$this->notice($rt['user_id'], 'message', 'like_pic')) { return $rt; } $user = User::getUser($rt['user_id']); $like_user = User::getUser($uid); $mt = new MailTemplate("message_notice/like_picture.md"); $mt->setUserInfo($user->getInfo()); $mt->setValues(['like_user_name' => $like_user->getAliases(), 'picture_name' => $rt['pic_name'] ?: "Number " . $pid, 'like_user_url' => user_link($like_user->getName()), 'picture_display_url' => $rt['pic_display_url'], 'picture_page' => picture_link($pid), 'like_count' => $rt['pic_like_count']]); $this->message->addNoticeMsg($mt->getTitle(), $mt->getContent(), $user->getId()); } catch (\Exception $ex) { Log::write(_("NoticeApply message_like_pic create a Exception.") . "EX:[" . $ex->getCode() . "]:" . $ex->getMessage(), Log::NOTICE); } return $rt; }
<a title="第 <?php echo $__info['previous_id']; ?> 号图片" href="<?php echo picture_link($__info['previous_id']); ?> ">←上一张</a></li> <?php } if ($__info['next_id'] > $__info['pic_id']) { ?> <li class="next"><a title="第 <?php echo $__info['next_id']; ?> 号图片" href="<?php echo picture_link($__info['next_id']); ?> ">下一张→</a> </li> <?php } ?> </ul> <?php display_comment($__CommentData); ?> </div> <script> $(function () { $(".single .like_picture").click(function () { var s_o = this;
<?php /** * @var array $__list */ foreach ($__list as $data) { if (empty($data)) { continue; } ?> <div id="Pic_edit_<?php echo $data['pic_id']; ?> " class="pic_edit_list row"> <div class="thumbnail_img col-md-5"> <a href="<?php echo picture_link($data['pic_id']); ?> "><img class="thumbnail" src="<?php echo $data['pic_thumbnails_url']; ?> " alt="thumbnail"></a> <p class="well well-sm"> <span class="label label-danger">ID:<?php echo $data['pic_id']; ?> </span> <a class="label label-primary" href="<?php echo $data['pic_display_url']; ?> ">默认图</a>
"></li> <?php } ?> </ol> <div class="carousel-inner"> <?php for ($i = 0, $l = count($__info['gallery_pictures']); $i < $l; $i++) { ?> <div class="item<?php echo $i === 0 ? " active" : ""; ?> "> <div class="text-center"> <a href="<?php echo picture_link($__info['gallery_pictures'][$i]['pic_id']); ?> "> <img src="<?php echo $__info['gallery_pictures'][$i]['pic_display_url']; ?> " alt="<?php echo $__info['gallery_pictures'][$i]['pic_description']; ?> "> </a> </div> <div class="carousel-caption"> <p><?php echo $__info['gallery_pictures'][$i]['pic_description'];
echo $v['pic_description']; ?> </span></p> <p>状态:<span class="text-info"><?php echo $status[$v['pic_status']]; ?> </span> 评论数:<span class="text-info"><?php echo $v['pic_comment_count']; ?> </span></p> <p>查看图片:<?php $link = picture_link($v['pic_id']); ?> <a href="<?php echo $link; ?> "><?php echo $link; ?> </a></p> <p>创建时间:<span class="text-info"><?php echo $v['pic_create_time']; ?> </span> 标签:<?php if (count($v['pic_tags']) > 0) { echo "<span class='label label-info'>", implode("</span><span class='label label-info'>", $v['pic_tags']), "</span>";
<div class="picture clearfix"> <?php $i = 0; foreach ($__pic_list as $v) { ++$i; ?> <a class="<?php if ($i > 6) { echo "hidden-xs "; } if ($i > 8) { echo "hidden-sm"; } ?> " href="<?php echo picture_link($v['pic_id']); ?> " title="<?php echo mb_substr($v['pic_description'], 0, 20, "UTF-8"); ?> "> <img src="<?php echo $v['pic_thumbnails_url']; ?> " alt="<?php echo $v['pic_description']; ?> "></a> <?php
/** * @param array $list */ public function setServer($list) { if (isset($list[$this->server])) { $s =& $list[$this->server]; foreach ($this->info as &$v) { $v['pic_url'] = $s['url'] . $v['pic_path']; $v['thumbnail_url'] = Feed::getPicOfPath($s['url'], $v['thumbnail'], $v['pic_url']); $v['display_url'] = Feed::getPicOfPath($s['url'], $v['display'], $v['pic_url']); $v['link'] = picture_link($v['id']); } } }