Email on Birthday 1.0.1b

Here my mods and history gets moved when validated and released to the phpbb.com MODDB

Email on Birthday 1.0.1b

Postby lefty » Sun Sep 23, 2007 5:29 pm

Modification name: Email on Birthday
Author: lefty74
Modification description: If Birthdays are enabled this will send an email to the members on their birthday, can be turned off via ACP
Modification version: 1.0.1b
Tested on phpBB version: 3.0.6

MOD Download: Email on Birthday

Demo Board: Demoboard
Demo Username: test
Demo Password: testtest

Credits: Many thanks to terrafrost as he was the one that created this feature for me on phpbb2 in the first place :)
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby lefty » Sat Mar 15, 2008 1:59 pm

validated and approved to phpbb.com MODDB
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby Evil20071 » Wed May 14, 2008 12:17 am

Small problem I'm having with this. I had it installed before (First time went with NO problems, and works GREAT!!)

My forum crashed (FTP transfer goofed and files were totally lost) so I had to re-install it from scratch. Now, I can't find the mod ANYWHERE in the ACP. Not even in the mods control section under system. I've followed the same instructions both times, from the SQL Injection at the beginning, to all of the php edits, but still nothing. What should I do?
Evil20071
Newbie/Neuling
 
Posts: 2
Joined: Wed May 14, 2008 12:13 am

Re: Email on Birthday 1.0.0

Postby lefty » Wed May 14, 2008 11:12 am

at the end of the instructions it says to clear your cache and refresh your templates.

did you do that as well?

You should see in the ACP under Board features:

Code: Select all
Send Birthday email:                                             Yes No
Sends a birthday email on the users birthday     
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby Evil20071 » Wed May 14, 2008 4:36 pm

That wasn't showing. I went back in and re-did the SQL insert and it worked. Apparently my hosts database manager didn't get it done the first time.
Evil20071
Newbie/Neuling
 
Posts: 2
Joined: Wed May 14, 2008 12:13 am

Re: Email on Birthday 1.0.0

Postby redspider » Sun Nov 30, 2008 12:31 am

Hi Lefty!
I´ve just installed this mod on my forum, but I think it is not working. I´m in a hurry becaus I´m going to star the forum tomorrow, so I hope you can help me.

After installation I can see the option in the ACP and I´ve activated it, but nobody receives the mail.

I have a doubt in the installation process.In the instructions you say:

Comments
around line 94
Find
Tip: This may be a partial find and not the whole line.

Code: Select All
}
$db->sql_freeresult($result);


I´m not sure if I put the code in the right place. I put it after this lines replacing the line:
}
$db->sql_freeresult($result);

as you say.

if ($age = (int) substr($row['user_birthday'], -4))
{
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
}



Is it correct?

Any idea about this problem?.

I´m waiting 24 hours for the mails, but nothing.

Many thanks and regards.
redspider
Newbie/Neuling
 
Posts: 9
Joined: Sun Nov 30, 2008 12:18 am

Re: Email on Birthday 1.0.0

Postby lefty » Sun Nov 30, 2008 1:59 am

hi, this is what the part in my index.php looks like

Code: Select all
// Generate birthday list if required ...
$birthday_list = '';
$bd_list_ary = array();
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
    $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
    $sql = 'SELECT user_id, username, user_colour, user_birthday, user_email, user_lang,user_notify_type, user_jabber 
        FROM '
 . USERS_TABLE . "
        WHERE user_birthday LIKE '"
 . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
            AND user_type IN ("
 . USER_NORMAL . ', ' . USER_FOUNDER . ')';
    $result = $db->sql_query($sql);

    while ($row = $db->sql_fetchrow($result))
    {
        $birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);

        if ($age = (int) substr($row['user_birthday'], -4))
        {
            $birthday_list .= ' (' . ($now['year'] - $age) . ')';
        }
        if (trim($row['user_email']) && $config['birthday_emails'])
        {
            $bd_list_ary[] = array(
                'method'    => $row['user_notify_type'],
                'email'        => $row['user_email'],
                'jabber'    => $row['user_jabber'],
                'name'        => $row['username'],
                'lang'        => $row['user_lang']
            );
        }
    }
    $db->sql_freeresult($result);

    $nowvar = getdate(time() + ($config['board_timezone'] + $config['board_dst'])*3600 - date('Z'));

    if ( sizeof($bd_list_ary) && $config['birthday_run'] < mktime(0, 0, 0, $nowvar['mon'], $nowvar['mday'], $nowvar['year']) && $config['birthday_emails'] )
   {
   set_config('birthday_run', mktime(0, 0, 0, $nowvar['mon'], $nowvar['mday'], $nowvar['year']));

   include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
    $messenger = new messenger();

    foreach ($bd_list_ary as $pos => $addr)
    {
        $messenger->template('birthday_email', $addr['lang']);

        $messenger->to($addr['email'], $addr['name']);
        $messenger->im($addr['jabber'], $addr['name']);

        $messenger->assign_vars(array(
            'USERNAME'        => htmlspecialchars_decode($addr['name'])
        ));

        $messenger->send($addr['method']);
    }
    unset($bd_list_ary);

    $messenger->save_queue();
    unset($messenger);
    }
    $cache->destroy('config');
}
 


