'.__('Settings').''; } // Return new embedded link. return $links; } // Function for plugin widget registration. function srp_install_widgets() { // Register widget. register_widget("WDG_SpecialRecentPosts"); } // This function checks whether the plugin has been updated. // If it's so, it performs several checks before updating the plugin db options. function srp_plugin_init() { // Importing global default options array. global $srp_default_plugin_values; // Checking if plugin db options exist. if (get_option('srp_plugin_options')) { // Setting current db options. $srp_current_options = get_option('srp_plugin_options'); // Checking if plugin has a db version option or if this is minor than the current version declared through the updated code. if ( (!isset($srp_current_options["srp_version"]) && isset($srp_default_plugin_values["srp_version"]) ) || ( version_compare($srp_current_options["srp_version"], $srp_default_plugin_values["srp_version"], '<')) ) { // Plugin version is prior to 1.5 or is lower to the current updated files. // For first, let's check for new array keys and eventually put them in the current array option. $srp_diff_array = array_diff_key($srp_default_plugin_values, $srp_current_options); // Check if there are no new array keys. In this case, we need to update only the version option. if (!empty($srp_diff_array)) { // Merge current option array with new values. $srp_result_array = array_merge($srp_current_options, $srp_diff_array); // Update current plugin option version. $srp_result_array["srp_version"] = $srp_default_plugin_values["srp_version"]; // Update db options. update_option('srp_plugin_options', $srp_result_array); } else { // Update current plugin option version. $srp_current_options["srp_version"] = $srp_default_plugin_values["srp_version"]; // Update db options. update_option('srp_plugin_options', $srp_current_options); } } else { // Current bulk is updated. Do Nothing. } } else { // First Install. Do nothing. } } /* | --------------------------------------------- | PLUGIN COMPATIBILITY CHECK | --------------------------------------------- */ function check_plugin_compatibility() { // Checking for PHP version. $current_ver = phpversion(); switch(version_compare($current_ver, SRP_REQUIRED_PHPVER)) { case -1: $error = new WP_Error('broke', __("Error! You're running an old version of PHP. In order for this plugin to work, you must enable your server with PHP support version 5.0.0+. Please contact your hosting/housing company support, and check how to enable it.")); if (is_wp_error($error)) { echo "

" . $error->get_error_message() . "

"; } break; case 0: case 1: break; } // Check for GD support. if (!function_exists("gd_info")) { $error = new WP_Error('broke', __("Error! GD libraries are not supported by your server. Please contact your hosting/housing company support, and check how to enable it. Without these libraries, thumbnails can't be properly resized and displayed.")); if (is_wp_error($error)) { echo "

" . $error->get_error_message() . "

"; } } // Check for thumbnail option enabled theme. if (!current_theme_supports('post-thumbnails')) { $error = new WP_Error('broke', __("Warning! Your theme doesn't support post thumbnail. The plugin will keep on working with first post images only. To enable post thumbnail support, please check the Wordpress Documentation")); if (is_wp_error($error)) { echo "

" . $error->get_error_message() . "

"; } } } /* | --------------------------------------------- | AMIN MENUS PAGE AND STYLESHEETS | --------------------------------------------- */ // Main Admin setup function. function srp_admin_setup() { // Adding SubMenu Page. $page = add_submenu_page('options-general.php', __('Special Recent Posts - Settings Page', 'Special Recent Posts - Settings Page'), __('Special Recent Posts', 'Special Recent Posts'), 'administrator', __FILE__, 'srp_admin_menu_options'); // Using registered $page handle to hook stylesheet loading. add_action('admin_print_styles-' . $page, 'srp_admin_plugin_add_style'); } // Main function to add admin stylesheet. function srp_admin_plugin_add_style() { // Enqueuing plugin admin stylesheet. wp_enqueue_style('srp-admin-stylesheet'); } // Main function to add widget stylesheet into current theme. function srp_theme_css() { // Printing spcific stylesheet for widgets in current theme. $theme_css = get_option('srp_plugin_options'); echo ""; // Adding IE7 Fix. echo ""; } /* | --------------------------------------------- | BUILDING PLUGIN OPTION PAGE | --------------------------------------------- */ // Main function that builds the plugin admin page. function srp_admin_menu_options() { // Checking if we have the manage option permission enabled. if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } ?>

UPGRADE NOW TO SPECIAL RECENT POSTS PRO!
Special Recent Posts PRO has been finally released with new incredible features, improved performance and a brand new re-designed plugin.
Dicover it now on CodeCanyon.com
(*) Required Field

', SRP_TRANSLATION_ID); ?>

Thumbnails are generated through an automatic process which tries to retrieve each post featured image; in case this step fails or the thumbnail is unavailable, the plugin will try to fetch the first image from the post content. Adaptive resize is applied to display images at their best quality without stretching. If no images are available, a default thumbnail is displayed. Here are the basic options for this section:

Thumbnail Width:
Set the preferred thumbnail width.
Note: This setting could be overrided by a specific widget value.
Thumbnail Height:
Set the preferred thumbnail height.
Note: This setting could be overrided by a specific widget value.
Link to Post:
Check this option if you want the thumbnails to be linked to post pages.
Default Thumbnail URL:
Paste here the full URL of a custom image for the thumbnail placeholder. This will be displayed when no post images are available.
', SRP_TRANSLATION_ID); ?>

  • px px
  • />

Max Text Size to Display:
Insert here after how many characters/words the post excerpt should be \'cut\'.
Excerpt Allowed Tags:
Insert here a list of tags you\'d like to keep displayed inside the generated text output. The list must be written without quotes, dots or commas.
Example: <a><img><i>
Max Title Size to Display:
Insert here after how many characters/words the post title should be \'cut\'.
Set String Break:
Insert here the suffix string to be appended after the post excerpt and if it should be linked to the post page.
Set Image String Break:
Insert here the absolute URL of a custom image to use as graphic stringbreak. This will override the textual one.
Format Post Date.:
Insert here how to format the post date field. Check the legend for each parameter. For further options see the PHP documentation online.
Post Offset
Check this field if you want to hide from the recent posts the current post displayed (usually on single post view).
Use Category Title
Check this field if you want to display the category name as widget title instead of the custom one. It will be linked to the category archive page.
No Posts Available Text
This is the text that will be displayed when no posts are available.
', SRP_TRANSLATION_ID); ?>

  • /> /> />
  • /> /> />
  • />
  • />
  • />

"
$v) { // Assigning previous default value if field is empty. String break field excluded. if ((empty($v)) && ( ($k != "srp_string_break") && ($k != "srp_noposts_message") && ($k != "srp_excerpt_allowed_tags") && ($k != "srp_image_string_break"))) { $data[$k] = $srp_current_options[$k]; } } // Handling special html tags in "srp_excerpt_allowed_tags". $data['srp_excerpt_allowed_tags'] = htmlspecialchars($data['srp_excerpt_allowed_tags'], ENT_QUOTES); // Updating WP Option with new $_POST data. update_option('srp_plugin_options', $data); // Displaying "save settings" message. echo "

" . __('Settings Saved', SRP_TRANSLATION_ID) . "

"; } }