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.
2776
Plugins / Re: Something I started working on
« on September 22nd, 2012, 04:06 PM »Always looking for plugins eh? Be a man, write everything yourself!
Okay, may have found a bug somewhere, *or* I incorrectly set something up, but it shouldn't be doing this...
And it seems that your plugin system provides an absolute URL to the tick.png file. It should either calculate the relative position for it, or we should update the admin code to deal with absolute URLs... What do you prefer..?
There's also the other matter: making it easy to use. The current structure is easy enough to follow for modders. If you want @dynamic to mess around with it and do something else, that's absolutely fine, but please please please do not force modders to have to do something more byzantine and awkward to put an icon in to the admin menu. (I'm still not happy with how plugins have to jump through hoops like adding a whole line of CSS including positioning to add a simple main menu icon.)
The rest of the code is straightforward on this point: if the icon looks like a URL, treat it as a URL, if it doesn't look like a URL, fetch it from the admin folder of the theme's images.
Also, remember that a plugin CANNOT know for certain what folder it will be installed in, relative to Plugins/, which is the whole point of having the context variables. If you want to make it relative, do it OUTSIDE of the plugin, e.g. in the @dynamic code.
2777
Features / Re: Plugin revs
« on September 21st, 2012, 02:39 PM »
(1 file, 2KB)
Revision: 50
Author: arantor
Date: 21 September 2012 13:39:21
Message:
! [Topic Solved] Fix for permissions not being checked exactly as they should. (TopicSolved-MessageIndex.php)
----
Modified : /topic_solved/src/TopicSolved-MessageIndex.php
Revision: 50
Author: arantor
Date: 21 September 2012 13:39:21
Message:
! [Topic Solved] Fix for permissions not being checked exactly as they should. (TopicSolved-MessageIndex.php)
----
Modified : /topic_solved/src/TopicSolved-MessageIndex.php
2778
Features / Re: Plugin revs
« on September 21st, 2012, 04:04 AM »
(2 files, 1KB)
Revision: 49
Author: arantor
Date: 21 September 2012 03:04:27
Message:
! [Topic Solved] Debugged quick moderation, it does actually function. Permissions have not been tested. (plugin-info.xml, TopicSolved-QuickMod.php)
----
Modified : /topic_solved/plugin-info.xml
Modified : /topic_solved/src/TopicSolved-QuickMod.php
Revision: 49
Author: arantor
Date: 21 September 2012 03:04:27
Message:
! [Topic Solved] Debugged quick moderation, it does actually function. Permissions have not been tested. (plugin-info.xml, TopicSolved-QuickMod.php)
----
Modified : /topic_solved/plugin-info.xml
Modified : /topic_solved/src/TopicSolved-QuickMod.php
2779
Off-topic / Re: Wedge Appreciation Thread
« on September 21st, 2012, 12:19 AM »
Pfft. The only people who should be scared of me are people who want all the rewards without any of the work.
I also don't have any compunctions about telling people exactly what I think. I guess a lot of people are frightened of being told the truth in no uncertain terms.
I also don't have any compunctions about telling people exactly what I think. I guess a lot of people are frightened of being told the truth in no uncertain terms.
2780
Off-topic / Re: Wedge Appreciation Thread
« on September 20th, 2012, 08:45 PM »Like, where would I be able to see the CSS/HTML
2781
Features / Re: Sidebar emulation method in IE6/7
« on September 19th, 2012, 09:09 PM »
The idea being that all browsers use the same code...
2782
Features / Re: Plugin revs
« on September 19th, 2012, 03:33 PM »
(19 files - includes folders apparently, 49KB)
Revision: 48
Author: arantor
Date: 19 September 2012 14:31:25
Message:
! [Topic Solved] Initial checkin. Quick mod doesn't work at the present time but I'm fed up of it right now.
----
Added : /topic_solved
Added : /topic_solved/img
Added : /topic_solved/img/cross-button.png
Added : /topic_solved/img/tick-button.png
Added : /topic_solved/img/tick.png
Added : /topic_solved/img/tick_big.png
Added : /topic_solved/lang
Added : /topic_solved/lang/TopicSolved-Admin.english.php
Added : /topic_solved/lang/TopicSolved-Display.english.php
Added : /topic_solved/lang/TopicSolved-MessageIndex.english.php
Added : /topic_solved/plugin-info.xml
Added : /topic_solved/readme
Added : /topic_solved/readme/readme.english.txt
Added : /topic_solved/src
Added : /topic_solved/src/TopicSolved-Action.php
Added : /topic_solved/src/TopicSolved-Display.php
Added : /topic_solved/src/TopicSolved-MessageIndex.php
Added : /topic_solved/src/TopicSolved-Permissions.php
Added : /topic_solved/src/TopicSolved-QuickMod.php
(The readme is pretty much just a placeholder too, will likely extend that at some time)
Revision: 48
Author: arantor
Date: 19 September 2012 14:31:25
Message:
! [Topic Solved] Initial checkin. Quick mod doesn't work at the present time but I'm fed up of it right now.
----
Added : /topic_solved
Added : /topic_solved/img
Added : /topic_solved/img/cross-button.png
Added : /topic_solved/img/tick-button.png
Added : /topic_solved/img/tick.png
Added : /topic_solved/img/tick_big.png
Added : /topic_solved/lang
Added : /topic_solved/lang/TopicSolved-Admin.english.php
Added : /topic_solved/lang/TopicSolved-Display.english.php
Added : /topic_solved/lang/TopicSolved-MessageIndex.english.php
Added : /topic_solved/plugin-info.xml
Added : /topic_solved/readme
Added : /topic_solved/readme/readme.english.txt
Added : /topic_solved/src
Added : /topic_solved/src/TopicSolved-Action.php
Added : /topic_solved/src/TopicSolved-Display.php
Added : /topic_solved/src/TopicSolved-MessageIndex.php
Added : /topic_solved/src/TopicSolved-Permissions.php
Added : /topic_solved/src/TopicSolved-QuickMod.php
(The readme is pretty much just a placeholder too, will likely extend that at some time)
2783
Features / Re: New revs
« on September 19th, 2012, 03:27 PM »
(2 files, 2KB)
Revision: 1697
Author: arantor
Date: 19 September 2012 14:27:28
Message:
! Stupid bug in permissions code when there aren't any enabled plugins. (ManagePermissions.php, Reports.php)
----
Modified : /trunk/Sources/ManagePermissions.php
Modified : /trunk/Sources/Reports.php
Revision: 1697
Author: arantor
Date: 19 September 2012 14:27:28
Message:
! Stupid bug in permissions code when there aren't any enabled plugins. (ManagePermissions.php, Reports.php)
----
Modified : /trunk/Sources/ManagePermissions.php
Modified : /trunk/Sources/Reports.php
2784
Features / Re: New revs
« on September 19th, 2012, 04:47 AM »
(4 files, 9KB)
Revision: 1695
Author: arantor
Date: 19 September 2012 03:47:02
Message:
! Added permissions management directly from the plugin files. (plugin-info.rng, ManagePermissions.php, ManagePlugins.php, Reports.php)
----
Modified : /trunk/Sources/ManagePermissions.php
Modified : /trunk/Sources/ManagePlugins.php
Modified : /trunk/Sources/Reports.php
Modified : /trunk/other/plugin-info.rng
Revision: 1695
Author: arantor
Date: 19 September 2012 03:47:02
Message:
! Added permissions management directly from the plugin files. (plugin-info.rng, ManagePermissions.php, ManagePlugins.php, Reports.php)
----
Modified : /trunk/Sources/ManagePermissions.php
Modified : /trunk/Sources/ManagePlugins.php
Modified : /trunk/Sources/Reports.php
Modified : /trunk/other/plugin-info.rng
2785
Bug reports / Re: Mismatch detector is broken
« on September 19th, 2012, 03:53 AM »
OK, I found the root cause of why this was broken.
You'll notice above the code block is a mismatched nb item. That was what was causing it to go wrong - because other stuff was trying to fix it like inserting tags to match the nb.
That could be really annoying and confusing.
You'll notice above the code block is a mismatched nb item. That was what was causing it to go wrong - because other stuff was trying to fix it like inserting tags to match the nb.
That could be really annoying and confusing.
2786
Features / Adding permissions from plugin-info.xml
« on September 19th, 2012, 03:28 AM »
I mentioned yesterday that I would have to look at this, and well, here we are.
This is, interestingly, absolutely required in the long term, so I might as well do it now.
Problem 1: unless permissions are declared in the plugin-info.xml file, there's no way for the system to automate cleanup when removing a plugin. This would be more of a problem if it weren't for problem 2.
Problem 2: even if you declare permissions in your plugin's settings page (using the permissions option or similar), there is a possibility that the main manage-permissions code can remove them again because they're not part of the main permissions code as well.
Consequently, we actually have to declare permissions and add them to the main permissions area, even if you keep all the settings in the plugins area like I've been doing. It sucks, but given the rest of the architecture that's actually the best way to go forward.
What it does mean is that you do need to actively declare your permissions, regardless of anything else. And if you really want to do complex stuff, you can still use the hooks that are there, but you must ALWAYS declare permissions in the plugin-info.xml file.
Even if you're doing byzantine stuff like declaring permissions guests can't have, which isn't in the plugin-info.xml file but only accessible via the hook to keep the structure lean, you still have to put the bulk of permissions stuff in plugin-info.xml.
Here's what the structure will look like - simplest case, like I've added for topic solved.
Code: [Select]
Anyone who's added SMF permissions should recognise all the components of that ;) In case people haven't... let me break it down.
<newperms> is the overall container. If that block isn't found, there's no permission processing to do. If it is, there should be a filename entry, which should cover the language file which contains all the strings for that plugin's permissions.
<permissionlist> is the container for all the permissions. There is another container I'll get onto in a moment.
<permission> declares a new permission. Type is membergroup or board, for whichever it is, name is the core permission name. ownany declares whether it is an own/any permission or not, and if it isn't, the name will be the actual name for allowedTo() tests. Otherwise it'll be the permission + _own and _any, just like in SMF.
classic indicates which group it will be added to in Classic View, simple for Simple View, just like in SMF. I may yet rip this stuff out, don't know yet.
If you need to add a whole new group of permissions, you can do so by also adding the groups container.
For example, if I had wanted to make a new section for Topic Solved entirely, I could have done so with:
Code: [Select]
All the $txt requirements (i.e. what all these should be named) is entirely unchanged from what it is in SMF.
This looks cumbersome but it actually is no more than you'd have written making permissions in SMF (and this is simpler in practice, you just declare it and it works)
This is, interestingly, absolutely required in the long term, so I might as well do it now.
Problem 1: unless permissions are declared in the plugin-info.xml file, there's no way for the system to automate cleanup when removing a plugin. This would be more of a problem if it weren't for problem 2.
Problem 2: even if you declare permissions in your plugin's settings page (using the permissions option or similar), there is a possibility that the main manage-permissions code can remove them again because they're not part of the main permissions code as well.
Consequently, we actually have to declare permissions and add them to the main permissions area, even if you keep all the settings in the plugins area like I've been doing. It sucks, but given the rest of the architecture that's actually the best way to go forward.
What it does mean is that you do need to actively declare your permissions, regardless of anything else. And if you really want to do complex stuff, you can still use the hooks that are there, but you must ALWAYS declare permissions in the plugin-info.xml file.
Even if you're doing byzantine stuff like declaring permissions guests can't have, which isn't in the plugin-info.xml file but only accessible via the hook to keep the structure lean, you still have to put the bulk of permissions stuff in plugin-info.xml.
Here's what the structure will look like - simplest case, like I've added for topic solved.
<newperms filename="lang/TopicSolved-Permissions">
<permissionlist>
<permission type="membergroup" name="topicsolved" ownany="true" classic="general" simple="view_basic_info" />
</permissionlist>
</newperms>Anyone who's added SMF permissions should recognise all the components of that ;) In case people haven't... let me break it down.
<newperms> is the overall container. If that block isn't found, there's no permission processing to do. If it is, there should be a filename entry, which should cover the language file which contains all the strings for that plugin's permissions.
<permissionlist> is the container for all the permissions. There is another container I'll get onto in a moment.
<permission> declares a new permission. Type is membergroup or board, for whichever it is, name is the core permission name. ownany declares whether it is an own/any permission or not, and if it isn't, the name will be the actual name for allowedTo() tests. Otherwise it'll be the permission + _own and _any, just like in SMF.
classic indicates which group it will be added to in Classic View, simple for Simple View, just like in SMF. I may yet rip this stuff out, don't know yet.
If you need to add a whole new group of permissions, you can do so by also adding the groups container.
For example, if I had wanted to make a new section for Topic Solved entirely, I could have done so with:
<newperms filename="lang/TopicSolved-Permissions">
<groups>
<group type="membergroup" column="right" classic="ts_group" simple="ts_group" />
</groups>
<permissionlist>
<permission type="membergroup" name="topicsolved" ownany="true" classic="ts_group" simple="ts_group" />
</permissionlist>
</newperms>All the $txt requirements (i.e. what all these should be named) is entirely unchanged from what it is in SMF.
This looks cumbersome but it actually is no more than you'd have written making permissions in SMF (and this is simpler in practice, you just declare it and it works)
2787
Bug reports / Mismatch detector is broken
« on September 19th, 2012, 03:20 AM »
It gets very confused. See attachment. It clearly isn't mismatched but it's complaining nonetheless.
Also, if I save this as a draft, then go to re-edit the draft, it pre-pends a code bbc in front of everything - as if the first code tag is irrelevant.
Posted: September 19th, 2012, 03:18 AM
Also, if I save this as a draft, then go to re-edit the draft, it pre-pends a code bbc in front of everything - as if the first code tag is irrelevant.
2788
The Pub / Re: Language editing inside Wedge
« on September 18th, 2012, 06:50 PM »
You know me by now, I do not give that much credence in how other things do it. I care about how I think it should be done in Wedge. You're conflating two separate use cases under one umbrella, which as I already alluded to is not how it should be. Let's clear that up right now.
Use case 1: Translators
In the *short term*, translators have to copy files and edit them directly. Putting the bulk of stuff in the database makes it harder for them to translate, unless we build a complete translation interface directly into Wedge, which is a very large waste of time by making something that ends up with every user when only a fraction of a percent of users will use it.
In the *long term* we end up with something like sm.org has, a translation facility. It's a facility that tracks all the languages, all the changes and allows for building translation packages, much like SMF's language packs. This doesn't require any file editing, it's all a web based interface.
User friendliness is not really a concern in these cases because of the very small number of people that will have to deal with these things.
User case 2: Users wanting to customise their setup
This is the only scenario I give a damn about in the core package itself, because this would be useful to potentially any site owner who wants to customise their site. There is already a foundation of one of these in SMF and Wedge (see Admin > Languages, you can select a language then edit its files there)
I want to be able to give people the ability to edit the language files directly from the ACP, without them having to go into code or manually edit files, or to have to open the permissions up. Doing so as suggested would allow people to edit things from the ACP, without any of these other issues - and it could be made to be more friendly than what is presented available right now. I mean, it would be huge if people even knew it was there...Quote That's even less user friendly, in fact, and I'm well aware that other systems do this and it is one reason I've avoided them.
Use case 1: Translators
In the *short term*, translators have to copy files and edit them directly. Putting the bulk of stuff in the database makes it harder for them to translate, unless we build a complete translation interface directly into Wedge, which is a very large waste of time by making something that ends up with every user when only a fraction of a percent of users will use it.
In the *long term* we end up with something like sm.org has, a translation facility. It's a facility that tracks all the languages, all the changes and allows for building translation packages, much like SMF's language packs. This doesn't require any file editing, it's all a web based interface.
User friendliness is not really a concern in these cases because of the very small number of people that will have to deal with these things.
User case 2: Users wanting to customise their setup
This is the only scenario I give a damn about in the core package itself, because this would be useful to potentially any site owner who wants to customise their site. There is already a foundation of one of these in SMF and Wedge (see Admin > Languages, you can select a language then edit its files there)
I want to be able to give people the ability to edit the language files directly from the ACP, without them having to go into code or manually edit files, or to have to open the permissions up. Doing so as suggested would allow people to edit things from the ACP, without any of these other issues - and it could be made to be more friendly than what is presented available right now. I mean, it would be huge if people even knew it was there...
Perhaps one should put the master language(s) in the database, "only" able to be printed out to a file that can be edited. This way you'd avoid people accidentally editing the master file(s).
2789
The Pub / Re: Language editing inside Wedge
« on September 18th, 2012, 06:17 PM »It's really relevant to any topic discussing translations, in my opinion.
The master language files are always left alone, whatever the language. Then the edits are made locally to a given language. Doing a translation means in the first case manually copying the files and editing them - but only until we get around to making a proper language editor here for translators (which will auto rebuild language packs)
In any case this setup is not designed for translators' benefit, it is designed for people who want to customise their installation without having to edit files directly (with all the attendant problems that go with it)
You guys already knew that SMF had a built-in language editing facility that also wasn't designed for translation, right?
The idea is very interesting. Is caching implied too?
There is a pretty easy interface to change the language strings in MyBB.
I have absolutely no idea... Would this make the code slower overall?
Also, how do we deal with PHP code in languages files, you know, the array declarations, string concatenation and other things...?
As far as the array declarations, it's still not a problem, the language editor just has to understand how to read the array, and then be able to overwrite the array later. All that really means is to store the serialised array and unserialise it when loading from the DB.
The speed issue is the big one. Practically it means intercepting loadLanguage and loadPluginLanguage calls, perform them then pull from the database. We can also cache the resulting language file, though.
Oh, and while I'm at it -- I'm also working on integrating language strings directly into JavaScript files.
How do I do that...? Oh, so simple.
What did we decide in the end?
2790
Bug reports / Re: Permissions UI does not honour illegal permissions properly
« on September 18th, 2012, 05:05 PM »
I gotta do other things with the permissions stuff anyway, and last night I wrote up how I want to extend the permissions code from plugin-info.xml files, so I can probably fix this along the way.