Email on Birthday

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
robb58
Registered User
Posts: 24
Joined: Fri Sep 08, 2006 5:17 pm
Location: Cornwall UK
Contact:

Re: Email on Birthday

Post by robb58 » Wed Apr 23, 2008 7:18 pm

OK.... being a bit dense here..... where abouts in the ACP do you turn on the option to send the birthday email? :oops:

Tarabass
Registered User
Posts: 44
Joined: Mon Mar 31, 2008 7:45 pm
Location: Elburg, Gelderland, The Netherlands
Contact:

Re: Email on Birthday

Post by Tarabass » Wed Apr 23, 2008 7:32 pm

ACP->General->Board features ;)

gergokee
Registered User
Posts: 87
Joined: Fri Feb 16, 2007 1:26 pm

Re: Email on Birthday

Post by gergokee » Wed Apr 23, 2008 10:08 pm

i have only "require birthday mod" installed but it shouldn't do anything with this mod...
forum: http://forum.thevotenation.com/


And you can set the "display birthday congrats in profile"
Last edited by gergokee on Wed May 07, 2008 12:22 am, edited 1 time in total.

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Wed Apr 23, 2008 10:25 pm

gergokee wrote:i have only "require birthday mod" installed but it shouldn't do anything with this mod...
well, apparently it does because this works fine on vanilla. ;)


could you paste your code from index.php between the lines
// Generate birthday list if required ...
...
// Assign index specific vars
cheers
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

robb58
Registered User
Posts: 24
Joined: Fri Sep 08, 2006 5:17 pm
Location: Cornwall UK
Contact:

Re: Email on Birthday

Post by robb58 » Wed Apr 23, 2008 10:35 pm

Tarabass wrote:ACP->General->Board features ;)
I have all of the birthday boxes ticked but it doesn't look any different to the original version of the board features CP - i.e., no extra section or box to tick for a "send a birthday email". Is this correct?

gergokee
Registered User
Posts: 87
Joined: Fri Feb 16, 2007 1:26 pm

Re: Email on Birthday

Post by gergokee » Wed Apr 23, 2008 10:41 pm

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 . ')';
			//-- mod: Prime Birthdate Require -------------------------------------------//
	$sql = str_replace('FROM ' . USERS_TABLE, ', user_show_age FROM ' . USERS_TABLE, $sql);
//-- end: Prime Birthdate Require -------------------------------------------//

	$result = $db->sql_query($sql);

	while ($row = $db->sql_fetchrow($result))
	{
	//-- mod: Prime Birthdate Require -------------------------------------------//
// This will prevent a user's username (0x02) or age (0x01) from being displayed 
// on the birthday list if they have chosen not to make it publicly viewable.
		if(empty($row['user_show_age']) || ($row['user_show_age'] & 0x02) == 0)
		{
			continue;
		}
		$row['user_birthday'] = (empty($row['user_show_age']) || ($row['user_show_age'] & 0x01) == 0) ? '' : $row['user_birthday'];
//-- end: Prime Birthdate Require -------------------------------------------//

		$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');
	
}

// JWD RANDOM FLAGS MOD 
	$image_file_path = './images/flags/'; 

	$d = dir($image_file_path) or die("Wrong path: $image_file_path");
	while (false !== ($entry = $d->read())) {
	if($entry != '.' && $entry != '..' && !is_dir($dir.$entry))
	$Images[] = $entry;

	}
	$d->close();

	for ($i=0; $i < 29; $i++)
	{
				//Display blocks to template
			$template->assign_block_vars('flags', array(
				'FLAG' 		=> '<img src="./images/flags/'.$Images[rand(1,190)].'" border="0">',)
			);
	}
	
// END JWD RANDOM FLAGS MOD
	
// Assign index specific vars
Well it's quite long :) some mods i added... The problem is in the first part i think...

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Thu Apr 24, 2008 10:10 am

robb58 wrote:
Tarabass wrote:ACP->General->Board features ;)
I have all of the birthday boxes ticked but it doesn't look any different to the original version of the board features CP - i.e., no extra section or box to tick for a "send a birthday email". Is this correct?
if you all the edits of the installation instructions were made, you should see something like this:

Send Birthday email: Yes No
Sends a birthday email on the users birthday

