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
6511
Plugins / Re: Converting WedgeDesk
« on September 8th, 2011, 04:47 PM »
It'll look better when it isn't buggy :P

But there are some other interesting side effects to converting to Wedge, like being able to use weToggle, so the collapsible areas are now animated, which is cool, and the code is getting shorter where I can remove so much of the cruft where I don't have to try and support both Curve and Core based themes. So much time was spent just removing Core compatibility code that it's unreal, far more than converting to our meta code for styling purposes.
6512
Plugins / Re: Converting WedgeDesk
« on September 8th, 2011, 04:42 PM »
OK, so by now I've done most of the template conversions. (The old plugin manager isn't, but to be fair, it's obsolete once Wedge's is done, so I'm not that bothered about it...) And most of the other conversions are done, so really, most of what's left to do is bug fixing and tidying up, but before I got into that (as a prelude to converting it to being an add-on), I thought I'd overhaul the ticket UI.

Don't get me wrong, what Nas did was very nice, but we're 18 months on, and I'm a bit fed up of it now, so I thought I'd emulate Nao's work elsewhere.

It's only taken me 20 minutes of hacking to get this to work like this, but here's what I have thus far. (In case you're wondering, it's based on the main post view)

Yes, it's buggy (in multiple ways) but it does at least work, and it'll probably come to resemble Wedge's layout more in time, like removing the upper menu and switching it to a collapsible one like Wedge uses (leaving reply/quote as normally accessible, and everything else as menu items)

I have to say, I'm really liking where it's going, but that's just me.
6513
Off-topic / Re: Already fixed SMF bug
« on September 8th, 2011, 04:15 PM »
Quote
I don't remember ever touching that... Did you?
Yes, I did, a long, long time. The idea was to harmonise the headers being sent because there were different headers being sent in the hopes of sanitising the filename into UTF-8 even if it wasn't already, for browsers to cope with. We're UTF-8 only, and have been for a long ol' time, so it ceased to be an issue.

Certainly it predates Media being integrated, and it may even predate Dlattach.php becoming its own file, that's how far back it was.

And IIRC you were the one who asked me to look into it at the time because you thought we didn't need multiple lines of headers...
6514
Off-topic / Already fixed SMF bug
« on September 8th, 2011, 03:52 PM »
Someone PM'd me about http://www.simplemachines.org/community/index.php?topic=451766.0 and the incorrect header being sent.

It's a valid bug, actually, in SMF, where the header varies depending on browser. I'm happy to report that we don't really do that, and that the rogue header isn't sent like that in Wedge.

We actually modified this behaviour months ago to send one header for IE because IE needs a slightly different header, and one for everyone else - which works, and isn't in the format that causes FF nightlies to fail.
6515
Off-topic / Re: Baidu bloody loves me.
« on September 8th, 2011, 03:48 PM »
Protip: examine the HTTP headers.

If there's no Accept header, chances are it's a dodgy request - or it's Baidu.
6516
Off-topic / Re: Post count fever
« on September 8th, 2011, 02:50 PM »
That's because we're reasonably hardcore spammers :P
6517
Features / Re: Template skeleton!
« on September 8th, 2011, 02:48 PM »
Quote
I've only seen this quickly, it seemed to me but it seems like XML will bypass many things in loadTheme() or something...
loadTheme should always be called, at least. But if $_REQUEST['xml'] is defined, hideChrome() is called, the Xml template is loaded, and the rest of the pure theme stuff (most importantly, loading any required templates and initialising template layers) doesn't happen.

After that, it sets up jQuery, and looks for the init subtemplate in a theme, sorts out blocks, then just wanders off on other stuff like dealing with scheduled and imperative queues, the mail queue and stuff like that, nothing that should be a problem here.

Anything in the error log?
Quote
any subsequent layers added will become parents of the earlier added layers. It's not a big problem to me but I don't think SMF does it in that direction... (Does it?)
No, any subsequent layers are children of the existing layer. Thus if you add a new layer to the default, you get html_before, body_before, newlayer_before, main, newlayer_after etc.
Quote
When exactly do we want to add a layer, and what for? Generally it's because we want to add something around the code being executed.
Yes, but we don't always want to layer things, which is where it gets complicated. The way I'd envisage using it normally is to have some content, encapsulated in markup (either a block or some other container) and inject that into the existing structure, which wouldn't necessarily constitute a layer.

The really important use is to be able to inject content into the sidebar, which notionally requires adding to the list of templates to be called by the sidebar layer, rather than creating new layers.[1]
Quote
Also, I'm having fun (ah ah... not exactly) trying to figure out how to quickly rename an array key.
There isn't a particularly quick way of doing it, to the best of my knowledge. All the methods for accessing arrays (even more exotic options like array_replace in 5.3) are for dealing with the values not the keys.

