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
8191
Features / Re: New revs
« on November 18th, 2010, 02:59 PM »
I'm not ignoring you - I really just haven't had time to keep up with everything :(
8192
Plugins / Re: Plugin hooks
« on November 15th, 2010, 11:57 PM »
Could always actually call it plugins. Doesn't really matter, as long as it's a little different to be able to break the mindsets of old.
8193
Plugins / Re: Plugin hooks
« on November 15th, 2010, 11:28 PM »
It's a mindset problem. People think mods, they think of modifications under the hood. They won't see it as modules, no matter how hard we try. We need a clean break to be able to get away from that mentality.
8194
Plugins / Re: Plugin hooks
« on November 12th, 2010, 09:29 PM »
Don't forget the padding introduced by serialize'ing though, that adds a surprising amount of stuff.
8195
Plugins / Re: Plugin hooks
« on November 12th, 2010, 05:49 PM »
Quote
Do you think 64KB (the max variable length (TEXT) in wedge_settings) will be enough to store all possible hooks...?
Hmm, good question. Not sure right now... need to think about that.
8196
Features / Re: New revs
« on November 12th, 2010, 05:46 PM »
Regarding the last change, I haven't looked yet, but I seem to recall that outgoing_email occurs before the email is sent, but the PM and create topic hooks happen after the PM is sent/topic is created...?

* Arantor will review in a minute, just trying to dry off after going out in the rain to get fixings for dinner...
8197
Plugins / Re: Plugin hooks
« on November 12th, 2010, 05:37 PM »
Neither is integrate_eggnog but hey, who's counting?

magic_quotes shouldn't really be needed though (only for those really weird CMSes that do strange mystic things when magic quotes is enabled)
8198
Plugins / Re: Plugin hooks
« on November 12th, 2010, 03:46 PM »
There are instances where arrays are stored in $modSettings. None of them are consistent (e.g. the signature settings is a comma-separated value list, the censored words good/bad lists are newline-separated items, as are news items)

Storing an array is fine, but I personally wouldn't make it automatic, because you only have to unserialise it again later - and unless you're going to maintain a list of those things, you won't know what to unserialise en masse at the start.

Better would be to manage individual items yourself as and when.
8199
Plugins / Re: Plugin hooks
« on November 12th, 2010, 02:26 PM »
To a point you're getting into the game of second-guessing the developer intent, and without any secondary information, it's hard to be sure.

Remember, the integration functions were originally for linking SMF to a third party app, so reset_pass makes sense there, because what you're doing is when a user changes their password in SMF, you're flagging a routine in A.N.Other system to update the same user's password there too.

I'd argue in that case, there shouldn't be a need for the value to be byref. Other instances, however, yes it should be a byref, particularly if it seems logical for a third party app to want to modify something before SMF has its wicked way with it.

We're sort of taking that idea and expanding on it, meaning that any original purpose is likely now somewhat irrelevant. For each hook, look at where it is, what local variables are applicable and make a judgement call as to whether it is reasonable and appropriate for third party code (of any kind) to be modifying that. reset_pass is one case it shouldn't be necessary, for example.
8200
Features / Re: Scheduled tasks interface
« on November 12th, 2010, 11:57 AM »
Well, it's not *wrong* but from where I'm sitting, add-on is technically correct, because it's something you add on; it's sort of converting between a noun and a verb.

Whereas 'addon' is neither, and in fact in some parts of the UK, it's a corruption of the verb 'to don' as in to wear.

Add-on is, in addition to being 'correct', is also more accepted since it's what Firefox uses (even if their site is addons.mozilla.org)

I'm not actually that bothered; I'd just always write it with the hyphen because to me that's how I think it should be, and why I said about not being a hyphenazi ;)
8201
Plugins / Re: Plugin hooks
« on November 12th, 2010, 11:02 AM »
Quote
You want SD to be ported to Wedge, don't you...?
Well, it's more a rewrite than port given the changes already to the editor component, not to mention the other changes we've already done. More importantly, though, the plugin system would need to be rethought and brought more in line with how RC4 implemented it (which, I have to say, was cleaner than how I did it in some ways)
Quote
Integration is its purpose, but it shouldn't be its definition. Its definition is a hook.
Imagine that instead of calling parse_bbc(), you had to call parse_bbc_into_an_html_string()
Sign me up :D
Quote
Me neither. Probably another example of two vars that developed at pretty much the same time and were favored by one dev or another... Or they wanted to have the "me" equivalent to you's "$context['member']" or something.
$context['member'] actually makes sense for the most part since its main use is in the profile area when you're looking at another user's profile, so it is the contextual information for that user. $context['user'] though overlaps mostly with $user_info for no discernible reason.
Quote
Yeah, adding hooks in the main callee is perfectly fine and I would recommend it, too. Just don't add hooks in every Subs.php function, that's all
That's not anticipation, that would just be stupid :P
Quote
I'm sure most modders will work into making sure their modifications are all turned into hooks at that point.
(It's that's possible, of course. But right now I can't think of anything that isn't.)
A lot of the really little tweaks currently published as mods would be tricky to implement directly because of what they do - rearranging little bits of templates, and realistically, those are not possible to hook simply because of the mess you get into because you'd be adding hooks for every single minor point.
8202
Features / Re: Scheduled tasks interface
« on November 12th, 2010, 10:53 AM »
With the hyphen, but we shouldn't hyphenazis ;)
8203
Plugins / Re: Plugin hooks
« on November 12th, 2010, 10:45 AM »
Quote
But, see, what if the modder wants to do something in that place, but unrelated to the list of actions?
I did that, actually, in a shoutbox I built; as part of the plugin system SimpleDesk had, I did actually add the same hook that the action handler routine has (though calling SD's hook rather than SMF having it), and abused the hook to not only add my action but also to receive the AJAX calls and handle them, as well as manipulating $context at the same time.

Goes back to what I said before - the running state in $context is fully manipulatable, but really there should be no need to abuse such a hook when a better structure can be put in place.
Quote
I think modders can start using hooks, as long as we provide them with a dummy mod that would show the correct ways of doing things. (Or some prominent mods start using hooks and they look into their code.)
Yes :) This is something I'm quite keen on, not only providing the framework for modders but working with them to build add-ons, so not only providing dummy add-ons but full new features as add-ons that demonstrate how to achieve various things.
Quote
And as I said earlier, we really should rename the hook functions, too.
Well, they were designed for integration which is where the name comes in, but sure, we can rename them to be more appropriate.
Quote
Yeah, beginning with $context['user']...
I still have no idea why that exists when $user_info contains virtually everything you'd want to know anyway.
Quote
I'm not much of a fan of anticipation, not because it's extra work for us, but more likely because if we start adding hooks in useless places, like at the beginning of every single function, it will waste CPU time for everyone, possibly for nothing.
I wasn't going to do it that way, I had a simpler plan - once the action handler was known and the index knew where it was sending the user, I planned to add a hook before and after it has run (since some functions don't return back, and some users will no doubt want to expand upon what's already been done). Yes, there is of course a performance hit there, but the increased flexibility more than makes up for it.
Quote
Maybe for the most important mods, if there are any, we could offer the modder to convert their mods for them.
For the ones that aren't in the core itself, I'll likely put some time aside to sit and implement some of the smaller ones, partly as an example of 'how-to' and partly so we have that functionality available for people. But I'd definitely want to work with mod authors to help them make the jump.
Quote
I think a good policy would be to add a warning when installing a package. In red.
* Arantor likes that idea.
Quote
Yes, but it's not very instinctive, see?
Oh, I'm not disputing that :P I'm well aware of the idiosyncratic nature of SMF's code, just explaining the basis for it...
8204
Plugins / Re: Plugin hooks
« on November 12th, 2010, 10:20 AM »
Well, I'd love to get stuff out of the global scope generally, there's really not a need for some of the stuff to pollute global scope the way it does.

$modSettings is for modifiable settings, it contains the contents of the admin panel's options that are forum wide (as opposed to $settings which is theme wide and $options which is user-centric) that are modifiable through the admin panel without editing any files, and is the general home of modification settings too.
8205
Features / Re: Scheduled tasks interface
« on November 12th, 2010, 10:14 AM »
Keep it simple: add-ons