function cp_admin_logs_desc_comment($type, $uid, $points, $data) { if ($type != 'comment') { return; } $cdata = get_comment($data); if ($cdata == null) { echo '<span title="' . __('Comment removed', 'cp') . '...">' . __('Comment', 'cp') . '</span>'; return; } $pid = $cdata->comment_post_ID; $pdata = get_post($pid); $ptitle = $pdata->post_title; $url = get_permalink($pid) . '#comment-' . $data; $detail = __('Comment', 'cp') . ': ' . cp_truncate(strip_tags($cdata->comment_content), 100, false); echo '<span title="' . $detail . '">' . __('Comment on', 'cp') . ' "<a href="' . $url . '">' . $ptitle . '</a>"</span>'; }
function cp_admin_logs_desc_post_author_points($type, $uid, $points, $data) { if ($type != 'post_comment') { return; } $cdata = get_comment($data); $pid = $cdata->comment_post_ID; $pdata = get_post($pid); $ptitle = $pdata->post_title; $url = get_permalink($pid) . '#comment-' . $data; $detail = __('Comment', 'cp') . ': ' . cp_truncate(strip_tags($cdata->comment_content), 100, false); if ($cdata->user_id != '0') { $commenter = '"<a href="' . get_author_posts_url($cdata->user_id) . '">' . get_the_author_meta('display_name', $cdata->user_id) . '</a>"'; } else { $commenter = 'Someone'; } echo '<span title="' . $detail . '">' . $commenter . ' ' . __('posted a comment on your post', 'cp') . ' "<a href="' . $url . '">' . $ptitle . '</a>"</span>'; }