Thread Letzte 10 Zeilen einer Textdatei ausgeben (73 answers)
Opened by TrioxX at 2006-12-03 12:20

Gast Gast
 2006-12-06 11:59
#9282 #9282
Danke.

Vllt. hilft dir ja das hier schon, ohne dich durchs System wurschteln zu müssen:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package Plugins::TextCommands;
use strict;

return bless({
command_handlers => {
'renee' => \&renee_handler,
},
});

sub custom_handler
{
my($self,$main,$command,$text) = @_;

my @ret=();

if ($text ne '')
{
my $output = $main->createOutput(

{

template => $command,

name => $main->{current_user}{name},

nick => $main->{current_user}{nick},

color => $main->{current_user}{color},

text => $main->toHTML($text),

});
$output->restrictToCurrentRoom;
push @ret,$output;
}

return \@ret;
}


Das wäre die *pm für einen /renee Befehl. Dieser würde das Template messages/renee.html aufrufen, wo ich bsp. folgendes machen würde:

Code: (dl )
<font color="{GET|$params.color}"><i>&lt;<a href="javascript:void(0)" onfocus="resetFocus()" onclick="{IF|$params.name ne $current_user.name}{IF|$current_user.popup_privatemsg}writePrivateMsg('{GET_ESCAPED|$params.name}','{GET_ESCAPED|$params.nick}','');{ELSE}insertText('/msg {GET_JS|$params.nick} ');{ENDIF}{ENDIF}return false;" style="color:{GET|$params.color}">{GET|$params.nick}</a> {DOFILTER|links|formatting|smileys|smileyshide}{GET|$params.text}{ENDDO}&gt;</i></font><br> 


Die $params werden wie man sieht, innerhalb der *pm gesetzt.

View full thread Letzte 10 Zeilen einer Textdatei ausgeben