New revs - Public comments

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #330, on March 29th, 2012, 07:27 PM »
Only a few minutes closer by train. Where I get on the train now is merely one stop further down the London-Brighton line. But I wanted to get out, get some fresh air, even some sunlight, and road-test my camera. Good afternoon of walking but I must have walked about 5 miles in total and I'm just not used to it.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #331, on March 29th, 2012, 07:39 PM »
Every time Milady and I see the English countryside on tv is like playing a drinking game. We just love 'la campagne... Anglaaaaaaaise !', as we say for fun. It's got a little green something that we just don't have here in France. We love to walk around in the countryside :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #332, on March 29th, 2012, 08:08 PM »
I'm trying to do that a bit more, hence tromping around Brighton today. Photos are in the process of being uploaded in an experiment trying out Tumblr.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #333, on March 30th, 2012, 10:20 AM »
Site is updated.

Just two minor tidbits:

- you called the unique key in categories 'id_cat', but yesterday you called the exact same unique key in board 'board_id'... :P

- since you're using date_offset_get(), shouldn't you pass to it... date_create()? Like, date_offset_get(date_create()). I know the date_offset_get page has an example that uses your syntax, but I'm just saying... Semantically, it feels more logical... :^^;:

Seen your tumblr. You could have shared the URL here, eh? ;) It's pretty good.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #334, on March 30th, 2012, 11:15 AM »
Hmm, wasn't there already another index called id_board though? I can't remember.

date_offset_get is a synonym of one of the DateTime methods, yes, I suppose I could use date_create but I was in a bit of a hurry last night. There are also so many methods and aliases that it's genuinely confusing as to which to use when.

I will link my Tumblr when I decide how best to do so, thinking I might put it in my sig ;)

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #335, on March 30th, 2012, 11:25 AM »
Nope, no such id_board index, at least in install.sql and in my database...
I understand your issue with aliases eheh. I'd just recommend renaming the code, although obviously it will do exactly the same, but it tickles me ;)

Also. Working on the board creation bug. (Having new boards breaking the *entire* forum until I fix them in phpmyadmin isn't exactly cool...)

The bug is two-fold: member groups and pretty URLs.

I fixed the PURL bug a few minutes ago -- it was a sad, a very sad typo (a forgotten backslash) which broke the URL generation code for boards, and worst of all -- that particular piece of code wasn't even needed...

So I'm working on member groups and, wow. It seems that there's a minor difficulty.
Wedge, like SMF, initializes the member_groups field to '-1,0' by default.
Then SMF will do this:

Code: [Select]
// Who's allowed to access this board.
if (isset($boardOptions['access_groups']))
{
$boardUpdates[] = 'member_groups = {string:member_groups}';
$boardUpdateParameters['member_groups'] = implode(',', $boardOptions['access_groups']);
}

Only, Wedge no longer has this. Because it uses a new table with the same data (for access), it directly fills in the data in the table, and ignores the member_groups field in the boards table, which may or may not break the board access system. Actually, I don't know... But if it isn't used anymore, maybe this field should be removed entirely...?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #336, on March 30th, 2012, 11:28 AM »
Primary access to boards is handled through the separate table, sure. But in Load.php there is some code that actually relies on member_groups being set in the boards table to set some parameters for board privacy. I don't know if you plan to reuse that or rework it in light of topic privacy or not, so I didn't remove it but there is a note above it asking whether that should be removed.

If *that*'s removed, then the entire structure of member_groups can go from the boards table.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #337, on March 30th, 2012, 12:27 PM »
Are you talking about that bit?

Code: [Select]
// !!! Are we still meant to be using this now we have query_see_topic ? It's going to be inaccurate!

If yes -- it's probably something I added from noisen. It uses the (older) topic privacy format for boards. And yes, it's not 'inaccurate' per se because it's mainly of use in case topic privacy is set to inherit the board privacy setting. Other than that... Well, yes it can go, it's only a UI thing at this point.
Posted: March 30th, 2012, 12:18 PM

Hey, I think you rewrote the board privacy feature in Load.php... That bit with switch ($board_info['privacy'])... It gives you away because I never use switch() in my code :P

The only feature that board privacy has, that isn't in your implementation, is friends. But because it's a pretty basic thing to implement in the user-group mindset, it can go easily. It just won't be 'available' to users right now...
I think I'll you play with removing the code because, basically, I'm getting short on time today.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #338, on March 30th, 2012, 12:33 PM »
I only rewrote it insofar as it would actually not throw fatal errors to non admins ;)

