Wedge

Public area => Off-topic => The Pub => Other software => Topic started by: dorje on October 21st, 2011, 11:36 AM

Title: Once upon a time...
Post by: dorje on October 21st, 2011, 11:36 AM
... there was a smf community member that replies to every tech related question about smf in about 5 or 10 minutes. :)

I've posted a simple question 30 minutes ago, when will I have a reply? :eheh:

P.S. - Off course: thank you Arantor for all the support you gave me in smf forum in the past. :)
Title: Re: Once upon a time...
Post by: Arantor on October 21st, 2011, 11:43 AM
I tried my best, didn't always work out so well though :/

In answer to the question posted, if it's something simple, you can usually expect an answer inside 10 minutes these days if a certain team member is around. Less than that if you bump within 24 hours, to be told not to bump. Said person is VERY good at that, as well as telling people that it will be replied to if and when someone knows the answer, which seems to be very infrequent.

Oh, you posted in the coding board? Hmm, answers are not prompt there, and are reasonably seldom as to their accuracy too.

The PM form itself is in PersonalMessage.template.php, however it's a beast of a file (so is PersonalMessage.php in the Sources folder), so unless you're looking at something pretty specific, you may have a bit of trouble sifting out what it is you want to do.
Title: Re: Once upon a time...
Post by: dorje on October 21st, 2011, 12:03 PM
 :yahoo:

Well, I've already looked in the PersonalMessage.template.php, but I can't find where it generates the body textarea... The only textarea I've found threre is the one for reporting a message... :hmm:

I want to do something very simple: send other arguments to ?action=pm;sa in order to populate the subject and body fields with certain content... :)
Title: Re: Once upon a time...
Post by: Arantor on October 21st, 2011, 12:06 PM
The textarea is not part of the template, it calls the richtext editor component elsewhere, so the actual textarea is only supplied when template_control_richedit() is called.

For setting the body, look for control_create_richedit(). There should even be an example of grabbing the body of a PM and injecting it when quoting a message ($_GET['quote'] will be checked for, and $_GET['pmsg'] will be set in that case)

For setting the subject, that'll be a regular <input> not a textarea control.
Title: Re: Once upon a time...
Post by: dorje on October 21st, 2011, 12:26 PM
Thank you, I'll take a look now!  :cool:
Posted: October 21st, 2011, 12:08 PM

Works as espected. :yahoo:

Thank you very much Arantor! :)
Title: Re: Once upon a time...
Post by: Dismal Shadow on October 21st, 2011, 07:23 PM
I remembered when I joined the community and the quickest reply I've found was from Arantor when he first helped me. As times went by, we have all learned from him and understand him better. He became more than a friend to the majority of us. :)
Title: Re: Once upon a time...
Post by: dorje on October 22nd, 2011, 09:12 AM
Quote from ~DS~ on October 21st, 2011, 07:23 PM
I remembered when I joined the community and the quickest reply I've found was from Arantor when he first helped me. As times went by, we have all learned from him and understand him better. He became more than a friend to the majority of us. :)
:+1:
Title: Re: Once upon a time...
Post by: live627 on October 22nd, 2011, 09:28 AM
Has this turned into a reminiscing thread :P

I remember constantly being surprised at the speed of his replies (and I know who the person mentioned in the first reply is Oo)
Title: Re: Once upon a time...
Post by: dorje on October 22nd, 2011, 09:55 AM
Quote from live627 on October 22nd, 2011, 09:28 AM
Has this turned into a reminiscing thread :P
:angel:
Quote from live627 on October 22nd, 2011, 09:28 AM
I remember constantly being surprised at the speed of his replies
Really! And now something fantastic: I've posted a question in smf.org, and I got the answer in wedg.org! 8-)
Quote from live627 on October 22nd, 2011, 09:28 AM
(and I know who the person mentioned in the first reply is Oo)
I think I don't know that person...
Title: Re: Once upon a time...
Post by: tfs on October 31st, 2011, 05:51 PM
You guys are all off base!  Didn't you know?  Arantor is a bot.  An AI that monitors the forums.  I can't believe you guys didn't know that!   :angel:
Title: Re: Once upon a time...
Post by: Arantor on October 31st, 2011, 06:07 PM
Oh, that story has resurfaced, eh, where I'm a bot from the future, after SMF 7 (the one with time travel) is released, come back to prevent SMF 6 from ruining the world. Or something. I forget the details.
Title: Re: Once upon a time...
Post by: Dismal Shadow on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
Title: Re: Once upon a time...
Post by: tfs on October 31st, 2011, 06:13 PM
Quote from ~DS~ on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
It's been remade.  Now with four ports.(http://www.thinkgeek.com/computing/accessories/9223/)
Title: Re: Once upon a time...
Post by: Arantor on October 31st, 2011, 06:19 PM
Quote from ~DS~ on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
Don't think you'll find it has... I'm assuming from that, that you're in season 5 still. It's explained in the finale, and it very definitely isn't in season 6. They even find the swimming pool.
Quote from tfs on October 31st, 2011, 06:13 PM
It's been remade.  Now with four ports.(http://www.thinkgeek.com/computing/accessories/9223/)
I have one of those on my desk :D
Title: Re: Once upon a time...
Post by: Dismal Shadow on November 1st, 2011, 03:53 AM
Quote from Arantor on October 31st, 2011, 06:19 PM
Quote from ~DS~ on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
Don't think you'll find it has... I'm assuming from that, that you're in season 5 still. It's explained in the finale, and it very definitely isn't in season 6. They even find the swimming pool.
nope, still stuck somewhere in season 3 still. :p
Title: Re: Once upon a time...
Post by: Arantor on November 1st, 2011, 08:52 AM
In which case the TARDIS very definitely has not been destroyed. The nearest that happens is what happens in episode 12.

