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
2491
Bug reports / Re: Periodic notifications don't seem to work
« on September 23rd, 2013, 07:38 PM »
Quote from live627 on September 23rd, 2013, 01:47 AM
Quote from Nao on September 21st, 2013, 01:35 AM
How about triggering scheduled tasks only if the current user's language is the default..? Then at least we can avoid what happened last time.
I don't know what to say, sorry.
Well, technically I think it's a problem that's always been there; it's probably already in SMF. To tell the truth, though, I don't remember seeing it on my websites, but that's probably because I don't have a scheduled task that sends e-mails around... Not that I can think of, at least.

I think that it would be best to test for scheduled task triggers only if the current visitor is using the default forum language; otherwise, we'll be risking what happened the other day, when everyone received an e-mail in French...
And frankly, I don't think it's realistic to expect the scheduler to 'know' what language files need to be reloaded specifically for this task.
Of course, I could 'quite simply' do some magic trick to loadLanguage...

Code: [Select]
function loadLanguage($template_name, $lang = '', $fatal = true, $force_reload = false, $fallback = false, $force_reload_all = false)
{
global $theme, $context, $settings, $boarddir, $db_show_debug, $txt, $helptxt, $cachedir;
static $already_loaded = array(), $folder_date = array();

if ($force_reload_all)
{
loadLanguage(array_keys($already_loaded), $lang, $fatal, true, $fallback);
return '';
}

There you go, this adds a trigger to force a mass-reload of all existing language files loaded so far.
Of course, that's going to be relatively expensive, but if we don't have more than a couple of active language files, it's just a matter of gathering all users that are on the same language as the current user, then send the e-mails, then gather the other users by language, and for them, call $force_reload_all, and send the e-mails to them. Then, restore $txt (which, of course, we'll have saved in the first place.)

Dunno which solution is the best, really... What do you think of this function hack, though?
2492
Archived fixes / Re: Random patch
« on September 23rd, 2013, 07:29 PM »
Good find!
Isn't it better to remove the second one, though..? The second one is included Inside a test, and there's another access to 'post_error' within another code block outside of it; while it's unlikely that it'll be touched, I'd rather we take this one outside the code block, and thus leave the one at line 243 in, and remove the one at line 360 or so.

Agreed, disagreed..? :^^;:
2493
The Pub / Re: Random question
« on September 23rd, 2013, 07:25 PM »
Hmm, yes..?
Originally, it was done this way yes, but I never had any reason to do it otherwise... It's a separator between posts, if you want to style something below posts, you can always do an :after or something on the #forumposts container..?
2494
Bug reports / Re: Periodic notifications don't seem to work
« on September 21st, 2013, 01:35 AM »
Bump.

Also. How about triggering scheduled tasks only if the current user's language is the default..? Then at least we can avoid what happened last time.
2495
Features / Re: New revs
« on September 20th, 2013, 07:36 PM »
rev 2258 -- e-mail rewrite! You didn't think it was needed? Neither did I, until I found the bugs!
(3 files, 9kb)

+ Notification batches can now be sent as HTML, too. Although it's disabled by default, I can confirm that it works just fine. (Notifications.php, Notifications.template.php)

