Changeset 565448
- Timestamp:
- 06/29/2012 02:28:14 PM (14 years ago)
- Location:
- wp-birthday-users
- Files:
-
- 24 edited
- 1 copied
-
tags/0.1.7 (copied) (copied from wp-birthday-users/trunk)
-
tags/0.1.7/birthday-users-admin-css.css (modified) (2 diffs)
-
tags/0.1.7/functions.php (modified) (7 diffs)
-
tags/0.1.7/images/protected.png (modified) (previous)
-
tags/0.1.7/lang/wp-birthday-users-de_DE.mo (modified) (previous)
-
tags/0.1.7/lang/wp-birthday-users-de_DE.po (modified) (2 diffs)
-
tags/0.1.7/lang/wp-birthday-users-fr_FR.mo (modified) (previous)
-
tags/0.1.7/lang/wp-birthday-users-fr_FR.po (modified) (3 diffs)
-
tags/0.1.7/lang/wp-birthday-users-nl_NL.mo (modified) (previous)
-
tags/0.1.7/lang/wp-birthday-users-nl_NL.po (modified) (2 diffs)
-
tags/0.1.7/lang/wp-birthday-users.pot (modified) (1 diff)
-
tags/0.1.7/readme.txt (modified) (5 diffs)
-
tags/0.1.7/wp-birthday-users.php (modified) (7 diffs)
-
trunk/birthday-users-admin-css.css (modified) (2 diffs)
-
trunk/functions.php (modified) (7 diffs)
-
trunk/images/protected.png (modified) (previous)
-
trunk/lang/wp-birthday-users-de_DE.mo (modified) (previous)
-
trunk/lang/wp-birthday-users-de_DE.po (modified) (2 diffs)
-
trunk/lang/wp-birthday-users-fr_FR.mo (modified) (previous)
-
trunk/lang/wp-birthday-users-fr_FR.po (modified) (3 diffs)
-
trunk/lang/wp-birthday-users-nl_NL.mo (modified) (previous)
-
trunk/lang/wp-birthday-users-nl_NL.po (modified) (2 diffs)
-
trunk/lang/wp-birthday-users.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/wp-birthday-users.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-birthday-users/tags/0.1.7/birthday-users-admin-css.css
r561800 r565448 1 1 /* 2 * WP Birthday Users style sheet for admin3 * */2 * * WP Birthday Users style sheet for admin 3 * * */ 4 4 5 5 #icon-wp-birthday-users { … … 54 54 float: left; 55 55 } 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 34 34 } 35 35 36 ### Function: get previous key in array 37 function 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 46 function 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 36 54 ### Function: Get Permision number of a group 37 55 function bu_permLevel($permlevel='administrator') { … … 51 69 function getUserMetaValue($display='first_name,last_name', $user_id) { 52 70 $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); 54 73 $parts = explode(",", $display); 55 74 if (count($parts) < 2) { … … 67 86 $optionarray_def = array(); 68 87 $optionarray_def = get_option('birthdayusers_options'); 69 if (isset($rebuild) ) {88 if (isset($rebuild) && $rebuild) { 70 89 foreach(scandir(plugin_dir_path(__FILE__)."icals") as $item){ 71 90 if(is_file(plugin_dir_path(__FILE__)."icals/$item")){ … … 80 99 $usersarray['info']['basedir'] = $upload['basedir']."/birthday.ics"; 81 100 $usersarray['info']['baseurl'] = $upload['baseurl']."/birthday.ics"; 101 $usersarray['info']['today'] = 0; 82 102 foreach ($blogusers as $user) { 83 103 $birthday = get_user_meta($user->ID, 'birthday_date', true); … … 96 116 $usersarray['info']['oldest'] = ($nickname!= ""?$nickname:$user->user_login); 97 117 } 98 if (isset($rebuild) && $ birthdayshare == 1) {118 if (isset($rebuild) && $rebuild && $birthdayshare == 1) { 99 119 write2file(birthday2ical($birthday, $user->ID, $birthdayage, $changes, $optionarray_def['bu_display']), plugin_dir_path(__FILE__)."icals/b2i_".$user->user_login); 100 120 } … … 107 127 'birthday_newer' => ($date[1]<10?"0".$date[1]:$date[1]) 108 128 ); 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 } 109 132 $usersarray['info']['average_age'] += age($birthday); 110 111 133 if ($birthdate < $oldest) { 112 134 $oldest = $birthdate; … … 121 143 } 122 144 $usersarray['info']['total_users'] = count($blogusers); 123 if (isset($rebuild) ) {145 if (isset($rebuild) && $rebuild) { 124 146 write2file(merge2ical(plugin_dir_path(__FILE__)."icals"), $upload['basedir']."/birthday.ics"); 125 147 $usersarray['info']['text'] .= __('Birthdays rebuild.', 'wp-birthday-users'); -
wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-de_DE.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:44+0100\n"8 "PO-Revision-Date: 2012-06-29 11:27+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 144 144 msgstr "Geburtstag" 145 145 146 #: widget.php:7 147 msgid "Display a list of birthdays" 148 msgstr "Zeigt eine Liste der Geburtstage" 149 150 #: widget.php:36 151 msgid "Sort by month" 152 msgstr "Sortieren nach Monat" 153 154 #: widget.php:40 155 msgid "Show upcoming birthdays" 156 msgstr "Zeigen Sie nächsten Geburtstage" 157 158 #: widget.php:44 159 msgid "How many upcoming birthdays" 160 msgstr "Wie viele nächsten Geburtstage" 161 162 #: widget.php:48 163 msgid "Show past birthdays" 164 msgstr "Zeige Bereits verjährt" 165 166 #: widget.php:52 167 msgid "How many past birthdays" 168 msgstr "Wie viele Bereits verjährt" 169 170 #: widget.php:56 171 msgid "Hide widget if no birthdays today" 172 msgstr "Widget ausblenden, wenn keine verjährt heute" 173 174 #: widget.php:62 175 msgid "Show ical download link" 176 msgstr "Zeige iCal Download-Link" 177 178 #: widget.php:94 179 msgid "Download Birthday calendar" 180 msgstr "Download Geburtstagskalender" 181 182 #: widget.php:101 183 msgid "Today" 184 msgstr "heute" 185 186 #: widget.php:62 187 msgid "No birthdays today" 188 msgstr "Keine Geburtstage heute" 189 -
wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-fr_FR.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:42+0100\n"8 "PO-Revision-Date: 2012-06-29 11:25+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 62 62 #: wp-birthday-users.php:163 63 63 msgid "Upcoming birthdays" 64 msgstr "Anniversaires à enir"64 msgstr "Anniversaires à venir" 65 65 66 66 #: wp-birthday-users.php:173 67 67 msgid "Passed birthdays" 68 msgstr "Anniversaires pass "68 msgstr "Anniversaires passés" 69 69 70 70 #: wp-birthday-users.php:249 … … 144 144 msgstr "Anniversaire " 145 145 146 #: widget.php:7 147 msgid "Display a list of birthdays" 148 msgstr "Afficher une liste des anniversaires" 149 150 #: widget.php:36 151 msgid "Sort by month" 152 msgstr "Trier par mois" 153 154 #: widget.php:40 155 msgid "Show upcoming birthdays" 156 msgstr "Montrer anniversaires à venir" 157 158 #: widget.php:44 159 msgid "How many upcoming birthdays" 160 msgstr "Combien anniversaires à venir" 161 162 #: widget.php:48 163 msgid "Show past birthdays" 164 msgstr "Montrer anniversaires passés" 165 166 #: widget.php:52 167 msgid "How many past birthdays" 168 msgstr "Combien anniversaires passés" 169 170 #: widget.php:56 171 msgid "Hide widget if no birthdays today" 172 msgstr "Masquer le widget si aucune année aujourd'hui" 173 174 #: widget.php:62 175 msgid "Show ical download link" 176 msgstr "Afficher le lien télécharger iCal" 177 178 #: widget.php:94 179 msgid "Download Birthday calendar" 180 msgstr "Télécharger le calendrier d'anniversaire" 181 182 #: widget.php:101 183 msgid "Today" 184 msgstr "Aujourd'hui" 185 186 #: widget.php:62 187 msgid "No birthdays today" 188 msgstr "Pas d'anniversaires aujourd'hui" 189 -
wp-birthday-users/tags/0.1.7/lang/wp-birthday-users-nl_NL.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:39+0100\n"8 "PO-Revision-Date: 2012-06-29 11:26+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 145 145 msgstr "Verjaardag " 146 146 147 #: widget.php:7 148 msgid "Display a list of birthdays" 149 msgstr "Toon een lijst van jarige, komende verjaardagen en reeds verjaarden" 150 151 #: widget.php:36 152 msgid "Sort by month" 153 msgstr "Toon volgens maand" 154 155 #: widget.php:40 156 msgid "Show upcoming birthdays" 157 msgstr "Toon komende jarigen" 158 159 #: widget.php:44 160 msgid "How many upcoming birthdays" 161 msgstr "Hoeveel komende jarigen" 162 163 #: widget.php:48 164 msgid "Show past birthdays" 165 msgstr "Toon reeds verjaarden" 166 167 #: widget.php:52 168 msgid "How many past birthdays" 169 msgstr "Hoeveel reeds verjaard" 170 171 #: widget.php:56 172 msgid "Hide widget if no birthdays today" 173 msgstr "Verberg widget indien geen jarige vandaag" 174 175 #: widget.php:62 176 msgid "Show ical download link" 177 msgstr "Toon ical download link" 178 179 #: widget.php:94 180 msgid "Download Birthday calendar" 181 msgstr "Download Verjaardagskalender" 182 183 #: widget.php:101 184 msgid "Today" 185 msgstr "Vandaag" 186 187 #: widget.php:62 188 msgid "No birthdays today" 189 msgstr "Geen jarigen vandaag" 190 -
wp-birthday-users/tags/0.1.7/lang/wp-birthday-users.pot
r561800 r565448 140 140 msgid "Birthday " 141 141 msgstr "" 142 143 #: widget.php:7 144 msgid "Display a list of birthdays" 145 msgstr "" 146 147 #: widget.php:36 148 msgid "Sort by month" 149 msgstr "" 150 151 #: widget.php:40 152 msgid "Show upcoming birthdays" 153 msgstr "" 154 155 #: widget.php:44 156 msgid "How many upcoming birthdays" 157 msgstr "" 158 159 #: widget.php:48 160 msgid "Show past birthdays" 161 msgstr "" 162 163 #: widget.php:52 164 msgid "How many past birthdays" 165 msgstr "" 166 167 #: widget.php:56 168 msgid "Hide widget if no birthdays today" 169 msgstr "" 170 171 #: widget.php:62 172 msgid "Show ical download link" 173 msgstr "" 174 175 #: widget.php:94 176 msgid "Download Birthday calendar" 177 msgstr "" 178 179 #: widget.php:101 180 msgid "Today" 181 msgstr "" 182 183 #: widget.php:62 184 msgid "No birthdays today" 185 msgstr "" -
wp-birthday-users/tags/0.1.7/readme.txt
r561800 r565448 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HPZRXMPY99LPS&item_name=Wordpress%20plugin&item_number=wp%20birthday%20users¤cy_code=EUR 5 5 Requires at least: x.x.x 6 Tested up to: 3.4 7 Stable tag: 0.1. 66 Tested up to: 3.4.1 7 Stable tag: 0.1.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 > 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) 25 25 26 Version 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 26 28 == Installation == 27 29 … … 32 34 5. Go to your profil and fill in your birthday. Save it. 33 35 6. This will create a birthday.ics-file in your upload-directory of wordpress. 36 7. Additional you can add a widget on your blog, or edit the settings. 34 37 35 38 If you upgrade: 36 Run rebuild-script found on the birthdays overview page. 39 Run rebuild-script found on the birthdays overview page. (since 0.1.6 this is automatic when saving something in the settingspage) 37 40 38 41 == Frequently Asked Questions == … … 60 63 61 64 == 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 62 69 63 70 = 0.1.6 = … … 96 103 == Upgrade Notice == 97 104 105 = 0.1.7 = 106 Fix with admin view page + added widget. Upgrage immediately! 107 98 108 = 0.1.6 = 99 Fix for empty names + additional functionality. Upgrade recommended 109 Fix for empty names + additional functionality. Upgrade recommended! 100 110 101 111 = 0.1.5 = 102 Adds additional functionality. Upgrade recommended 112 Adds additional functionality. Upgrade recommended! 103 113 104 114 = 0.1.4 = 105 Should fix the error in version 0.1.3 Upgrade immediately .115 Should fix the error in version 0.1.3 Upgrade immediately! 106 116 107 117 = 0.1.3 = -
wp-birthday-users/tags/0.1.7/wp-birthday-users.php
r561800 r565448 4 4 Plugin URI: http://omar.reygaert.eu/wp/plugins/wp-birthday-users 5 5 Plugin that adds birthday posts for the users. 6 Version: 0.1. 66 Version: 0.1.7 7 7 Domain Path: /lang 8 8 Author: Omar Reygaert … … 18 18 } 19 19 20 ### Load in the loop functions 20 ### Load in the loop functions and widget 21 21 require( 'functions.php' ); 22 23 ### Function: Birthday Users Manager Menu 22 require( 'widget.php' ); 23 24 ### Function: Birthday Users Manager Menu 24 25 add_action('admin_menu', 'birthday_users_page'); 25 26 function birthday_users_page() { … … 45 46 // Create the birthdaylist. 46 47 $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'); 50 53 $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) { 59 56 $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'); 70 67 $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) { 79 70 $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"; 86 77 } 87 78 } … … 91 82 <div class="wrap"> 92 83 <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']."&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']."&rebuild=true\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2> 94 85 <ul> 95 86 <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> … … 101 92 <div class="metabox-holder"> 102 93 <div class="postbox"> 103 <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming"> </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"> </span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaycome)." / ".$usersbirthday; ?> )</small></h3> 104 95 <div class="content"> 105 96 <table> … … 111 102 <div class="metabox-holder"> 112 103 <div class="postbox"> 113 <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed"> </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"> </span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaypast)." / ".$usersbirthday; ?> )</small></h3> 114 105 <div class="content"> 115 106 <table> … … 148 139 if ($_POST['birthday_share'] == 0 && ($changedate || $changeshare || $changeage) && file_exists(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login)) { 149 140 deletefile(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login); 141 update_user_meta( $user_id, 'birthday_change', 0); 150 142 } 151 143 // Save in plugin-folder -
wp-birthday-users/trunk/birthday-users-admin-css.css
r561800 r565448 1 1 /* 2 * WP Birthday Users style sheet for admin3 * */2 * * WP Birthday Users style sheet for admin 3 * * */ 4 4 5 5 #icon-wp-birthday-users { … … 54 54 float: left; 55 55 } 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 34 34 } 35 35 36 ### Function: get previous key in array 37 function 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 46 function 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 36 54 ### Function: Get Permision number of a group 37 55 function bu_permLevel($permlevel='administrator') { … … 51 69 function getUserMetaValue($display='first_name,last_name', $user_id) { 52 70 $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); 54 73 $parts = explode(",", $display); 55 74 if (count($parts) < 2) { … … 67 86 $optionarray_def = array(); 68 87 $optionarray_def = get_option('birthdayusers_options'); 69 if (isset($rebuild) ) {88 if (isset($rebuild) && $rebuild) { 70 89 foreach(scandir(plugin_dir_path(__FILE__)."icals") as $item){ 71 90 if(is_file(plugin_dir_path(__FILE__)."icals/$item")){ … … 80 99 $usersarray['info']['basedir'] = $upload['basedir']."/birthday.ics"; 81 100 $usersarray['info']['baseurl'] = $upload['baseurl']."/birthday.ics"; 101 $usersarray['info']['today'] = 0; 82 102 foreach ($blogusers as $user) { 83 103 $birthday = get_user_meta($user->ID, 'birthday_date', true); … … 96 116 $usersarray['info']['oldest'] = ($nickname!= ""?$nickname:$user->user_login); 97 117 } 98 if (isset($rebuild) && $ birthdayshare == 1) {118 if (isset($rebuild) && $rebuild && $birthdayshare == 1) { 99 119 write2file(birthday2ical($birthday, $user->ID, $birthdayage, $changes, $optionarray_def['bu_display']), plugin_dir_path(__FILE__)."icals/b2i_".$user->user_login); 100 120 } … … 107 127 'birthday_newer' => ($date[1]<10?"0".$date[1]:$date[1]) 108 128 ); 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 } 109 132 $usersarray['info']['average_age'] += age($birthday); 110 111 133 if ($birthdate < $oldest) { 112 134 $oldest = $birthdate; … … 121 143 } 122 144 $usersarray['info']['total_users'] = count($blogusers); 123 if (isset($rebuild) ) {145 if (isset($rebuild) && $rebuild) { 124 146 write2file(merge2ical(plugin_dir_path(__FILE__)."icals"), $upload['basedir']."/birthday.ics"); 125 147 $usersarray['info']['text'] .= __('Birthdays rebuild.', 'wp-birthday-users'); -
wp-birthday-users/trunk/lang/wp-birthday-users-de_DE.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:44+0100\n"8 "PO-Revision-Date: 2012-06-29 11:27+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 144 144 msgstr "Geburtstag" 145 145 146 #: widget.php:7 147 msgid "Display a list of birthdays" 148 msgstr "Zeigt eine Liste der Geburtstage" 149 150 #: widget.php:36 151 msgid "Sort by month" 152 msgstr "Sortieren nach Monat" 153 154 #: widget.php:40 155 msgid "Show upcoming birthdays" 156 msgstr "Zeigen Sie nächsten Geburtstage" 157 158 #: widget.php:44 159 msgid "How many upcoming birthdays" 160 msgstr "Wie viele nächsten Geburtstage" 161 162 #: widget.php:48 163 msgid "Show past birthdays" 164 msgstr "Zeige Bereits verjährt" 165 166 #: widget.php:52 167 msgid "How many past birthdays" 168 msgstr "Wie viele Bereits verjährt" 169 170 #: widget.php:56 171 msgid "Hide widget if no birthdays today" 172 msgstr "Widget ausblenden, wenn keine verjährt heute" 173 174 #: widget.php:62 175 msgid "Show ical download link" 176 msgstr "Zeige iCal Download-Link" 177 178 #: widget.php:94 179 msgid "Download Birthday calendar" 180 msgstr "Download Geburtstagskalender" 181 182 #: widget.php:101 183 msgid "Today" 184 msgstr "heute" 185 186 #: widget.php:62 187 msgid "No birthdays today" 188 msgstr "Keine Geburtstage heute" 189 -
wp-birthday-users/trunk/lang/wp-birthday-users-fr_FR.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:42+0100\n"8 "PO-Revision-Date: 2012-06-29 11:25+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 62 62 #: wp-birthday-users.php:163 63 63 msgid "Upcoming birthdays" 64 msgstr "Anniversaires à enir"64 msgstr "Anniversaires à venir" 65 65 66 66 #: wp-birthday-users.php:173 67 67 msgid "Passed birthdays" 68 msgstr "Anniversaires pass "68 msgstr "Anniversaires passés" 69 69 70 70 #: wp-birthday-users.php:249 … … 144 144 msgstr "Anniversaire " 145 145 146 #: widget.php:7 147 msgid "Display a list of birthdays" 148 msgstr "Afficher une liste des anniversaires" 149 150 #: widget.php:36 151 msgid "Sort by month" 152 msgstr "Trier par mois" 153 154 #: widget.php:40 155 msgid "Show upcoming birthdays" 156 msgstr "Montrer anniversaires à venir" 157 158 #: widget.php:44 159 msgid "How many upcoming birthdays" 160 msgstr "Combien anniversaires à venir" 161 162 #: widget.php:48 163 msgid "Show past birthdays" 164 msgstr "Montrer anniversaires passés" 165 166 #: widget.php:52 167 msgid "How many past birthdays" 168 msgstr "Combien anniversaires passés" 169 170 #: widget.php:56 171 msgid "Hide widget if no birthdays today" 172 msgstr "Masquer le widget si aucune année aujourd'hui" 173 174 #: widget.php:62 175 msgid "Show ical download link" 176 msgstr "Afficher le lien télécharger iCal" 177 178 #: widget.php:94 179 msgid "Download Birthday calendar" 180 msgstr "Télécharger le calendrier d'anniversaire" 181 182 #: widget.php:101 183 msgid "Today" 184 msgstr "Aujourd'hui" 185 186 #: widget.php:62 187 msgid "No birthdays today" 188 msgstr "Pas d'anniversaires aujourd'hui" 189 -
wp-birthday-users/trunk/lang/wp-birthday-users-nl_NL.po
r561800 r565448 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/extend/plugins/wp-birthday-users\n" 7 7 "POT-Creation-Date: 2012-06-01 14:43:47+00:00\n" 8 "PO-Revision-Date: 2012-06-2 1 15:39+0100\n"8 "PO-Revision-Date: 2012-06-29 11:26+0100\n" 9 9 "Last-Translator: Omar Reygaert <Omar.Reygaert@gmail.com>\n" 10 10 "Language-Team: Omar Reygaert <Omar.Reygaert@gmail.com>\n" … … 145 145 msgstr "Verjaardag " 146 146 147 #: widget.php:7 148 msgid "Display a list of birthdays" 149 msgstr "Toon een lijst van jarige, komende verjaardagen en reeds verjaarden" 150 151 #: widget.php:36 152 msgid "Sort by month" 153 msgstr "Toon volgens maand" 154 155 #: widget.php:40 156 msgid "Show upcoming birthdays" 157 msgstr "Toon komende jarigen" 158 159 #: widget.php:44 160 msgid "How many upcoming birthdays" 161 msgstr "Hoeveel komende jarigen" 162 163 #: widget.php:48 164 msgid "Show past birthdays" 165 msgstr "Toon reeds verjaarden" 166 167 #: widget.php:52 168 msgid "How many past birthdays" 169 msgstr "Hoeveel reeds verjaard" 170 171 #: widget.php:56 172 msgid "Hide widget if no birthdays today" 173 msgstr "Verberg widget indien geen jarige vandaag" 174 175 #: widget.php:62 176 msgid "Show ical download link" 177 msgstr "Toon ical download link" 178 179 #: widget.php:94 180 msgid "Download Birthday calendar" 181 msgstr "Download Verjaardagskalender" 182 183 #: widget.php:101 184 msgid "Today" 185 msgstr "Vandaag" 186 187 #: widget.php:62 188 msgid "No birthdays today" 189 msgstr "Geen jarigen vandaag" 190 -
wp-birthday-users/trunk/lang/wp-birthday-users.pot
r561800 r565448 140 140 msgid "Birthday " 141 141 msgstr "" 142 143 #: widget.php:7 144 msgid "Display a list of birthdays" 145 msgstr "" 146 147 #: widget.php:36 148 msgid "Sort by month" 149 msgstr "" 150 151 #: widget.php:40 152 msgid "Show upcoming birthdays" 153 msgstr "" 154 155 #: widget.php:44 156 msgid "How many upcoming birthdays" 157 msgstr "" 158 159 #: widget.php:48 160 msgid "Show past birthdays" 161 msgstr "" 162 163 #: widget.php:52 164 msgid "How many past birthdays" 165 msgstr "" 166 167 #: widget.php:56 168 msgid "Hide widget if no birthdays today" 169 msgstr "" 170 171 #: widget.php:62 172 msgid "Show ical download link" 173 msgstr "" 174 175 #: widget.php:94 176 msgid "Download Birthday calendar" 177 msgstr "" 178 179 #: widget.php:101 180 msgid "Today" 181 msgstr "" 182 183 #: widget.php:62 184 msgid "No birthdays today" 185 msgstr "" -
wp-birthday-users/trunk/readme.txt
r561800 r565448 4 4 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HPZRXMPY99LPS&item_name=Wordpress%20plugin&item_number=wp%20birthday%20users¤cy_code=EUR 5 5 Requires at least: x.x.x 6 Tested up to: 3.4 7 Stable tag: 0.1. 66 Tested up to: 3.4.1 7 Stable tag: 0.1.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 > 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) 25 25 26 Version 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 26 28 == Installation == 27 29 … … 32 34 5. Go to your profil and fill in your birthday. Save it. 33 35 6. This will create a birthday.ics-file in your upload-directory of wordpress. 36 7. Additional you can add a widget on your blog, or edit the settings. 34 37 35 38 If you upgrade: 36 Run rebuild-script found on the birthdays overview page. 39 Run rebuild-script found on the birthdays overview page. (since 0.1.6 this is automatic when saving something in the settingspage) 37 40 38 41 == Frequently Asked Questions == … … 60 63 61 64 == 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 62 69 63 70 = 0.1.6 = … … 96 103 == Upgrade Notice == 97 104 105 = 0.1.7 = 106 Fix with admin view page + added widget. Upgrage immediately! 107 98 108 = 0.1.6 = 99 Fix for empty names + additional functionality. Upgrade recommended 109 Fix for empty names + additional functionality. Upgrade recommended! 100 110 101 111 = 0.1.5 = 102 Adds additional functionality. Upgrade recommended 112 Adds additional functionality. Upgrade recommended! 103 113 104 114 = 0.1.4 = 105 Should fix the error in version 0.1.3 Upgrade immediately .115 Should fix the error in version 0.1.3 Upgrade immediately! 106 116 107 117 = 0.1.3 = -
wp-birthday-users/trunk/wp-birthday-users.php
r561800 r565448 4 4 Plugin URI: http://omar.reygaert.eu/wp/plugins/wp-birthday-users 5 5 Plugin that adds birthday posts for the users. 6 Version: 0.1. 66 Version: 0.1.7 7 7 Domain Path: /lang 8 8 Author: Omar Reygaert … … 18 18 } 19 19 20 ### Load in the loop functions 20 ### Load in the loop functions and widget 21 21 require( 'functions.php' ); 22 23 ### Function: Birthday Users Manager Menu 22 require( 'widget.php' ); 23 24 ### Function: Birthday Users Manager Menu 24 25 add_action('admin_menu', 'birthday_users_page'); 25 26 function birthday_users_page() { … … 45 46 // Create the birthdaylist. 46 47 $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'); 50 53 $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) { 59 56 $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'); 70 67 $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) { 79 70 $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"; 86 77 } 87 78 } … … 91 82 <div class="wrap"> 92 83 <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']."&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']."&rebuild=true\">".__('rebuild birthdays', 'wp-birthday-users')."</a> - <a href=\"options-general.php?page=".$pluginname[0]."/config.php\">".__('Settings')."</a></span>":"") ?></h2> 94 85 <ul> 95 86 <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> … … 101 92 <div class="metabox-holder"> 102 93 <div class="postbox"> 103 <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="upcoming"> </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"> </span><?php _e('Upcoming birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaycome)." / ".$usersbirthday; ?> )</small></h3> 104 95 <div class="content"> 105 96 <table> … … 111 102 <div class="metabox-holder"> 112 103 <div class="postbox"> 113 <div class="handlediv" title="Klik om te wisselen"><br /></div><h3><span class="passed"> </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"> </span><?php _e('Passed birthdays', 'wp-birthday-users'); ?> - <small>( <?php echo count($birthdaypast)." / ".$usersbirthday; ?> )</small></h3> 114 105 <div class="content"> 115 106 <table> … … 148 139 if ($_POST['birthday_share'] == 0 && ($changedate || $changeshare || $changeage) && file_exists(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login)) { 149 140 deletefile(plugin_dir_path(__FILE__)."icals/b2i_".$user_info->user_login); 141 update_user_meta( $user_id, 'birthday_change', 0); 150 142 } 151 143 // Save in plugin-folder
Note: See TracChangeset
for help on using the changeset viewer.