Plugin Directory

Changeset 565448


Ignore:
Timestamp:
06/29/2012 02:28:14 PM (14 years ago)
Author:
omarke85
Message:

tagging version 0.1.7

Location:
wp-birthday-users
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-birthday-users/tags/0.1.7/birthday-users-admin-css.css

    r561800 r565448  
    11/*
    2  * WP Birthday Users style sheet for admin
    3  * */
     2 *  * WP Birthday Users style sheet for admin
     3 *   * */
    44
    55#icon-wp-birthday-users {
     
    5454  float: left;
    5555}
    56 
     56.birthday {
     57  background: transparent url(images/present.png) 1px 0 no-repeat;
     58  padding-left: 18px;
     59}
     60.inputtitle  {
     61  width: 190px;
     62  padding: 5px 0;
     63}
     64.textinput {
     65  width: 25px;
     66}
     67.inputtd {
     68  text-align: center;
     69}
     70.inputtitle>a {
     71  background: transparent url(images/birthday.png) 1px 0 no-repeat;
     72  padding: 8px;
     73  float: right;
     74}
  • wp-birthday-users/tags/0.1.7/functions.php

    r561800 r565448  
    3434}
    3535
     36### Function: get previous key in array
     37function getPrevKey($key, $hash = array()){
     38  $keys = array_keys($hash);
     39  $found_index = array_search($key, $keys);
     40  if ($found_index === false || $found_index === 0)
     41    return false;
     42  return $keys[$found_index-1];
     43}
     44
     45### Function: get next key in array
     46function getNextKey($key, $hash = array()) {
     47  $keys = array_keys($hash);
     48  $found_index = array_search($key, $keys);
     49  if ($found_index === false)
     50    return false;
     51  return $keys[$found_index+1];
     52}
     53
    3654### Function: Get Permision number of a group
    3755function bu_permLevel($permlevel='administrator') {
     
    5169function getUserMetaValue($display='first_name,last_name', $user_id) {
    5270  $display = ($display == NULL?'first_name,last_name':$display);
    53   $user = get_user_to_edit($user_id);
     71  $user = get_user_by('id', $user_id);
     72  //$user = get_user_to_edit($user_id);
    5473  $parts = explode(",", $display);
    5574  if (count($parts) < 2) {
     
    6786  $optionarray_def = array();
    6887  $optionarray_def = get_option('birthdayusers_options');
    69   if (isset($rebuild)) {
     88  if (isset($rebuild) && $rebuild) {
    7089    foreach(scandir(plugin_dir_path(__FILE__)."icals") as $item){
    7190      if(is_file(plugin_dir_path(__FILE__)."icals/$item")){
     
    8099  $usersarray['info']['basedir'] = $upload['basedir']."/birthday.ics";
    81100  $usersarray['info']['baseurl'] = $upload['baseurl']."/birthday.ics";
     101  $usersarray['info']['today'] = 0;
    82102  foreach ($blogusers as $user) {
    83103    $birthday      = get_user_meta($user->ID, 'birthday_date', true);
     
    96116          $usersarray['info']['oldest'] = ($nickname!= ""?$nickname:$user->user_login);
    97117        }
    98         if (isset($rebuild) && $birthdayshare == 1) {
     118        if (isset($rebuild) && $rebuild && $birthdayshare == 1) {
    99119          write2file(birthday2ical($birthday, $user->ID, $birthdayage, $changes, $optionarray_def['bu_display']), plugin_dir_path(__FILE__)."icals/b2i_".$user->user_login);
    100120        }
     
    107127          'birthday_newer' => ($date[1]<10?"0".$date[1]:$date[1])
    108128        );
     129        if ((($date[1]<10?"0".$date[1]:$date[1])."-".($date[0]<10?"0".$date[0]:$date[0])) === date('m-d')) {
     130          $usersarray['info']['today']++;
     131        }
    109132        $usersarray['info']['average_age'] += age($birthday);
    110          
    111133        if ($birthdate < $oldest) {
    112134          $oldest = $birthdate;
     
    121143  }
    122144  $usersarray['info']['total_users'] = count($blogusers);
    123   if (isset($rebuild)) {
     145  if (isset($rebuild) && $rebuild) {
    124146    write2file(merge2ical(plugin_dir_path(__FILE__)."icals"), $upload['basedir']."/birthday.ics");
    125147    $usersarray['info']['text'] .= __('Birthdays rebuild.', 'wp-birthday-users');
  • wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-de_DE.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:44+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:27+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    144144msgstr "Geburtstag"
    145145
     146#: widget.php:7
     147msgid "Display a list of birthdays"
     148msgstr "Zeigt eine Liste der Geburtstage"
     149
     150#: widget.php:36
     151msgid "Sort by month"
     152msgstr "Sortieren nach Monat"
     153
     154#: widget.php:40
     155msgid "Show upcoming birthdays"
     156msgstr "Zeigen Sie nächsten Geburtstage"
     157
     158#: widget.php:44
     159msgid "How many upcoming birthdays"
     160msgstr "Wie viele nächsten Geburtstage"
     161
     162#: widget.php:48
     163msgid "Show past birthdays"
     164msgstr "Zeige Bereits verjährt"
     165
     166#: widget.php:52
     167msgid "How many past birthdays"
     168msgstr "Wie viele Bereits verjährt"
     169
     170#: widget.php:56
     171msgid "Hide widget if no birthdays today"
     172msgstr "Widget ausblenden, wenn keine verjährt heute"
     173
     174#: widget.php:62
     175msgid "Show ical download link"
     176msgstr "Zeige iCal Download-Link"
     177
     178#: widget.php:94
     179msgid "Download Birthday calendar"
     180msgstr "Download Geburtstagskalender"
     181
     182#: widget.php:101
     183msgid "Today"
     184msgstr "heute"
     185
     186#: widget.php:62
     187msgid "No birthdays today"
     188msgstr "Keine Geburtstage heute"
     189
  • wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-fr_FR.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:42+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:25+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    6262#: wp-birthday-users.php:163
    6363msgid "Upcoming birthdays"
    64 msgstr "Anniversaires àenir"
     64msgstr "Anniversaires à venir"
    6565
    6666#: wp-birthday-users.php:173
    6767msgid "Passed birthdays"
    68 msgstr "Anniversaires pass"
     68msgstr "Anniversaires passés"
    6969
    7070#: wp-birthday-users.php:249
     
    144144msgstr "Anniversaire "
    145145
     146#: widget.php:7
     147msgid "Display a list of birthdays"
     148msgstr "Afficher une liste des anniversaires"
     149
     150#: widget.php:36
     151msgid "Sort by month"
     152msgstr "Trier par mois"
     153
     154#: widget.php:40
     155msgid "Show upcoming birthdays"
     156msgstr "Montrer anniversaires à venir"
     157
     158#: widget.php:44
     159msgid "How many upcoming birthdays"
     160msgstr "Combien anniversaires à venir"
     161
     162#: widget.php:48
     163msgid "Show past birthdays"
     164msgstr "Montrer anniversaires passés"
     165
     166#: widget.php:52
     167msgid "How many past birthdays"
     168msgstr "Combien anniversaires passés"
     169
     170#: widget.php:56
     171msgid "Hide widget if no birthdays today"
     172msgstr "Masquer le widget si aucune année aujourd'hui"
     173
     174#: widget.php:62
     175msgid "Show ical download link"
     176msgstr "Afficher le lien télécharger iCal"
     177
     178#: widget.php:94
     179msgid "Download Birthday calendar"
     180msgstr "Télécharger le calendrier d'anniversaire"
     181
     182#: widget.php:101
     183msgid "Today"
     184msgstr "Aujourd'hui"
     185
     186#: widget.php:62
     187msgid "No birthdays today"
     188msgstr "Pas d'anniversaires aujourd'hui"
     189
  • wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-nl_NL.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:39+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:26+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    145145msgstr "Verjaardag "
    146146
     147#: widget.php:7
     148msgid "Display a list of birthdays"
     149msgstr "Toon een lijst van jarige, komende verjaardagen en reeds verjaarden"
     150
     151#: widget.php:36
     152msgid "Sort by month"
     153msgstr "Toon volgens maand"
     154
     155#: widget.php:40
     156msgid "Show upcoming birthdays"
     157msgstr "Toon komende jarigen"
     158
     159#: widget.php:44
     160msgid "How many upcoming birthdays"
     161msgstr "Hoeveel komende jarigen"
     162
     163#: widget.php:48
     164msgid "Show past birthdays"
     165msgstr "Toon reeds verjaarden"
     166
     167#: widget.php:52
     168msgid "How many past birthdays"
     169msgstr "Hoeveel reeds verjaard"
     170
     171#: widget.php:56
     172msgid "Hide widget if no birthdays today"
     173msgstr "Verberg widget indien geen jarige vandaag"
     174
     175#: widget.php:62
     176msgid "Show ical download link"
     177msgstr "Toon ical download link"
     178
     179#: widget.php:94
     180msgid "Download Birthday calendar"
     181msgstr "Download Verjaardagskalender"
     182
     183#: widget.php:101
     184msgid "Today"
     185msgstr "Vandaag"
     186
     187#: widget.php:62
     188msgid "No birthdays today"
     189msgstr "Geen jarigen vandaag"
     190
  • wp-birthday-users/tags/0.1.7/lang/wp-birthday-users.pot

    r561800 r565448  
    140140msgid "Birthday "
    141141msgstr ""
     142
     143#: widget.php:7
     144msgid "Display a list of birthdays"
     145msgstr ""
     146
     147#: widget.php:36
     148msgid "Sort by month"
     149msgstr ""
     150
     151#: widget.php:40
     152msgid "Show upcoming birthdays"
     153msgstr ""
     154
     155#: widget.php:44
     156msgid "How many upcoming birthdays"
     157msgstr ""
     158
     159#: widget.php:48
     160msgid "Show past birthdays"
     161msgstr ""
     162
     163#: widget.php:52
     164msgid "How many past birthdays"
     165msgstr ""
     166
     167#: widget.php:56
     168msgid "Hide widget if no birthdays today"
     169msgstr ""
     170
     171#: widget.php:62
     172msgid "Show ical download link"
     173msgstr ""
     174
     175#: widget.php:94
     176msgid "Download Birthday calendar"
     177msgstr ""
     178
     179#: widget.php:101
     180msgid "Today"
     181msgstr ""
     182
     183#: widget.php:62
     184msgid "No birthdays today"
     185msgstr ""
  • wp-birthday-users/tags/0.1.7/readme.txt

    r561800 r565448  
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HPZRXMPY99LPS&item_name=Wordpress%20plugin&item_number=wp%20birthday%20users&currency_code=EUR
    55Requires at least: x.x.x
    6 Tested up to: 3.4
    7 Stable tag: 0.1.6
     6Tested up to: 3.4.1
     7Stable tag: 0.1.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424> For some reason there is 2 breakspaces in the wp-birthday-users.php at the end. Delete these to let the plugin work. (I try to fix it later)
    2525
     26Version 0.1.7 introduce the posibility to show a widget on your page. This will show you a widget with the users whos birthday is today, and you can choose to show upcoming and past birthdays (and how many of it), also a downloadimage with to the ical.
     27
    2628== Installation ==
    2729
     
    32345. Go to your profil and fill in your birthday. Save it.
    33356. This will create a birthday.ics-file in your upload-directory of wordpress.
     367. Additional you can add a widget on your blog, or edit the settings.
    3437
    3538If you upgrade:
    36 Run rebuild-script found on the birthdays overview page.
     39Run rebuild-script found on the birthdays overview page. (since 0.1.6 this is automatic when saving something in the settingspage)
    3740
    3841== Frequently Asked Questions ==
     
    6063
    6164== Changelog ==
     65
     66= 0.1.7 =
     67* Fixed birthday view (there were errors in the view when only 1 user, etc...)
     68* Added widget posibility
    6269
    6370= 0.1.6 =
     
    96103== Upgrade Notice ==
    97104
     105= 0.1.7 =
     106Fix with admin view page + added widget. Upgrage immediately!
     107
    98108= 0.1.6 =
    99 Fix for empty names + additional functionality. Upgrade recommended
     109Fix for empty names + additional functionality. Upgrade recommended!
    100110
    101111= 0.1.5 =
    102 Adds additional functionality. Upgrade recommended
     112Adds additional functionality. Upgrade recommended!
    103113
    104114= 0.1.4 =
    105 Should fix the error in version 0.1.3 Upgrade immediately.
     115Should fix the error in version 0.1.3 Upgrade immediately!
    106116
    107117= 0.1.3 =
  • wp-birthday-users/tags/0.1.7/wp-birthday-users.php

    r561800 r565448  
    44Plugin URI: http://omar.reygaert.eu/wp/plugins/wp-birthday-users
    55Plugin that adds birthday posts for the users.
    6 Version: 0.1.6
     6Version: 0.1.7
    77Domain Path: /lang
    88Author: Omar Reygaert
     
    1818}
    1919
    20 ### Load in the loop functions
     20### Load in the loop functions and widget
    2121require( 'functions.php' );
    22 
    23 ### Function: Birthday Users Manager Menu
     22require( 'widget.php' );
     23
     24### Function: Birthday Users Manager Menu
    2425add_action('admin_menu', 'birthday_users_page');
    2526function birthday_users_page() {
     
    4546  // Create the birthdaylist.
    4647  $usersarray = birthdayslist($_REQUEST["rebuild"]);
    47   $usersbirthday = count($usersarray['come'])+count($usersarray['past']);
    48   if ($usersarray['come'] != NULL) {
    49     uasort($usersarray['come'], 'date_sort');
     48  $birthdaycome = $usersarray['come'];
     49  $birthdaypast = $usersarray['past'];
     50  $usersbirthday = count($birthdaycome)+count($birthdaypast);
     51  if ($birthdaycome != NULL) {
     52    uasort($birthdaycome, 'date_sort');
    5053    $upcoming = '';
    51     foreach ($usersarray['come'] as $user_id => $user) {
    52       if ($user['birthday_newer'] == $usersarray['come'][$key-1]['birthday_newer']) {
    53         $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    54         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    55           $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    56         }
    57         $upcoming .= "</tr>\n";
    58       } else {
     54    foreach ($birthdaycome as $key => $user) {
     55      if ($user['birthday_newer'] != $birthdaycome[getPrevKey($key, $birthdaycome)]['birthday_newer'] || count($birthdaycome) == 1) {
    5956        $upcoming .= "<th>".date('M', mktime(0,0,0,$user['birthday_newer'],1))."</th>\n";
    60         $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    61         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    62           $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    63         }
    64         $upcoming .= "</tr>\n";
    65       }
    66     }
    67   }
    68   if ($usersarray['past'] != NULL) {
    69     usort($usersarray['past'], 'date_sort');
     57      }
     58      $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username".($user['birthday_sort'] === date('m-d')?" birthday":"")."\">".$user['birthday_user']."</td>";
     59      if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
     60        $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
     61      }
     62      $upcoming .= "</tr>\n";
     63    }
     64  }
     65  if ($birthdaypast != NULL) {
     66    usort($birthdaypast, 'date_sort');
    7067    $passed = '';
    71     foreach ($usersarray['past'] as $key => $user) {
    72       if ($user['birthday_newer'] == $usersarray['past'][$key-1]['birthday_newer']) {
    73         $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    74         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    75           $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    76         }
    77         $passed .= "</tr>\n";
    78       } else {
     68    foreach ($birthdaypast as $key => $user) {
     69      if ($user['birthday_newer'] != $birthdaypast[getPrevKey($key, $birthdaypast)]['birthday_newer'] || count($birthdaypast) == 1) {
    7970        $passed .= "<th>".date('M', mktime(0,0,0,$user['birthday_newer'],1))."</th>\n";
    80         $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    81         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    82           $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    83         }
    84         $passed .= "</tr>\n";
    85       }
     71      }
     72      $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
     73      if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
     74        $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
     75      }
     76      $passed .= "</tr>\n";
    8677    }
    8778  }
     
    9182  <div class="wrap">
    9283    <div id="icon-wp-birthday-users" class="icon32"><br /></div>
    93     <h2><?php _e('Birthdays', 'wp-birthday-users'); echo (current_user_can('activate_plugins')?"<span class=\"rebuild\"><a href=\"?".$_SERVER['QUERY_STRING']."&amp;rebuild\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2>
     84    <h2><?php _e('Birthdays', 'wp-birthday-users'); echo (current_user_can('activate_plugins')?"<span class=\"rebuild\"><a href=\"?".$_SERVER['QUERY_STRING']."&amp;rebuild=true\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2>
    9485    <ul>
    9586      <li><em><?php printf(__('%1$s</em> of the %2$s registered user filled in there birthday.', 'wp-birthday-users'), $usersbirthday, $usersarray['info']['total_users']); ?></li>
     
    10192    <div class="metabox-holder">
    10293      <div class="postbox">
    103         <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming">&nbsp;</span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($usersarray['come'])." / ".$usersbirthday; ?> )</small></h3>
     94        <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming">&nbsp;</span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaycome)." / ".$usersbirthday; ?> )</small></h3>
    10495        <div class="content">
    10596          <table>
     
    111102    <div class="metabox-holder">
    112103      <div class="postbox">
    113         <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed">&nbsp;</span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($usersarray['past'])." / ".$usersbirthday; ?> )</small></h3>
     104        <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed">&nbsp;</span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaypast)." / ".$usersbirthday; ?> )</small></h3>
    114105        <div class="content">
    115106          <table>
     
    148139  if ($_POST['birthday_share'] == 0 && ($changedate || $changeshare || $changeage) && file_exists(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login)) {
    149140    deletefile(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login);
     141    update_user_meta( $user_id, 'birthday_change',  0);
    150142  }
    151143  // Save in plugin-folder
  • wp-birthday-users/trunk/birthday-users-admin-css.css

    r561800 r565448  
    11/*
    2  * WP Birthday Users style sheet for admin
    3  * */
     2 *  * WP Birthday Users style sheet for admin
     3 *   * */
    44
    55#icon-wp-birthday-users {
     
    5454  float: left;
    5555}
    56 
     56.birthday {
     57  background: transparent url(images/present.png) 1px 0 no-repeat;
     58  padding-left: 18px;
     59}
     60.inputtitle  {
     61  width: 190px;
     62  padding: 5px 0;
     63}
     64.textinput {
     65  width: 25px;
     66}
     67.inputtd {
     68  text-align: center;
     69}
     70.inputtitle>a {
     71  background: transparent url(images/birthday.png) 1px 0 no-repeat;
     72  padding: 8px;
     73  float: right;
     74}
  • wp-birthday-users/trunk/functions.php

    r561800 r565448  
    3434}
    3535
     36### Function: get previous key in array
     37function getPrevKey($key, $hash = array()){
     38  $keys = array_keys($hash);
     39  $found_index = array_search($key, $keys);
     40  if ($found_index === false || $found_index === 0)
     41    return false;
     42  return $keys[$found_index-1];
     43}
     44
     45### Function: get next key in array
     46function getNextKey($key, $hash = array()) {
     47  $keys = array_keys($hash);
     48  $found_index = array_search($key, $keys);
     49  if ($found_index === false)
     50    return false;
     51  return $keys[$found_index+1];
     52}
     53
    3654### Function: Get Permision number of a group
    3755function bu_permLevel($permlevel='administrator') {
     
    5169function getUserMetaValue($display='first_name,last_name', $user_id) {
    5270  $display = ($display == NULL?'first_name,last_name':$display);
    53   $user = get_user_to_edit($user_id);
     71  $user = get_user_by('id', $user_id);
     72  //$user = get_user_to_edit($user_id);
    5473  $parts = explode(",", $display);
    5574  if (count($parts) < 2) {
     
    6786  $optionarray_def = array();
    6887  $optionarray_def = get_option('birthdayusers_options');
    69   if (isset($rebuild)) {
     88  if (isset($rebuild) && $rebuild) {
    7089    foreach(scandir(plugin_dir_path(__FILE__)."icals") as $item){
    7190      if(is_file(plugin_dir_path(__FILE__)."icals/$item")){
     
    8099  $usersarray['info']['basedir'] = $upload['basedir']."/birthday.ics";
    81100  $usersarray['info']['baseurl'] = $upload['baseurl']."/birthday.ics";
     101  $usersarray['info']['today'] = 0;
    82102  foreach ($blogusers as $user) {
    83103    $birthday      = get_user_meta($user->ID, 'birthday_date', true);
     
    96116          $usersarray['info']['oldest'] = ($nickname!= ""?$nickname:$user->user_login);
    97117        }
    98         if (isset($rebuild) && $birthdayshare == 1) {
     118        if (isset($rebuild) && $rebuild && $birthdayshare == 1) {
    99119          write2file(birthday2ical($birthday, $user->ID, $birthdayage, $changes, $optionarray_def['bu_display']), plugin_dir_path(__FILE__)."icals/b2i_".$user->user_login);
    100120        }
     
    107127          'birthday_newer' => ($date[1]<10?"0".$date[1]:$date[1])
    108128        );
     129        if ((($date[1]<10?"0".$date[1]:$date[1])."-".($date[0]<10?"0".$date[0]:$date[0])) === date('m-d')) {
     130          $usersarray['info']['today']++;
     131        }
    109132        $usersarray['info']['average_age'] += age($birthday);
    110          
    111133        if ($birthdate < $oldest) {
    112134          $oldest = $birthdate;
     
    121143  }
    122144  $usersarray['info']['total_users'] = count($blogusers);
    123   if (isset($rebuild)) {
     145  if (isset($rebuild) && $rebuild) {
    124146    write2file(merge2ical(plugin_dir_path(__FILE__)."icals"), $upload['basedir']."/birthday.ics");
    125147    $usersarray['info']['text'] .= __('Birthdays rebuild.', 'wp-birthday-users');
  • wp-birthday-users/trunk/lang/wp-birthday-users-de_DE.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:44+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:27+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    144144msgstr "Geburtstag"
    145145
     146#: widget.php:7
     147msgid "Display a list of birthdays"
     148msgstr "Zeigt eine Liste der Geburtstage"
     149
     150#: widget.php:36
     151msgid "Sort by month"
     152msgstr "Sortieren nach Monat"
     153
     154#: widget.php:40
     155msgid "Show upcoming birthdays"
     156msgstr "Zeigen Sie nächsten Geburtstage"
     157
     158#: widget.php:44
     159msgid "How many upcoming birthdays"
     160msgstr "Wie viele nächsten Geburtstage"
     161
     162#: widget.php:48
     163msgid "Show past birthdays"
     164msgstr "Zeige Bereits verjährt"
     165
     166#: widget.php:52
     167msgid "How many past birthdays"
     168msgstr "Wie viele Bereits verjährt"
     169
     170#: widget.php:56
     171msgid "Hide widget if no birthdays today"
     172msgstr "Widget ausblenden, wenn keine verjährt heute"
     173
     174#: widget.php:62
     175msgid "Show ical download link"
     176msgstr "Zeige iCal Download-Link"
     177
     178#: widget.php:94
     179msgid "Download Birthday calendar"
     180msgstr "Download Geburtstagskalender"
     181
     182#: widget.php:101
     183msgid "Today"
     184msgstr "heute"
     185
     186#: widget.php:62
     187msgid "No birthdays today"
     188msgstr "Keine Geburtstage heute"
     189
  • wp-birthday-users/trunk/lang/wp-birthday-users-fr_FR.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:42+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:25+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    6262#: wp-birthday-users.php:163
    6363msgid "Upcoming birthdays"
    64 msgstr "Anniversaires àenir"
     64msgstr "Anniversaires à venir"
    6565
    6666#: wp-birthday-users.php:173
    6767msgid "Passed birthdays"
    68 msgstr "Anniversaires pass"
     68msgstr "Anniversaires passés"
    6969
    7070#: wp-birthday-users.php:249
     
    144144msgstr "Anniversaire "
    145145
     146#: widget.php:7
     147msgid "Display a list of birthdays"
     148msgstr "Afficher une liste des anniversaires"
     149
     150#: widget.php:36
     151msgid "Sort by month"
     152msgstr "Trier par mois"
     153
     154#: widget.php:40
     155msgid "Show upcoming birthdays"
     156msgstr "Montrer anniversaires à venir"
     157
     158#: widget.php:44
     159msgid "How many upcoming birthdays"
     160msgstr "Combien anniversaires à venir"
     161
     162#: widget.php:48
     163msgid "Show past birthdays"
     164msgstr "Montrer anniversaires passés"
     165
     166#: widget.php:52
     167msgid "How many past birthdays"
     168msgstr "Combien anniversaires passés"
     169
     170#: widget.php:56
     171msgid "Hide widget if no birthdays today"
     172msgstr "Masquer le widget si aucune année aujourd'hui"
     173
     174#: widget.php:62
     175msgid "Show ical download link"
     176msgstr "Afficher le lien télécharger iCal"
     177
     178#: widget.php:94
     179msgid "Download Birthday calendar"
     180msgstr "Télécharger le calendrier d'anniversaire"
     181
     182#: widget.php:101
     183msgid "Today"
     184msgstr "Aujourd'hui"
     185
     186#: widget.php:62
     187msgid "No birthdays today"
     188msgstr "Pas d'anniversaires aujourd'hui"
     189
  • wp-birthday-users/trunk/lang/wp-birthday-users-nl_NL.po

    r561800 r565448  
    66"Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n"
    77"POT-Creation-Date: 2012-06-01 14:43:47+00:00\n"
    8 "PO-Revision-Date: 2012-06-21 15:39+0100\n"
     8"PO-Revision-Date: 2012-06-29 11:26+0100\n"
    99"Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
    1010"Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n"
     
    145145msgstr "Verjaardag "
    146146
     147#: widget.php:7
     148msgid "Display a list of birthdays"
     149msgstr "Toon een lijst van jarige, komende verjaardagen en reeds verjaarden"
     150
     151#: widget.php:36
     152msgid "Sort by month"
     153msgstr "Toon volgens maand"
     154
     155#: widget.php:40
     156msgid "Show upcoming birthdays"
     157msgstr "Toon komende jarigen"
     158
     159#: widget.php:44
     160msgid "How many upcoming birthdays"
     161msgstr "Hoeveel komende jarigen"
     162
     163#: widget.php:48
     164msgid "Show past birthdays"
     165msgstr "Toon reeds verjaarden"
     166
     167#: widget.php:52
     168msgid "How many past birthdays"
     169msgstr "Hoeveel reeds verjaard"
     170
     171#: widget.php:56
     172msgid "Hide widget if no birthdays today"
     173msgstr "Verberg widget indien geen jarige vandaag"
     174
     175#: widget.php:62
     176msgid "Show ical download link"
     177msgstr "Toon ical download link"
     178
     179#: widget.php:94
     180msgid "Download Birthday calendar"
     181msgstr "Download Verjaardagskalender"
     182
     183#: widget.php:101
     184msgid "Today"
     185msgstr "Vandaag"
     186
     187#: widget.php:62
     188msgid "No birthdays today"
     189msgstr "Geen jarigen vandaag"
     190
  • wp-birthday-users/trunk/lang/wp-birthday-users.pot

    r561800 r565448  
    140140msgid "Birthday "
    141141msgstr ""
     142
     143#: widget.php:7
     144msgid "Display a list of birthdays"
     145msgstr ""
     146
     147#: widget.php:36
     148msgid "Sort by month"
     149msgstr ""
     150
     151#: widget.php:40
     152msgid "Show upcoming birthdays"
     153msgstr ""
     154
     155#: widget.php:44
     156msgid "How many upcoming birthdays"
     157msgstr ""
     158
     159#: widget.php:48
     160msgid "Show past birthdays"
     161msgstr ""
     162
     163#: widget.php:52
     164msgid "How many past birthdays"
     165msgstr ""
     166
     167#: widget.php:56
     168msgid "Hide widget if no birthdays today"
     169msgstr ""
     170
     171#: widget.php:62
     172msgid "Show ical download link"
     173msgstr ""
     174
     175#: widget.php:94
     176msgid "Download Birthday calendar"
     177msgstr ""
     178
     179#: widget.php:101
     180msgid "Today"
     181msgstr ""
     182
     183#: widget.php:62
     184msgid "No birthdays today"
     185msgstr ""
  • wp-birthday-users/trunk/readme.txt

    r561800 r565448  
    44Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HPZRXMPY99LPS&item_name=Wordpress%20plugin&item_number=wp%20birthday%20users&currency_code=EUR
    55Requires at least: x.x.x
    6 Tested up to: 3.4
    7 Stable tag: 0.1.6
     6Tested up to: 3.4.1
     7Stable tag: 0.1.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424> For some reason there is 2 breakspaces in the wp-birthday-users.php at the end. Delete these to let the plugin work. (I try to fix it later)
    2525
     26Version 0.1.7 introduce the posibility to show a widget on your page. This will show you a widget with the users whos birthday is today, and you can choose to show upcoming and past birthdays (and how many of it), also a downloadimage with to the ical.
     27
    2628== Installation ==
    2729
     
    32345. Go to your profil and fill in your birthday. Save it.
    33356. This will create a birthday.ics-file in your upload-directory of wordpress.
     367. Additional you can add a widget on your blog, or edit the settings.
    3437
    3538If you upgrade:
    36 Run rebuild-script found on the birthdays overview page.
     39Run rebuild-script found on the birthdays overview page. (since 0.1.6 this is automatic when saving something in the settingspage)
    3740
    3841== Frequently Asked Questions ==
     
    6063
    6164== Changelog ==
     65
     66= 0.1.7 =
     67* Fixed birthday view (there were errors in the view when only 1 user, etc...)
     68* Added widget posibility
    6269
    6370= 0.1.6 =
     
    96103== Upgrade Notice ==
    97104
     105= 0.1.7 =
     106Fix with admin view page + added widget. Upgrage immediately!
     107
    98108= 0.1.6 =
    99 Fix for empty names + additional functionality. Upgrade recommended
     109Fix for empty names + additional functionality. Upgrade recommended!
    100110
    101111= 0.1.5 =
    102 Adds additional functionality. Upgrade recommended
     112Adds additional functionality. Upgrade recommended!
    103113
    104114= 0.1.4 =
    105 Should fix the error in version 0.1.3 Upgrade immediately.
     115Should fix the error in version 0.1.3 Upgrade immediately!
    106116
    107117= 0.1.3 =
  • wp-birthday-users/trunk/wp-birthday-users.php

    r561800 r565448  
    44Plugin URI: http://omar.reygaert.eu/wp/plugins/wp-birthday-users
    55Plugin that adds birthday posts for the users.
    6 Version: 0.1.6
     6Version: 0.1.7
    77Domain Path: /lang
    88Author: Omar Reygaert
     
    1818}
    1919
    20 ### Load in the loop functions
     20### Load in the loop functions and widget
    2121require( 'functions.php' );
    22 
    23 ### Function: Birthday Users Manager Menu
     22require( 'widget.php' );
     23
     24### Function: Birthday Users Manager Menu
    2425add_action('admin_menu', 'birthday_users_page');
    2526function birthday_users_page() {
     
    4546  // Create the birthdaylist.
    4647  $usersarray = birthdayslist($_REQUEST["rebuild"]);
    47   $usersbirthday = count($usersarray['come'])+count($usersarray['past']);
    48   if ($usersarray['come'] != NULL) {
    49     uasort($usersarray['come'], 'date_sort');
     48  $birthdaycome = $usersarray['come'];
     49  $birthdaypast = $usersarray['past'];
     50  $usersbirthday = count($birthdaycome)+count($birthdaypast);
     51  if ($birthdaycome != NULL) {
     52    uasort($birthdaycome, 'date_sort');
    5053    $upcoming = '';
    51     foreach ($usersarray['come'] as $user_id => $user) {
    52       if ($user['birthday_newer'] == $usersarray['come'][$key-1]['birthday_newer']) {
    53         $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    54         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    55           $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    56         }
    57         $upcoming .= "</tr>\n";
    58       } else {
     54    foreach ($birthdaycome as $key => $user) {
     55      if ($user['birthday_newer'] != $birthdaycome[getPrevKey($key, $birthdaycome)]['birthday_newer'] || count($birthdaycome) == 1) {
    5956        $upcoming .= "<th>".date('M', mktime(0,0,0,$user['birthday_newer'],1))."</th>\n";
    60         $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    61         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    62           $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    63         }
    64         $upcoming .= "</tr>\n";
    65       }
    66     }
    67   }
    68   if ($usersarray['past'] != NULL) {
    69     usort($usersarray['past'], 'date_sort');
     57      }
     58      $upcoming .= "<tr><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username".($user['birthday_sort'] === date('m-d')?" birthday":"")."\">".$user['birthday_user']."</td>";
     59      if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
     60        $upcoming .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
     61      }
     62      $upcoming .= "</tr>\n";
     63    }
     64  }
     65  if ($birthdaypast != NULL) {
     66    usort($birthdaypast, 'date_sort');
    7067    $passed = '';
    71     foreach ($usersarray['past'] as $key => $user) {
    72       if ($user['birthday_newer'] == $usersarray['past'][$key-1]['birthday_newer']) {
    73         $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    74         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    75           $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    76         }
    77         $passed .= "</tr>\n";
    78       } else {
     68    foreach ($birthdaypast as $key => $user) {
     69      if ($user['birthday_newer'] != $birthdaypast[getPrevKey($key, $birthdaypast)]['birthday_newer'] || count($birthdaypast) == 1) {
    7970        $passed .= "<th>".date('M', mktime(0,0,0,$user['birthday_newer'],1))."</th>\n";
    80         $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
    81         if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
    82           $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
    83         }
    84         $passed .= "</tr>\n";
    85       }
     71      }
     72      $passed .= "<tr class=\"user\"><td class=\"date\">".$user['birthday_date']."</td><td> - </td><td class=\"username\">".$user['birthday_user']."</td>";
     73      if ($user['birthday_age']==1 || current_user_can('activate_plugins')) {
     74        $passed .= "<td>(".age($user['birthday_date']).__('y', 'wp-birthday-users').")</td>";
     75      }
     76      $passed .= "</tr>\n";
    8677    }
    8778  }
     
    9182  <div class="wrap">
    9283    <div id="icon-wp-birthday-users" class="icon32"><br /></div>
    93     <h2><?php _e('Birthdays', 'wp-birthday-users'); echo (current_user_can('activate_plugins')?"<span class=\"rebuild\"><a href=\"?".$_SERVER['QUERY_STRING']."&amp;rebuild\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2>
     84    <h2><?php _e('Birthdays', 'wp-birthday-users'); echo (current_user_can('activate_plugins')?"<span class=\"rebuild\"><a href=\"?".$_SERVER['QUERY_STRING']."&amp;rebuild=true\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2>
    9485    <ul>
    9586      <li><em><?php printf(__('%1$s</em> of the %2$s registered user filled in there birthday.', 'wp-birthday-users'), $usersbirthday, $usersarray['info']['total_users']); ?></li>
     
    10192    <div class="metabox-holder">
    10293      <div class="postbox">
    103         <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming">&nbsp;</span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($usersarray['come'])." / ".$usersbirthday; ?> )</small></h3>
     94        <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming">&nbsp;</span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaycome)." / ".$usersbirthday; ?> )</small></h3>
    10495        <div class="content">
    10596          <table>
     
    111102    <div class="metabox-holder">
    112103      <div class="postbox">
    113         <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed">&nbsp;</span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($usersarray['past'])." / ".$usersbirthday; ?> )</small></h3>
     104        <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed">&nbsp;</span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaypast)." / ".$usersbirthday; ?> )</small></h3>
    114105        <div class="content">
    115106          <table>
     
    148139  if ($_POST['birthday_share'] == 0 && ($changedate || $changeshare || $changeage) && file_exists(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login)) {
    149140    deletefile(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login);
     141    update_user_meta( $user_id, 'birthday_change',  0);
    150142  }
    151143  // Save in plugin-folder
Note: See TracChangeset for help on using the changeset viewer.