Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Arantor
5266
Features / Re: Privacy options
« on December 6th, 2011, 12:46 PM »
* Arantor invokes the demons of moderation and allows people to change their vote!
5267
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 08:36 PM »
And you'd have to otherwise, no?

Looks good to me at a first glance.
5268
Features / Re: Privacy options
« on December 5th, 2011, 08:34 PM »
Not if you want a poor man's helpdesk, for example... There are plenty of cases where you might want to allow multiple users but not everyone to see a given topic.
5269
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 07:37 PM »
I can see the logic of that but I can also see the desire to use code tags inside a code tag... Though that's not practical or really feasible since proper full nesting can't be done anyway. Sounds like a plan to me really.
5270
Features / Re: Post moderation
« on December 5th, 2011, 07:34 PM »
Yup, only at post saving time.
5271
Off-topic / Re: Doctor Who
« on December 5th, 2011, 05:05 PM »
And just think, in another life, Kazran Sardick was a long-haired bearded man who played with wands, and was headmaster at some insanely strange school that's housed in a castle, and helped guide a small boy with a scar on his forehead to greatness.[1]
 1. The actor for old Kazran Sardick is one Michael Gambon, better known as Dumbledore for most of the Harry Potter films.
5272
Features / Re: Post moderation
« on December 5th, 2011, 04:59 PM »
OK, getting down to brass tacks (I can wait on the above post for a while, not so bothered by that), I figured all the way along that I'd have to store it somehow and parse it meaningfully.

What I'm ultimately thinking is that I'm going to store the list of rules in an XML block, inside the DB. Now before anyone shouts how inefficient that is, consider it from my perspective.

It's clean to parse, it's not restricting the content to linear columns (and given the inclusive/exclusive nature of things, that's a good thing) and it means I can cleanly delineate and/or clauses in exceptions and rules without brackets which while human readable, do make it a lot more complex to process internally.

Performance of handling XML isn't bad actually, probably better than I'd be able to do with a custom language parser all told.

This is just off the cuff but covers what I'm thinking of. (It's not intended to be user-visible but I guess it could be for 'pro' users. I don't really intend to build a pro interface exactly. I'd rather build one great interface and be done with it, the idea is that this is internal use only. It probably wouldn't even be indented/line-broken normally.)

Code: [Select]
<rules>
  <rule for="posts">
    <criteria>
      <boards id="1" />
    </criteria>
  </rule>
</rules>

This would make all the new posts in board 1 be moderated, except for admins.

Code: [Select]
<rules>
  <rule for="topics">
    <criteria>
      <boards id="10" />
    </criteria>
    <criteria>
      <posts lt="10" />
    </criteria>
  </rule>
</rules>

New topics will be moderated if the board is id 10, OR if the user has less than 10 posts. That's why there's the criteria tag, to contain all the elements of a clause, because you could do things like this:

Code: [Select]
<rules>
  <rule for="topics">
    <criteria>
      <warning gt="40" />
      <boards except-id="10" />
    </criteria>
    <criteria>
      <boards id="1" />
    </criteria>
  </rule>
</rules>

This way, you'd post moderate any new topic created by a user if it's in board 1, OR if they have more than 40% warning, except in board 10. Perhaps that's a banned board, or a test board or similar. Either way, it allows you to create AND clauses within a rule. (This one is: (warning > 40 && board != 10) || board = 1, expressed in code.)

Hmm, now I look at it, I'm sort of wondering about writing it in PHP-like code, but I just feel that it would be easier to manipulate done in XML than it would in some kind of code. This is, after all, extensible (and suits how I'm envisaging plugins would interact though this too)

Thoughts?
5273
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 12:23 PM »
Quote
But that would mean a fuller rewrite of preparsecode, which I'm not ready/willing to do...
I know, and same here. But that is the eventual goal.
Quote
So, I'm looking at the code tag stuff and all I see is that it's mainly used to deal with special tags only when they're outside code tags.
Well, yes and no. The main things it's used for are to make *sure* that url and img tags are legal. It does also serve to carry out certain other exception handling that won't be applicable inside code tags.

Basically, it's the bit that needs overhauling anyway, so provided that the bits between tags remain accessible for manipulating (bearing in mind that they could be rewritten in the process) I'm cool with overhauling it with strpos.
5274
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 10:31 AM »
*nods* Sounds like a plan to me :)

Though at some point the preparser needs to be gutted to actually examine the post with respect to the tag's definitions, rather than relying on its own defined rules (so that table->tr->td isn't defined through some esoteric regexp but because that's how the bbc rules define it - which means it becomes possible to add attributes, or even, dare I suggest a th tag)
5275
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 09:45 AM »
Hmm, that's just before the splitter code runs, interesting.

I don't think you can cause any kind of vulnerability that easily with it but you can cause all kinds of mess with it if not careful, because the splitter explicitly relies on having matched tags when it does the split.
5276
Features / Re: Fixing mismatched BBCode
« on December 5th, 2011, 12:54 AM »
Where does that code run, exactly?

(Haven't looked at the commit yet)
5277
Features / Re: Fixing mismatched BBCode
« on December 4th, 2011, 11:53 PM »
The parser logic is smart enough to cope with closers (even respecting block level vs non block level tags to a point) - except for code closers. What do you have in mind as far as fixing openers goes?
5278
Features / Re: Fixing mismatched BBCode
« on December 4th, 2011, 11:17 PM »
Quote
Why exactly is it so important to have matching tags?
Generally, it's not a huge deal because the parser will close any tags at the end (so that the tag endings will be output correctly) but for code tags, processing is quite a bit different in the bowels of the bbc parser, because the content is actually split by code tag, and the loop can safely deal with extra /code closers but it'll get very upset if there's more openers than closers.
5279
Features / Re: Fixing mismatched BBCode
« on December 4th, 2011, 12:57 PM »
What needs to happen is that it needs to understand nesting hierarchy properly, not just for code tags (which will solve other issues of stupidity)

As an exercise, modify the post in the DB or hand it directly to parse_bbc to see what that does. That actually keeps track of hierarchy to a point.

Code tags inside code tags won't (and can't, by definition) ever nest properly. The innermost closer will always be hit first, ending the tag, so what comes after it will always be wrong as it will be the remainder of the code tag outside the original code tag. And it cannot and should not be assumed that a code tag nested inside a code tag will have an inner closer either.
5280
Features / Re: Privacy options
« on December 4th, 2011, 12:49 PM »
I think it would potentially be confusing to treat it as a draft, but personal posts I can see the logic of, e.g. blog post with very personal details.

Re moderation, I think I'm going to have to leave it for now and come back to it.

Also, one thing that I'd address: how many people are voting on what sounds useful vs what they would actually use if it were available...?