I'm thinking this should be converted to a setting stored in the boards table, rather than implied or inferred from the (old) groups setup. I'm wary of touching it because I'm not quite so sure how you want to set it up ultimately, and I have other things to play with today anyway.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #339, on March 30th, 2012, 12:50 PM »
How come it would be wrong to use the board access table to emulate this anyway...?
If you don't want to show it to guests, remove -1 from the list... If you want to restrict it from access to group 4, add 4 to the deny list... It seems to me that it is a more efficient way of dealing with it than mine.

The only thing that's missing is an "easy UI", e.g. when creating a board, it should offer to have either a simple or complex membergroup list, and in simple mode it should have models -- "Only my groups", for instance, would only give access to user groups that you own, i.e. no guests and regular members and non-personal/non-hidden groups...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #340, on March 30th, 2012, 12:53 PM »
Doing it off groups is an inference, it's also not possible to infer 'friends' from that either, assuming you wanted to do that, nor is it possible to infer 'just me' or 'everyone' without guessing or coming up with some magic state to refer to these. Much better would simply be to define a value in the boards table to indicate that board's default privacy, which avoids any risk or inference being wrong, and it's almost certainly faster too.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #341, on March 30th, 2012, 01:09 PM »
Quote from Arantor on March 30th, 2012, 12:53 PM
Doing it off groups is an inference, it's also not possible to infer 'friends' from that either, assuming you wanted to do that,
Any first group created by anyone would be called 'Friends' by default. Or 'Contacts', I'm not sure. I suspect that people would never create more than one group anyway. (How many of you with a FB account have *several* friend lists...? It'd be interesting to know. I have a few, but I know it took me years to get there.)
Quote
is it possible to infer 'just me' or 'everyone' without guessing or coming up with some magic state to refer to these.
How so...? board_access doesn't support that?
Quote
Much better would simply be to define a value in the boards table to indicate that board's default privacy, which avoids any risk or inference being wrong, and it's almost certainly faster too.
How faster would it be, since you need to join the board_access table anyway..?
Posted: March 30th, 2012, 01:08 PM

(I love it how Wedge auto-fixed the mismatched tags when I changed them in quick edit. That one is mine, too, IIRC :P)

nolsilang

  • Lurking <i class=
  • Posts: 106
Re: New revs - Public comments
« Reply #342, on March 30th, 2012, 01:23 PM »
Quote from Nao on March 30th, 2012, 01:09 PM
Any first group created by anyone would be called 'Friends' by default. Or 'Contacts', I'm not sure. I suspect that people would never create more than one group anyway. (How many of you with a FB account have *several* friend lists...? It'd be interesting to know. I have a few, but I know it took me years to get there.)
I have several friend list, to differentiate school friends(High School,University) Work friends(former,current) Online Game Friends(several title).

If you talked about forum groups. I'm using groups to categorize member that enrolled on same year(it's university forum). I think it's standard use.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: New revs - Public comments
« Reply #343, on March 30th, 2012, 01:31 PM »
Quote
How so...? board_access doesn't support that?
How can it, when it is view/enter per group per board. There's absolutely no way using the groups table to work out 'just me' or 'everyone', unless you override a board's access by being an admin or board owner, and everyone is only inferrable if it contains every group, and then if you add a new group, you have to remember to add that group to that board, by which time it isn't 'everyone' but 'everyone who was here when I set it up' (sort of)
Quote
How faster would it be, since you need to join the board_access table anyway..?
No, you don't, not necessarily. The list of boards you can see and access is calculated and cached ready for use, which is done to avoid that join.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: New revs - Public comments
« Reply #344, on March 31st, 2012, 02:50 PM »
Quote from Arantor on March 30th, 2012, 01:31 PM
How can it, when it is view/enter per group per board. There's absolutely no way using the groups table to work out 'just me' or 'everyone', unless you override a board's access by being an admin or board owner,
Which is the case... I mean, why waste time reading another table when you know it's your topic...?
Quote
and everyone is only inferrable if it contains every group,
Everyone really is a meta-group for 'guests and members alike'...
If you mean 'all of my custom groups', then yes, board access has to be updated later. I don't know about the best solution for that. Except another meta-group, of course...
Quote
Quote
How faster would it be, since you need to join the board_access table anyway..?
No, you don't, not necessarily. The list of boards you can see and access is calculated and cached ready for use, which is done to avoid that join.
Hmm, it's something that can't really be done for topics, unfortunately...