Would be helpful if you could say which problem do you have ?
Otherwise what i can see in your Plugin , you should change
PHP Code:
len = format(motd, 1500,"<body bgcolor=#000000><font color=#87cefa><pre>");
to
PHP Code:
len += format(motd[len], 1500,"<body bgcolor=#000000><font color=#87cefa><pre>");
and to put </body>
PHP Code:
len += format(motd[len], 1500,"</body>");