Oh, and there's what happens in series episode 13.
Title: Re: Once upon a time...
Post by: dorje on November 2nd, 2011, 03:53 PM
Who is Robbo_?

I was looking for annoy user mod, and saw this thread: http://www.simplemachines.org/community/index.php?topic=343810.0

Title: Re: Once upon a time...
Post by: Arantor on November 2nd, 2011, 04:09 PM
Robbo_ took the mod over from me a long time ago along with a lot of my other mods.
Title: Re: Once upon a time...
Post by: dorje on November 2nd, 2011, 04:17 PM
Quote from Arantor on November 2nd, 2011, 04:09 PM
Robbo_ took the mod over from me a long time ago along with a lot of my other mods.
:o

But why, as he didn't release newer versions?
Title: Re: Once upon a time...
Post by: Arantor on November 2nd, 2011, 04:18 PM
I didn't know that at the time, and neither did he. Remember, it was 18+ months ago I did the handover, as it was somewhere around the time of RC3.
Title: Re: Once upon a time...
Post by: dorje on November 2nd, 2011, 04:28 PM
Quote from Arantor on November 2nd, 2011, 04:18 PM
I didn't know that at the time, and neither did he. Remember, it was 18+ months ago I did the handover, as it was somewhere around the time of RC3.
I saw that, I'm just editing the xml to install on RC4...

But the installer I've just downloaded has still your nickname!! :eheh:
Title: Re: Once upon a time...
Post by: Arantor on November 2nd, 2011, 04:36 PM
Yes... the package id is set when first uploaded and you have to get the Customisation Team to change it, if you try and upload a mod with the wrong package id in it, it'll complain bitterly at you.
Title: Re: Once upon a time...
Post by: Dismal Shadow on November 2nd, 2011, 04:46 PM
Quote from dorje on November 2nd, 2011, 04:17 PM
Quote from Arantor on November 2nd, 2011, 04:09 PM
Robbo_ took the mod over from me a long time ago along with a lot of my other mods.
:o

But why, as he didn't release newer versions?
IIRC, he was busy in RL and have other projects to do.
Title: Re: Once upon a time...
Post by: dorje on November 4th, 2011, 01:34 PM
Quote from Arantor on November 2nd, 2011, 04:36 PM
Yes... the package id is set when first uploaded and you have to get the Customisation Team to change it, if you try and upload a mod with the wrong package id in it, it'll complain bitterly at you.
Can I ask you a quick question?

I've modified the xml in order to pass all tests with RC4... It is ok to install the mod now, or is there something I have to warn?
Title: Re: Once upon a time...
Post by: Arantor on November 4th, 2011, 01:43 PM
The package manager itself doesn't care what the id is, with the exception of having two packages with the same id for the purposes of using package upgrades. (So you can have 1.0 and 1.1 of a mod, install 1.0, then install 1.1 to update 1.0, though the entire process of how this is applied breaks if you ever want to uninstall things, unless you uninstall them in reverse order)

The real test for the id that I referred to is on the mod site; it won't let you upload a mod to the mod site if the id is different to the one listed for a given mod, which is set up at the time of first upload. The team can alter it so future uploads can use a different id.

If it isn't going on the mod site, you can stick whatever id in it you like :)
Title: Re: Once upon a time...
Post by: dorje on November 4th, 2011, 02:06 PM
Thank you! :)

I've just installed it....

SUPERB!!! :eheh: :cool:
Title: Re: Once upon a time...
Post by: tfs on November 4th, 2011, 09:37 PM
Quote from dorje on November 2nd, 2011, 03:53 PM
I was looking for annoy user mod, and saw this thread: http://www.simplemachines.org/community/index.php?topic=343810.0
Hey Nao, do you remember when Dragooon used this on you over at smf-media.com?  I think you were just starting to write FOXY! at the time.  I thought you were going to call out a mafia hit on him.  :)
Title: Re: Once upon a time...
Post by: Nao on November 4th, 2011, 10:18 PM
Ah back when he was a spoiled brat! :lol:
Title: Re: Once upon a time...
Post by: dorje on November 10th, 2011, 12:05 PM
Really guys... @smf.org nobody is answering to my questions. :hmm:

