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
3976
Features / Re: New revs - Public comments
« on January 4th, 2013, 05:03 PM »
Thanks for diggin' it out, though! ;)
And it's never too late...
3977
The Pub / Re: Context object?
« on January 4th, 2013, 05:02 PM »
Quote from Arantor on January 3rd, 2013, 10:07 PM
Yup, I'm aware of that. They are going to be cleaned up in due course when I finish the rest of the UI. Mostly it's going to be pushed to the ManageBans file, the only stuff actually needed in the main admin language file is stuff that is needed for the main admin menu itself.
Well, good that you're aware of it. I like things clean. Enough work for translators already with the new strings... :)
Maybe we should do a script that takes all $txt[] strings and tests for them in the entire file set. If not found, add to a 'suspicious list' where we'll manually check that these strings aren't at least used in some more complex manners like string building ($txt['we_' . $string]), etc...
Quote
Well, it's sort of required, if you're not calling getInstance(), you need to do something else to instantiate it and its content. Just loading it isn't enough.
It's very odd. If I just call we::init_user() and we::init_browser(), it works. If I load wedb without initializing it, it doesn't work. Does that mean we need to call a random method on the object in order for PHP to initialize it..?!
Quote
So if you don't get the instance, how exactly does it get any of its content? Just loading it is not enough.
Well, as it's a static object (at least static public methods...), with static variables in it, technically I guess PHP doesn't need to instantiate the object in the first place..? I don't know. I'm trying to learn.
Quote
For example, the template list can only be modified from within the wetem class.
Yup, it's my only case of building a 'true' object, and making a 'clean' use of method visibility to simplify life for plugin/theme authors. It's actually what convinced me that objects can sometimes be more beneficial than procedural programming (I was fiercely opposed to objectifying anything before that... :P), but in the case of the system object, it's only static, it's not a 'real' object per se, although if you start moving allowedTo() over there, I guess it'll have to be... (Oh, how about a generic we::can(...) function? Lol.)
Quote
In the case of user information and permissions, I'd argue that we::* should be keeping that as a private member if it isn't already, because there is no reason the permissions need to be exposed outside the we object except for allowedTo(), and arguably that should be a method of we::* anyway, as should loading permissions really.
I have no qualms with $user['permissions'] being private, actually I have no qualms with perms being moved to their own array outside $user, etc...
Quote
I've been tempted more than once to rewrite that in some fashion to clean it up, it's mostly a thinly veiled port of how it was done before.
I thought the comment next to that line sounded like you... What was the original implementation? I mean, if it's not using static late binding (because of compatibility), how did it do it? Multiple lines I guess? Can't bother to check it out...That's not what I meant... I had interest in seeing my IP's evolution over multiple messages, rather than my IP at the current moment. For instance, these days, my IP has been very static, it hasn't changed in weeks, perhaps months actually, even though officially I'm supposed to be on a dynamic IP... Things like that, I like being able to check. And I shall check that one. :P
Quote
That's mostly just a mental lapse. It's hard work for me to consciously use bastardised English.
I feel for you. But just as my fellow Québecois cousins managed to gently bastardize French their own way, the 'main' language in here (as in 'used by the most people') is metropolitan French, i.e. they're the ones who have to take it on themselves to 'speak French' rather than Québecois when they want to address an international French audience. Same for the British... Because Americans can't stop thinking about sex, today the British have to speak American when they want to adopt a 'neutral tone'. Reminds me of that skit in The Meaning of Life... :lol:

Anyway! Can you check it out?
Quote from Arantor on January 4th, 2013, 01:05 AM
Also, I looked at r1825. Thanks for fixing my typo :)
You're welcome. I like to think my annoying diff reading sessions can sometimes help me catch a bug we wouldn't have found until much later otherwise. ;)
Quote
As to the other changes regarding the we object, the change of __clone, yes, technically it can be a void method though returning false is more 'correct'.
Shorter function = more space for 'public' keywords, the very ones I complained about... :P
Quote
There should never be any reason to check permissions prior to permissions being loaded, other than the fact topic privacy is currently fatally broken.
Do you mean that this particular issue is caused by my topic privacy implementation...? Ooops. (Well, it's not even 'officially implemented' yet... And I doubt it'll ever be, because of all the performance issues we discussed?!)
3978
Off-topic / Re: Happy New Years
« on January 4th, 2013, 04:04 PM »
Lulz, got 4 likes just for my cheesy line above... :lol:

