Link Library - Version 7.1.9

Version Description

  • Added new options to only display links that are updated/new and to specify for how many days links should be considered as updated/new
Download this release

Release Info

Developer jackdewey
Plugin Icon 128x128 Link Library
Version 7.1.9
Comparing to
See all releases

Code changes from version 7.1.8 to 7.1.9

link-library-admin.php CHANGED
@@ -2774,7 +2774,7 @@ wp_editor( $post->post_content, 'content', $editor_config );
2774
  'showcustomurl5', 'customurl1tooltip', 'customurl2tooltip', 'customurl3tooltip', 'customurl4tooltip', 'customurl5tooltip', 'showcustomtext1', 'showcustomtext2',
2775
  'showcustomtext3', 'showcustomtext4', 'showcustomtext5', 'customtext1tooltip', 'customtext2tooltip', 'customtext3tooltip', 'customtext4tooltip',
2776
  'customtext5tooltip', 'showcustomlist1', 'showcustomlist2', 'showcustomlist3', 'showcustomlist4', 'showcustomlist5', 'customlist1tooltip', 'customlist2tooltip',
2777
- 'customlist3tooltip', 'customlist4tooltip', 'customlist5tooltip', 'rss_item_date_source'
2778
  ) as $option_name
2779
  ) {
2780
  if ( isset( $_POST[$option_name] ) ) {
@@ -2804,7 +2804,7 @@ wp_editor( $post->post_content, 'content', $editor_config );
2804
  'suppress_custom_text_1_if_empty', 'suppress_custom_text_2_if_empty', 'suppress_custom_text_3_if_empty',
2805
  'suppress_custom_text_4_if_empty', 'suppress_custom_text_5_if_empty', 'suppress_custom_list_1_if_empty', 'suppress_custom_list_2_if_empty',
2806
  'suppress_custom_list_3_if_empty', 'suppress_custom_list_4_if_empty', 'suppress_custom_list_5_if_empty', 'catnamelink', 'hideemptycats',
2807
- 'rsslibrarypagination',
2808
  )
2809
  as $option_name
2810
  ) {
@@ -5018,14 +5018,14 @@ function general_custom_fields_meta_box( $data ) {
5018
  </tr>
5019
  <tr>
5020
  <td style='width:150px'>
5021
- <?php _e( 'Show Link Updated Flag', 'link-library' ); ?>
5022
  </td>
5023
  <td style='width:75px;'>
5024
  <input type="checkbox" id="showupdated" name="showupdated" <?php checked( $options['showupdated'] ); ?>/>
5025
  </td>
5026
  <td></td>
5027
  <td style='width:150px'>
5028
- <?php _e( 'Show Link Updated Date in Tooltip', 'link-library' ); ?>
5029
  </td>
5030
  <td style='width:75px;'>
5031
  <input type="checkbox" id="showupdatedtooltip" name="showupdatedtooltip" <?php checked( $options['showupdatedtooltip'] ); ?>/>
@@ -5033,7 +5033,7 @@ function general_custom_fields_meta_box( $data ) {
5033
  </tr>
5034
  <tr>
5035
  <td style='width:150px'>
5036
- <?php _e( 'Link Updated Flag Position', 'link-library' ); ?>
5037
  </td>
5038
  <td style='width:75px;'>
5039
  <select id="showupdatedpos" name="showupdatedpos">
@@ -5049,12 +5049,27 @@ function general_custom_fields_meta_box( $data ) {
5049
  <td style='width:20px'>
5050
  </td>
5051
  <td class="lltooltip" title="<?php _e( 'Label to be displayed before new links', 'link-library' ); ?>">
5052
- <?php _e( 'Updated link label', 'link-library' ); ?>
5053
  </td>
5054
  <td class="lltooltip" title="<?php _e( 'Label to be displayed before new links', 'link-library' ); ?>">
5055
  <input type="text" id="updatedlabel" name="updatedlabel" size="40" value="<?php echo $options['updatedlabel']; ?>" />
5056
  </td>
5057
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5058
  <tr>
5059
  <td class="lltooltip" title="<?php _e( 'Sets default link target window, does not override specific targets set in links', 'link-library' ); ?>">
5060
  <?php _e( 'Link Target', 'link-library' ); ?>
2774
  'showcustomurl5', 'customurl1tooltip', 'customurl2tooltip', 'customurl3tooltip', 'customurl4tooltip', 'customurl5tooltip', 'showcustomtext1', 'showcustomtext2',
2775
  'showcustomtext3', 'showcustomtext4', 'showcustomtext5', 'customtext1tooltip', 'customtext2tooltip', 'customtext3tooltip', 'customtext4tooltip',
2776
  'customtext5tooltip', 'showcustomlist1', 'showcustomlist2', 'showcustomlist3', 'showcustomlist4', 'showcustomlist5', 'customlist1tooltip', 'customlist2tooltip',
2777
+ 'customlist3tooltip', 'customlist4tooltip', 'customlist5tooltip', 'rss_item_date_source', 'updateddays'
2778
  ) as $option_name
2779
  ) {
2780
  if ( isset( $_POST[$option_name] ) ) {
2804
  'suppress_custom_text_1_if_empty', 'suppress_custom_text_2_if_empty', 'suppress_custom_text_3_if_empty',
2805
  'suppress_custom_text_4_if_empty', 'suppress_custom_text_5_if_empty', 'suppress_custom_list_1_if_empty', 'suppress_custom_list_2_if_empty',
2806
  'suppress_custom_list_3_if_empty', 'suppress_custom_list_4_if_empty', 'suppress_custom_list_5_if_empty', 'catnamelink', 'hideemptycats',
2807
+ 'rsslibrarypagination', 'showupdatedonly'
2808
  )
2809
  as $option_name
2810
  ) {
5018
  </tr>
5019
  <tr>
5020
  <td style='width:150px'>
5021
+ <?php _e( 'Show Link Updated/New Flag', 'link-library' ); ?>
5022
  </td>
5023
  <td style='width:75px;'>
5024
  <input type="checkbox" id="showupdated" name="showupdated" <?php checked( $options['showupdated'] ); ?>/>
5025
  </td>
5026
  <td></td>
5027
  <td style='width:150px'>
5028
+ <?php _e( 'Show Link Updated/New Date in Tooltip', 'link-library' ); ?>
5029
  </td>
5030
  <td style='width:75px;'>
5031
  <input type="checkbox" id="showupdatedtooltip" name="showupdatedtooltip" <?php checked( $options['showupdatedtooltip'] ); ?>/>
5033
  </tr>
5034
  <tr>
5035
  <td style='width:150px'>
5036
+ <?php _e( 'Link Updated/New Flag Position', 'link-library' ); ?>
5037
  </td>
5038
  <td style='width:75px;'>
5039
  <select id="showupdatedpos" name="showupdatedpos">
5049
  <td style='width:20px'>
5050
  </td>
5051
  <td class="lltooltip" title="<?php _e( 'Label to be displayed before new links', 'link-library' ); ?>">
5052
+ <?php _e( 'Updated/New link label', 'link-library' ); ?>
5053
  </td>
5054
  <td class="lltooltip" title="<?php _e( 'Label to be displayed before new links', 'link-library' ); ?>">
5055
  <input type="text" id="updatedlabel" name="updatedlabel" size="40" value="<?php echo $options['updatedlabel']; ?>" />
5056
  </td>
5057
  </tr>
5058
+ <tr>
5059
+ <td style='width:150px'>
5060
+ <?php _e( 'Only show updated/new links', 'link-library' ); ?>
5061
+ </td>
5062
+ <td style='width:75px;'>
5063
+ <input type="checkbox" id="showupdatedonly" name="showupdatedonly" <?php checked( $options['showupdatedonly'] ); ?>/>
5064
+ </td>
5065
+ <td></td>
5066
+ <td style='width:150px'>
5067
+ <?php _e( 'Number of days to be considered updated/new', 'link-library' ); ?>
5068
+ </td>
5069
+ <td style='width:75px;'>
5070
+ <input type="text" id="updateddays" name="updateddays" size="4" value="<?php echo $options['updateddays']; ?>" />
5071
+ </td>
5072
+ </tr>
5073
  <tr>
5074
  <td class="lltooltip" title="<?php _e( 'Sets default link target window, does not override specific targets set in links', 'link-library' ); ?>">
5075
  <?php _e( 'Link Target', 'link-library' ); ?>
link-library-defaults.php CHANGED
@@ -451,6 +451,8 @@ function ll_reset_options( $settings = 1, $layout = 'list', $setoptions = 'retur
451
  <div class="rss-library-source"><span class="rss-library-site">[link_title]</span><span class="rss-library-date">[rss_item_date] - [rss_item_time]</span></div>
452
  <div class="rss-library-content">[rss_item_content]</div>
453
  </div>';
 
 
454
 
455
  if ( 'return_and_set' == $setoptions ) {
456
  $settingsname = 'LinkLibraryPP' . $settings;
451
  <div class="rss-library-source"><span class="rss-library-site">[link_title]</span><span class="rss-library-date">[rss_item_date] - [rss_item_time]</span></div>
452
  <div class="rss-library-content">[rss_item_content]</div>
453
  </div>';
454
+ $options['showupdatedonly'] = false;
455
+ $options['updateddays'] = 14;
456
 
457
  if ( 'return_and_set' == $setoptions ) {
458
  $settingsname = 'LinkLibraryPP' . $settings;
link-library.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Link Library
4
  Plugin URI: http://wordpress.org/extend/plugins/link-library/
5
  Description: Display links on pages with a variety of options
6
- Version: 7.1.8
7
  Author: Yannick Lefebvre
8
  Author URI: http://ylefebvre.github.io/
9
  Text Domain: link-library
3
  Plugin Name: Link Library
4
  Plugin URI: http://wordpress.org/extend/plugins/link-library/
5
  Description: Display links on pages with a variety of options
6
+ Version: 7.1.9
7
  Author: Yannick Lefebvre
8
  Author URI: http://ylefebvre.github.io/
9
  Text Domain: link-library
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jackdewey
3
  Donate link: https://ylefebvre.github.io/wordpress-plugins/link-library/
4
  Tags: link, list, directory, page, library, AJAX, RSS, feeds, inline, search, paging, add, submit, import, batch, pop-up
5
  Requires at least: 4.4
6
- Tested up to: 5.7.1
7
- Stable tag: 7.1.8
8
 
9
  The purpose of this plugin is to add the ability to output a list of link categories and a complete list of links with notes and descriptions.
10
 
@@ -48,6 +48,9 @@ Further configuration is available under the Link Library Settings panel.
48
 
49
  == Changelog ==
50
 
 
 
 
51
  = 7.1.8 =
52
  * Fix to only make clear: both div display after categories when rendering category list using block editor
53
 
3
  Donate link: https://ylefebvre.github.io/wordpress-plugins/link-library/
4
  Tags: link, list, directory, page, library, AJAX, RSS, feeds, inline, search, paging, add, submit, import, batch, pop-up
5
  Requires at least: 4.4
6
+ Tested up to: 5.7.2
7
+ Stable tag: 7.1.9
8
 
9
  The purpose of this plugin is to add the ability to output a list of link categories and a complete list of links with notes and descriptions.
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 7.1.9 =
52
+ * Added new options to only display links that are updated/new and to specify for how many days links should be considered as updated/new
53
+
54
  = 7.1.8 =
55
  * Fix to only make clear: both div display after categories when rendering category list using block editor
56
 
render-link-library-sc.php CHANGED
@@ -942,6 +942,15 @@ function RenderLinkLibrary( $LLPluginClass, $generaloptions, $libraryoptions, $s
942
  );
943
  }
944
 
 
 
 
 
 
 
 
 
 
945
  if ( isset( $_GET['link_letter'] ) && !empty( $_GET['link_letter'] ) ) {
946
  $link_query_args['link_starts_with'] = $_GET['link_letter'];
947
  }
@@ -1573,7 +1582,7 @@ function RenderLinkLibrary( $LLPluginClass, $generaloptions, $libraryoptions, $s
1573
 
1574
  $date_diff = time() - intval( $linkitem['publication_date'] );
1575
 
1576
- if ( $date_diff < 604800 ) {
1577
  $linkitem['recently_updated'] = true;
1578
  } else {
1579
  $linkitem['recently_updated'] = false;
942
  );
943
  }
944
 
945
+ if ( $showupdatedonly ) {
946
+ $link_query_args['date_query'] = array(
947
+ array(
948
+ 'after' => '-' . $updateddays . ' days',
949
+ 'column' => 'post_date',
950
+ ),
951
+ );
952
+ }
953
+
954
  if ( isset( $_GET['link_letter'] ) && !empty( $_GET['link_letter'] ) ) {
955
  $link_query_args['link_starts_with'] = $_GET['link_letter'];
956
  }
1582
 
1583
  $date_diff = time() - intval( $linkitem['publication_date'] );
1584
 
1585
+ if ( $date_diff < 86400 * $updateddays ) {
1586
  $linkitem['recently_updated'] = true;
1587
  } else {
1588
  $linkitem['recently_updated'] = false;