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 - Nao
5491
Archived fixes / Re: 'Home' button bug
« on April 14th, 2012, 12:25 AM »
(Fixed. The 'minor change' was actually unneeded...)
5492
Features / Re: New revs
« on April 14th, 2012, 12:22 AM »
rev 1548 (Too many things to finish before I can commit them...)
(5 files, 3kb)

+ Added a custom time format string, "%@", which you may use to add something after the day number, e.g. "31st", "3rd", etc, and using it by default in English and French. Used a custom array in $txt, translators should set $txt['day_suffix'] to array('n' => '%d') if they have no specific suffixes to add for their language. (Load.php, Subs.php, index.language.php)

! Fixed board ordering in category pages. (Subs-BoardIndex.php)
5493
Archived fixes / Re: 'Home' button bug
« on April 13th, 2012, 11:59 PM »
It certainly is yes. I made a minor change earlier today to speed up handling of the main index URL, probably broke it. I'll look into it tomorrow.
5494
Plugins / Re: Plugins I refuse to do
« on April 13th, 2012, 03:42 PM »
Silly idea. Add a default question called {equation}. this will make Wedge generate on the fly a very simple random equation for users to solve.

Of course that'll also keep out those who never heard of the minus sign... :lol:
5495
Bug reports / Re: Pretty URL remarks
« on April 13th, 2012, 12:47 PM »
As you say!
5496
I have a feeling that either no one reads the 'SMF bug' topics, or no one cares about the option :P
5497
Bug reports / Re: Pretty URL remarks
« on April 13th, 2012, 09:12 AM »
- Google: well, it depends if they visit all pages but those in actual links... In our case it's <a data-href> so it shouldn't visit. But we know Google is too curious for its own sake... Anyway it will load the page but point to the correct canonical URL. I can live with that...
- SimpleSEF: if it matches against \d+ only, then I guess it can't find it yes. Wedge matches against more, precisely so that %1$d is taken into account.
5498
Bug reports / Re: Pretty URL remarks
« on April 12th, 2012, 11:17 PM »
How so?

Btw I was mistaken.. I inverted my benchmark results. The svn version is actually a bit faster. Need to dig into this.
5499
Bug reports / Re: Board order issues
« on April 12th, 2012, 09:51 PM »
BTW the query seems to execute in a millisecond or two... Really not worth worrying ;)

What does this mean in explain?

Using where; Using filesort

Does it mean it uses an index and then a filesort on the entries it found?
5500
I see what you mean.
Maybe we could simply change the way menus (or contextual tabs) are rendered...
(I'd rather change tabs. Not that they're ugly, but they can probably made to look more like our button strips..?)
5501
Bug reports / Re: Pretty URL remarks
« on April 12th, 2012, 09:44 PM »
Nope, even that works perfectly... :)
Posted: April 12th, 2012, 09:40 PM

Always has, BTW... I think! (IIRC it's always been transformed even when scripts were disabled.)
5502
Bug reports / Re: Pretty URL remarks
« on April 12th, 2012, 08:40 PM »
I'm trying not to look into SlammedDime's mod really. Perhaps out of pride -- because I had issues with the guy before. Also because I don't feel like reinventing something that works (albeit is a bit complicated...). I didn't write PrettyURLs either. I just know it well enough to fix its bugs as fast as needed.

Anyway, err... Apart from that, I don't really know where to start here. Just wanted to mention that with my 'simpler' regex, at least I get to easily change ANY url in the page and that works for JavaScript too... Just look at action menus, usually they wouldn't use transformed URLs ;) (The only thing to remember is to allow for %a-z or something in any string where you're expecting digits, since usually you'll get myvariable=%var% in JS and you want to replace these without breaking them... (It's different for topic IDs though. Can't really replace these :P)
5503
Features / Re: timeformat annoys me...
« on April 12th, 2012, 08:34 PM »
I'll be committing that, then ;)
5504
Bug reports / Re: Pretty URL remarks
« on April 12th, 2012, 08:27 PM »
So... I think it's working again?

But right now, it's fairly... Slower, I should say. I'm not exactly sure why -- the regex should be faster (if anything it's simpler...), and I also optimized the underlying PHP, but still, it's up to twice slower than before to do the replacements.

I'm kinda hoping I could make it a bit faster by doing the overall page replacement only once:

- retrieve all content in the page like this: '\btopic=(\d+)|\bboard=(\d+)' (perhaps also \bcategory=(\d+)??)
- thus we have a list of topic and board IDs ($matches[1] has topics, $matches[2] has boards), including stuff that isn't ACTUALLY topic IDs to transform, but we get it as quick as we can. Now we simply do our search & replace regex...
- during the replacement, if we ever find 'topic=' or 'board=' in the match, and we don't have a list of topic/board names, fill the topic/board name cache(s).
- possibly call a new hook at this point...
- test for action=profile, replace with profile. (Has custom URL scheme)
- test for action=, replace with action. (Has custom URL scheme)

Should cater for everything...?! Except for the URL cache. (Which I've always contemplated dropping anyway... If performance is THAT important to you, maybe you shouldn't consider doing pretty URLs in the first place...?! Because that cache table ALWAYS gets huge after a while...)

What do you think?

Currently, this is pretty much how it is done...:
- run the search regex
- loop through all links and find uncached URLs
- call topic handling, loop through all links to find topics and transform them
- call action handling, loop through all links to find actions and transform them
- etc...
- run the replace regex with a callback that will look for the rebuilt URL in the temporary memory cache, and will do the replacement on all links.

I have a feeling that it *could* be made faster, see...!
Do you share my feeling or not?
Posted: April 12th, 2012, 08:16 PM

Funny... I just did a benchmark of my two regexes. And indeed the 'faster' one (in theory) is 4 times faster than the older one.
So the slowing down thingy must be somewhere else...
5505
Bug reports / Re: Board order issues
« on April 12th, 2012, 07:07 PM »
Well, after all this time I still don't know whether to use an extra table, or several, or none, and whether to use membergroups for everything, etc, etc... It feels like it's going to be my second 'impossible task' after my failure to make a decision on the AeMe-powered attachment system. (Even though Noisen.com is quite happy to run with my original privacy code...)