btw, emails are only sent once a day, if you have chosen ur birthday after the emails were sent, it won't send it again.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby redspider » Sun Nov 30, 2008 1:24 pm

Hey Lefty! Many thanks.The problem was in one line.

It´s working fine now.

Regards.
redspider
Newbie/Neuling
 
Posts: 9
Joined: Sun Nov 30, 2008 12:18 am

Re: Email on Birthday 1.0.0

Postby lefty » Sun Nov 30, 2008 1:56 pm

excellent :cheer:
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby bigbrotherbiggs » Mon Jun 01, 2009 1:24 am

Sorry Lefty I am new to php let alone phpBB this is the second mod I have installed and I am stumped right at the beginning and at the end. In that i have no idea how to do the SQL bit nor how to purge the cache and refresh templates. Could you teach me how to do this? Thanks
bigbrotherbiggs
Newbie/Neuling
 
Posts: 1
Joined: Mon Jun 01, 2009 1:18 am

Re: Email on Birthday 1.0.0

Postby lefty » Mon Jun 01, 2009 9:40 am

hi bbb,

first, check what your prefix is. in your config.php file you will find what prefix you are using:
like here:
Code: Select all
<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
...
$table_prefix = 'phpbb_';
....
?>


if it is anything other than phpbb_ you will need to amend the sql script and change phpbb_ to whatever your prefix would be, e.g. if your prefix were phpbb3 the sql would need to be changed from
Code: Select all
INSERT INTO phpbb_config (config_name, config_value) VALUES ('birthday_emails', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('birthday_run', '');

TO
Code: Select all
INSERT INTO phpbb3config (config_name, config_value) VALUES ('birthday_emails', '0');
INSERT INTO phpbb3config (config_name, config_value) VALUES ('birthday_run', '');


once that is sorted, what you basically do is open you phpMyAdmin, then go to the database of your phpbb3 board.
next, there should be a tab called SQL. Click on that file, paste the SQL script into the input box and run the script by clicking run/go/ok (Not sure what it is called atm).
and that should be it.

more information on how to install mods (incl. sql's) can be found here.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.0

Postby AirWarrior » Tue Dec 01, 2009 10:27 pm

Maby a dumb question.
Is this working on 3.0.6 too or needed to be update firtst?
Thx for reading my post.
Greetz
AirWarrior
AirWarrior
Forum Member
 
Posts: 19
Joined: Tue Nov 10, 2009 10:14 pm
Location: In the middle of The Netherlands

Re: Email on Birthday 1.0.0

Postby lefty » Wed Dec 02, 2009 12:17 am

this one does not work on 3.0.6.

i am working on the changes.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1

Postby lefty » Wed Dec 02, 2009 11:52 pm

2009-12-02 - Version 1.0.1
  • updated to work with 3.0.6
  • added logging in ACP for emails sent
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1

Postby kids » Thu Dec 03, 2009 5:02 pm

lefty wrote:
2009-12-02 - Version 1.0.1
  • updated to work with 3.0.6
  • added logging in ACP for emails sent


Thank you :tigs:
This is a very good mod, I have installed, but have a small problem,
Can only be sent to the first user?
kids
Newbie/Neuling
 
Posts: 2
Joined: Thu Dec 03, 2009 4:52 pm

Re: Email on Birthday 1.0.1

Postby AirWarrior » Thu Dec 03, 2009 5:15 pm

thx, keep it going :cheer:
Thx for reading my post.
Greetz
AirWarrior
AirWarrior
Forum Member
 
Posts: 19
Joined: Tue Nov 10, 2009 10:14 pm
Location: In the middle of The Netherlands

Re: Email on Birthday 1.0.1

Postby lefty » Thu Dec 03, 2009 7:08 pm

kids wrote:
lefty wrote:
2009-12-02 - Version 1.0.1
  • updated to work with 3.0.6
  • added logging in ACP for emails sent


Thank you :tigs:
This is a very good mod, I have installed, but have a small problem,
Can only be sent to the first user?

when i tested it, it worked for more than one. please note that the script is only run once a day, i.e. if a user registers whose birthday it is that day he won't get an email until the next birthday.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1

Postby lefty » Thu Dec 03, 2009 9:27 pm

argh, i forgot to look at thhis: http://www.phpbb.com/community/viewtopi ... 5#p5555715

update will follow soonest!
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1

Postby kids » Fri Dec 04, 2009 4:21 am

wow, to understand
Yesterday, I was tried a user, and then try again, so an error :happysmerk:

But, :shifty:
This mod must have a user login,
In order to send email
There are ways to give this mod automatically sent whitdout login.

Thank you for your information
kids
Newbie/Neuling
 
Posts: 2
Joined: Thu Dec 03, 2009 4:52 pm

Re: Email on Birthday 1.0.1

Postby lefty » Fri Dec 04, 2009 8:59 pm

you dont need to be logged in to run the script. hopefully, i will get round to get the new version out today, cant guarantee tho.
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1a

Postby lefty » Sat Dec 05, 2009 12:28 am

Code: Select all
2009-12-03 - Version 1.0.1a
forgot to look at this http://www.phpbb.com/community/viewtopic.php?p=5555715#p5555715
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1b

Postby lefty » Sun Dec 27, 2009 12:03 pm

updated to 1.0.1b.
bugfix - it was possible that the script was called (again) if a user was on different time settings than the board settings
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Re: Email on Birthday 1.0.1b

Postby AirWarrior » Sat Feb 06, 2010 4:55 pm

When i follow the steps in install.xml it go's wrong in the last step.
Open: language/en/acp/common.php
Find:
Code: Select all
?>


Add before
Code: Select all
// Log Entry email on birthday mod from lefty74
$lang = array_merge($lang, array(
   'LOG_BIRTHDAY_EMAIL_SENT'      => '<strong>Birthday email sent to</strong><br />» %s',
));


Then when i save the file i get white pages.
Thx for reading my post.
Greetz
AirWarrior
AirWarrior
Forum Member
 
Posts: 19
Joined: Tue Nov 10, 2009 10:14 pm
Location: In the middle of The Netherlands

Re: Email on Birthday 1.0.1b

Postby AirWarrior » Sat Feb 13, 2010 5:01 pm

Anybody :rant2:
Thx for reading my post.
Greetz
AirWarrior
AirWarrior
Forum Member
 
Posts: 19
Joined: Tue Nov 10, 2009 10:14 pm
Location: In the middle of The Netherlands

Re: Email on Birthday 1.0.1b

Postby lefty » Fri Feb 19, 2010 4:40 pm

AirWarrior wrote:When i follow the steps in install.xml it go's wrong in the last step.
Open: language/en/acp/common.php
Find:
Code: Select all
?>


Add before
Code: Select all
// Log Entry email on birthday mod from lefty74
$lang = array_merge($lang, array(
   'LOG_BIRTHDAY_EMAIL_SENT'      => '<strong>Birthday email sent to</strong><br />» %s',
));


Then when i save the file i get white pages.

white pages normally show up when you have suppressed errors. do you have an error log on your server that displays the error?

Can you confirm that you saved the edited file in UTF8 without BOM format?
AirWarrior wrote:Anybody :rant2:
was offline for two weeks until now so this is the first time i coudl reply :fluester:
lefty aka The Heikze! :eyebrowe:

Heiko Carstens
http://www.lefty74.com

Would you like me to install one of my mods for you? Read here for details
lefty
Abschlussklasse R10c
 
Posts: 1357
Joined: Mon Feb 06, 2006 1:20 am
Location: Den Haag - NL

Next

Return to [3.0.x] MOD Database Releases

Who is online

Users browsing this forum: No registered users and 2 guests

cron