Popup on Birthday

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

Popup on Birthday

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

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 :)
Last edited by lefty on Mon Oct 29, 2007 11:41 pm, edited 1 time in total.
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

mods ¨¨^^^^

Postby PHIL » Mon Sep 24, 2007 7:33 pm

^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
PHIL
Newbie/Neuling
 
Posts: 3
Joined: Mon Sep 24, 2007 7:28 pm

Re: mods ¨¨^^^^

Postby lefty » Mon Sep 24, 2007 8:00 pm

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?
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 : thanks

Postby PHIL » Tue Sep 25, 2007 5:36 am

Thank you for this mods but I had found it on a Vietnamese forum, you have much success

Good day

phil
PHIL
Newbie/Neuling
 
Posts: 3
Joined: Mon Sep 24, 2007 7:28 pm

Postby lefty » Mon Oct 29, 2007 11:42 pm

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




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: [Beta] Popup on Birthday 0.0.3

Postby lefty » Sat Jan 26, 2008 1:22 am

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
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: Popup on Birthday

Postby lefty » Sat Mar 15, 2008 2:02 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: Popup on Birthday

Postby evil derboy » Tue Jun 15, 2010 9:09 pm

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
evil derboy
Newbie/Neuling
 
Posts: 1
Joined: Tue Jun 15, 2010 9:07 pm

Re: Popup on Birthday

Postby lefty » Tue Jun 15, 2010 10:16 pm

hi, you probably want to change the user_birthday field that is referred to in the mod to the one you are using.
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: Popup on Birthday

Postby Valle » Mon Oct 25, 2010 2:43 pm

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
Valle
Newbie/Neuling
 
Posts: 1
Joined: Mon Oct 25, 2010 2:34 pm

Re: Popup on Birthday

Postby lefty » Fri Oct 29, 2010 8:00 pm

Hallo,tut mir leid, wuerd schon helfen habe aber leider nicht die zeit. sorry :depressed:
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: Popup on Birthday

Postby jbsaxman » Thu Dec 23, 2010 9:03 pm

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?
jbsaxman
Newbie/Neuling
 
Posts: 2
Joined: Thu Dec 23, 2010 8:58 pm

Re: Popup on Birthday

Postby lefty » Fri Dec 24, 2010 10:39 am

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.
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: Popup on Birthday

Postby jbsaxman » Fri Dec 24, 2010 6:19 pm

Cool. I'll keep checking in.
jbsaxman
Newbie/Neuling
 
Posts: 2
Joined: Thu Dec 23, 2010 8:58 pm

Re: Popup on Birthday

Postby Terr0r » Thu Sep 08, 2011 11:44 am

can I use this MOD on phpBB 3.0.9
if you can't fix it with ducktape you ain't using enough
For my MODS and BBCodes or other things that I have made take a look here
Image
Terr0r
Newbie/Neuling
 
Posts: 4
Joined: Thu Sep 08, 2011 11:42 am

Re: Popup on Birthday

Postby lefty » Sat Sep 10, 2011 1:24 pm

will check today and get back to you.
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: Popup on Birthday

Postby lefty » Sat Sep 10, 2011 2:22 pm

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();
}
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: Popup on Birthday

Postby Terr0r » Sat Nov 12, 2011 10:35 pm

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
if you can't fix it with ducktape you ain't using enough
For my MODS and BBCodes or other things that I have made take a look here
Image
Terr0r
Newbie/Neuling
 
Posts: 4
Joined: Thu Sep 08, 2011 11:42 am

Re: Popup on Birthday

Postby Blackwolf » Sun Mar 04, 2012 4:27 am

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:
PhpBB3 Version: 3.0.10
Oz Unity
Ultimate Edition
Ultimate Edition Oz

We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us.
Blackwolf
Forum Member
 
Posts: 25
Joined: Thu Jan 27, 2011 10:18 am
Location: Melbourne, Australia

Re: Popup on Birthday

Postby lefty » Sat Mar 10, 2012 11:42 pm

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.
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: Popup on Birthday

Postby Blackwolf » Sun Mar 11, 2012 1:45 am

Well...humble appologies.....today is my Birthday.....for real.... :birthdayparty:

Got the pop up. :thumbsup:

working now.png
PhpBB3 Version: 3.0.10
Oz Unity
Ultimate Edition
Ultimate Edition Oz

We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us.
Blackwolf
Forum Member
 
Posts: 25
Joined: Thu Jan 27, 2011 10:18 am
Location: Melbourne, Australia

Re: Popup on Birthday

Postby lefty » Sun Mar 11, 2012 11:35 am

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 !!
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


Return to [3.0.x] MOD Database Releases

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron