Page 1 of 1

Popup on Birthday

PostPosted: Sun Sep 23, 2007 5:49 pm
by lefty
Modification name: Popup on Birthday
Author: lefty74
Modification description: Makes a popup appear when a user logs in at their birthday or within 14 days of their birthday. Can be switched off in ACP
Modification version: 1.0.0
Tested on phpBB version: 3.0.0

Download file: Popup on Birthday

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

Screenshots:
Image

Credits: Many thanks to stitch625 as this was his idea really :)

mods ¨¨^^^^

PostPosted: Mon Sep 24, 2007 7:33 pm
by PHIL
^bonjour

excuse me!!!!!! je parles french

je me suis permis de prendre les mods que tu as fait et de les traduire en français

ils sont super. :goodideasign:  :thumbsup:

my forum

my name is PHIL

forum

http://visionexperimental.be/phpbb/index.php :scared3:

merci pour tout

Re: mods ¨¨^^^^

PostPosted: Mon Sep 24, 2007 8:00 pm
by lefty
PHIL wrote:^bonjour

excuse me!!!!!! je parles french

je me suis permis de prendre les mods que tu as fait et de les traduire en français

ils sont super. :goodideasign:  :thumbsup:

my forum

my name is PHIL

forum

http://visionexperimental.be/phpbb/index.php :scared3:

merci pour tout


hi, sorry i dont speak french, if babelfish is right, you are translating my mods?

re : thanks

PostPosted: Tue Sep 25, 2007 5:36 am
by PHIL
Thank you for this mods but I had found it on a Vietnamese forum, you have much success

Good day

phil

PostPosted: Mon Oct 29, 2007 11:42 pm
by lefty
updated to 0.0.2
to change from 0.0.1 to 0.0.2 :

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
// Check whether it is the user's birthday
if (isset($user->data['is_registered']) && $user->data['is_registered'] && $config['birthday_popup'] )
{

$birthdaydate = (gmdate('Y') . '-' . trim(substr($user->data['user_birthday'],3,-5)) . '-' . substr($user->data['user_birthday'],0,-8));
$user_birthday = strtotime($birthdaydate) ;
$last_visit_birthday = $user->data['user_lastvisit'];
$now_popup = getdate(time() + $user->timezone + $user->dst - date('Z'));
$today_popup = mktime(0, 0, 0, $now_popup['mon'], $now_popup['mday'], $now_popup['year']);
if ( $birthdaydate )
{
if ( ( $user_birthday >= $today_popup ) && ( $user_birthday < ($today_popup + 86400) ) && ( $user_birthday > $last_visit_birthday ) )
{
if (!$user->data['user_birthday_popup'] || $user->data['user_birthday_popup'] < $user->data['session_last_visit'])
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_birthday_popup = ' . $user->data['session_last_visit'] . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);

$popup_birthday_today = true;
$popup_birthday_before = false;
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}

}
else if ( ( $user_birthday > $last_visit_birthday ) && ( $user_birthday < $today_popup ) && ( $user_birthday > ( $today_popup - 14 * 86400) ) )
{
if (!$user->data['user_birthday_popup'] || $user->data['user_birthday_popup'] < $user->data['session_last_visit'])
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_birthday_popup = ' . $user->data['session_last_visit'] . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);

$popup_birthday_today = false;
$popup_birthday_before = true;
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}

}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
// Check whether it is the user's birthday
if (isset($user->data['is_registered']) && $user->data['is_registered'] && $config['birthday_popup'] && ( trim(substr($user->data['user_birthday'],0,-8)) > 0 ) )
{

$birthdaydate = (gmdate('Y') . '-' . trim(substr($user->data['user_birthday'],3,-5)) . '-' . trim(substr($user->data['user_birthday'],0,-8)));
$user_birthday = strtotime($birthdaydate) ;
$last_visit_birthday = $user->data['user_lastvisit'];
$now_popup = getdate(time() + $user->timezone + $user->dst - date('Z'));
$today_popup = mktime(0, 0, 0, $now_popup['mon'], $now_popup['mday'], $now_popup['year']);

if ( ( $user_birthday >= $today_popup ) && ( $user_birthday < ($today_popup + 86400) ) && ( $user_birthday > $last_visit_birthday ) )
{
if (!$user->data['user_birthday_popup'] || $user->data['user_birthday_popup'] < $user->data['session_last_visit'])
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_birthday_popup = ' . $user->data['session_last_visit'] . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);

$popup_birthday_today = true;
$popup_birthday_before = false;
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}

}
else if ( ( $user_birthday > $last_visit_birthday ) && ( $user_birthday < $today_popup ) && ( $user_birthday > ( $today_popup - 14 * 86400) ) )
{
if (!$user->data['user_birthday_popup'] || $user->data['user_birthday_popup'] < $user->data['session_last_visit'])
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_birthday_popup = ' . $user->data['session_last_visit'] . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);

$popup_birthday_today = false;
$popup_birthday_before = true;
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}
}
else
{
$popup_birthday_today = false;
$popup_birthday_before = false;
}
#
#-----[ FIND ]------------------------------------------
#
'U_POPUP_BIRTHDAY' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=birthday_popup"),

