/** * LazyestCommentor::comments_pagenum_link() * * @param mixed $result * @return */ function comments_pagenum_link($result) { global $lg_gallery; if ($lg_gallery->is_gallery()) { $folder = new LazyestFolder($lg_gallery->currentdir); $cansave = '' != $lg_gallery->currentdir ? $folder->valid() && $folder->can_save() : true; if ($cansave) { $lgresult = $lg_gallery->uri() . $lg_gallery->file; $comment_pos = strpos($result, 'comment-page-'); if ($comment_pos !== false) { $lgresult .= substr($result, $comment_pos); } else { $lgresult .= '#comments'; } return $lgresult; } unset($folder); } return $result; }