コメントの返事(ようつべ)

このコミットが含まれているのは:
テクニカル諏訪子 2020-12-29 22:01:06 +09:00
コミット 47f9f76da1
2個のファイルの変更39行の追加3行の削除

ファイルの表示

@ -88,7 +88,20 @@ class Prayer {
$g->comment->channel = $g->snippet->topLevelComment->snippet->authorChannelUrl;
$g->comment->icon = $g->snippet->topLevelComment->snippet->authorProfileImageUrl;
$g->comment->created = date('Y年m月d日 H:i:s', strtotime($g->snippet->topLevelComment->snippet->publishedAt));
$g->comment->message = $g->snippet->topLevelComment->snippet->textDisplay;
$g->comment->message = strip_tags($g->snippet->topLevelComment->snippet->textDisplay, array('<br />'));
$g->comment->replyCount = (isset($g->snippet->totalReplyCount) ? $g->snippet->totalReplyCount : 0);
if (isset($g->replies)) {
$g->comment->replies = array();
foreach ($g->replies->comments as $k => $c) {
$g->comment->replies[$k]['id'] = $c->id;
$g->comment->replies[$k]['name'] = $c->snippet->authorDisplayName;
$g->comment->replies[$k]['channel'] = $c->snippet->authorChannelUrl;
$g->comment->replies[$k]['icon'] = $c->snippet->authorProfileImageUrl;
$g->comment->replies[$k]['created'] = date('Y年m月d日 H:i:s', strtotime($c->snippet->publishedAt));
$g->comment->replies[$k]['message'] = strip_tags($c->snippet->textDisplay, array('<br />'));
}
}
$come[] = $g->comment;
}

ファイルの表示

@ -20,10 +20,33 @@
</cite> <span class="says">より:</span>
<span class="comment-meta commentmetadata"> <a :href="`/blog/${slug}#comment-${c.id}`">{{ c.created }}</a></span>
</div>
<p style="white-space: pre-wrap;">{{ c.message }}</p>
<div class="reply">返信</div>
<p style="white-space: pre-wrap; word-wrap: break-word; width: 500px;" v-html="c.message"></p>
<div class="reply">返信{{ c.replyCount }}</div>
</div>
</li>
<span v-if="c.replies">
<ul class="commentlist" v-for="(r, j) in c.replies" :key="`comment-${i}-reply-${j}`">
<li class="comment even thread-even depth-2" :id="`li-comment-${r.id}`">
<div class="commentnumber">{{ i+1 }}/{{ j+1 }}</div>
<div :id="`comment-${r.id}`">
<div>
<cite class="fn">
<span v-if="isvideo === 'n'">
<img style="height: 24px;" :src="r.icon" :alt="`${r.name}さんのアイコン`">
<a :href="r.channel">{{ (r.name || '名無しのテクニシャン') }}</a>
</span>
<span v-else>
<span v-if="r.user_id"><a :href="`/profile/${r.user_id}`" :style="r.showcol"><img style="width: 24px; height: 24px;" :src="r.avatar" :alt="`${r.showname}さんのアイコン`"> {{ r.showname }}</a></span>
<span v-else>{{ (r.name || '名無しのテクニシャン') }}</span>
</span>
</cite> <span class="says">より:</span>
<span class="comment-meta commentmetadata"> <a :href="`/blog/${slug}#comment-${r.id}`">{{ r.created }}</a></span>
</div>
<p style="white-space: pre-wrap; word-wrap: break-word; width: 500px;" v-html="r.message"></p>
</div>
</li>
</ul>
</span>
</ul>
</span>
<span v-if="isvideo !== 'n'">