Mark's plugins:
Sets the site notifications of new users to true when they first log in and sends them a welcome message from the administrator account.
Users before activation of this plugin wont be affected.
Note: After activation, admin should straight away fill out the Welcome Message subject and content. Message wont be sent until this is done
P.S. We've spent many hours creating free plugins for Elgg. Please take a minute to give something back by liking us on facebook http://www.facebook.com/webintelligence.ie
Comments
Excelente trabaja muy bien en Elgg 1.8.8
gracias:)
Very nice idea, thank you. For future releases (if you plan any) it would be nice to select from which user the email is coming from, instead of just the administrator (I take it the first admistrator of site in case of multiple administrators.) Again, thanks for the plugin.
looks good, easy setup, great idea...much appreciated!
Thanks @SDBradi:)
@Starphysique Yes its the first administrator on the site, the one created during installation. Yes for future releases, I will allow users to choose which account the welcome message comes from
---> Lo vamos a probar...!!
Hi Mark,
Was just looking over the code for this:
Is it enabling all notification methods for the user here? You explicitly declare $personal[$method] = 1; then check for it in the next line. So as far as I can see it will always be true and always turn on all notification methods...
Just checked matt and yes, it's a useless bit of code! I will change it simply to passing through "true". Yeah it sets all notification methods for users to true, because internal messages are off by default.
ok, thanks for confirming that. The problem I foresee then, is that I want to use this plugin on an existing installation. However as soon as I do this it will mess with the notification settings that all my users have set for themselves. How about using the methods_override parameter of notify_user? I think that would make this plugin safe to add to an existing site.
Only users who have registered after this plugin has been activated will be affected. So the first time they log in, they wont have touched their notification (it will be at the default of email on, message off)...At least thats the way it should work;)
@Mark:
me not see any value in all that fooling around with relationships and fancy 10 lines of php code footsies and merengue ;) if you want to check if a user is logging for the first time - the simple piece of code needed is ==> if ($user->last_login==0 why in this galaxy would you code any more ?
@Dhrup I use relationships everywhere i can instead of metadata simply because the code executes quicker
thats still no excuse for not just using data that is already available in the table ;oO no reason for replaciing ONE simple phrase with 10 - 20 or more lines of code, is it ? now can relationships code 10-20 lines of php execute faster than one variable reference $user->last_login==0 ? it does not execute faster LOLZ ;-) not everything in the world fits into our specially shaped relationship baskets ! read the mysql structures ;-X
CREATE TABLE IF NOT EXISTS `users_entity`
(
`guid` bigint(20) unsigned NOT NULL,
`name` text NOT NULL,
`username` varchar(128) NOT NULL DEFAULT '',
...
`last_action` int(11) NOT NULL DEFAULT '0',
`prev_last_action` int(11) NOT NULL DEFAULT '0',
`last_login` int(11) NOT NULL DEFAULT '0',
`prev_last_login` int(11) NOT NULL DEFAULT '0',
Sorry I read that wrong and thought last_login was metadata, not already in the user_entity table. Yeah you are right, in this scenario its obviously quicker to use last_login (dont know how i didnt think of that when writing it!)
Hi Mark,
I went back through the code, you're right it shouldn't affect existing users. I missed the fact that you set a default welcome message time in activate.php.
Re: Dhrups suggestion - last_login is probably more reliable as well, just in case a relationship gets dropped somehow. Also, with the agressive metadata caching/pre-fetching coming in 1.8.9 there shouldn't be an issue using metadata for simple things like this :)
Any tokens, like %username% or %password% can be used to show username and password for example?
Thank you.
Hi Roman, you would need to parse the body of the message on line 77 in start.php. So you could search $body and replace %username% with $object->username and %password% with $object->password. Let me know how it goes
Well, I was almost happy to see it sending parsed message, %username% was correct but %password% is encrypted password string, not password string entered by user. It was easy one, had to add 2 lines of php to the start.php file:
lines 78-79:
$body = str_replace("%username%",$object->username,$body);
$body = str_replace("%password%",$object->password,$body);
Yes actually you wont be able to send typed password, its hashed before saving to database
;)