Wedge

Public area => The Pub => Plugins => Topic started by: Arantor on October 2nd, 2011, 06:40 PM

Title: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 2nd, 2011, 06:40 PM
Heh, well, the title might have given you a clue what's going on.

In order to more thoroughly test the plugin system, and indeed a few other things while I'm at it, I'm slowly going to be writing some plugins for Wedge. Most of them won't be huge, in fact I suspect a number of them will fall into the tweaks category, and no doubt I'm going to have to patch them as Wedge itself evolves, but it's a good indicator that I'm on the right direction if I can build these.

Two things:
1. This IS NOT a requests thread. DO NOT request plugins. I'm not taking requests, nor functionality requests for things I've already mentioned here. They will be published when I'm ready and not before.

2. I'm not sharing the plugins here. Apart from the fact that they're likely to need changes as Wedge evolves, you can't even get Wedge yourself yet. And even if you could, it's likely that something will break as things go on, so that until Wedge is at a stable position, there's no point in my handing out anything more than tiny code samples.


Anyway, the first one is a quick hack of the 'Users Online Today' functionality that's used here, though it's without configuration, options or indeed anything other than the absolute minimum functionality.

This is also interesting for me because it's the first time I've bent the rules about code placement. I think I've also found something up with the template skeleton functionality but that's another matter entirely.

Controversially, the entirety of the template and language strings are in the one file. Given that the template is 10 lines of code (and only 2 PHP statements, a global and an echo), and that I'm using 5 language strings out of nicety as 2 or 3 would probably do, with the entire plugin weighing in at 75 lines... having three files (source, language, template) seems just wasteful, and definitely inefficient.

But anyhow, here's a screenshot. It's nothing special - but it does work (after I added a hook to the board index, though I think I'm going to change that hook a bit to suit something else I have in mind). It won't look much different even if I do change that hook, though.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Dr. Deejay on October 2nd, 2011, 07:02 PM
Nice work Arantor ;)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: ['Daniel'] on October 2nd, 2011, 08:36 PM
 :cool: really nice one!!
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on October 2nd, 2011, 08:43 PM
(http://skypeemoticons.net/wp-content/uploads/2010/01/Skype-emoticons-48-yes.gif)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: billy2 on October 2nd, 2011, 09:50 PM
Yay  :wow:
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 3rd, 2011, 05:44 PM
OK, second one. I'm not quite so happy with this, though, but it works well enough, IMO.

Again, no edits. Again, a single file. I couldn't even be bothered to do language string hacking on this one :/

It has a couple of bugs, namely that it won't work when pretty URLs is enabled because it looks for index.php in the URL, and that on layouts that don't have the same header structure as the default theme/skin combo (namely Wedge->Wine->Warm), it will fail because it isn't smart enough to look for a fallback. But for a quick 45 minutes hacking together, I think it works acceptably well.


For the record: Wedge is a theme. Wine is the default skin in that theme. Warm, WorldWind and Wuthering are all skins that inherit from Wine. (Warm and Wuthering are Nao's creations, as is Wine. WorldWind is mine, but it's unfinished and needs more work, especially now the template skeleton stuff is available)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Dr. Deejay on October 3rd, 2011, 07:14 PM
Great work :) I only don't like the font used in the dropdown, but hey that's just me :P
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 3rd, 2011, 07:16 PM
There's not a lot of choice in that seeing how it has to be a monospaced font so the bars line up properly...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 3rd, 2011, 10:52 PM
LOL. Technically i had a quick skin selector in my to-do list. I guess I can drop it now ;)

Is it the same HTML as the dropdown I made on the admin area? If yes we might wanna consider putting it into a sub function...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 3rd, 2011, 11:01 PM
It's really not that polished. I certainly wouldn't publish it, even knowing my earlier published mods weren't nearly as polished.
Quote
Is it the same HTML as the dropdown I made on the admin area? If yes we might wanna consider putting it into a sub function...
See for yourself. ThemeSelector.php - the entire plugin.

Code: [Select]
<?php

if (!defined('WEDGE'))
die('Hacking attempt...');