And I've to admit: I'm not to happy to ask smf-related question here. Not because I'm not happy with Arantor's answers, but because here are you working on wedge and I feel not comfortable to speak about smf, even if wedge is a smf fork. :)
Title: Re: Once upon a time...
Post by: Arantor on November 10th, 2011, 12:15 PM
updateMemberData is supposed to update the row, and it should then kick in on the next page load (if you want it to be active in the current page load, update $user_info yourself)

Note that not everything in $user_info is taken directly from the members table, so it would be interesting to know exactly what you're trying to update and how.

As for asking questions, for the most part they will be relevant to Wedge as well, so there's no real harm in asking, and it has been known to prompt me to fix things I'd known were broken but never got around to fixing.

(The reason it doesn't update the current member is because it's a general purpose function for addressing any and all members, not just the current user.)


(I should note it doesn't bother me that people are asking questions. What bothers me is that I can still answer questions for SMF, and still do a better job of it than the bulk of their support team *put together*. That's not me blowing my own trumpet, it's the fact that I'm not going to fob you off with some 'I'll reply if and when I know the answer' crap. If you don't know the answer, fine. But stop fucking about with telling people how you don't know the answer, and go and find out. I'm sure more people will appreciate having an answer that's useful after 10 minutes instead of being fobbed off after 5. Here endeth the rant -_-)
Title: Re: Once upon a time...
Post by: dorje on November 10th, 2011, 02:58 PM
Quote from Arantor on November 10th, 2011, 12:15 PM
updateMemberData is supposed to update the row, and it should then kick in on the next page load (if you want it to be active in the current page load, update $user_info yourself)
So there is no function to reload data?

How does it work when I change my forum profile in the default profile form in smf? It sends data, executes the update and then reloads the page?
Quote from Arantor on November 10th, 2011, 12:15 PM
Note that not everything in $user_info is taken directly from the members table, so it would be interesting to know exactly what you're trying to update and how.
Well, only email and password fields at the moment... So I'll update the array in the update script. It really isn't a problem, I only wanted to know if there is a way to do it using existing functions. :)
Quote from Arantor on November 10th, 2011, 12:15 PM
As for asking questions, for the most part they will be relevant to Wedge as well, so there's no real harm in asking, and it has been known to prompt me to fix things I'd known were broken but never got around to fixing.
Ok, happy to read this. :)

I'll do my best in smf-bugfinding and I'll pass you informations! :eheh:
Quote from Arantor on November 10th, 2011, 12:15 PM
(The reason it doesn't update the current member is because it's a general purpose function for addressing any and all members, not just the current user.)
Right. I forgot that admins can change user profiles of other users! :whistle:
Quote from Arantor on November 10th, 2011, 12:15 PM
(I should note it doesn't bother me that people are asking questions. What bothers me is that I can still answer questions for SMF, and still do a better job of it than the bulk of their support team *put together*. That's not me blowing my own trumpet, it's the fact that I'm not going to fob you off with some 'I'll reply if and when I know the answer' crap. If you don't know the answer, fine. But stop fucking about with telling people how you don't know the answer, and go and find out. I'm sure more people will appreciate having an answer that's useful after 10 minutes instead of being fobbed off after 5. Here endeth the rant -_-)
That's the point. For example: I don't require that smf has a function to update members data. There can be tons of simple "workarounds" for doing that. But a simple answer like yours can really route a user in the right direction, without wasting time in looking at something that simple doesn't exist... :)

Thank you. ;)
Title: Re: Once upon a time...
Post by: Arantor on November 10th, 2011, 03:15 PM
Quote
So there is no function to reload data?
No, because of the nature of updateMemberData. It is designed specifically for updating multiple members at once, not just the current member. Consequently it's more work to update the current member's data, especially since virtually every single time it's used, it's then pushed through a redirect and so it will be reloaded on the next page load.

You could, I guess, call loadUserSettings() but I really wouldn't recommend it, especially if you already have the data handy, having just validated it, you could just update $user_info there and then.
Quote
How does it work when I change my forum profile in the default profile form in smf? It sends data, executes the update and then reloads the page?
By calling updateMemberData, going through a redirect and reloads the page.
Quote
Well, only email and password fields at the moment... So I'll update the array in the update script. It really isn't a problem, I only wanted to know if there is a way to do it using existing functions.
Unless you're going to be using right there and then to do something (i.e. in the scope of the current page load), there's no need to reload $user_info. Even if you *are* using it in the same page load, you have it available to work with.
Quote
I'll do my best in smf-bugfinding and I'll pass you informations!
All bug reports are useful, even if they might not seem like bugs.
Quote
That's the point. For example: I don't require that smf has a function to update members data. There can be tons of simple "workarounds" for doing that. But a simple answer like yours can really route a user in the right direction, without wasting time in looking at something that simple doesn't exist...
*nods* This is one reason I actually don't like doing support. People ask a question and they expect their question answered, except that very often I find they're asking the wrong question. Sometimes intentionally, often not.