Okay, here's a little experiment.

I want to release Wedge tomorrow, with 10 times more features than announced, and a free Galaxy S3/S4/Nexus 4/iPhone 5 for everyone.

Let me get the pop-corn...
3979
It isn't planned. It's already there. We just won't distribute it until we enter the beta phase. ;)

It was written by TE by the way, not us, but wedge.org was converted very easily with it.
3980
Other software / Re: Discussing Wedge on simplemachines.org
« on January 4th, 2013, 12:22 AM »
BTW, would be nice if you could post links to these discussions, if they're public or whatever... :^^;:
3981
The Pub / Re: Context object?
« on January 3rd, 2013, 05:41 PM »
Quote from Arantor on January 2nd, 2013, 11:57 PM
I haven't got PHP 5.2... haven't had it in almost a year... but back a year or so ago I was trying to make a weusr object and it wasn't working :/
I see. Perhaps you forgot to add a static keyword to the variable? Which would be surprising...
Anyway, I can assure you that it works in all situations I tried.
Quote
If it's working for you, it'll almost certainly work for everyone else. But I'm going to be doing some real testing on real hosting before long (not a VPS I have total control over)
Lulz.

Okay, I'll be posting my comments on your latest commits here...

- ManageBans.english.php: this has exclusively $txt['ban_*'] entries, some of which are still present in other files. Do you think these other files have to be cleaned up, or they really need these entries separately from a custom loadLanguage('ManageBans') call...? It'd be nice to look into this.

- Actually a commit of mine...: I was wondering... Is ::getInstance() really THAT useful? I did a few class_exists('we') calls which I later realized return true not after calling we::getInstance(), but instead simply after loading the class file. Also, Wedge never actually requires getting an instance to treat it (for instance to get a list of variables or whatever, like I suggested in another post in this topic), so the only 'point' is to prevent getting two instances... However, it can also be done by providing a dummy __construct, a dummy __clone, and basically: what's the need for that..? Admins and users have no need for these, and plugin authors are unlikely to try and get an instance either (they'll 'do it' the way we do it, because they'll look at our code). So, I'd suggest simply having init() functions when needed (e.g. we object), and not bothering with calling new self() anywhere. Obviously, tested on PHP 5.2. One of the advantages is that you no longer need the strange call_array_func function call in Class-DB to extend the DB object. Because it doesn't do anything anyway... As you're more versed into objects than I am, please advise.

- Haven't tested your badge display order changes yet, but I was wondering... Couldn't my earlier system be replaced with yours? Or does it need both the display order thing and show_when stuff? (I'm not sure it can't be replaced with a negative value or whatever..?) I'm probably wrong, though. :)

- I liked, as a regular user, being able to view my own IP, so that I can determine if I'm on a dynamic or static IP. Though, it's also true that only power users would do that, and they'd usually have other ways to determine that... Or they'd own their own forum like I do, and check their IPs on them. ;)

- While I certainly don't mind you using British English in your comments (you are, after all, Her Majesty's subject), I'd like to point out that you're also using it in the language files (e.g. 'organise'), which is different -- AFAIK the language files are in US English, and British versions are to be provided in addition to them, not as replacements. I don't care what phpBB does, I just don't want to mix up British and US English, I already do it too much personally, but I have an excuse for that :lol:

More to (possibly) come later...
3982
Features / Re: New revs
« on January 3rd, 2013, 05:35 PM »
rev 1825
(4 files, 2kb)

! Noticed this typo in the latest scheduled tasks query. (ScheduledTasks.php)

* Clarifying a comment. (Security.php)

* Apparently, a singleton's __clone() function doesn't need to return false. (Class-System.php)

* Loading system object first, just in case. At least things like we::$is_admin will return null, and no error, if something is triggered too early. (index.php)
3983
The Pub / Re: Context object?
« on January 2nd, 2013, 11:56 PM »
Good :)

Also please confirm that we::$browser now works as intended? It does for me. php 5.2 with apache 2.2.11.
3984
Off-topic / Re: Happy New Years
« on January 2nd, 2013, 10:12 PM »
Happy new year...

My resolution is to get Wedge out by the end of the year, obviously :lol:
3985
Features / Re: New revs
« on January 2nd, 2013, 09:46 PM »
rev 1822
(3 files, 2kb)

! Fixed class object instantiation not correctly initializing the browser array. (Class-System.php)

* Adding privacy tables to the list of protected tables. I think we should do a thorough check of all our table names before proceeding... (Class-DBPackages.php)

* Don't need to reset the permissions array at that point. (Still need to fix the fact that permissions can be tested against before 'we' is initialized...) (SSI.php)

@ Re: rev 1820, if we regularly update jQuery and jQuery UI, it'd probably be smarter to allow for plugin authors to link to an alias of these libraries, i.e. jquery.js and jquery-ui.js, which would then be redirected to the latest...? Or just rename the files.
3986
The Pub / Re: Context object?
« on January 1st, 2013, 02:58 AM »
Pete -- I just can't seem to be able to install PHP 5.2 on my PC. It keeps sending me a connection error in WampServer, even though I followed the pretty straightforward install process. Anyway, problem is -- the system object DOES have 'static' keywords in front of our variables like $user. So it really should be working in PHP 5.2... I've even seen comments to that effect on the web.
Maybe (but it's very unlikely) you need to add '&' in front of the getInstance method in the object, to return a reference, but I don't see why that would change anything.
Anyway, I found this:
http://www.nqbao.com/2009/11/the-best-way-to-access-PHP-global-variable
The guy runs PHP 5.2.9 and look at solution #7... It's the same as mine, pretty much, only very simplified.
So I'm guessing it does work in PHP 5.2, it just doesn't work for you in that particular fashion.

Re: stylesheets, the main problem is that my own local version is uncommitted because it makes so many little changes here and there... I don't know exactly if committing them immediately would fix your problems.

Re: zip class, I don't know any better... I think a 80KB library is overkill already. But that's just me... If it makes life easier for everyone...
3987
The Pub / Re: Context object?
« on January 1st, 2013, 12:54 AM »
I'll have a look when I'm on my pc.
Everything works fine for me locally, otherwise I wouldn't have committed. I'm very surprised.  Hopefully this won't represent the quality of my work in 2013 ;)
3988
The Pub / Re: Context object?
« on December 31st, 2012, 11:42 PM »
I dont get it?

Im just saying, in we::$user, we need to declare public static $user instead of just public $user. Is that the case? I'm not in front of my computer for now...
3989
The Pub / Re: Context object?
« on December 31st, 2012, 11:17 PM »
I probably forgot to declare the variables as static.
Can you verify it works if you do that? I'm pretty sure it does. 5.3 only allows NOT specifying the static keyword and still being able to access it.
3990
Features / Re: Purging users pending approval, and some other stuff
« on December 31st, 2012, 07:37 PM »
I think the default should be 30 days... Isn't that the maximum value in this field anyway?
Really, thanks for implementing this. I had a hard time last week removing 500+ members who hadn't activated (spam bots), was actually considering doing something like this but I'd have been too lazy to implement it myself... It's like you read my mind ;)

Oh, while I'm at it... I have plenty of comments/questions on your latest batch of commits, but can't bother to find the comments topic, so if you have two minutes, please bump it for me :P
Will be unavailable tonight, anyway... (Not much, at least.)

Ah yes, and I found a bug on noisen.com, can you verify that it isn't in Wedge as well..? I had two questions set in anti-spam, and it was set to only ask 1, so I entered 2 and saved. It then showed me '0'... I modified it again, again 0. I tried '3' and it set it to '2'... Works that way.
It's likely that it was already fixed in Wedge or SMF 2.0, but it doesn't cost anything to mention that ;)