Author Topic: Search for Birthday  (Read 1533 times)

Hornyflings

  • Prime Member
  • ****
  • Posts: 194
  • Karma: +3/-0
    • AsiasHeart
Search for Birthday
« on: January 13, 2016, 08:02:24 AM »
Is there any solution for admin in members search to add the possibility to search for members birthday. for instance admin can search for all members who have birthday today ?

Search possibility should only be available for admin.

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 505
  • Karma: +43/-2
  • Etano Contributor (Skins & Mods)
    • KH Web Development
Re: Search for Birthday
« Reply #1 on: January 14, 2016, 11:33:40 AM »
for instance admin can search for all members who have birthday today ?

You could try something like:

** Line reference is approximate and may differ. If you examine the file you will clearly be able to see where to put the additional code **

admin > member_results.php around line 75 add:
Code: [Select]
<?php ## IGNORE ##

$input['birthday']=sanitize_and_format_gpc($_GET,'birthday',TYPE_INT,0,0);
if (empty(
$input['birthday'])) {
unset($input['birthday']);
}

Then around line 116 add:

Code: [Select]
<?php ## IGNORE ##

if (isset($input['birthday'])) { // Only members who have a birthday today
$where.=" AND DAY(f3) = DAY(CURDATE()) AND MONTH(f3) = MONTH(CURDATE())";
}


Then create a link to process the search such as on the member search page (admin > skin > member_search.html) in the quick links box:

Code: [Select]
<li><a href="member_results.php?birthday=1">Today's Birthdays</a></li>

Hornyflings

  • Prime Member
  • ****
  • Posts: 194
  • Karma: +3/-0
    • AsiasHeart
Re: Search for Birthday
« Reply #2 on: January 15, 2016, 12:53:33 AM »
Hi KHDev,
thanks a lot for sharing!
Your mod works absolutely perfect !!!

Joycey

  • Active Member
  • ***
  • Posts: 95
  • Karma: +0/-0
Re: Search for Birthday
« Reply #3 on: January 16, 2016, 07:11:08 AM »
Thank KHDev

Wow I'm glad I saw this post! Now I can give my site users a surprise on their birthday. :D

God bless!

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3005
  • Karma: +210/-7
    • Maverick Webworks
Re: Search for Birthday
« Reply #4 on: January 16, 2016, 09:24:21 AM »
Will be added in next version release.

As always, thanks KHDev for your contributions.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 505
  • Karma: +43/-2
  • Etano Contributor (Skins & Mods)
    • KH Web Development
Re: Search for Birthday
« Reply #5 on: January 16, 2016, 04:41:50 PM »
No problem guys. :)

Hornyflings

  • Prime Member
  • ****
  • Posts: 194
  • Karma: +3/-0
    • AsiasHeart
Re: Search for Birthday
« Reply #6 on: February 15, 2016, 05:23:04 AM »
To make it more comfortable to send birthday greetings via mail to my members I've added the following mod. But have in mind this solution is suitable only for smaller sites. Due to avoid to run into any spamming trouble it's not recommended for sites with thousands of members.

This mod allows to select members in search result and at the bottom of the members_result page within the dropdown menu choose the option "Happy birthday" and send birthday greetings to all selected members.

Step 1:

Copy /admin/email_send.php and rename to admin/birthday.php
within the file I've changed any related filenames from email_send.xxx to birtday.xxx

/Copy /admin/skin/email_send.html and rename to /admin/skin/birthday.html

Change:
Code: [Select]
<td class="field {profile_fields.error_subject}"><input type="text" name="subject" id="subject" value="{output.subject}" size="50" tabindex="1" /></td>
to:
Code: [Select]
<td class="field {profile_fields.error_subject}"><input type="text" name="subject" id="subject" value="{output.subject}Happy Birthday!" size="50" tabindex="1" /></td>
and:
Code: [Select]
<textarea name="message_body" id="message_body" cols="" rows="" wrap="off" tabindex="2">{output.message_body}</textarea>
to:
Code: [Select]
<textarea name="message_body" id="message_body" cols="" rows="" wrap="off" tabindex="2">{output.message_body}
<p>Dear member,</p>
<p>Happy Birthday and so on .... . (your text)</p>
<p>your text</p>
</textarea>

Copy /admin/skin/styles/email_send.css and rename to /admin/skin/styles/birthday.css

Step 2:

within /admin/skin/member_results.html close to the end of the file you will find:
<div class="mass_members">

add the follwing code within that section:
Code: [Select]
<option value="birthday">Happy birthday</option>
within /admin/js/member_results.js find:
Code: [Select]
} else if (act.val()=='message') {
$('#mass_member_form').attr('action','message_send.php');

below add:
Code: [Select]
} else if (act.val()=='birthday') {
$('#mass_member_form').attr('action','birthday.php');

That's all.

In case you want to send birthday greetings as on-site message it should be possible use message_send.xxx files as source instead of email_send.xxx

Joycey

  • Active Member
  • ***
  • Posts: 95
  • Karma: +0/-0
Re: Search for Birthday
« Reply #7 on: April 18, 2016, 05:53:35 AM »
Hey All,

If possible, please tell me can one display This week or today's birthdays in on site main menu how to do it please?

Thank you kindly

KHDev

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 505
  • Karma: +43/-2
  • Etano Contributor (Skins & Mods)
    • KH Web Development
Re: Search for Birthday
« Reply #8 on: April 18, 2016, 08:42:45 AM »
Hey All,

If possible, please tell me can one display This week or today's birthdays in on site main menu how to do it please?

Thank you kindly

To allow your members to find profiles which have a birthday TODAY you can try the following:

Open ROOT > search.php


Find this block of code around line 113:

Code: [Select]
case 'online':
$input['acclevel_code']='search_basic';
$continue=true;
$where.=" AND a.`fk_user_id` IN ('".join("','",array_keys($_list_of_online_members))."')";
$skip_cache=true;
break;


Add this block below it :


Code: [Select]

case 'birthday':
$input['acclevel_code']='search_basic';
$continue=true;
$where.=" AND DAY(f3) = DAY(CURDATE()) AND MONTH(f3) = MONTH(CURDATE())";
break;


Then in your skin file menu you would use a link like :

Code: [Select]
<a href="{tplvars.relative_url}search.php?st=birthday" title="Todays Birthdays">Today's Birthdays</a>

Omololu

  • Active Member
  • ***
  • Posts: 45
  • Karma: +0/-0
Re: Search for Birthday
« Reply #9 on: June 23, 2016, 05:36:57 PM »
is there a way to search for birthdays in a week or even at a month. i mean to know all the member that has birthday in a month.......