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
6136
Features / The calendar
« on October 4th, 2011, 12:17 PM »
Been thinking about this quite a bit today, not entirely sure why.

On the list of plugins I'd made, recurring events and event registration/RSVP came up fairly high on the list for calendar plugins.

But what I'm wondering is about unbundling the calendar. Our stance on it has always really been that if we give the calendar a real use, it can stay - and I know it can have plenty more uses than it currently has, but I'm wary of putting all that into the core. I don't know why I'm so reticent about it, there's really no reason for it.

Now that the plugin manager is basically functional, though, there's no real reason why I can't bundle the calendar into a plugin and have that developed separately. I guess there is a part of me that's enthusiastic about segregating functionality, especially since the calendar is not the fastest thing in the world (I'd leave birthdays in the core, though!)

It would, interestingly, also ensure that several hooks exist and are proven to work (notably integrating stuff into the post dialogue, validating it on reception and throwing it back for an error)

Thoughts?
6137
Features / Re: These two bytes may not matter to you...
« on October 4th, 2011, 12:04 PM »
In other news, I thought I'd try a new tactic with getting phpseclib down in size. I'm not yet sure whether I'm entirely happy with it, but anyway.

I went through the files, making sure I only had the files I needed, then pushed them all through http://customhost.com.ua/php-minify/ to strip comments. I made sure to leave whitespace in and preserve newlines since I still want readable source, then did some regex magic to convert all the leading 4-spaces to tabs and I'm now down to ~280K with it. My target's always been 250KB to try and slim it down to, since if it's there, I figure it's small enough to justify its inclusion.

On reflection, I realised that I was a bit uptight with my PHP 5.3 compatibility changes, a class having its own name as a function will still be called for a default constructor, provided it's not namespaced, so I don't need to go through and convert the default constructors to __construct, but I now don't have the source I did changes to initially, it still has all the PHP 4 compatibility in it, and more irritatingly I ditched the conversion I did to indicate visibility of variables - they're all declared as var rather than public/private, which means they'll all be technically public.

Here's the thing: do I do it *right* and fix all that, or do I leave it, knowing that it'll work because it's not actually an issue per se and leave it being smaller?
6138
Features / Re: New revs - Public comments
« on October 4th, 2011, 10:32 AM »
Get bionic knees!!
6139
Plugins / Re: Plugin development
« on October 4th, 2011, 10:31 AM »
Alternatively I can still use RepositoryHosting ;) Sure, it's not free (but is only $6/month) but the choice of SVN, Mercurial and Git, with more control over the number of users/permissions etc... makes it fairly hard to beat short of running it myself.
6140
The Pub / [Archive] Re: Logo Madness
« on October 4th, 2011, 08:52 AM »
They'd be rectangular. I didn't explain myself that well, I'll try and mock up what's inside my head later on.
6141
The Pub / [Archive] Re: Logo Madness
« on October 4th, 2011, 12:28 AM »
Hmmm, I've wondered today about making badges based on my avatar-interpretation-of-logo, where I'd create a grey-scale base that would look like a base that supported the logo (as though the logo were placed into a slight recess in the surface).

Then, I'd write a PHP script to accept a colour, it would tint the background, insert the text I give it, then overlay the logo into place to make new badges. It seems like a lot of effort but that's the sort of crazy thing only I would do, because that way I'd be able to spin new badges out for whatever teams/colours we want :)

I think it would also probably necessitate a custom font renderer since I'd keep the same font but there's no really good way to outline the font we currently use cleanly (having already tried it) but that's not exactly a killer. Either I'd get the text and draw it or encode it into the script like I did for the CAPTCHA font.

* Arantor has funky crazy ideas late at night.
6142
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...
6143
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...
6144
There's not a lot of choice in that seeing how it has to be a monospaced font so the bars line up properly...
6145
Plugins / Re: Hooking up data loading
« on October 3rd, 2011, 05:51 PM »
Well, I don't think I can do too much more work on the plugin manager (other than minor stuff) without adding this before long, simply because most of the hooks I'd really want to add, well, depend on this.

I'm not imagining any problems off it right now, I'll have another read of the code later on tonight, then look at playing with it in a real environment unless anyone has anything else to add?
6146
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)
6147
Off-topic / Re: Doctor Who
« on October 3rd, 2011, 05:19 PM »
Nope, not seen it, what's it about?
6148
Off-topic / Re: Doctor Who
« on October 3rd, 2011, 03:21 PM »
Quote
Oh, that's something I definitely should do again... Only watched most episodes once.
Yeah, what happened with us is that I got Liz watching it after series 5, and we ended up buying the first 4 series that summer (and the 5th when it came out), so we could rewatch it in its entirety back to back before the Christmas special.

Even though I'd seen them all before, I was seeing things I didn't remember.
Quote
Actually, I think I missed two episodes from the show -- an episode with cat women on New New York, and The Girl From the Fireplace. And yes, I know it was written by Moffat...  I definitely should take some time to watch it (or re-watch it, in case I simply forgot about it.)
The episode with cat women in New New York is cute but nothing earth shattering. We do get to see Boe again though, briefly, before his main plot resolves in Gridlock.

Girl From The Fireplace. Watch it. NOW.
Quote
I watched the episode because, well... I'm watching every single episode, obviously.
But even with the ridiculous plot, it was fantastic to see John Simm again. I just love the guy so much... I think I could watch him on Countdown and still be in awe. I'm sure he'd end up finding a 9-letter word with a Q, a K and a Z.
Heh, it wasn't RTD's finest. And he is a great actor, and it shows, but even the best actor can't make gold out of a turd-like script.
6149
Features / Re: New revs - Public comments
« on October 3rd, 2011, 03:01 PM »
Take care of yourself! I doubt I could manage an hour's jog. Even after two months on Wii Fit... which I've let lapse because even after 2 months I hadn't shifted much in the way of weight. :(
Quote
Anyway-- that's life. I'm pretty messed up today. My health has been worsening ever since I started work on Wedge. Wondering how I'm going to cope after we go live...
Going live isn't going to be a problem, given my typical 100+ posts per day support schedule... especially given that towards the end of my regular time at sm.org I was consistently doing 5k posts a month.

I'm hoping, though, to limit the number of support posts that we get by setting intelligent defaults (like making quick reply on by default) and the admin UI just being easier to cope with.

Meanwhile, I'm just reinstalling it cleanly to be able to judge what it looks like - but I'm getting the impression that using Diagona icons might be an idea.
Posted: October 3rd, 2011, 02:59 PM

Having now actually seen it, I'm inclined to agree with using smaller icons. They just seem a shade too big for the relative size of buttons. Going greyscale won't really help, IMO.
6150
Off-topic / Re: Doctor Who
« on October 3rd, 2011, 03:00 PM »
I think you'll really like it :)