#
#-----[ REPLACE WITH ]------------------------------------------
#
'U_POPUP_BIRTHDAY' => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=birthday_popup'),
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
function birthday_popup()
{
global $template, $user;

$user->setup('posting');

page_header($user->lang['CONGRATULATIONS']);

$template->set_filenames(array(
'birthday_popup' => 'birthday_popup.html')
);

$birthdaydate = (gmdate('Y') . '-' . trim(substr($user->data['user_birthday'],3,-5)) . '-' . substr($user->data['user_birthday'],0,-8));
$user_birthday = strtotime($birthdaydate) ;
$last_visit_birthday = $user->data['user_lastvisit'];
$now_popup = getdate(time() + $user->timezone + $user->dst - date('Z'));
$today_popup = mktime(0, 0, 0, $now_popup['mon'], $now_popup['mday'], $now_popup['year']);

if ( ( $user_birthday >= $today_popup ) && ( $user_birthday < ($today_popup + 86400) ) && ( $user_birthday > $last_visit_birthday ) )
{
$message = sprintf($user->lang['CONGRATSTODAY'], $user->data['username']);
}
else if ( ( $user_birthday > $last_visit_birthday ) && ( $user_birthday < $today_popup ) )
{
$message = sprintf($user->lang['CONGRATSBEFORE'], $user->data['username']);
}


$template->assign_vars(array(
'MESSAGE' => $message,
'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false)
);

$template->display('birthday_popup');
}

#
#-----[ REPLACE WITH ]------------------------------------------
#

function birthday_popup()
{
global $template, $user;

$user->setup('posting');

page_header($user->lang['CONGRATULATIONS']);

$template->set_filenames(array(
'birthday_popup' => 'birthday_popup.html')
);

   $birthdaydate = (gmdate('Y') . '-' . trim(substr($user->data['user_birthday'],3,-5)) . '-' . trim(substr($user->data['user_birthday'],0,-8)));
$user_birthday = strtotime($birthdaydate) ;
$last_visit_birthday = $user->data['user_lastvisit'];
$now_popup = getdate(time() + $user->timezone + $user->dst - date('Z'));
$today_popup = mktime(0, 0, 0, $now_popup['mon'], $now_popup['mday'], $now_popup['year']);

if ( ( $user_birthday >= $today_popup ) && ( $user_birthday < ($today_popup + 86400) ) && ( $user_birthday > $last_visit_birthday ) )
{
$message = sprintf($user->lang['CONGRATSTODAY'], $user->data['username']);
}
else if ( ( $user_birthday > $last_visit_birthday ) && ( $user_birthday < $today_popup ) )
{
$message = sprintf($user->lang['CONGRATSBEFORE'], $user->data['username']);
}


$template->assign_vars(array(
'MESSAGE' => $message,
'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false)
);

$template->display('birthday_popup');
}
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/overall_header.html
#
#-----[ FIND ]------------------------------------------
#
window.open('{U_POPUP_BIRTHDAY}', '_phpbbbdpopup', 'height=225,resizable=yes,width=400');
#
#-----[ REPLACE WITH ]------------------------------------------
#
popup('{U_POPUP_BIRTHDAY}', 400, 225, '_phpbbbdpopup');
#
#-----[ OPEN ]------------------------------------------
#
styles/subsilver2/overall_header.html
#
#-----[ FIND ]------------------------------------------
#
window.open('{U_POPUP_BIRTHDAY}', '_phpbbbdpopup', 'height=225,resizable=yes,width=400');
#
#-----[ REPLACE WITH ]------------------------------------------
#
popup('{U_POPUP_BIRTHDAY}', 400, 225, '_phpbbbdpopup');
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM





Re: [Beta] Popup on Birthday 0.0.3

PostPosted: Sat Jan 26, 2008 1:22 am
by lefty
updated to v0.0.3
Code: Select all
##
## 2008-01-26 - Version 0.0.3
##      -updated for Gold and put to beta

upgrade instructions in the contrib folder

Re: Popup on Birthday

PostPosted: Sat Mar 15, 2008 2:02 pm
by lefty
validated and approved to phpbb.com MODDB

Re: Popup on Birthday

PostPosted: Tue Jun 15, 2010 9:09 pm
by evil derboy
Hi Lefty,

Loving your mods!

I'm looking for something will remind a user when their motor insurance is due for renewal 14 days beforehand. Is there any way that I can use your mod to check a different profile field other than the users birthday?

I imagine it must be fairly simple for the mod to check a different date field? What would I need to change?

Thanks very much in advance for any help you can give me on this.

Cheers,

Derek

Re: Popup on Birthday

PostPosted: Tue Jun 15, 2010 10:16 pm
by lefty
hi, you probably want to change the user_birthday field that is referred to in the mod to the one you are using.

Re: Popup on Birthday

PostPosted: Mon Oct 25, 2010 2:43 pm
by Valle
guten Tag,
ich möchte den Mod so verändern:
wenn ein Benutzer sich im Forum anmeldet soll Popup erscheinen das aber nur einmal erscheint also sobalt der Benutzer den Link in dem Popup geklickt hat verschwindet das Popup für den Benutzer für immer.
Hat von euch jemand eine Ahnung wie man das realisieren kann?

Hello,
I want to change the mod so:
when a user logs in the forum seem to pop up but this appears only once so sobalt the user has clicked the link in the popup the popup disappears for the user forever.
Has anyone of you any idea how to implement it?
Sorry for this bad English I have translate it with Google translate :goodideasign: xD

Re: Popup on Birthday

PostPosted: Fri Oct 29, 2010 8:00 pm
by lefty
Hallo,tut mir leid, wuerd schon helfen habe aber leider nicht die zeit. sorry :depressed:

Re: Popup on Birthday

PostPosted: Thu Dec 23, 2010 9:03 pm
by jbsaxman
Lefty,

I've been trying to add this mod to my test forum to see how I like it.

The problem is that the addition to functions.php cannot be made automatically.

The failure is:

FIND
Code: Select all
$template->assign_vars(array(
      'PROGRESS_BAR'   => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS']))
   );

   $template->display('popup');
}


This does not exist in the functions.php. I am on phpbb 3.0.8

Any suggestions?

Re: Popup on Birthday

PostPosted: Fri Dec 24, 2010 10:39 am
by lefty
Hi, I haven't been able to test this myself on 3.0.8.

It's on my list and I hope to have done it some time next week.

Re: Popup on Birthday

PostPosted: Fri Dec 24, 2010 6:19 pm
by jbsaxman
Cool. I'll keep checking in.

Re: Popup on Birthday

PostPosted: Thu Sep 08, 2011 11:44 am
by Terr0r
can I use this MOD on phpBB 3.0.9

Re: Popup on Birthday

PostPosted: Sat Sep 10, 2011 1:24 pm
by lefty
will check today and get back to you.

Re: Popup on Birthday

PostPosted: Sat Sep 10, 2011 2:22 pm
by lefty
yes, it works on 309 but in the installation instructions

there is a part where you are asked to find below in posting.php:

Code: Select all
   $template->assign_vars(array(
      'PROGRESS_BAR'   => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS']))
   );

   $template->display('popup');
}



the correct code to find is this:
Code: Select all
   $template->assign_vars(array(
      'PROGRESS_BAR'   => $user->img('upload_bar', $user->lang['UPLOAD_IN_PROGRESS']))
   );

   $template->display('popup');

   garbage_collection();
   exit_handler();
}

Re: Popup on Birthday

PostPosted: Sat Nov 12, 2011 10:35 pm
by Terr0r
okay thanks is it also possible to get a popup likes what you see on this site ?

http://www.stsoftware.biz/support/index ... ytutorials

I hope that is possible

already thanks for the help

Greets Terr0r

Re: Popup on Birthday

PostPosted: Sun Mar 04, 2012 4:27 am
by Blackwolf
Board 3.0.10

Checked edits.....like 5 times....tested.....pop up not working.....nor on your test site.....

Shame your not going to be maintaining these.....but any ideas?

I have reinstalled several times....all worked in 3.0.9 :embarrassed:

Re: Popup on Birthday

PostPosted: Sat Mar 10, 2012 11:42 pm
by lefty
Hi Blackwolf,
sorry, I am sorry that this doesn't work for you anymore. i haven't looked at the code in more than a year. i am sorry but i really don't know without looking at it deeper why it would have stopped.

Re: Popup on Birthday

PostPosted: Sun Mar 11, 2012 1:45 am
by Blackwolf
Well...humble appologies.....today is my Birthday.....for real.... :birthdayparty:

Got the pop up. :thumbsup:

working now.png

Re: Popup on Birthday

PostPosted: Sun Mar 11, 2012 11:35 am
by lefty
Blackwolf wrote:Well...humble appologies.....today is my Birthday.....for real.... :birthdayparty:

Got the pop up. :thumbsup:

working now.png

lol, i wondered if you showed up because you were just testing it :happysmerk:

:new2_party1: :hapbirthday3: :cheers2:

have a great birthday !!