function 
themeSelector()
{
global $txt$user_info$language$modSettings$context$scripturl;

// Will need this whatever.
loadSource('Themes');

$temp cache_get_data('arantor_theme_listing'180);
if ($temp === null)
{
// Get all the themes...
$request wesql::query('
SELECT id_theme AS id, value AS name
FROM {db_prefix}themes
WHERE variable = {string:name}'
,
array(
'name' => 'name',
)
);
$temp = array();
while ($row wesql::fetch_assoc($request))
$temp[$row['id']] = $row;
wesql::free_result($request);

// Get theme dir for all themes
$request wesql::query('
SELECT id_theme AS id, value AS dir
FROM {db_prefix}themes
WHERE variable = {string:dir}'
,
array(
'dir' => 'theme_dir',
)
);
while ($row wesql::fetch_assoc($request))
$temp[$row['id']]['skins'] = wedge_get_skin_list($row['dir'] . '/skins');
wesql::free_result($request);

cache_put_data('arantor_theme_listing'$temp180);
}

// So, now we have a list of all the themes.
$context['themes'] = $temp;
loadBlock('header_theme_selector''header''add');
}

function 
template_header_theme_selector()
{
global $context$settings$txt;

echo '
Select a skin: <select name="boardtheme" id="boardtheme" onchange="changeTheme(this);" style="font-family: \'dejavu sans mono\',\'monaco\',\'lucida console\',\'courier new\',monospace">'
;

foreach ($context['themes'] as $theme)
{
echo '<option value="'$theme['id'], '"'$settings['theme_id'] == $theme['id'] && (empty($context['skin']) || $context['skin'] == 'skins') ? ' selected' '''>'$theme['name'], '</option>';
if (!empty($theme['skins']))
wedge_show_skins($theme$theme['skins'], 1$settings['theme_id'], $context['skin']);
}

echo '
</select>'
;

add_js('
function changeTheme (obj)
{
var sUrl = new String(window.location);
sUrl = sUrl.replace(/theme=([0-9]+\_[A-Z0-9\+\/\=]+);?/i, "");
var sAnchor = "";
var search = sUrl.search("#");

if(search != -1)
{
sAnchor = sUrl.substr(search);
sUrl = sUrl.substr(0, search);
}

var len = sUrl.length;
var lastchr = sUrl.charAt(len-1);
while ((lastchr == "?" || lastchr == ";") && len > 1)
{
len--;
lastchr = sUrl.charAt(len-1);
}
sUrl = sUrl.substr(0, len);

len = sUrl.length;

var themelink = "theme=" + obj.value + sAnchor;
var indexsearch = sUrl.search("/index.php");

if (indexsearch < len && indexsearch != -1)
window.location = sUrl + ((indexsearch == (len - 10)) ? "?" : ";") + themelink;
else
window.location = sUrl + ((sUrl.charAt(len-1) != "/") ? "/" : "") + "index.php?" + themelink;

return false;
}'
);
}

?>

So, yes, it does use your code but the amount of code that's duplicated, it's not worth making into a function. JS is not clever, not efficient, but it was hacked together quickly!

I find it hilarious that I have almost as much effort in loading the theme list than I do everything else...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: billy2 on October 3rd, 2011, 11:05 PM
How's your blue theme coming on? The one you were going to donate to me ;)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 3rd, 2011, 11:08 PM
Wait, what?

I haven't touched the theme in ages; so long that when I first wrote today's code, I spent 5 minutes debugging why my skin wasn't showing up, only for me to realise I never moved it into the skins/ folder, from the stylings/ folder it had. I don't recall exactly how far back it was that Nao renamed the folder but that - at least - is how long it's been since I even touched it...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: billy2 on October 3rd, 2011, 11:09 PM
Tut tut.  :lol:
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 8th, 2011, 07:00 PM
OK, today's little project is two-fold. Firstly, it's a plugin that provides reCAPTCHA. I'm not a huge fan of it personally, but I know some people are.

Secondly, in order to make it actually work, I had to write add some hooks. Currently it's done as four hooks injected into the control_create_verification and relevant generic control template, and I'm not sure I can make it any smaller, either, given the nature of the different operations.

Still, having implemented the hooks, I'm just working on the admin panel before tackling the proper integration (and thus testing my hooks, heh) and I thought I'd share what that looks like. It's not much in itself, but it will show a few other... hints... relating to other changes in the admin panel.[1]
 1. If you're wondering what I'm talking about, look at Admin > Configuration > Security and Moderation > Anti-Spam in 2.0 final or 2.0.1 and compare the difference. If you're still not clear what I'm getting at, post your questions/concerns here and I'll answer them. ;)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 8th, 2011, 08:22 PM
And now I've implemented the rest, and as far as I can tell, it seems to work as expected.

Screenshot from IE8 attached. I'm not proud of this one particularly, because reCAPTCHA makes certain expectations that I had to work round, namely none of the usual JS functions could be used, the script has to be injected into the template where you want it displayed, rather than using any of the delay functions. Which sucks, especially in the quick reply since it'll actually load prior to any of the Wedge stuff, but it IS using the reCAPTCHA-own URL, so it should be cached.

It's also translatable, which is cool, and the language file is set up to allow that. Just need to throw a readme together before I commit it to the repo.
Posted: October 8th, 2011, 08:11 PM

In other news, yes, this is the quick reply dialogue. You can see one of the new CAPTCHA types in Wedge, an animated-fade-in style (designed and implemented by me), plus the ability to switch to the full editor in a snap.

I really need to make it styleable, though, I don't think I made it so either the plugin or the parent hooks actually are directly styleable (e.g. getting them centralised) but it's hardly a priority.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 8th, 2011, 10:32 PM
Nice!
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 8th, 2011, 10:40 PM
I'm now contemplating what to tackle next, knowing full well that each plugin I'm writing at the moment, I'm almost certainly going to be introducing new hooks each time to support it because of the lack of hooks currently in the system.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 8th, 2011, 11:11 PM
Well that's the idea...!

If you don't know what to do next, do you want me to post my personal to-do list that I don't know when I'll be able to tackle? :P
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 8th, 2011, 11:16 PM
Sure :)

I was deciding between doing some kind of 'related topics' thing or some kind of 'storing post edit history' this evening. The former has some interesting quirks about it that make it a PITA to do, while the latter really depends on having the wesqlQuery stuff in place (though I have no reason not to get that integrated, really)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 8th, 2011, 11:30 PM
I'll post a selection of my to do later. Tomorrow maybe.
Related posts would require implementing topic tags first. I'd say.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 8th, 2011, 11:35 PM
Well, ideally yes, but there's no reason why it can't be done on topic subjects. The headache is performance, the standard solution is to create a separate table of topic subjects and perform a search on those using a fulltext index or something like Sphinx.

The headache, of course, is that such a table would have to be done manually (it always would, because it must be a MyISAM table with a fulltext index, a setup that will soon be going drastically out of fashion as MySQL 5.5 becomes more and more commonplace) or else some other solution devised.

Need more time to mull over the exact implementation of that one, so maybe will do edit history instead.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 9th, 2011, 12:42 AM
I posted the list in the related topic.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 9th, 2011, 12:50 AM
Awesome, I've commented on a very limited number for now, there's a lot to take in there!
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 9th, 2011, 03:31 PM
Do you want the rest of my to-do? :lol:
(Well, anything not related to French fixes or whatever... And minor AeMe tidbits...)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 9th, 2011, 03:55 PM
I've done some bits, and will likely tackle some more today. I'm in a funny mood today, can't seem to settle and be in the 'coding place'.
Posted: October 9th, 2011, 03:37 PM

Btw, once I've got a few more plugin-y type things together, I'll do another blog post. It's been almost a month since our last blog post, so probably time to post something else - and we have screenshots we can use :)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 9th, 2011, 06:25 PM
I started work on a blog post yesterday but it was cheesy so I dropped it. I hate apologizing for the lack of progress. I'm not paid. We are doing more work than smf. Only thing that makes me feel bad is that nightwish is more active than I am. I wish I'd be as fresh as I was a year ago.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 9th, 2011, 06:29 PM
You're allowed to be tired. It's been a long road this last year, and I'm sorry I wasn't able to spend quite as much time on the dev trail as I'd have liked. But I'm able to put the time into it right now, which means likely a flurry of commits as I make the changes I want to make, and then the commits to fix mistakes I make... *whistle*

The other thing is that when we started out, we had a lot of motivation fuelled by anger, and that's tempered a fair bit as they sort of got their act together, but moreso because we've put a lot of it behind us so we're able to see things more objectively now than a year ago.

That's partly why I'm pushing plugins the way I am, it enables me to spend a few hours on something and be able to call it close enough to 'done' to not worry about it. Sure, I'll go back to my plugins in a week or a month or whatever and do more work - but it's something bitesized that doesn't drain my energy too much.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 9th, 2011, 11:17 PM
You dd a fantastic job this week. For the first time in months (ever?), you beat me in number of commits, and by far, without me even slowing down my usual pace. I'm also very thankful that you decided to tackle some of my todo list. Ive always known you're a great coder and felt a bit lonely these last few months. It's really good to know I can slow down if I want (because of my very severe burnout) and wedge will still be worked on. Again thanks :)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 9th, 2011, 11:31 PM
You're more than welcome :) It *is* about time I pulled my weight, so to speak :lol:

Now, if only we had an awards plugin... maybe that should be my next target, heheh...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: live627 on October 9th, 2011, 11:46 PM
Quote from Arantor on October 9th, 2011, 11:31 PM
Now, if only we had an awards plugin... maybe that should be my next target, heheh...
Did you peek into my plugin repo? :P lol
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 9th, 2011, 11:48 PM
Quote from live627 on October 9th, 2011, 11:46 PM
Quote from Arantor on October 9th, 2011, 11:31 PM
Now, if only we had an awards plugin... maybe that should be my next target, heheh...
Did you peek into my plugin repo? :P lol
Nope but it's been on my to-do list for a while, as well as a points type system (and naturally, the integration between the two)

You'd be surprised how much of this stuff goes through my head while I'm just standing making the first cup of tea in the moment... this morning's was to try and figure out the best way to manage that.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 10th, 2011, 01:46 AM
OK, another quick one from me. This time it's a small plugin I've named Flitter, so called because it handles Facebook, Twitter and Google like/share buttons.

Quite a few pictures to cover off. Picture 0[1] shows the new admin icon. It's not a particularly nice icon but it shows that it can be done and the plugin naturally will demonstrate how to achieve doing it yourself.

Picture 1 shows the plugin settings page. This is actually purely internal; there's no custom template for the admin settings here, it's all using the internal settings template, just more thoroughly than most might realise is possible.

Picture 2 shows it added to the sidebar, while picture 3 shows it added above the topic.

I should again reiterate the usual with these plugins: there's no file edits, no voodoo, it's all making use of the systems provided by the underlying system to achieve these things.[2]
 1. I'm a programmer, what of it? Of course, this wasn't because I forgot to do it originally but wanted to have this one first... ;)
 2. And in one case I'm still not clear whether it's a bug or not, but whatever, it's good for testing these crazy things out.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 13th, 2011, 05:24 PM
After a couple of days of slacking on the plugin front, here's a pic of the next one. Elsewhere you'll have seen me threaten to make birthdays a plugin. Well, now it is.

So far, I've just removed the birthdays stuff from core and dumped it into a plugin of its own. It's not finished but it should work as expected (not tested birthday emails yet) at least it certainly seems to for the front page.

Note that this isn't its final position, final layout or anything. I'll likely change the look slightly (using a birthday cake icon and putting in the group colour, amongst other things, oh and putting it up above the forum stats block, but that's pending some investigation in to the template skeleton code)

But it is otherwise a conventional plugin now rather than a core feature.

(No, it is not my birthday today or within the next 7 days)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: live627 on October 13th, 2011, 07:54 PM
I like how you use the word "threaten" :P
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 13th, 2011, 11:27 PM
Technically, I'm surprised that so much data & code was linked to the birthday feature... Really. I thought it'd make for a sub-2KB plugin but now I suspect it'll be at least 10KB...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 13th, 2011, 11:44 PM
It is a bit more than 10K but a decent amount of that is language strings.

It is also interesting to note that I've rewritten the way birthdays are cached, and a few other things, which is why it bulked out a bit.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: TE on October 18th, 2011, 12:51 PM
started to play with my first plugin (authentication module), but I'm confused 'cause I get these errors:
Quote
One or more features required by this plugin are not available. (verify_user, register)
the xml part in plugin-info.xml is this:
Code: [Select]
<hooks>
<function point="verify_user" function="integrate_verify_user" filename="$plugindir/authenticate" />
<function point="reset_pass" function="integrate_reset_password" filename="$plugindir/authenticate" />
<function point="verify_password" function="integrate_verify_password" filename="$plugindir/authenticate" />
<function point="register" function="integrate_register" filename="$plugindir/authenticate" />
<function point="validate_login" function="integrate_validate_login" filename="$plugindir/authenticate" />
</hooks>

Is there something wrong with my hook definition? Maybe a bug within the plugin manager?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 18th, 2011, 01:18 PM
Hrm. It seems I missed adding both hooks to the list of known hooks for some reason.

At the end of ManagePlugins.php is a list of what is supposed to be all the hooks in Wedge's core. just add those two to the list and it'll allow you to use them.

I'll fix my local copy so it can be committed in future.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: TE on October 18th, 2011, 02:32 PM
Quote from Arantor on October 18th, 2011, 01:18 PM
just add those two to the list and it'll allow you to use them.
Thanks, that's it  :cool:
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 18th, 2011, 02:34 PM
Yeah, it's a fairly simple enough test: get all the hooks we know and see if a plugin requests any we don't know :P But that doesn't help if not all the ones actually in Wedge aren't listed. Guess I'll have to check that again :/
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 18th, 2011, 03:10 PM
Maybe you should make a script that runs through your local install and automatically extracts hook names ;)
The problem is that it's not something we can easily overlook. We need a full list of hooks, if only to be able to document them later... (What you did in ManagePlugins was a good start!)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 18th, 2011, 03:20 PM
Yeah, that's something I meant to do but the starting list was generated by doing a search on call_hook and going through the results. I must have missed a couple as I went.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 18th, 2011, 05:17 PM
Some hooks are stored in an array but I doubt any of these would never be called the normal way elsewhere?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 18th, 2011, 05:24 PM
Which hooks?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 20th, 2011, 10:59 PM
$action_hooks or something... IIRC.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 20th, 2011, 11:06 PM
call_hook('actions') ? It's called normally.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: live627 on October 21st, 2011, 01:20 AM
Maybe the buffer hooks? Those are called in a special way...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 21st, 2011, 01:22 AM
True, they are, but I'm fairly sure I dealt with them.

Though, call_hook('actions') was silently broken for a while recently, until I noticed and fixed it by renaming it to avoid a collision in the plugin loader.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 21st, 2011, 09:56 AM
Just search for call_hook($ in the codebase. I'd say.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 21st, 2011, 09:57 AM
When I originally did it, I just hit up every place where call_hook was used, without being specific in terms of variables.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 25th, 2011, 03:59 PM
In other news, I've started work on a new plugin. Details will be shared when I have something to share but suffice to say it's a bigger plugin than any of those in this thread, it will probably end up being smaller than WedgeDesk in the end (with any luck) but it is also something I've long thought about doing and never done before.

What I will say at this juncture is that it is a ground-up rewrite of an older SMF mod, without using any of the original code, database tables or JavaScript, and that it will naturally come with the sorts of refinements that you should be used to by now from me :P This one isn't so much to prove the plugin system but that I need to take a mental break from all the plugin stuff itself because I'm fed up trying to solve the issues attached to things like FTP for the moment.

Also, slightly more controversially is that I've chosen a licence for it, and it's one that I suspect a number of people won't be too pleased with, because it's the CC Attribution No-Derivs(http://creativecommons.org/licenses/by-nd/3.0/) licence. It means that it can be shared but not forked, mostly because I want to retain control of it, but of course if I end up getting fed up with it I'll relicence it appropriately at the time.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on October 25th, 2011, 05:46 PM
What's the difference with mpl? Less restrictive I suspect?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on October 25th, 2011, 06:00 PM
As compared to...?

From http://en.wikipedia.org/wiki/Mozilla_Public_License
Quote
The rights granted by the initial author include: 1. to use, reproduce, modify, display, perform, sublicense, and distribute the source, and modified version of the source. 2. patent rights to use and make available the original code 3. to distribute works which contain the code in combination with new code, and to license the new code in any way the distributor wishes
The rights granted by subsequent users include: 1. to use, reproduce, modify, display, perform, sublicense and distribute the source of their modifications 2. patent rights to use and make available both the modifications and the entire work 3. to distribute works which contain the code in combination with new code, and to license the new code in any way the distributor wishes
Quote
The way in which the Mozilla Public License is drafted basically requires subsequent users to license the original code under MPL and all additional code under any kind of license. Therefore, a company can create a proprietary product from code licensed under MPL by licensing the added components in a closed source manner. The stipulation that core files stay under the MPL provides incentive for developers to improve and develop aspects of the core functionality. The MPL is GPL-incompatible because the GPL module cannot be legally linked with an MPL module.
Long story short, if an MPL module were to be implemented in Wedge for any reason, that's fine. It's compliant with just about any licence out there, doesn't enforce wider licence changes (unlike GPL) but pretty much enforces that any MPL file *stays* MPL, because you can't have a file that's both MPL and proprietary.[1]

Essentially if we were to integrate something, the MPL file(s) and any changes we've made to make them work would remain MPL, irrespective of the rest of Wedge's licence, regardless of what licence that is.

In some ways it's better than BSD because it doesn't allow sub-licensing in the way BSD does, and it should be noted that if SMF were MPL licensed rather than BSD licensed, we'd have a much harder time justifying the current non BSD licence (and even harder trying to enforce that)

I don't really plan on using MPL for my plugins though, for the time being I'm much happier sticking a free to redistribute, but no derivative works licence on them.
 1. By which I mean any other licence, technically. Even GPL comes into that category.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 04:09 AM
OK, had a bit of time this evening and while I worked on a few other things too, I primarily updated my Users Online Today plugin for Wedge.

It now has the ability to display users online not only 'today' (based on server time) but also online in the last 24 hours (from now) or last 7 days (from now), is allowed to be shown to 'anyone', 'anyone signed in', 'admins and global moderators' (based on moderate_forum or admin_forum permissions) or 'admins' (true admins), and lets you reorder by name or time, ascending or descending.

The only thing left to really do with it would be to display the 'last online' time as a hovertext to the links themselves, but other than that... I'm not really that fussed with it to be honest. It all works, it now even has its own admin area to play with, with all of its three options.[1]

That kicks at least three different SMF mods off the possible to-do list, too...
 1. Yes, I know I could use the equivalent of Modification Settings, but I far rather don't pollute things that aren't mine, so to speak, and it's not like it's actually that much work to integrate anyway.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Powerbob on November 13th, 2011, 04:43 AM
WOW nice one, well done  :cool:

Something I definitely will be using. When the time comes  :whistle:
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: billy2 on November 13th, 2011, 01:00 PM
Brilliant !!
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 01:01 PM
It's not like I have a list of SMF mods that I want to make or anything :whistle:
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on November 13th, 2011, 01:04 PM
And that's one mod we will be using here!
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 01:07 PM
It isn't exactly the same as the picture any more; I changed it slightly because I discovered that if the number of visitors was rather high, it would potentially cause the header to wrap, so I made it fit closer to the normal online list.

The code's not the best in the world (it's in my plugins repo if you're interested) and I'm fairly sure it could probably be cached without too much effort, just that I didn't bother doing so at this time.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 02:06 PM
In other news, my next little project is a port of my SimpleDesk shoutbox to Wedge (decoupling it from SimpleDesk in the process) and maybe adding some neat features in the process.

More details as and when I'm done with it :)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on November 13th, 2011, 02:12 PM
Won't that overlap with thoughts?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 02:17 PM
Nope.

I'm talking about the AJAX/realtime type deal.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on November 13th, 2011, 03:40 PM
Now this plugin is tarting to intrigue me as the option for user's in the last 24 hours would be my preference :)
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 03:42 PM
'Today' is the default, but yeah, 24 hours is what I actually expect a lot of people to use, especially on forums that have multiple time zone users.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on November 13th, 2011, 04:15 PM
Agreed there, when we tried the Users Online mod, everyone complained that the list reset at midnight server time. Even those on the same time as the server didn't like it too much.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 04:15 PM
That mod should actually offer 24 hours and 7 days now?
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on November 13th, 2011, 04:27 PM
I'm not sure what it does now, after the complaints we had removed it and never really checked on it since.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 04:31 PM
If it's http://custom.simplemachines.org/mods/index.php?mod=217 it does today, 24 hours, 7 days, accounts for buddies and hidden properly and also displays the time the user was last online.

Mine doesn't display the time the user was last online (as a tooltip) and it doesn't account for buddies but that's more because I'm not actually that fussed about accounting for buddies...
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on November 13th, 2011, 04:57 PM
Thanks just took a quick look and that's the same mod, for some reason I never got the options for changing today vs. 24 hours etc, maybe another mod conflicts. Just re-installed for the heck of it and searched high and low and still no options to change it.

SMF's buddy system is rather week anyway. If someone is adding me to their buddy list I'd like to knwo about it and have the ability to approve, ignore, or block the person. The current implementation is more like a stalker list if IMO.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on November 13th, 2011, 04:59 PM
Wedge will have asynchronous friend lists like here.
When I get to it.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Arantor on November 13th, 2011, 05:06 PM
Quote from Nao on November 13th, 2011, 04:59 PM
Wedge will have asynchronous friend lists like here.
When I get to it.
^^ why I'm not interested in supporting it for my plugins :P
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: spoogs on November 13th, 2011, 05:25 PM
Thanks for the heads up Nao, I hadn't noticed how it was implemented here.
Title: Re: Personal plugin showcase (yes, I'm an attention grabbing git)
Post by: Nao on November 13th, 2011, 08:24 PM
It's Ultimate Profile with some custom code like the ability to hide selected contacts (eg you want to follow someone but don't want it to be known.)