Please doublecheck your edits and clear cache, refresh your templates and have another look ;)
gergokee wrote:
Well it's quite long :) some mods i added... The problem is in the first part i think...
cheers, I will have a look when i find some time...

edit:
only had a very quick look, not tested since i dont have the mod installed, but you could try this:

find

Code: Select all

continue;
replace with

Code: Select all

	         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']
	             );
	          }
             continue;
backup your files before doing this so as this is completely untested
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

gergokee
Registered User
Posts: 87
Joined: Fri Feb 16, 2007 1:26 pm

Re: Email on Birthday

Post by gergokee » Thu Apr 24, 2008 10:38 am

didn't work, but what i need is just not giving attention to the field: "Display congrats" So it is enough if it displays congrats both if it set to yes or no... and of course sends emails!

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Thu Apr 24, 2008 3:59 pm

gergokee wrote:didn't work, but what i need is just not giving attention to the field: "Display congrats" So it is enough if it displays congrats both if it set to yes or no... and of course sends emails!
if you do not want a function from a certain mod you should contact that mod author how to 'disable' it. in your case, i think it is primehalo's mod. he will probably be able to tell you straight away how to do it.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

robb58
Registered User
Posts: 24
Joined: Fri Sep 08, 2006 5:17 pm
Location: Cornwall UK
Contact:

Re: Email on Birthday

Post by robb58 » Thu Apr 24, 2008 4:26 pm

if you all the edits of the installation instructions were made, you should see something like this:

Send Birthday email: Yes No
Sends a birthday email on the users birthday

Please doublecheck your edits and clear cache, refresh your templates and have another look
I'm not seeing this but I reckon I could have messed up the placing of the code in this section of the acp_board.php file

Code: Select all

'allow_birthdays'		=> array('lang' => 'ALLOW_BIRTHDAYS',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
						'BIRTHDAY_EMAILS'			=> 'Send Birthday email',
	'BIRTHDAY_EMAILS_EXPLAIN'	=> 'Sends a birthday email on the users birthday',

						'legend2'				=> 'ACP_LOAD_SETTINGS',
						'load_birthdays'		=> array('lang' => 'YES_BIRTHDAYS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
Could you advise me on how it should look?

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Thu Apr 24, 2008 4:43 pm

thats what it should look like... :?

you refreshed templates, cleared cache?

if you have that installed on a testboard, can you give pm me the url and maybe set up an test account with admin rights?
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

robb58
Registered User
Posts: 24
Joined: Fri Sep 08, 2006 5:17 pm
Location: Cornwall UK
Contact:

Re: Email on Birthday

Post by robb58 » Thu Apr 24, 2008 8:00 pm

Duh... I've just checked my code and realised I'd made a complete pigs ear of the ACP_Board.php! I've fixed it and all seems to be working now :D

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Fri Apr 25, 2008 12:02 am

robb58 wrote:Duh... I've just checked my code and realised I'd made a complete pigs ear of the ACP_Board.php! I've fixed it and all seems to be working now :D
:D great
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

User avatar
mcdanielnc89
Registered User
Posts: 703
Joined: Tue Feb 06, 2007 10:49 pm
Location: Missouri
Contact:

Re: Email on Birthday

Post by mcdanielnc89 » Sun May 04, 2008 7:39 am

Ok, I'm a fan of you, lefty.. All of your mods have worked fantastically. If you could when you get time. or if someone else has tried this let me know if it fully works with 3.0.1.

Thanks :D
Last edited by mcdanielnc89 on Sun May 04, 2008 9:02 am, edited 1 time in total.

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Re: Email on Birthday

Post by lefty74 » Sun May 04, 2008 8:07 am

mcdanielnc89 wrote:Ok, I'm a an of you, lefty.. All of your mods have worked fantastically. Id you could when yuou get time. or if someoen else has tried this.. Let me know if it fully works with 3.0.1
cheers mcdanielnc89 :)
it upgraded my board to 3.0.1 a little while ago and all my mods work with 3.0.1. The only thing i still have to do is whether the FIND in the installation instructions are still ok or whether they need minor adjusting.

Email on Birthday, however, works fine.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.

Locked

Return to “[3.0.x] MOD Database Releases”