I have function in my plugin that is:
add_filter('comment_text', 'commentimage_comment_text');
function commentimage_comment_text($comment = '') {
$options = get_option('commentimage');
$id = get_comment_ID();
$images = $options['images'];
if (!isset($images) || !is_numeric($images)) $images = 1;
$url = get_option('siteurl');
for ($i=0; $i<$images; $i++) {
if (file_exists(ABSPATH . 'wp-content/comment-image/' . $id . ($i==0?'':('-'.$i)) . '-tn.jpg')) {
$comment .= '<p><a href="' . $url . '/wp-content/comment-image/' . commentimage_find_original($id, $i) . '"><img src="' . $url . '/wp-content/comment-image/' . $id . ($i==0?'':('-'.$i)) . '-tn.jpg"/></a></p>';
}
}
return $comment;
}
Now it is showing a successful image uploaded by my viewers. I want my viewers to have the option of rating them, so for that I write in my plugin just below the above line the following code:
add_filter('comment_text', 'commentimage_comment_text2');
function commentimage_comment_text2()
{
$rtt= "<br>Rating";
return $rtt;
}
Then my pictures are gone and it shows text rating - I will change the text rating to my desired needs once I get the answer on how to overcome over writing.