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.
241
Bug reports / SMF bug 4873 (agreement not shown, no error, if agreement.txt is not available)
« on February 29th, 2012, 01:35 PM »
Interesting one this, I'd always assumed there would be an error, but guess not.
In any case, I'd love to see if we can't do something better than using agreement.txt by default, simply because if you're going to modify it, you have to get into the realms of modifying the file itself rather than using the DB or similar.
Whatever we do with this, we should bear this in mind.
In any case, I'd love to see if we can't do something better than using agreement.txt by default, simply because if you're going to modify it, you have to get into the realms of modifying the file itself rather than using the DB or similar.
Whatever we do with this, we should bear this in mind.
242
Bug reports / SMF bug 479 (attachments potentially attached to the wrong post)
« on February 29th, 2012, 01:29 PM »
The issue in this bug is that if a page errors for any reason, any attachments made are saved after the initial submission and the details stored in session, but it's not specific - they're just generically in session, because browsers with multiple tabs just weren't around at the time, and as such it was never really so much of a problem.
Whatever fix SMF has, they've separated it out by board, which is workable but still susceptible to two topics in the same board exhibiting the same behaviour.
Possible solutions:
* only accept attachments AJAXively (e.g. to Media and return a media bbcode for it)
* when submitting, create a token for those attachments, and return that token with the form, such that the token has to be returned to get the attachments submitted. (All the other protections about orphaned attachments in session would need to be adapted but this is not a huge task)
Whatever fix SMF has, they've separated it out by board, which is workable but still susceptible to two topics in the same board exhibiting the same behaviour.
Possible solutions:
* only accept attachments AJAXively (e.g. to Media and return a media bbcode for it)
* when submitting, create a token for those attachments, and return that token with the form, such that the token has to be returned to get the attachments submitted. (All the other protections about orphaned attachments in session would need to be adapted but this is not a huge task)
243
Bug reports / SMF bug 4938 (attachment maintenance can fall foul of the security timeout)
« on February 29th, 2012, 01:22 PM »
There's not really a good solution for this one, as indicated, because the password's going to be needed every hour, and I don't think for something like that, that it is reasonable to expect them to type the password in every hour.
I'm thinking a CLI script might be a better way to deal with that, but would encourage discussion on the matter.
I'm thinking a CLI script might be a better way to deal with that, but would encourage discussion on the matter.
244
Bug reports / SMF bug 4770 (top level menu items should be clickable)
« on February 29th, 2012, 01:19 PM »
In the profile and in the admin areas, the top level menu items are explicitly not clickable, and many, many times I've clicked them by accident and got nowhere >_<
Not sure yet how best to deal with it, though, especially since admin and profile use them in such different ways, but I'm sure we can do something with them.
Not sure yet how best to deal with it, though, especially since admin and profile use them in such different ways, but I'm sure we can do something with them.
245
Archived fixes / SMF bug 4859 (Text limit not necessarily enforced properly)
« on February 29th, 2012, 01:08 PM »
I can see what's being said here - if you have a post that, when converted to get its br tags etc, will overflow 64K but the post itself was otherwise below 64K, it can be truncated at the end of the text boundary.
There was talk at one point that we were going to make it mediumtext, but the SQL says we didn't >_> Hmm, need to look this one up.
There was talk at one point that we were going to make it mediumtext, but the SQL says we didn't >_> Hmm, need to look this one up.
246
Bug reports / Possible incorrect behaviour in fatal error handling?
« on February 29th, 2012, 02:57 AM »
OK, so I'm fixing up the calendar at last, and there's the grisly assortment of mismatches of variables and things out of scope where they were before in the original code and I forgot to preserve it.
But, interestingly, I got this to happen.
The top template, as you might recognise, is the fatal error template. The theory is that it should normally override everything and anything. But it's called with a simple wetem::load, and as it happens in this case, another wetem::load has already been issued before we get to the actual fatal_lang_error call.
I'm inclined to think that the fatal error should override and remove anything in the default layer rather than the current prepending behaviour.
Thoughts (Nao especially)?
But, interestingly, I got this to happen.
The top template, as you might recognise, is the fatal error template. The theory is that it should normally override everything and anything. But it's called with a simple wetem::load, and as it happens in this case, another wetem::load has already been issued before we get to the actual fatal_lang_error call.
I'm inclined to think that the fatal error should override and remove anything in the default layer rather than the current prepending behaviour.
Thoughts (Nao especially)?
247
Plugins / A project I started a while back
« on February 27th, 2012, 11:11 PM »
OK, so here's a project I started a while ago but put down due to so much other stuff going on. Now I'm dusting it off and trying to work on it, and I thought I might share a few pictures. ;)
I only really got as far as the admin area with a few very minor bits of UI foundation for the main area, but nonetheless...
Back in November when I first started on this before getting massively derailed, I had planned unreservedly to make it paid. Now, I'm a bit undecided on my plugins being free or paid, but it's likely that this one will be paid.[1]
I only really got as far as the admin area with a few very minor bits of UI foundation for the main area, but nonetheless...
Back in November when I first started on this before getting massively derailed, I had planned unreservedly to make it paid. Now, I'm a bit undecided on my plugins being free or paid, but it's likely that this one will be paid.[1]
| 1. | It has been suggested that I make all my plugins paid but pay a small one-time-only fee. I'm certainly more amenable to that than any kind of annual licensing deal. But there's a *lot* of stuff in this plugin so IMHO making it paid would be justified. |
248
Plugins / Menu integration
« on February 27th, 2012, 06:48 PM »
Having now integrated the admin panel stuff for simple cases, I'm inclined to think I should add something similar for the main menu - much as it's already possible to add actions without any hooks being called. The idea isn't to remove those hooks but to take out the most common use cases from being required (to lower the barrier to entry for basic stuff, without compromising more powerful stuff should it be needed)
Main menu tabs are a bit more complex than actions, because they need to cover things like permissions, so here's what I'm thinking. There would be a single cache of all the items, which is a nicely serialized array.
The XML would look like:
Code: [Select]
This would create a new menu item, which would be highlighted on action=myplugin (due to the name), would use $txt['my_plugin'] as its caption (loaded from the plugin's MyPlugin.language.php file, and cached!), would have myicon.png as its icon, would only be visible if the user had some_perm permission, and when clicked would go to the given URL. Same deal for sub items.
As far as the caching goes, all that information would be cached, as well as - and this is the important part - when we created the cache and added an item, we'd also make sure to load all the different installed languages' files, to grab the entry/ies that we needed, and we'd cache them all in the menu. Since it's done at enable-plugin time, it should be relatively cheap to do.
The only problem I can imagine with that setup is that we might end up overflowing the serialize field if there's a lot of languages and a lot of menu entries added. Maybe this is a candidate for json_encode instead.
Also note we would definitely need to change the menu styling code as discussed before to create a single base class for each of the menu icons, such that each icon held to the same styling as far as padding etc. goes (and then this only has to worry about adding the icon itself, rather than having to worry about trying to add all the extra style code like padding)
Thoughts? (This one's primarily for plugin authors, though I'd appreciate your comments, Nao)
Main menu tabs are a bit more complex than actions, because they need to cover things like permissions, so here's what I'm thinking. There would be a single cache of all the items, which is a nicely serialized array.
The XML would look like:
<menu_items>
<language file="MyPlugin">
<item name="myplugin" caption="my_plugin" icon="$pluginurl/myicon.png" permission="some_perm" url="$scripturl?action=myplugin" after="search">
<item name="myplugin" caption="my_sub_plugin" url="$scripturl?action=myplugin;sa=blah">
</item>
</menu_items>This would create a new menu item, which would be highlighted on action=myplugin (due to the name), would use $txt['my_plugin'] as its caption (loaded from the plugin's MyPlugin.language.php file, and cached!), would have myicon.png as its icon, would only be visible if the user had some_perm permission, and when clicked would go to the given URL. Same deal for sub items.
As far as the caching goes, all that information would be cached, as well as - and this is the important part - when we created the cache and added an item, we'd also make sure to load all the different installed languages' files, to grab the entry/ies that we needed, and we'd cache them all in the menu. Since it's done at enable-plugin time, it should be relatively cheap to do.
The only problem I can imagine with that setup is that we might end up overflowing the serialize field if there's a lot of languages and a lot of menu entries added. Maybe this is a candidate for json_encode instead.
Also note we would definitely need to change the menu styling code as discussed before to create a single base class for each of the menu icons, such that each icon held to the same styling as far as padding etc. goes (and then this only has to worry about adding the icon itself, rather than having to worry about trying to add all the extra style code like padding)
Thoughts? (This one's primarily for plugin authors, though I'd appreciate your comments, Nao)
249
Features / Using HTML5 form inputs
« on February 27th, 2012, 04:06 PM »
This was something Nao mentioned to me based on my contact form plugin, so I thought I'd run with it a bit more.
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)
There are quite a few places where numbers are required in the admin panel, and right now there's validation done behind the scenes on it, but it occurred to me that using HTML5, we could handle validating those things better in supported browsers, and unsupported browsers can cleanly fall back to what was there before.
I give you <input type="number">.
(This is from Chrome. There is zero JavaScript involved in making this bit work, the browser just does it when trying to save the page.)
I'm gushing a little, because I never really looked at this before but I'm loving what you can do with it, very easily and effectively for newer browsers. I also think it makes the interface more meaningful (because it's clear that you're working with numbers rather than just bare textboxes)
250
Plugins / Another quick plugin
« on February 27th, 2012, 05:47 AM »
2 hours work, and I'm almost done (one random quirky bug and I need to test it on a real server that can email but otherwise I'm done)
Another one for the list :)
I probably could make it a little nicer in places, but I wanted to get the core functionality done.
Another one for the list :)
Posted: February 27th, 2012, 05:45 AM
I probably could make it a little nicer in places, but I wanted to get the core functionality done.
251
Features / Board access
« on February 27th, 2012, 01:41 AM »
OK, so this has been driving me nuts for months.
Some of you may know that we integrated the ability to split board viewing (on the board index) from access a while back, much as View Only Boards mod lets you do (or, the mod I wrote for any of you who remember that, haha[nb]Those of you who don't, it turns view/enter into physical board permissions)
On top of that, I actually made it so you could deny access to boards as opposed to just not allowing (e.g. if you wanted to have a banned group who could only access one board to plead their case)
But I couldn't figure out the interface to make it work, and I'm still not 100% about this but it's the nearest I've got to anything workable.
The first picture is the default that you'll see on making a new board - keeping in simple (where view = access, and no deny). The second picture turns on view != access, the third turns on deny as well (but of course you can turn on deny separately to view != access)
Thoughts?
Sorry that it's a bit confusing with the attachments, I probably should have used the gallery >_<
Some of you may know that we integrated the ability to split board viewing (on the board index) from access a while back, much as View Only Boards mod lets you do (or, the mod I wrote for any of you who remember that, haha[nb]Those of you who don't, it turns view/enter into physical board permissions)
On top of that, I actually made it so you could deny access to boards as opposed to just not allowing (e.g. if you wanted to have a banned group who could only access one board to plead their case)
But I couldn't figure out the interface to make it work, and I'm still not 100% about this but it's the nearest I've got to anything workable.
The first picture is the default that you'll see on making a new board - keeping in simple (where view = access, and no deny). The second picture turns on view != access, the third turns on deny as well (but of course you can turn on deny separately to view != access)
Thoughts?
Posted: February 27th, 2012, 01:40 AM
Sorry that it's a bit confusing with the attachments, I probably should have used the gallery >_<
252
Features / Making report-to-moderator more powerful
« on February 26th, 2012, 06:39 PM »
It occurs to me that we could do something quite interesting with this - how about, if the same post gets reported more than (say) 3 times, it automatically get moderated causing it to require something more serious to be done with it?
It would of course be admin configurable ;)
Thoughts?
It would of course be admin configurable ;)
Thoughts?
253
Features / Going backwards to go forwards (aka dealing with an inheritance)
« on February 25th, 2012, 03:09 PM »
OK, so I was working on my style based on SMF's Core theme again, and I realised that the board index actually needs some work to it in the markup.
Those of you who remember the Core theme will probably remember that in Core, each category was a separate block visually - well, turns out it's also a separate block in the markup, i.e. a separate table. But in Curve, it's one massive table for the entire board index.
Specifically, it's a single massive table that uses 3 tbodys per category, one for the heading, one for the boards and one as a divider between boards.
I'm suggesting the structure be altered thus:
* a new div around the board index (encapsulating everything that is currently #board_list)
* a new table for each category
* said table should use a thead for the category name and tbody to contain each of the rows, which is both easier to style and more semantically correct
* the divider between categories should be handled a div in case people want to style it or otherwise target it (much as currently it's a tbody.divider, it should become a div.table_divider or similarly named class)
This combination of things should allow us to retain anything that can be presently done against Curve markup whilst also allowing for the sorts of things I want to do in my Core mashup (like putting borders around entire categories to visually separate them from everything else)
Thoughts?
Those of you who remember the Core theme will probably remember that in Core, each category was a separate block visually - well, turns out it's also a separate block in the markup, i.e. a separate table. But in Curve, it's one massive table for the entire board index.
Specifically, it's a single massive table that uses 3 tbodys per category, one for the heading, one for the boards and one as a divider between boards.
I'm suggesting the structure be altered thus:
* a new div around the board index (encapsulating everything that is currently #board_list)
* a new table for each category
* said table should use a thead for the category name and tbody to contain each of the rows, which is both easier to style and more semantically correct
* the divider between categories should be handled a div in case people want to style it or otherwise target it (much as currently it's a tbody.divider, it should become a div.table_divider or similarly named class)
This combination of things should allow us to retain anything that can be presently done against Curve markup whilst also allowing for the sorts of things I want to do in my Core mashup (like putting borders around entire categories to visually separate them from everything else)
Thoughts?
254
Plugins / Settings page integration
« on February 25th, 2012, 12:40 AM »
Had a random idea about this today. The plugin info file already lists all the $settings variables that a plugin uses (so that it can set defaults and clean up properly later) but I've been thinking about the interface side of things.
Right now, if a plugin wants to add a settings page, even a simple one, it's going to have to create a file, use at least two hooks[1] and create a stub file that is almost entirely identical from plugin to plugin. Heck, when I start a plugin now that uses a simple settings page, I just copy everything from an earlier one.
So, here's what I'm thinking. Everything that you would normally have to set up for a settings page ($config_vars etc.) can be streamlined. Of course, more complex plugins (of the likes of WedgeDesk) would still do their own thing, but the smaller stuff could be simplified.
For example, I have a stub plugin that will grow into a big scary share-topics-with-services monster, dubbed Flitter because it was originally just Facebook + Twitter. Right now, it's very straightforward however, with its settings page being:
Code: [Select]
Then you have a function which binds to the admin menu, and the rest of the boilerplate in this function that's used for saving and calling the relevant templates and stuff. It gets set up as action=admin;area=flitter and uses 'Flitter' as the title (which is the plugin's title anyway)
I'm thinking we could handle this in the plugin-info.xml file directly instead.
Code: [Select]
Assuming the plugin author uses this, it should be able to handle the menu item, the settings themselves, making them searchable and auto-linking it in the plugins area (minimising the need for using the <acp-url> element though not obsoleting it)
The area= part specifies what admin area it should be, the icon is the icon for the dropdown menu, the bigicon is the big icon to use, <load-language> identifies what language file(s) should be loaded when running the page, so that the relevant strings can be loaded. Everything else just correlates to the above.
Personally, I think it's less effort for the plugin developer generally, it's less they have to deal with - you don't expressly have to deal with hooks when doing this and you're still doing less work than you would doing it manually.
Thoughts?
Right now, if a plugin wants to add a settings page, even a simple one, it's going to have to create a file, use at least two hooks[1] and create a stub file that is almost entirely identical from plugin to plugin. Heck, when I start a plugin now that uses a simple settings page, I just copy everything from an earlier one.
So, here's what I'm thinking. Everything that you would normally have to set up for a settings page ($config_vars etc.) can be streamlined. Of course, more complex plugins (of the likes of WedgeDesk) would still do their own thing, but the smaller stuff could be simplified.
For example, I have a stub plugin that will grow into a big scary share-topics-with-services monster, dubbed Flitter because it was originally just Facebook + Twitter. Right now, it's very straightforward however, with its settings page being:
$config_vars = array(
array('desc', 'flitter_desc'),
array('select', 'flitter_position', array('topic' => $txt['flitter_position_topic'], 'sidebar' => $txt['flitter_position_sidebar'])),
array('title', 'flitter_fb'),
array('check', 'flitter_showfb'),
array('title', 'flitter_twitter'),
array('check', 'flitter_showtwitter'),
$txt['flitter_twitter_via_desc'],
array('text', 'flitter_twitter_via'),
array('text', 'flitter_twitter_related'),
array('text', 'flitter_twitter_related_desc'),
array('title', 'flitter_google'),
array('check', 'flitter_showgoogle'),
);Then you have a function which binds to the admin menu, and the rest of the boilerplate in this function that's used for saving and calling the relevant templates and stuff. It gets set up as action=admin;area=flitter and uses 'Flitter' as the title (which is the plugin's title anyway)
I'm thinking we could handle this in the plugin-info.xml file directly instead.
<settings-page area="flitter" icon="mgallery.png" bigicon="$plugindir/flitter.png">
<load-language file="Flitter-Admin" />
<desc name="flitter_desc" />
<select name="flitter_position">
<opt value="topic" name="flitter_position_topic" />
<opt value="sidebar" name="flitter_position_sidebar" />
</select>
<title name="flitter_fb" />
<check name="flitter_showfb" />
<title name="flitter_twitter" />
<check name="flitter_showtwitter" />
<literal name="flitter_twitter_via_desc" />
<text name="flitter_twitter_via" />
<text name="flitter_twitter_related" />
<text name="flitter_twitter_related_desc" />
<title name="flitter_google" />
<check name="flitter_showgoogle" />
</settings-page>Assuming the plugin author uses this, it should be able to handle the menu item, the settings themselves, making them searchable and auto-linking it in the plugins area (minimising the need for using the <acp-url> element though not obsoleting it)
The area= part specifies what admin area it should be, the icon is the icon for the dropdown menu, the bigicon is the big icon to use, <load-language> identifies what language file(s) should be loaded when running the page, so that the relevant strings can be loaded. Everything else just correlates to the above.
Personally, I think it's less effort for the plugin developer generally, it's less they have to deal with - you don't expressly have to deal with hooks when doing this and you're still doing less work than you would doing it manually.
Thoughts?
| 1. | Three if you want to make it searchable as well, yup, even that isn't automated. |
255
Other software / Finally, they've made an announcement
« on February 24th, 2012, 05:05 PM »
http://www.simplemachines.org/community/index.php?topic=469381.0
I'm disappointed it's taken this long to actually get some kind of announcement about SMF's future - it's been about 8 months since 2.0's gold release, and it sounds like 2.1 isn't making great strides, but it's making *something*, which is a good thing.
I'm not clear on exactly what they mean by the security tokens stuff, and by 'mod/admin sessions' (especially considering what's in SMF already) but the other stuff seems fairly run of the mill for 2.1 itself.
The announcement of 3.0 / smCore is nothing surprising, it's been talked about many times over the years but little has thus far come of it - but you never know. Going for the MVCS approach isn't a bad one (it's cleaner in most cases than MVC itself usually produces) either.
Intriguing but it feels a bit like 'we're not dead yet, honest' to me :(
I'm disappointed it's taken this long to actually get some kind of announcement about SMF's future - it's been about 8 months since 2.0's gold release, and it sounds like 2.1 isn't making great strides, but it's making *something*, which is a good thing.
I'm not clear on exactly what they mean by the security tokens stuff, and by 'mod/admin sessions' (especially considering what's in SMF already) but the other stuff seems fairly run of the mill for 2.1 itself.
The announcement of 3.0 / smCore is nothing surprising, it's been talked about many times over the years but little has thus far come of it - but you never know. Going for the MVCS approach isn't a bad one (it's cleaner in most cases than MVC itself usually produces) either.
Intriguing but it feels a bit like 'we're not dead yet, honest' to me :(