Kommentar intern erstellen
Posted: Mon Sep 22, 2008 2:58 pm
Hi
Um einen Text zu formatieren nutzt das existierende Livecomment-Plugin das frontend_display-event. In Kombination mit jquery sähe das so aus:
Aufruf im Javascript:In der PHP: Steht im Kommentareingabefeld also *abc* wird <strong>abc</strong> daraus gemacht, wenn das s9y-markup-plugin aktiviert ist.
Nun wäre es ziemlich praktisch, wenn nicht nur das innere des Kommentars ausgegeben würde, sondern ein ganzer Kommentarblock. Also einKann man das irgendwie bewerkstelligen? Ohne Hilfestellung komme ich auf diesem Weg nicht weiter.
Gruß
Um einen Text zu formatieren nutzt das existierende Livecomment-Plugin das frontend_display-event. In Kombination mit jquery sähe das so aus:
Aufruf im Javascript:
Code: Select all
$.post(lcbase, 'data='+$('#serendipity_commentform_comment').val(), function(text){
alert(text);
},'html')Code: Select all
case 'external_plugin':
if ($eventData == 'livecomment') {
$data = array('comment' => $_REQUEST['data']);
serendipity_plugin_api::hook_event('frontend_display', $data);
echo $data['comment'];
} Nun wäre es ziemlich praktisch, wenn nicht nur das innere des Kommentars ausgegeben würde, sondern ein ganzer Kommentarblock. Also ein
Code: Select all
<div id="serendipity_comment_" class="serendipity_comment serendipity_comment_author_unknown comment_oddbox" style="padding-left: 40px">
<div class="serendipity_commentBody">
<strong>abc</strong>
</div>
<div class="serendipity_comment_source">
...Gruß