In this case, for example, you're asking about reloading $user_info after a change. The real question isn't how to update $user_info, but whether you actually need to or not. If you're not using that information for anything for the rest of the page view, there's no need for a reload. Even if you are using it in the exact same page load, as you seem to be, and you're just using $user_info as convenience, you can trivially update $user_info there and then anyway once you have it. Don't forget there's also $context['user'] to consider.

Or you can do what SMF does and leave page flow to force it to be reloaded anyway. Depending on what else you're changing on that page it might be advisable to just do that.

Incidentally, email and password are tricky things to deal with. Not so much password, assuming you get the hashing right and make sure the other fields are left alone, but email is, because normally it's supposed to retrigger email validation (assuming that's turned on) which is a raft of other changes that updateMemberData doesn't automatically deal with. (Most importantly, it's going to reset is_activated from 1 to another number, though off hand I can't remember what that number is, because I don't think it's 0. There are something like 9 different legal values for is_activated, too.)


Getting back on point, I realise that not everyone knows SMF/Wedge's code like I or Nao or others do. What I would hope and expect to see is how volunteer support boards that are worth a damn should work: those who know the general stuff (which is, to be fair, what the majority of topics really are) can answer the general questions. Anyone can answer them and most questions do not require intimate knowledge of the system.

Then for anything more complex, the quantity should be lower but so too is the quantity of people who can answer them. But it's in this field where people have the real chance to shine; it doesn't take that much knowledge to follow through the bulk of SMF, no matter how huge it seems, and it often doesn't take more than a minute or two to scan through the source for the area that controls something. I learned a lot of the specifics about SMF by doing just this, and I really think some of the team would *really* benefit from this approach. Kicking back questions doesn't help anyone, it's just ego stroking for the person doing it.[1]

But in most cases, the total time spent kicking someone's post back (followed by the inevitable apology and further kick back) could have been used to find the real answer.
 1. I learned this the hard way. Took me a while to realise it, too.
Title: Re: Once upon a time...
Post by: dorje on November 10th, 2011, 04:25 PM
Well, I've got an intresting answer @sm.org, that solves my question

And the answer demonstrates that my question was not well posted...

It'll be intresting to consider why a user posts a question in wrong way (as I did). The english knowledge is an impediment for sure, but maybe we can find also other reasons (and consider them in the future for support). :)

Title: Re: Once upon a time...
Post by: Arantor on November 10th, 2011, 04:31 PM
An interesting answer, yes. I'd forgotten about $user_profile, since you were talking about $user_info, I figured it was letting the user update their own settings rather than someone else's. (Though, intriguingly, virtually everything else stays the same; $user_profile just holds the same details for every user, $user_info holds a bunch of stuff for the current user, but all arguments about whether you reuse the information on the page hold true either way.)

On the whole, it's a pretty good answer from AngelinaBelle, there, the only thing that would have made it perfect is understanding what the cache level parameter is doing. Specifically, that ties into the cache level settings in the cache subsystem.

Level 0 is off, level 1 is the basic level of caching, and occurs on files if necessary or if a proper cache backend (XCache, APC, memcached) is specified. Level 2 and above physically require a proper cache backend, and don't really apply to file caching, and unless you have a really good reason you won't be using level 2+ anyway because you likely end up with more stale data than you really want, meaning that loadMemberData doesn't really ever fetch from cache for most users.
Title: Re: Once upon a time...
Post by: Dismal Shadow on November 10th, 2011, 05:03 PM
Quote from tfs on October 31st, 2011, 06:13 PM
Quote from ~DS~ on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
It's been remade.  Now with four ports.(http://www.thinkgeek.com/computing/accessories/9223/)
How could I missed this post?
SOLD!!
Title: Re: Once upon a time...
Post by: Arantor on November 10th, 2011, 05:16 PM
Quote from ~DS~ on November 10th, 2011, 05:03 PM
Quote from tfs on October 31st, 2011, 06:13 PM
Quote from ~DS~ on October 31st, 2011, 06:10 PM
But the Tardis had been destroyed...
It's been remade.  Now with four ports.(http://www.thinkgeek.com/computing/accessories/9223/)
How could I missed this post?
SOLD!!
AND IT MAKES THE NOISE :D There is an insane amount of fun to be had in just plugging stuff in, just for the noise!