Plugin Directory

Changeset 627873


Ignore:
Timestamp:
11/20/2012 08:29:26 PM (13 years ago)
Author:
iluminatus
Message:

Adding catch for warnings when posts matching user criteria were not found.

Location:
network-latest-posts/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • network-latest-posts/trunk/languages/languages.pot

    r625323 r627873  
    33"Project-Id-Version: Network Latest Posts v3.2\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-11-14 19:55+0100\n"
    6 "PO-Revision-Date: 2012-11-14 19:55+0100\n"
     5"POT-Creation-Date: 2012-11-20 21:16+0100\n"
     6"PO-Revision-Date: 2012-11-20 21:17+0100\n"
    77"Last-Translator: Jose Luis Sayago Rojas <[email protected]>\n"
    88"Language-Team: L'Elite <[email protected]>\n"
     
    391391msgstr ""
    392392
    393 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    394 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     393#: ../network-latest-posts.php:474
     394msgid "Sorry, I couldn't find any recent posts matching your parameters."
     395msgstr ""
     396
     397#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     398#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    395399msgid "Published on"
    396400msgstr ""
    397401
    398 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    399 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     402#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     403#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    400404msgid "by"
    401405msgstr ""
    402406
    403 #: ../network-latest-posts.php:767
     407#: ../network-latest-posts.php:768
    404408msgid "&laquo;"
    405409msgstr ""
    406410
    407 #: ../network-latest-posts.php:768
     411#: ../network-latest-posts.php:769
    408412msgid "&raquo;"
    409413msgstr ""
    410414
    411 #: ../network-latest-posts.php:1077 ../network-latest-posts.php:1081
    412 #: ../network-latest-posts.php:1085
     415#: ../network-latest-posts.php:1078 ../network-latest-posts.php:1082
     416#: ../network-latest-posts.php:1086
    413417msgid "more"
    414418msgstr ""
    415419
    416 #: ../network-latest-posts.php:1217 ../network-latest-posts.php:1218
     420#: ../network-latest-posts.php:1218 ../network-latest-posts.php:1219
    417421msgid "Network Latest Posts"
    418422msgstr ""
  • network-latest-posts/trunk/languages/trans-nlp-es_ES.po

    r625323 r627873  
    33"Project-Id-Version: Network Latest Posts v3.2\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-11-14 19:56+0100\n"
     5"POT-Creation-Date: 2012-11-20 21:17+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Jose Luis Sayago Rojas <[email protected]>\n"
     
    392392msgstr "Clases CSS Personalizadas para el Contenedor (wrapper) de los bloques"
    393393
    394 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    395 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     394#: ../network-latest-posts.php:474
     395msgid "Sorry, I couldn't find any recent posts matching your parameters."
     396msgstr ""
     397"Lo siento, no pude encontrar ningún artículo que coincidiera con tus "
     398"parámetros."
     399
     400#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     401#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    396402msgid "Published on"
    397403msgstr "Publicado en"
    398404
    399 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    400 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     405#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     406#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    401407msgid "by"
    402408msgstr "por"
    403409
    404 #: ../network-latest-posts.php:767
     410#: ../network-latest-posts.php:768
    405411msgid "&laquo;"
    406412msgstr "&laquo;"
    407413
    408 #: ../network-latest-posts.php:768
     414#: ../network-latest-posts.php:769
    409415msgid "&raquo;"
    410416msgstr "&raquo;"
    411417
    412 #: ../network-latest-posts.php:1077 ../network-latest-posts.php:1081
    413 #: ../network-latest-posts.php:1085
     418#: ../network-latest-posts.php:1078 ../network-latest-posts.php:1082
     419#: ../network-latest-posts.php:1086
    414420msgid "more"
    415421msgstr "leer el resto"
    416422
    417 #: ../network-latest-posts.php:1217 ../network-latest-posts.php:1218
     423#: ../network-latest-posts.php:1218 ../network-latest-posts.php:1219
    418424msgid "Network Latest Posts"
    419425msgstr "Art&iacute;culos Recientes de la Red"
  • network-latest-posts/trunk/languages/trans-nlp-fr_FR.po

    r625323 r627873  
    33"Project-Id-Version: Network Latest Posts v3.2\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-11-14 19:56+0100\n"
     5"POT-Creation-Date: 2012-11-20 21:18+0100\n"
    66"PO-Revision-Date: \n"
    77"Last-Translator: Jose Luis Sayago Rojas <[email protected]>\n"
     
    392392msgstr "Classe CSS pour la balise que contient les blocs (wrapper)"
    393393
    394 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    395 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     394#: ../network-latest-posts.php:474
     395msgid "Sorry, I couldn't find any recent posts matching your parameters."
     396msgstr ""
     397"Désolé, je n'ai pas trouvé des articles correspondant aux paramètres saisis."
     398
     399#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     400#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    396401msgid "Published on"
    397402msgstr "Publi&eacute; sur"
    398403
    399 #: ../network-latest-posts.php:671 ../network-latest-posts.php:727
    400 #: ../network-latest-posts.php:891 ../network-latest-posts.php:947
     404#: ../network-latest-posts.php:672 ../network-latest-posts.php:728
     405#: ../network-latest-posts.php:892 ../network-latest-posts.php:948
    401406msgid "by"
    402407msgstr "par"
    403408
    404 #: ../network-latest-posts.php:767
     409#: ../network-latest-posts.php:768
    405410msgid "&laquo;"
    406411msgstr "&laquo;"
    407412
    408 #: ../network-latest-posts.php:768
     413#: ../network-latest-posts.php:769
    409414msgid "&raquo;"
    410415msgstr "&raquo;"
    411416
    412 #: ../network-latest-posts.php:1077 ../network-latest-posts.php:1081
    413 #: ../network-latest-posts.php:1085
     417#: ../network-latest-posts.php:1078 ../network-latest-posts.php:1082
     418#: ../network-latest-posts.php:1086
    414419msgid "more"
    415420msgstr "lire le reste"
    416421
    417 #: ../network-latest-posts.php:1217 ../network-latest-posts.php:1218
     422#: ../network-latest-posts.php:1218 ../network-latest-posts.php:1219
    418423msgid "Network Latest Posts"
    419424msgstr "Derniers Articles du R&eacute;seau"
  • network-latest-posts/trunk/network-latest-posts.php

    r625323 r627873  
    44Plugin URI: http://en.8elite.com/network-latest-posts
    55Description: Display the latest posts from the blogs in your network using it as a function, shortcode or widget.
    6 Version: 3.5
     6Version: 3.5.1
    77Author: L'Elite
    88Author URI: http://laelite.info/
     
    125125 * -- Gerard Bik
    126126 * -- Proposed display post content instead of excerpts
     127 *
     128 * -- ThorHammer
     129 * --- Spotted a warning when NLPosts couldn't find posts.
    127130 *
    128131 * That's it, let the fun begin!
     
    469472            restore_current_blog();
    470473        }
     474        // If no content was found
     475        if( empty($all_posts) ) {
     476            // Nothing to do here, let people know and get out of here
     477            echo "<div class='alert'><p>".__("Sorry, I couldn't find any recent posts matching your parameters.","trans-nlp")."</p></div>";
     478            return;
     479        }
    471480        // Sort by date (regardless blog IDs)
    472481        if( $sort_by_date == 'true' ) {
     
    477486                    case "newer":
    478487                        // Sort the array
    479                         krsort($all_posts);
     488                        @krsort($all_posts);
    480489                        // Limit the number of posts
    481490                        if( !empty($sorting_limit) ) {
    482                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     491                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    483492                        }
    484493                        break;
     
    486495                    case "older":
    487496                        // Sort the array
    488                         ksort($all_posts);
     497                        @ksort($all_posts);
    489498                        // Limit the number of posts
    490499                        if( !empty($sorting_limit) ) {
    491                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     500                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    492501                        }
    493502                        break;
     
    495504                    default:
    496505                        // Sort the array
    497                         krsort($all_posts);
     506                        @krsort($all_posts);
    498507                        // Limit the number of posts
    499508                        if( !empty($sorting_limit) ) {
    500                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     509                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    501510                        }
    502511                        break;
     
    504513            } else {
    505514                // Sort the array
    506                 krsort($all_posts);
     515                @krsort($all_posts);
    507516                // Limit the number of posts
    508517                if( !empty($sorting_limit) ) {
    509                     $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     518                    $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    510519                }
    511520            }
     
    519528                    case "asc":
    520529                        // Sort the array
    521                         ksort($all_posts);
     530                        @ksort($all_posts);
    522531                        // Limit the number of posts
    523532                        if( !empty($sorting_limit) ) {
    524                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     533                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    525534                        }
    526535                        break;
     
    528537                    case "desc":
    529538                        // Sort the array
    530                         krsort($all_posts);
     539                        @krsort($all_posts);
    531540                        // Limit the number of posts
    532541                        if( !empty($sorting_limit) ) {
    533                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     542                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    534543                        }
    535544                        break;
     
    537546                    default:
    538547                        // Sort the array
    539                         krsort($all_posts);
     548                        @krsort($all_posts);
    540549                        // Limit the number of posts
    541550                        if( !empty($sorting_limit) ) {
    542                             $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     551                            $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    543552                        }
    544553                        break;
     
    546555            } else {
    547556                // Sort the array
    548                 ksort($all_posts);
     557                @ksort($all_posts);
    549558                // Limit the number of posts
    550559                if( !empty($sorting_limit) ) {
    551                     $all_posts = array_slice($all_posts,0,$sorting_limit,true);
     560                    $all_posts = @array_slice($all_posts,0,$sorting_limit,true);
    552561                }
    553562            }
    554         }
    555         // If no content was found
    556         if( empty($all_posts) ) {
    557             // Close the door and get out of here
    558             return;
    559563        }
    560564        // Open content box
  • network-latest-posts/trunk/readme.txt

    r625323 r627873  
    55Requires at least: 3.0
    66Tested up to: 3.4.1
    7 Stable tag: 3.5
     7Stable tag: 3.5.1
    88
    99This plugin allows you to pull all the recent posts from the blogs in your WordPress network and display them in your main site (or internal sites)
     
    144144== Changelog ==
    145145
     146= 3.5.1 =
     147* Added catch to avoid warnings when NLPosts can't find posts matching your parameters. Now it will display a message letting you know, no posts matching your criteria were found.
     148
    146149= 3.5 =
    147150* Added parameter display_content which allows you to display posts content instead of excerpts, minor bug fixes
Note: See TracChangeset for help on using the changeset viewer.