+ Rewrote sendmail() function: updated documentation (needed some work!), allowed for fine-tuning HTML e-mails by specifying the raw text fallback to send (it doesn't have to do that ugly tag stripping), shortened the body building part by not redoing everything twice, simplified the body boundary, added the boundary at the top of the message because it's the way it's done in RFC 2046, sped up mimespecialchars() a bit by not doing a preg_match_all, and fixed a bug where the raw text fallback was actually saying 'UTF-8' instead of the e-mail body itself, added in Arantor's earlier rewrite. Thank you Google for offering to read the 'raw contents' of an e-mail, because not every webmail provider does it, IIRC. (Subs-Post.php)

* Tweaked notification e-mails to look better. (Notifications.template.php)

@ Do we really have to provide TWO raw text fallbacks for HTML e-mails..?! Fighting spam, really? This code is at least 8 years old. Are we sure this isn't a fix for some completely outdated problem..?!
2496
Features / Re: New revs
« on September 20th, 2013, 07:24 PM »
rev 2257
(1 file +2-2, 186kb)

* Updated jQuery from 1.10.2/2.0.3 to 1.11/2.1 beta. They seem to be around the same size, only marginally heavier, no biggie, and supposedly they load faster, and I'm all for that. (Load.php, scripts/jquery-*.min.js)
2497
Bug reports / Re: Periodic notifications don't seem to work
« on September 19th, 2013, 09:29 PM »
You mean duplicated...? Coz they're the same strings as used in the notif popup... ^^
2498
Bug reports / Re: Periodic notifications don't seem to work
« on September 19th, 2013, 06:43 PM »
Nope, didn't remove the 'fix', because we need a 7bit-compatible fallback in all e-mail types anyway. The hotmail fix provides that.

Your solution, would it reload the Notifications language files, too..? Because that's where we find the strings for HTML e-mails, isn't it..?
2499
Bug reports / Re: Periodic notifications don't seem to work
« on September 19th, 2013, 05:12 PM »
Test. (Sorry.)
2500
Bug reports / Re: Periodic notifications don't seem to work
« on September 19th, 2013, 05:00 PM »
Yes you do :P
Welcome back!

I re-disabled the task yesterday right after 'forcing' it, and started work on fixing everything.
I didn't discuss it because, well, it's just plain boring, but here's what new so far.

- Plain text e-mails will now correctly show linebreaks, and better whitespace handling generally.
- There's now an option in Notifications.php to send in HTML, and I've set it to true, because from what I discovered in the sendmail function, HTML e-mails actually send two copies in multipart -- a raw e-mail, and a HTML e-mail. I modified sendmail() to allow for the sender to provide two different bodies for each context; i.e., in the case of notifications, we're sending both versions available. The only drawback is that we have to run both of these through prettify_urls()... Ah, well... I guess if you want it, you can always use the mail queue.
- I've modified a lot of the code in sendmail, mostly to make it easier to understand... Well, there's a part that got repeated twice in the original code (including SMF), now it's no longer the case.

The only problem that remains, right now, is with the language files, obviously... Wedge will use the language file from the current user at the moment the scheduled task is triggered.
I'm thinking of loading the users per language file, and then re-loading all language files, but... Well, how am I supposed to do that..?! Maybe there's already a built-in function to help with that in scheduled tasks, but I don't know anything about that area of Wedge, so...
2501
Archived fixes / Re: User box screwing up post height in quick edit mode
« on September 19th, 2013, 08:12 AM »
Yup! :)
2502
Features / Re: New revs
« on September 18th, 2013, 11:22 PM »
rev 2256
(2 files, 4kb)

* Solved a problem caused by follow_me, where quick editing a very long post would show a huge empty post and a tiny textarea. The textarea will now match exactly the size of its original post, making it more akin to a live editor. (topic.js)

* Insert a 'merged' div on the first post of a soft-merged series of posts, because users might want to style them all. I'm considering moving the merged class to their containing div (.postheader), but that would make it harder to style for IE6. I know, I know... 'Who cares?' (Subs-Template.php)

! Fixed quick edit of first post in a soft-merged blah blah. It used to request for a quick edit of all posts, at the same time. (topic.js)

! Blog posts can't be soft-merged with a regular comment. That would be silly... On pages 2 and later, obviously. (Subs-Template.php)
2503
Archived fixes / Re: Undefined index error
« on September 18th, 2013, 04:39 PM »
There are no more accents to care about in the footer... And it hurts my ego right now, but I'm fighting, I'm fighting hard... :^^;:
2504
The Pub / Re: Not So Mixed Signals
« on September 18th, 2013, 04:37 PM »
Well, Notepad2 NOT having tabs, is precisely the reason why I'm using it for all my PHP/JS editing... ;)
It's just a matter of taste, really! How you organize your workspace, etc.
Me, I have Notepad++ running permanently with about 10 files open (including the Wedge to-do list, which only I can decipher, and my Deideo to-do list, which none of you would be interested in. (It's a French website about music theft... Well, tentative website.)
And then, all of my other files are files I'll tend to open and then close later, so I keep them outside of my tab system, and it's easier for me to sort them mentally.
2505
Features / Re: New revs
« on September 18th, 2013, 04:29 PM »
rev 2255
(5 files, 2kb)

* Licensing tweaks. Most importantly, I decided to try removing the copyright mention from all pages (except for the credits page, of course.) This saves the HTML and my ego from inflating too much, and still keeps my rights the same. If I can't live without my name in there, I'll restore it, but it's unlikely. (Class-ZipExtract.php, index.language.php)

! A final fix for half-width non-breakable spaces not showing up in mobile and oldIE. Basically, I needed more work in minified JavaScript, and in the debug junk, which is shown after doing the original conversion anyway. I'm trying not to be too bothersome with this one, it's just a space... Or a missing one. In French. (Subs-Cache.php, Stats.french.php)