Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Tue May 11, 2010 12:45 pm   

[3.17] Bug: HTML logging no bg color or 'default' font color.
 
When HTML logging it doesn't initially write the body information for the background color or the default text color, causing them to fall back on the default browser colors a simple

<body bgcolor='#000000' text='#999999'>

or rather
<body bgcolor='#(html color for background) text='#(html color for default text)'>


at the top of the HTML file will allow practically all browsers to recognise it and color the default background colors (black in cmud?) and default text color (grey) correctly in html logs
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue May 11, 2010 2:11 pm   
 
Already noted with my own post regarding this. It's that defaults are not kicking out ansi values now. Zugg gave a workaround, saying to change the default colors. This is about the only thing you can do for now.

He did say the reason is most likely the change he made for the #SAY command (there was a bug where the first ansi wasn't recognized in #SAY). Not sure how much can be done for it, though.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue May 11, 2010 4:58 pm   
 
That is actually done on purpose to allow people to post the HTML within another web page. If CMUD added the BODY and HTML tags, then people would complain when they tried to post their log snippet into a blog or other site. So it's a no-win situation.
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Tue May 11, 2010 7:05 pm   
 
Make it an option!

*flees in terror*
_________________
Unwritten Legends
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue May 11, 2010 7:31 pm   
 
Oh, hah, I misread the question! Pfft. I should stop making posts when I first wake up. :\

Alternatively, if you want to, you can force it to write the information before logging using #FILE and #WRITE.

Charneus
Reply with quote
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Fri May 14, 2010 8:31 pm   
 
Well it could just write an

</body>

when closing log?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri May 14, 2010 9:15 pm   
 
Writing a /body doesn't work for people who want to append to existing log files to add more data. As charneus mentioned, you can always write to the log file yourself using #WRITELOG.

While I might add an option in the future for outputting the HTML and BODY tags, this is low on the priority list since it is easily achieved within your own scripts.
Reply with quote
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Fri May 14, 2010 9:20 pm   
 
Í don't see a writelog function, I made a #Write to do the job for now though
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Fri May 14, 2010 10:24 pm   
 
Here are two aliases I use if anyone wants to use them.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="newHtmlLog" copy="yes">
    <value><![CDATA[// Stop any previous log
#if (@htmlLogging) {stopHtmlLog} {#log off}
// Get title information
$title = %concat( %char, " ", %time( mm/dd/yyyy_hh:nn:ss))
$temp = %replace($title," ","")
$temp = %replace($temp,":","")
$temp = %replace($temp,"/","")
$temp = %replace($temp,"_","")
fileName = %concat($temp,".html")
$title = %replace($title, "_", " ")
// Write HTML to file
#file 1 @fileName
#write 1 {<!DOCTYPE html PUBLIC ~"-//W3C//DTD XHTML 1.0 Transitional//EN~" ~"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd~">}
#write 1 {<html xmlns=~"http://www.w3.org/1999/xhtml~">}
#write 1 {<head>}
#write 1 {<meta http-equiv=~"Content-Type~" content=~"text/html; charset=utf-8~" />}
#write 1 {<title>$title</title>}
#write 1 {<style type=~"text/css~">}
#write 1 {<!--}
#write 1 {body ~{}
#write 1 {      background-color: #000000;}
#write 1 {      font-family: Consolas;}
#write 1 {      color: #CCCCCC;}
#write 1 {~}}
#write 1 {-->}
#write 1 {</style>}
#write 1 {</head>}
#write 1 {}
#write 1 {<body>}
#close 1
// Begin logging
#log @filename
htmlLogging = 1]]></value>
  </alias>
</cmud>


Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="stopHtmlLog" copy="yes">
    <value><![CDATA[// Stop logging
#log off
htmlLogging = 0
// Append HTML closing tags to log
#file 1 @fileName
#write 1 {</body>}
#write 1 {</html>}
#close 1]]></value>
  </alias>
</cmud>


I just place them in onConnect and onDisconnect events or start and stop logs manually when I want.

Edit: Hmm okay well the second alias it refuses to put in the "<![CDATA[]]>" so I had to add it.

Edit: Sorry after I posted this I noticed a better way to do something and updated it.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sat May 15, 2010 12:09 am   
 
#WRITELOG is in the Beta but not in the documentation yet.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat May 15, 2010 8:17 am   
 
#writelog doesn't work by the way. It adds a line break to every line and screws up the HTML tags and CSS.

Example:
Code:
<style type="text/css"><br/>
<!--<br/>
body {<br/>
      background-color: #000000;<br/>
      font-family: Consolas;<br/>
      color: #C0C0C0;<br/>
}<br/>
--><br/>
</style><br/>
</head><br/>
<br/>
<body><br/>
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 17, 2010 5:05 pm   
 
Yes, you are correct that #WRITELOG adds a line break...because it was intended to write a line to the log file during normal logging, and in that case you want the BR added. I'll have to think about how I want to handle this.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net