What about something like:
Code: [Select]
$keys = array_keys($original_array);
$values = array_values($original_array);
foreach ($keys as $key => $value)
  if ($value == $key_to_find)
  {
    $keys[$key] = $key_to_replace;
    break;
  }
$new_array = array_combine($keys, $values);

I don't know how efficient that'd be versus building a new array from scratch as a product of regular iteration of the original array, but that's the approach that occurs to me, anyway.
Quote
Okay, renaming keys was easy enough, surprisingly... And fast.
Oh, you already did it, heh.
Quote
Of course I can include an option to do any of the three, but I'm sure there's going to be at least one option that never gets used... And we're bound to find people complaining they can't add an empty layer at the *end* of an existing layer...
The facility would be useful, even if it ends up being underused, though adding a template to the end of a layer is significantly more important in the long run.

You and I are actually in agreement, though it might not look like it. You're right, it should need all 4 options, which are effectively: outside, inside, before-item, after-item.

In your examples, the first is before-item (it's before <output />), inside, outside (all considered relative to main), and the only item that's lacking is after-item, because positioning of templates is potentially quite important.

Remember: forcing everything to be actual layers is potentially a headache and one I don't want to repeat. See, if you provide the ability to place content with those 4 options, it doesn't matter if it's a layer or a self contained item.

The same logic should cover for adding <extra-content /> after <output />, the only difference is that extra-content isn't an array signifying a layer but a self contained item, right?
Quote
No, don't touch $db_show_debug, I always have it enabled, even if I don't use it, while ?debug would kill my layouts...
Fair call, I do the same :lol: Like I said, I was only considering it being part of db_show_debug, but it really should be in the debug menu (and I'd probably remove it from URLs and sessions otherwise if it were a modSetting)
Quote
but I guess it's not going to take a long time to rework everything into using a HTML string if needed.
Please please please leave it as an array. It can be built from a pseudo markup string in the skin file but it really should be an array internally because it's much faster to inject items into an array than it is to use string munging.
Quote
Well, I don't really have a suggestion on how to fix this (plus, Pete seems to have the problem in WedgeDesk
This is where themes and mods are always going to have problems, because there is no possible way that you can expect everything to work in a meaningful manner, there just isn't.[2]

What we can do, however, is be intelligent about it. The default theme has a sidebar. I have no problem with the theme indicating through some kind of variable that it provides a sidebar. Then WedgeDesk can check to see if a sidebar is given, and if it is, use it, otherwise I can reimplement the sidebar type bits that I had before (as in if the theme doesn't provide for one, I can)

Then you get more clever, because if/when a portal comes along, it can look at that too - if the theme provides a sidebar, make use of it, but if not, the portal can create one. It'll take a bit of co-operation to make it work but instead of going it alone as much as historically happened, I see no reason why we can't be a bit smarter about it.
Quote
So I don't know that my thing will be 'the' solution at all for this kind of issue...
From my standpoint, I think it is, because it provides the core with the facility to let designers be a lot more free - and it's not like it's some mythical resource.

All the time it's supported and there are add-ons using it rather than hacking templates about, it'll be an improvement. Sure there are going to be incompatibilities but that's a fact of life: it's going to happen that some things just don't play nicely. This, however, will really minimise that being a problem, IMO.
Quote
But, doesn't SMF already allow themes to know that...?
Themes dictate what layers they want used, which is typically html and body. They're the ones calling the shots, it's not like there is default skeleton in place that they can make use of - or totally ignore in favour of their own, and that's it.

It's not like there's any kind of structure to it, other than a fairly limited approach, but even that isn't used that much. By making it more powerful, and proceeding to actually *use* that power a lot more, I think we'll see more and more examples of it.

But ultimately it's going to rely on a certain set of contractual obligations - like I mentioned above with the 'supports sidebar' concept. Themes are going to need to indicate if they provide these things or not, and if not, mods that want to use them will need to do something else to accommodate it (or risk the outfall of incompatibility), and that's something that's just going to have to happen. We can't (and, IMO, shouldn't) dictate that every theme has to support a sidebar, it's not realistic to expect that.
 1. Even if it's physically implemented by new layers, the notion is that it would be a single encapsulated template within the sidebar layer, if that makes sense.
 2. Hint: even the magical holy fucking grail that is WordPress[1] has this issue where themes have to provide support for common widgets and vice versa.
 1. I meant that sarcastically. WP is not a holy grail in my eyes.
6518
Off-topic / Re: Baidu bloody loves me.
« on September 8th, 2011, 02:00 PM »
I'm not being stalked by Baidu on at least one site of mine ;)
6519
Features / Re: New revs
« on September 8th, 2011, 12:23 PM »
Revision: 985
Author: arantor
Date: 11:22:43, 08 September 2011
Message:
! Allow the richedit component to style individual buttons if they so desire, not just the post button. (Class-Editor.php)
----
Modified : /trunk/Sources/Class-Editor.php


@ Something out of WedgeDesk, really. Where we're styling buttons in various places, I have a richedit control that has both a save and a delete button, and wanted to style the delete button like all the others. Really not a big thing but something I wanted to do :)
6520
Off-topic / Re: Baidu bloody loves me.
« on September 8th, 2011, 08:56 AM »
* Arantor quietly chokes on first cup of tea of the day :lol:
6521
Off-topic / Re: Baidu bloody loves me.
« on September 8th, 2011, 08:52 AM »
Baidu is a horrifically vicious bot. Where Google might send two or three requests at a time, I've seen Baidu send 20.

Interestingly, because of default Bad Behaviour checks, Baidu is actually currently blocked, and I'm honestly not sure whether I should change that or not - and I'm more inclined not to change it for the most part.
6522
Plugins / Re: Converting WedgeDesk
« on September 8th, 2011, 12:02 AM »
Oh, it's definitely going to be WedgeDesk, I already bought the domain names for that. I event spent some time mulling over how I think that site should look and function, seeing that it'll be just me designing for it.

In other news, I already have a list of things that I'm considering for future versions, which includes bug fixes of things I've found. (It's currently at 43 items, though some of those are notes for me for things to fix in the conversion)

I'm not averse to suggestions but it will very firmly go at my pace since there's no-one 'encouraging' me to work on this, so right now I'm concentrating on getting it up to speed for Wedge so that I can begin properly on the add-on and permissions overhauls. After that, I'll be more open to suggestions and so on, but the grand plan is to actually run WD as the primary module on wedgedesk.com, to function as both support vehicle and bug tracker. I mean, if you're going to do it, you gotta go for it properly, right?[1]

But I really want to have it not only out there to be a good mod for Wedge, to showcase what it can do - but also it'll be another way of promoting Wedge, and of promoting what can be achieved with sufficient care and attention. It may even help push Wedge's adoption not only by demonstrating that big, powerful add-ons can exist, but that there isn't the same issue against paid add-ons.[2]


@ Nao: It does use custom CSS. The enclosing div is not called either edge or edgehide, but it IS done by wrapping template layers around the entire content. When I said it was abuse of template layers, I really meant it: two divs are created, shd_left_column and shd_right_column. Left contains the left menu, the right column is opened in the _above layer, contains the main subtemplate, then closes it in the _below, which means it ends up containing the entire sidebar in it as well.[3]


I like Wedgets too, I actually nearly suggested Wedgelets quite early on but then I remembered how Java took that concept and screwed it up[4] with applets and servlets.[5] But Wedgets beats Wedgelets. And either of those are better than what I semi-seriously suggested for SD at one point.[6]
 1. The plan always was to move to SD on sd.net, since there's nothing technical really preventing it from replacing PT, it's mostly semantic difference, but a lot of that gap I can actually mitigate in WD with some of what I have planned.
 2. Even if paid mods end up being powered through wedge.org in some fashion, I'm still going to be running wd.com simply because that's the single best way to showcase it.
 3. I did not write the markup, and it's done that way because the menu reacts also to the << sidebar stuff in SMF, specifically that if the menus are dropdown, SD profile menu is a sidebar menu, and if the menus are sidebar, there's a little horizontal navbar above the content.
 4. Like most things in Java, really.
 5. Yes, servlets is a real Java term.
 6. "Drawers". On the basis that SD was a *desk* and desks have drawers. It made sense in my head.
6523
Plugins / Re: Converting WedgeDesk
« on September 7th, 2011, 11:18 PM »
Just thought I'd share this particular oddity. I have no idea why the sidebar is here.

(Nao: the sidebar appears slightly to the right of where it's supposed to be when the page loads - and it thinks it's in the collapsed position, so hovering on it pushes it out to here. This is the thing I already mentioned and I'm willing to bet it's caused by the abuse of template layers and divs to create that left menu.)
6524
Features / Re: Template skeleton!
« on September 7th, 2011, 11:15 PM »
Quote
I have no idea why it's not exactly a documented feature...
I don't know that either, but to be fair it's only really useful for themers and people that create template layers. Which means it's useful to themers and the dozen or so modders who ever bothered to investigate SMF and found it useful, which means Daniel15, various portal authors, me, you[1] and anyone else who really, really put time in.[2]

I sort of wondered about adding it to the debugging menu, but I figure it's convenient enough there. Or, alternatively, add it to $db_show_debug. If you're already using that, your layout's shot to hell anyway with masses more data than normal, why not go for the full house and do it then too?
 1. I saw its use in Aeva 2.x, thought it was ingenious.
 2. Oh, and one who only gets the title of modder in the strictly Darwinian sense, after observing a rival mod put in ads in an almost-totally-layers manner and seeing the mod they bought *not* do that. But we won't dwell on that.
6525
Features / Re: Template skeleton!
« on September 7th, 2011, 11:07 PM »
Sounds like a very awesome amount of functionality and very, very flexible too :)

Can't wait to actually see it to play with.