Right. Piano. Because that's what we used to kill that big demon that one time. No, wait. That was a rocket launcher.

Xander ,'Touched'


Buffistas Building a Better Board  

Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.

To-do list


John H - Nov 27, 2002 10:32:11 pm PST #1743 of 10000

I've turned the whole thing into a function in this iteration by the way, so that you can just go

$results = array();

$results = parse_html($formcontent);

so what more do I need to do to make it OO?

I do

class Parser {

 function parse_html(){
  [code code code]
 }
}

then call on it with

$sweetLumpyParsingMinion = new Parser;
$sweetLumpyParsingMinion->parse_html($post);

or something like that?

If I only have one function, it seems like overkill.


§ ita § - Nov 27, 2002 10:38:24 pm PST #1744 of 10000
Well not canonically, no, but this is transformative fiction.

The structure for the code to date is that if there's no associated data structure, the function just goes in a general file. However, this will be applied to posts, right? So it would be a method of the post class.


Rob - Nov 27, 2002 10:39:21 pm PST #1745 of 10000

If I only have one function, it seems like overkill.

Yep. Unless you're using global variables for state. In that case, a class is better style, since you can store the state as member variables.

Also, on edit, do what ita said. Although I wonder if it's worthwhile to keep it as a separate class/function, in order to keep the post class from growing too complex.


John H - Nov 27, 2002 10:42:27 pm PST #1746 of 10000

Aha, that makes more sense. [edit: ita that is, not that Rob didn't make sense too...] So you can just bung it in with all the other functions and call it.

I don't know what my block is with the OO thing. I just don't see it in my head.


Rob - Nov 27, 2002 10:53:37 pm PST #1747 of 10000

I owe John: 1 proselytizing message on OOP.


Noumenon - Nov 28, 2002 12:10:36 am PST #1748 of 10000
No other candidate is asking the hard questions, like "Did geophysicists assassinate Jim Henson?" or "Why is there hydrogen in America's water supply?" --defective yeti

Did you just give him an OOP FYI I.O.U.?


Jon B. - Nov 28, 2002 2:03:08 am PST #1749 of 10000
A turkey in every toilet -- only in America!

OK have a look at this page: [link]

Which tags is this supposed to check? Because it's not closing a t table tags.


John H - Nov 28, 2002 2:07:45 am PST #1750 of 10000

it's not closing a table tags.

It is now.

You tell me what tags, I'll add them -- does it actually make sense to tell it to close TABLE, TR and TDs?


Jon B. - Nov 28, 2002 2:17:40 am PST #1751 of 10000
A turkey in every toilet -- only in America!

You tell me what tags, I'll add them

Since I'm 3000 miles from home, I can't check the code and give you the list, but didn't I post a list upthread somewhere?

Ahh! I found it:

<a> <b> <i> <u> <ul> <ol> <li> <p> <br> <strike> <table> <tr> <td> <th> <font> <pre> <code>

does it actually make sense to tell it to close TABLE, TR and TDs?

Yes, but tables are tricky. As I pointed out a while back, the mere existence of a t td t /td pair within a post, without a t table t /table pair around them, causes havoc with the tables on this page. So even if you close an open t td tag, we'll still have problems.

I still think we should disallow table tags altogether (sorry, ita).


John H - Nov 28, 2002 2:23:47 am PST #1752 of 10000

didn't I post a list upthread somewhere?

The list I'm using is exactly that, with the table tags taken out.

The only way to reliably check table code would be with a proper parser, that checked syntax, not a brute-force method like mine.