WordPress autoupdater

zainstalować wp-CLI -> http://wp-cli.org/

użyć tego skryptu

#!/bin / bash

Updater(){
        wp rdzenia zmiana --allow root
        Rdzeń wp update-db --allow root
        wp uaktualnienie wtyczki --all --allow-korzeń
        Aktualizacja WP Theme --all --allow-korzeń
        Rdzeń wp zmiana języka --allow root
        CGROUP = $(stat -c '% G' wp-cron.php)
        CUSER = $(stat -c '% U' wp-cron.php)
        chown $ CUSER:$CGROUP ./* -rf
}

bo w $(find / var / www / vhostów -name wp-cron.php); zrobić
        wpdir = $(echo $ i | sed -r 's / wp-cron.php // g')
        echo $ wpdir
        cd $ wpdir
        Updater
Gotowe

W3 Razem Cache – Przerywany przeglądarkowe Błędy Decode

I zostały zmodyfikowane mój W3TC cache config, aby wyłączyć kompresję gzip.

Jednak nadal mam nagłówek kodowania gzip. Wygląda na to, że wprowadziliśmy problem konfiguracyjny z phpfpm (moje założenie teraz). Myślałem, że wykluczyć podwójne kodowanie już, ale coś przeoczyć. Ja potwierdzić moje założenia później, ale nie wydaje W3TC ma nic wspólnego z moim numerze Po dalszym dochodzeniu.

RSS nie działa – Błąd przetwarzania XML

miałem ten problem na moim witryna oparta na WordPressie. Zagadnienie było to, że miałem pustą linię na początku mojej stronie.

Rozwiązanie:

-> po długim czasie badań okazało się, że miałem „powrót” w moim pliku wp-config.php w sekcji, gdzie skonfigurowane przyszłość WP-Multisite.

Łącze libary zmienić dostawcę miniatur

you must use Version: 5.8.6.7 and change the main php file to

<?php
/*
Plugin Name: Link Library
Plugin URI: http://wordpress.org/extend/plugins/link-library/
Description: Display links on pages with a variety of options
Version: 5.8.6.7
Autor: Yannick Lefebvre
Author URI: http://ylefebvre.ca/

A plugin for the blogging MySQL/PHP-based WordPress.
Prawo autorskie 2014 Yannick Lefebvre

Translations:
French Translation courtesy of Luc Capronnier
Danish Translation courtesy of GeorgWP (http://wordpress.blogos.dk)
Italian Translation courtesy of Gianni Diurno

This program is free software; you can redistribute it and/or
modify it under the terms of the GNUs General Public License
as published addlinkcatlistoverrideby the Free Software Foundation; either version 2
of the License, lub (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

You can also view a copy of the HTML version of the GNU General Public
License at http://www.gnu.org/copyleft/gpl.html

I, Yannick Lefebvre, can be contacted via e-mail at ylefebvre@gmail.com
*/

require_once(ABSPATH . '/wp-admin/includes/bookmark.php');

global $my_link_library_plugin;
global $my_link_library_plugin_admin;

gdyby ( !get_option( 'link_manager_enabled' ) )
    add_filter( 'pre_option_link_manager_enabled', '__return_true' );

gdyby ( is_admin() ) {
    global $my_link_library_plugin_admin;
    require plugin_dir_path( __FILE__ ) . 'link-library-admin.php';
    $my_link_library_plugin_admin = new link_library_plugin_admin();
}

/*********************************** Link Library Class *****************************************************************************/
class link_library_plugin {

	//constructor of class, PHP4 compatible construction for backward compatibility
	function link_library_plugin() {

        // Functions to be called when plugin is activated and deactivated
        register_activation_hook( __FILE__, array($this, 'll_install' ) );
        register_deactivation_hook( __FILE__, array($this, 'll_uninstall' ) );

		$newoptions = get_option('LinkLibraryPP1', "");

		gdyby ( $newoptions == "" ) {
            global $my_link_library_plugin_admin;

            gdyby ( pusty( $my_link_library_plugin_admin ) ) {
                require plugin_dir_path( __FILE__ ) . 'link-library-admin.php';
                $my_link_library_plugin_admin = new link_library_plugin_admin();
            }

			$my_link_library_plugin_admin->ll_reset_options(1, 'list');
			$my_link_library_plugin_admin->ll_reset_gen_settings();
		}

		// wp_ajax_... is only run for logged usrs
		//add_action( 'wp_ajax_scn_check_url_action', array( &$this, 'ajax_action_check_url' ) );

		// Add short codes
		add_shortcode('link-library-cats', array($this, 'link_library_cats_func'));
		add_shortcode('link-library-search', array($this, 'link_library_search_func'));
		add_shortcode('link-library-addlink', array($this, 'link_library_addlink_func'));
		add_shortcode('link-library-addlinkcustommsg', array($this, 'link_library_addlink_func'));
		add_shortcode('link-library', array($this, 'link_library_func'));

		// Function to print information in page header when plugin present
		add_action('wp_head', array($this, 'll_rss_link'));

		// Function to determine if Link Library is used on a page before printing headers
		add_filter('the_posts', array($this, 'conditionally_add_scripts_and_styles'));
        // the_posts gets triggered before wp_head

		add_filter('wp_title', array($this, 'll_title_creator'));

		// Re-write rules filters to allow for custom permalinks
		add_filter('rewrite_rules_array', array($this, 'll_insertMyRewriteRules'));
		add_filter('query_vars', array($this, 'll_insertMyRewriteQueryVars'));

        add_action( 'template_redirect', array( $this, 'll_template_redirect' ) );
        add_action( 'wp_ajax_link_library_tracker', array( $this, 'link_library_ajax_tracker' ) );
        add_action( 'wp_ajax_nopriv_link_library_tracker', array( $this, 'link_library_ajax_tracker' ) );
        add_action( 'wp_ajax_link_library_ajax_update', array( $this, 'link_library_ajax_update') );
        add_action( 'wp_ajax_nopriv_link_library_ajax_update', array( $this, 'link_library_ajax_update') );
        add_action( 'wp_ajax_link_library_generate_image', array( $this, 'link_library_generate_image') );
        add_action( 'wp_ajax_nopriv_link_library_generate_image', array( $this, 'link_library_generate_image') );

		// Load text domain for translation of admin pages and text strings
		load_plugin_textdomain( 'link-library', fałszywy, dirname( plugin_basename( __FILE__ ) ) . '/languages' );

        global $wpdb;

        $wpdb->linkcategorymeta = $wpdb->get_blog_prefix() . "linkcategorymeta";
	}

    /************************** Link Library Installation Function **************************/
    function ll_install() {
        global $wpdb;

        gdyby (function_exists('is_multisite') && is_multisite()) {
            gdyby (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1))
            {
                $originalblog = $wpdb->blogid;

                $bloglist = $wpdb->get_col($wpdb->przygotować("SELECT blog_id FROM $wpdb->blogs"));
                dla każdego ($bloglist as $blog) {
                    switch_to_blog($blog);
                    $this->create_table_and_settings();
                }
                switch_to_blog($originalblog);
                powrót;
            }
        }
        $this->create_table_and_settings();
    }

    function new_network_site($blog_id, $user_id, $domain, $path, $site_id, $meta )
    {
        global $wpdb;

        gdyby ( ! function_exists('is_plugin_active_for_network') )
            require_once( ABSPATH . '/wp-admin/includes/plugin.php' );

        gdyby (is_plugin_active_for_network('link-library/link-library.php')) {
            $originalblog = $wpdb->blogid;
            switch_to_blog($blog_id);
            $this->create_table_and_settings();
            switch_to_blog($originalblog);
        }
    }

    function create_table_and_settings()
    {
        global $wpdb;

        $wpdb->links_extrainfo = $this->db_prefix().'links_extrainfo';

        $creationquery = "CREATE TABLE " . $wpdb->links_extrainfo . " (
				link_id bigint(20) NOT NULL DEFAULT '0',
				link_second_url varchar(255) CHARACTER SET utf8 DEFAULT NULL,
				link_telephone varchar(128) CHARACTER SET utf8 DEFAULT NULL,
				link_email varchar(128) CHARACTER SET utf8 DEFAULT NULL,
				link_visits bigint(20) DEFAULT '0',
				link_reciprocal varchar(255) DEFAULT NULL,
				link_submitter varchar(255) DEFAULT NULL,
				link_submitter_name VARCHAR( 128 ) NULL,
				link_submitter_email VARCHAR( 128 ) NULL,
				link_textfield TEXT NULL,
				link_no_follow VARCHAR(1) NULL,
				link_featured VARCHAR(1) NULL,
				link_manual_updated VARCHAR(1) NULL,
				UNIQUE KEY link_id (link_id)
				);";

        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
        dbDelta( $creationquery );

        $wpdb->linkcategorymeta = $this->db_prefix().'linkcategorymeta';

        $meta_creation_query =
            'CREATE TABLE ' . $wpdb->linkcategorymeta . ' (
        meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
        linkcategory_id bigint(20) unsigned NOT NULL DEFAULT "0",
        meta_key varchar(255) DEFAULT NULL,
        meta_value longtext,
        UNIQUE KEY (meta_id)
        );';

        dbDelta ( $meta_creation_query );

        $genoptions = get_option('LinkLibraryGeneral');

        gdyby ($genoptions != '')
        {
            gdyby ($genoptions['schemaversion'] == '' || floatval($genoptions['schemaversion']) < 3.5)
            {
                $genoptions['schemaversion'] = "3.5";
                update_option('LinkLibraryGeneral', $genoptions);
            }
            elseif (floatval($genoptions['schemaversion']) < "4.6")
            {
                $genoptions['schemaversion'] = "4.6";
                $wpdb->get_results("ALTER TABLE `" . $this->db_prefix() . "links_extrainfo` ADD `link_submitter_name` VARCHAR( 128 ) NULL, ADD `link_submitter_email` VARCHAR( 128 ) NULL , ADD `link_textfield` TEXT NULL ;");

                update_option('LinkLibraryGeneral', $genoptions);
            }
            elseif (floatval($genoptions['schemaversion']) < "4.7")
            {
                $genoptions['schemaversion'] = "4.7";
                $wpdb->get_results("ALTER TABLE `" . $this->db_prefix() . "links_extrainfo` ADD `link_no_follow` VARCHAR( 1 ) NULL;");

                update_option('LinkLibraryGeneral', $genoptions);
            }
            elseif (floatval($genoptions['schemaversion']) < "4.9")
            {
                $genoptions['schemaversion'] = "4.9";
                $wpdb->get_results("ALTER TABLE `" . $this->db_prefix() . "links_extrainfo` ADD `link_featured` VARCHAR( 1 ) NULL;");

                update_option('LinkLibraryGeneral', $genoptions);
            }

            for ($i = 1; $ja <= $genoptions['numberstylesets']; $i++) {
                $settingsname = 'LinkLibraryPP' . $ja;
                $options = get_option($settingsname);

                gdyby ($options != '')
                {
                    gdyby ($options['showname'] == '')
                        $options['showname'] = true;

                    gdyby ( isset($options['show_image_and_name'] ) && $options['show_image_and_name'] == true)
                    {
                        $options['showname'] = true;
                        $options['show_images'] = true;
                    }

                    gdyby ($options['sourcename'] == '')
                        $options['sourcename'] = 'primary';

                    gdyby ($options['sourceimage'] == '')
                        $options['sourceimage'] = 'primary';

                    gdyby ($options['dragndroporder'] == '')
                    {
                        gdyby ($options['imagepos'] == 'beforename')
                            $options['dragndroporder'] = '1,2,3,4,5,6,7,8,9,10,11,12';
                        elseif ($options['imagepos'] == 'aftername')
                            $options['dragndroporder'] = '2,1,3,4,5,6,7,8,9,10,11,12';
                        elseif ($options['imagepos'] == 'afterrssicons')
                            $options['dragndroporder'] = '2,3,4,5,6,1,7,8,9,10,11,12';
                    }
                    else if ($options['dragndroporder'] != '')
                    {
                        $elementarray = explode(',', $options['dragndroporder']);

                        $allelements = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12');
                        dla każdego ($allelements as $element)
                        {
                            gdyby (!in_array($element, $elementarray))
                            {
                                $elementarray[] = $element;
                                $options['dragndroporder'] = implode(",", $elementarray);
                            }
                        }
                    }

                    gdyby ($options['flatlist'] === true) $options['flatlist'] = 'unordered';
                    elseif ($options['flatlist'] === false) $options['flatlist'] = 'table';
                }

                update_option($settingsname, $options);
            }
        }
    }

    function remove_querystring_var($url, $klawisz) {

        $keypos = strpos($url, $klawisz);
        gdyby ($keypos)
        {
            $ampersandpos = strpos($url, '&', $keypos);
            $newurl = substr($url, 0, $keypos - 1);

            gdyby ($ampersandpos)
                $newurl .= substr($url, $ampersandpos);
        }
        else
            $newurl = $url;

        return $newurl;
    }

    /************************** Link Library Uninstall Function **************************/
    function ll_uninstall() {
        $genoptions = get_option('LinkLibraryGeneral');

        gdyby ($genoptions != '')
        {
            gdyby ( isset( $genoptions['stylesheet'] ) && isset( $genoptions['fullstylesheet'] ) && $genoptions['stylesheet'] != '' && $genoptions['fullstylesheet'] == '')
            {
                $stylesheetlocation = plugins_url( $genoptions['stylesheet'], __FILE__ );
                gdyby ( file_exists( $stylesheetlocation ) )
                    $genoptions['fullstylesheet'] = file_get_contents( $stylesheetlocation );

                update_option('LinkLibraryGeneral', $genoptions);
            }
        }
    }

    function db_prefix() {
		global $wpdb;
		gdyby (method_exists($wpdb, "get_blog_prefix"))
			return $wpdb->get_blog_prefix();
		else
			return $wpdb->prefix;
	}

    	/******************************************** Print style data to header *********************************************/

	function ll_rss_link() {
		global $llstylesheet, $rss_settings;

		gdyby ($rss_settings != "")
		{
			$settingsname = 'LinkLibraryPP' . $rss_settings;
			$options = get_option($settingsname);

			$feedtitle = ($options['rssfeedtitle'] == "" ? __('Link Library Generated Feed', 'link-library') : $options['rssfeedtitle']);

			$xpath = $this->relativePath( dirname( __FILE__ ), ABSPATH );
			echo '<link rel="alternate" type="application/rss+xml" title="' . esc_html(stripslashes($feedtitle)) . '" href="' . home_url('/?link_library_rss_feed=1&settingset=' . $rss_settings/* . '&xpath=' . $xpath*/) . '" />';
			unset( $xpath );
		}

		gdyby ($llstylesheet == true)
		{
			$genoptions = get_option('LinkLibraryGeneral');

			Echo "<style id='LinkLibraryStyle' type='text/css'>n";
			echo stripslashes($genoptions['fullstylesheet']);
			Echo "</style>n";
		}
	}

	/****************************************** Add Link Category name to page title when option is present ********************************/
	function ll_title_creator($title) {
		global $wp_query;
		global $wpdb;
                global $llstylesheet;

                gdyby ($llstylesheet)
                {
                    $genoptions = get_option('LinkLibraryGeneral');

                    $categoryname = ( isset( $wp_query->query_vars['cat_name'] ) ? $wp_query->query_vars['cat_name'] : '' );
                    $catid = ( isset( $_GET['cat_id'] ) ? intval($_GET['cat_id']) : '' );

                    $linkcatquery = "SELECT t.name ";
                    $linkcatquery .= "FROM " . $this->db_prefix() . "terms t LEFT JOIN " . $this->db_prefix(). "term_taxonomy tt ON (t.term_id = tt.term_id) ";
                    $linkcatquery .= "LEFT JOIN " . $this->db_prefix() . "term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) ";
                    $linkcatquery .= "WHERE tt.taxonomy = 'link_category' AND ";

                    gdyby ($categoryname != '')
                    {
                            $linkcatquery .= "t.slug = '" . $categoryname . "'";
                            $nicecatname = $wpdb->get_var($linkcatquery);
                            return $title . $genoptions['pagetitleprefix'] . $nicecatname . $genoptions['pagetitlesuffix'];
                    }
                    elseif ($catid != '')
                    {
                            $linkcatquery .= "t.term_id = '" . $catid . "'";
                            //echo $linkcatquery;
                            $nicecatname = $wpdb->get_var($linkcatquery);
                            return $title . $genoptions['pagetitleprefix'] . $nicecatname . $genoptions['pagetitlesuffix'];
                    }
                }

		return $title;
	}

    	/************************************* Function to add to rewrite rules for permalink support **********************************/
	function ll_insertMyRewriteRules($rules)
	{
		$newrules = array();

		$genoptions = get_option('LinkLibraryGeneral');

		gdyby ($genoptions != '')
		{
			for ($i = 1; $ja <= $genoptions['numberstylesets']; $i++) {
				$settingsname = 'LinkLibraryPP' . $ja;
				$options = get_option($settingsname);

				gdyby ($options['enablerewrite'] == true && $options['rewritepage'] != '')
					$newrules['(' . $options['rewritepage'] . ')/(.+?)$'] = 'index.php?pagename=$matches[1]&cat_name=$matches[2]';

				gdyby ($options['publishrssfeed'] == true)
				{
					$xpath = $this->relativePath( dirname( __FILE__ ), ABSPATH );

					gdyby ($options['rssfeedaddress'] != '')
						$newrules['(' . $options['rssfeedaddress'] . ')/(.+?)$'] = home_url() . '?link_library_rss_feed=1&settingset=$matches[1]';
					elseif ($options['rssfeedaddress'] == '')
						$newrules['(linkrss)/(.+?)$'] = plugins_url( 'link_library_rss_feed=1?settingset=$matches[1]' . '&xpath=' . $xpath, __FILE__ );

					unset( $xpath );
				}
			}
		}

		return $newrules + $rules;
	}

	// Adding the id var so that WP recognizes it
	function ll_insertMyRewriteQueryVars($vars)
	{
		array_push($vars, 'cat_name');
		return $vars;
	}

    function addhttp( $url ) {
        gdyby (!preg_match("~^(?:fa|ht)tps?://~i", $url)) {
            $url = "http://" . $url;
        }
        return $url;
    }

	/*********************************************** Private Link Library Categories Function *************************************/

	function PrivateLinkLibraryCategories($order = 'name', $hide_if_empty = true, $table_width = 100, $num_columns = 1, $catanchor = true,
				   $flatlist = 'table', $categorylist = '', $excludecategorylist = '', $showcategorydescheaders = false,
				   $showonecatonly = false, $settings = '', $loadingicon = '/icons/Ajax-loader.gif', $catlistdescpos = 'right',
				   $debugmode = false, $pagination = false, $linksperpage = 5, $showcatlinkcount = false, $showonecatmode = 'AJAX',
				   $cattargetaddress = '', $rewritepage = '', $showinvisible = false, $showuserlinks = false, $showcatonsearchresults = false) {

		global $wpdb;

		$output = '';

                $categoryid = '';

		gdyby (isset($_GET['cat_id']))
			$categoryid = intval($_GET['cat_id']);

		gdyby (!isset($_GET['searchll']) || $showcatonsearchresults == true)
		{
			$countcat = 0;

			$order = strtolower($order);

			$output .= "<!-- Link Library Categories Output -->nn";

			gdyby ($showonecatonly == true && ($showonecatmode == 'AJAX' || $showonecatmode == ''))
			{
                $nonce = wp_create_nonce( 'link_library_ajax_refresh' );

				$output .= "<SCRIPT LANGUAGE="JavaScript">n";
				$output .= "var ajaxobject;n";
				$output .= "function showLinkCat ( _incomingID, _settingsID, _pagenumber) {n";
				$output .= "gdyby (typeof(ajaxobject) != "undefined") { ajaxobject.abort(); }n";

				$output .= "tjQuery('#contentLoading').toggle();" .
                           "jQuery.ajax( {" .
                           "    type: 'POST', " .
                           "    url: '" . admin_url( 'admin-ajax.php' ) . "', " .
                           "    data: { action: 'link_library_ajax_update', " .
                           "            _ajax_nonce: '" . $nonce . "', " .
                           "            id : _incomingID, " .
                           "            ustawienia : _settingsID, " .
                           "            linkresultpage: _pagenumber }, " .
                           "    success: funkcjonować( data ){ " .
                           "            jQuery('#linklist" . $ustawienia. "').html( data ); " .
                           "            jQuery('#contentLoading').toggle();n" .
                           "            } } ); ";
				$output .= "}n";

				$output .= "</SCRIPT>nn";
			}

			// Handle link category sorting
			$direction = 'ASC';
			gdyby (substr($order,0,1) == '_') {
				$direction = 'DESC';
				$order = substr($order,1);
			}

			gdyby (!isset($direction)) $direction = '';
			// Fetch the link category data as an array of hashesa

			$linkcatquery = "SELECT ";
            gdyby ( $showcatlinkcount || $pagination ) {
                $linkcatquery .= "count(l.link_name) as linkcount, ";
            }
			$linkcatquery .= "t.name, t.term_id, t.slug as category_nicename, tt.description as category_description ";
			$linkcatquery .= "FROM " . $this->db_prefix() . "terms t LEFT JOIN " . $this->db_prefix(). "term_taxonomy tt ON (t.term_id = tt.term_id)";
			$linkcatquery .= " LEFT JOIN " . $this->db_prefix() . "term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) ";

			$linkcatquery .= " LEFT JOIN " . $this->db_prefix() . "links l on (tr.object_id = l.link_id";

			gdyby ($showinvisible == false)
				$linkcatquery .= " AND l.link_visible != 'N'";

			gdyby (!$showuserlinks)
				$linkcatquery .= " AND l.link_description not like '%LinkLibrary:AwaitingModeration:RemoveTextToApprove%' ";

			$linkcatquery .= " ) ";

			$linkcatquery .= "WHERE tt.taxonomy = 'link_category'";

			gdyby ($categorylist != "")
				$linkcatquery .= " AND t.term_id in (" . $categorylist. ")";

			gdyby ($excludecategorylist != "")
				$linkcatquery .= " AND t.term_id not in (" . $excludecategorylist . ")";

			gdyby ($hide_if_empty == true)
				$linkcatquery .= " AND l.link_name != '' ";

			$linkcatquery .= " GROUP BY t.name ";

			gdyby ($order == "name")
				$linkcatquery .= " ORDER by t.name " . $direction;
			elseif ($order == "id")
				$linkcatquery .= " ORDER by t.term_id " . $direction;
			elseif ($order == "order")
				$linkcatquery .= " ORDER by t.term_order " . $direction;
			elseif ($order == "catlist")
				$linkcatquery .= " ORDER by FIELD(t.term_id," . $categorylist . ") ";

			$catnames = $wpdb->get_results($linkcatquery);

			gdyby ($debugmode)
			{
				$output .= "n<!-- Category Query: " . print_r($linkcatquery, TRUE) . "-->nn";
				$output .= "n<!-- Category Results: " . print_r($catnames, TRUE) . "-->nn";
			}

			// Display each category

			if ($catnames) {

				$output .=  "<div id="linktable" class="linktable">";

				gdyby ($flatlist == 'table')
					$output .= "<table width="" . $table_width . "%">n";
				elseif ($flatlist == 'unordered')
					$output .= "<ul class='menu'>n";
				elseif ($flatlist == 'dropdown')
					$output .= "<form name='catselect'><select name='catdropdown' class='catdropdown'>";

				$linkcount = 0;

				dla każdego ( (array) $catnames as $catname) {
					// Handle each category.
					// Pierwszy, fix the sort_order info
					//$orderby = $cat['sort_order'];
					//$orderby = (bool_from_yn($cat['sort_desc'])?'_':'') . $orderby;

					$catfront = '';
					$cattext = '';
					$catitem = '';

					// Display the category name
					$countcat += 1;
					gdyby ($flatlist == 'table' and (($countcat % $num_columns == 1) lub ($num_columns == 1) )) $output .= "<tr>n";

					gdyby ($flatlist == 'table')
						$catfront = '	<td>';
					elseif ($flatlist == 'unordered')
						$catfront = '	<w>';
					elseif ($flatlist == 'dropdown')
					{
						$catfront = '	<option ';
						gdyby ($categoryid != '' && $categoryid == $catname->term_id)
							$catfront .= 'selected="selected" ';
						$catfront .= 'value="';
					}

					gdyby ($showonecatonly)
					{
						gdyby ($showonecatmode == 'AJAX' || $showonecatmode == '')
						{
							gdyby ($flatlist != 'dropdown')
								$cattext = "<a href='#' onClick="showLinkCat('" . $catname->term_id. "', '" . $ustawienia . "', 1);return false;" >";
							elseif ($flatlist == 'dropdown')
								$cattext = $catname->term_id;
						}
						elseif ($showonecatmode == 'HTMLGET')
						{
							gdyby ($flatlist != 'dropdown')
								$cattext = "<a href='";

							gdyby ($cattargetaddress != '' && strpos($cattargetaddress, "?") != false)
							{
								$cattext .= $cattargetaddress;
								$cattext .= "&cat_id=";
							}
							elseif ($cattargetaddress != '' && strpos($cattargetaddress, "?") == false)
							{
								$cattext .= $cattargetaddress;
								$cattext .= "?cat_id=";
							}
							elseif ($cattargetaddress == '')
								$cattext .= "?cat_id=";

							$cattext .= $catname->term_id;

							gdyby ($flatlist != 'dropdown')
								$cattext .= "'>";
						}
						elseif ($showonecatmode == 'HTMLGETPERM')
						{
							gdyby ($flatlist != 'dropdown')
								$cattext = "<a href='";

							$cattext .= "/" . $rewritepage . "/" . $catname->category_nicename;

							gdyby ($flatlist != 'dropdown')
								$cattext .= "'>";
						}
					}
					else if ($catanchor)
					{
						gdyby (!$pagination)
						{
							gdyby ($flatlist != 'dropdown')
								$cattext = '<a href="';

							$cattext .= '#' . $catname->category_nicename;

							gdyby ($flatlist != 'dropdown')
								$cattext .= '">';
						}
						elseif ($pagination)
						{
							gdyby ($linksperpage == 0 && $linksperpage == '')
								$linksperpage = 5;

							$pageposition = ( $linkcount + 1 ) / $linksperpage;
							$ceilpageposition = ceil($pageposition);
							gdyby ( $ceilpageposition == 0 && !isset( $_GET['linkresultpage'] ) ) {
								gdyby ($flatlist != 'dropdown')
									$cattext = '<a href="';

								$cattext .= get_permalink() . '#' . $catname->category_nicename;

								gdyby ( $flatlist != 'dropdown' )
									$cattext .= '">';
							} jeszcze {
								gdyby ( $flatlist != 'dropdown' )
									$cattext = '<a href="';

								$cattext .= '?linkresultpage=' . ($ceilpageposition == 0 ? 1 : $ceilpageposition) . '#' . $catname->category_nicename;

								gdyby ( $flatlist != 'dropdown' )
									$cattext .= '">';
							}

							$linkcount = $linkcount + $catname->linkcount;
						}
					}
					else
						$cattext = '';

					gdyby ( $flatlist == 'dropdown' )
						$cattext .= '">';

					gdyby ( $catlistdescpos == 'right' || $catlistdescpos == '' ) {
						$catitem .= '<div class="linkcatname">' . $catname->name . '</div>';
						gdyby ($showcatlinkcount)
							$catitem .= " (" . $catname->linkcount . ")";
					}

					gdyby ( $showcategorydescheaders ) {
						$catname->category_description = esc_html($catname->category_description);
						$catname->category_description = str_replace("[", "<", $catname->category_description);
						$catname->category_description = str_replace("]", ">", $catname->category_description);
						$catname->category_description = str_replace("&Quot;", """, $catname->category_description);
						$catitem .= "<span class='linkcatdesc'>" . $catname->category_description . "</przęsło>";
					}

					gdyby ($catlistdescpos == 'left')
					{
						$catitem .= '<div class="linkcatname">' . $catname->name . '</div>';
						gdyby ($showcatlinkcount)
							$catitem .= " (" . $catname->linkcount . ")";
					}

					gdyby (($catanchor || $showonecatonly) && $flatlist != 'dropdown')
						$catitem .= "</za>";

					$output .= ($catfront . $cattext . $catitem );

					gdyby ($flatlist == 'table')
						$catterminator = "	</td>n";
					elseif ($flatlist == 'unordered')
						$catterminator = "	</w>n";
					elseif ($flatlist == 'dropdown')
						$catterminator = "	</option>n";

					$output .= ($catterminator);

					gdyby ($flatlist == "table" i ($countcat % $num_columns == 0)) $output .= "</tr>n";
				}

				gdyby ($flatlist == "table" i ($countcat % $num_columns == 3)) $output .= "</tr>n";
				gdyby ($flatlist == "table" && $catnames)
					$output .= "</table>n";
				elseif ($flatlist == 'unordered' && $catnames)
					$output .= "</ul>n";
				elseif ($flatlist == 'dropdown' && $catnames)
				{
					$output .= "</Wybierz>n";
					$output .= "<button type='button' onclick='showcategory()'>" . __('Go!', 'link-library') . "</button>";
					$output .= "</form>";
				}

				$output .= "</div>n";

				gdyby ($showonecatonly && ($showonecatmode == 'AJAX' || $showonecatmode == ''))
				{
					gdyby ($loadingicon == '') $loadingicon = '/icons/Ajax-loader.gif';
					$output .= "<div class='contentLoading' id='contentLoading' style='display: none;'><img src='" . plugins_url( $loadingicon, __FILE__ ) . "' alt='Loading data, please wait...'></div>n";
				}

				gdyby ($flatlist == 'dropdown')
				{
					$output .= "<SCRIPT TYPE='text/javascript'>n";
					$output .= "tfunction showcategory(){n";

					gdyby ($showonecatonly && ($showonecatmode == 'AJAX' || $showonecatmode == '') )
					{
						$output .= "catidvar = document.catselect.catdropdown.options[document.catselect.catdropdown.selectedIndex].value;";
						$output .= "showLinkCat(catidvar, '" . $ustawienia . "', 1);return false; }";
					}
					jeszcze
					{
						$output .= "ttlocation=n";
						$output .= "document.catselect.catdropdown.options[document.catselect.catdropdown.selectedIndex].value }n";

					}
					$output .= "</SCRIPT>n";
				}
			}
			jeszcze
			{
				$output .= "<div>" . __('No categories found', 'link-library') . ".</div>";
			}

			$output .= "n<!-- End of Link Library Categories Output -->nn";
		}
		return $output;
	}

	function ll_highlight_phrase($str, $phrase, $tag_open = '<strong>', $tag_close = '</strong>')
	{
		gdyby ($str == '')
		{
			return '';
		}

		gdyby ($phrase != '')
		{
			return preg_replace('/('.preg_quote($phrase, '/').'(?![^<]*>))/i', $tag_open."\1".$tag_close, $str);
		}

		return $str;
	}

    function link_library_display_pagination( $previouspagenumber, $nextpagenumber, $numberofpages, $pagenumber, $showonecatonly, $showonecatmode, $AJAXcatid, $ustawienia, $pageID ) {

        $dotbelow = false;
        $dotabove = false;

        $incomingget = $_GET;
        unset ( $incomingget['page_id'] );
        unset ( $incomingget['linkresultpage'] );
        unset ( $incomingget['cat_id'] );

        gdyby ($numberofpages > 1)
        {
            $paginationoutput = "<div class='pageselector'>";

            gdyby ($pagenumber != 1)
            {
                $paginationoutput .= "<span class='previousnextactive'>";

                gdyby (!$showonecatonly) {
                    $argumentarray = array ( 'page_id' => get_the_ID(), 'linkresultpage' => $previouspagenumber );
                    $argumentarray = array_merge( $argumentarray, $incomingget );
                    $targetaddress = add_query_arg( $argumentarray );

                    $paginationoutput .= "<a href='" . $targetaddress . "'>" . __('Previous', 'link-library') . "</za>";
                } elseif ($showonecatonly) {
                    gdyby ($showonecatmode == 'AJAX' || $showonecatmode == '')
                        $paginationoutput .= "<a href='#' onClick="showLinkCat('" . $AJAXcatid . "', '" . $ustawienia . "', " . $previouspagenumber . ");return false;" >" . __('Previous', 'link-library') . "</za>";
                    elseif ($showonecatmode == 'HTMLGET') {
                        $argumentarray = array ( 'page_id' => $pageID, 'linkresultpage' => $previouspagenumber, 'cat_id' => $AJAXcatid );
                        $argumentarray = array_merge( $argumentarray, $incomingget );
                        $targetaddress = add_query_arg( $argumentarray );

                        $paginationoutput .= "<a href='" . $targetaddress . "' >" . __('Previous', 'link-library') . "</za>";
                    }

                }

                $paginationoutput .= "</przęsło>";
            }
            else
                $paginationoutput .= "<span class='previousnextinactive'>" . __('Previous', 'link-library') . "</przęsło>";

            for ($counter = 1; $counter <= $numberofpages; $counter++)
            {
                gdyby ($counter <= 2 || $counter >= $numberofpages - 1 || ($counter <= $pagenumber + 2 && $counter >= $pagenumber - 2))
                {
                    gdyby ($counter != $pagenumber)
                        $paginationoutput .= "<span class='unselectedpage'>";
                    else
                        $paginationoutput .= "<span class='selectedpage'>";

                    gdyby (!$showonecatonly) {
                        $argumentarray = array ( 'page_id' => $pageID, 'linkresultpage' => $counter );
                        $argumentarray = array_merge( $argumentarray, $incomingget );
                        $targetaddress = add_query_arg( $argumentarray );

                        $paginationoutput .= "<a href='" . $targetaddress . "'>" . $counter . "</za>";
                    } elseif ($showonecatonly) {
                        gdyby ($showonecatmode == 'AJAX' || $showonecatmode == '')
                            $paginationoutput .= "<a href='#' onClick="showLinkCat('" . $AJAXcatid . "', '" . $ustawienia . "', " . $counter . ");return false;" >" . $counter . "</za>";
                        elseif ($showonecatmode == 'HTMLGET') {
                            $argumentarray = array ( 'page_id' => $pageID, 'linkresultpage' => $counter, 'cat_id' => $AJAXcatid );
                            $argumentarray = array_merge( $argumentarray, $incomingget );
                            $targetaddress = add_query_arg( $argumentarray );

                            $paginationoutput .= "<a href='" . $targetaddress . "' >" . $counter . "</za>";
                        }

                    }

                    $paginationoutput .= "</za></przęsło>";
                }

                gdyby ($counter >= 2 && $counter < $pagenumber - 2 && $dotbelow == false)
                {
                    $paginationoutput .= "...";
                    $dotbelow = true;
                }

                gdyby ($counter > $pagenumber + 2 && $counter < $numberofpages - 1 && $dotabove == false)
                {
                    $paginationoutput .= "...";
                    $dotabove = true;
                }
            }

            gdyby ($pagenumber != $numberofpages)
            {
                $paginationoutput .= "<span class='previousnextactive'>";

                gdyby (!$showonecatonly) {
                    $argumentarray = array ( 'page_id' => $pageID, 'linkresultpage' => $nextpagenumber );
                    $argumentarray = array_merge( $argumentarray, $incomingget );
                    $targetaddress = add_query_arg( $argumentarray );

                    $paginationoutput .= "<a href='" . $targetaddress . "'>" . __('Next', 'link-library') . "</za>";
                }

                elseif ($showonecatonly)
                {
                    gdyby ($showonecatmode == 'AJAX' || $showonecatmode == '')
                        $paginationoutput .= "<a href='#' onClick="showLinkCat('" . $AJAXcatid . "', '" . $ustawienia . "', " . $nextpagenumber . ");return false;" >" . __('Next', 'link-library') . "</za>";
                    elseif ($showonecatmode == 'HTMLGET') {
                        $argumentarray = array ( 'page_id' => $pageID, 'linkresultpage' => $nextpagenumber );
                        $argumentarray = array_merge( $argumentarray, $incomingget );
                        $targetaddress = add_query_arg( $argumentarray );

                        $paginationoutput .= "<a href='" . $targetaddress . "' >" . __('Next', 'link-library') . "</za>";
                    }

                }

                $paginationoutput .= "</przęsło>";
            }
            else
                $paginationoutput .= "<span class='previousnextinactive'>" . __('Next', 'link-library') . "</przęsło>";

            $paginationoutput .= "</div>";
        }

        return $paginationoutput;
    }

	function PrivateLinkLibrary($order = 'name', $hide_if_empty = true, $catanchor = true,
									$showdescription = false, $shownotes = false, $showrating = false,
									$showupdated = false, $categorylist = '', $show_images = false,
									$show_image_and_name = false, $use_html_tags = false,
									$show_rss = false, $beforenote = '<br />', $nofollow = false, $excludecategorylist = '',
									$afternote = '', $beforeitem = '<w>', $afteritem = '</w>', $beforedesc = '', $afterdesc = '',
									$displayastable = false, $beforelink = '', $afterlink = '', $showcolumnheaders = false,
									$linkheader = '', $descheader = '', $notesheader = '', $catlistwrappers = 1, $beforecatlist1 = '',
									$beforecatlist2 = '', $beforecatlist3 = '', $divorheader = false, $catnameoutput = 'linklistcatname',
									$show_rss_icon = false, $linkaddfrequency = 0, $addbeforelink = '', $addafterlink = '', $linktarget = '',
									$showcategorydesclinks = false, $showadmineditlinks = true, $showonecatonly = false, $AJAXcatid = '',
									$defaultsinglecat = '', $rsspreview = false, $rsspreviewcount = 3, $rssfeedinline = false,
									$rssfeedinlinecontent = false, $rssfeedinlinecount = 1, $beforerss = '', $afterrss = '',
									$rsscachedir = '', $direction = 'ASC', $linkdirection = 'ASC', $linkorder = 'name',
									$pagination = false, $linksperpage = 5, $hidecategorynames = false, $settings = '',
									$showinvisible = false, $showdate = false, $beforedate = '', $afterdate = '', $catdescpos = 'right',
									$showuserlinks = false, $rsspreviewwidth = 900, $rsspreviewheight = 700, $beforeimage = '', $afterimage = '',
									$imagepos = 'beforename', $imageclass = '', $AJAXpageid = 1, $debugmode = false, $usethumbshotsforimages = false,
									$showonecatmode = 'AJAX', $dragndroporder = '1,2,3,4,5,6,7,8,9,10', $showname = true, $displayweblink = 'false',
									$sourceweblink = 'primary', $showtelephone = 'false', $sourcetelephone = 'primary', $showemail = 'false', $showlinkhits = false,
									$beforeweblink = '', $afterweblink = '', $weblinklabel = '', $beforetelephone = '', $aftertelephone = '', $telephonelabel = '',
									$beforeemail = '', $afteremail = '', $emaillabel = '', $beforelinkhits = '', $afterlinkhits = '', $emailcommand = '',
									$sourceimage = '', $sourcename = '', $thumbshotscid = '', $maxlinks = '', $beforelinkrating = '', $afterlinkrating = '',
									$showlargedescription = false, $beforelargedescription = '', $afterlargedescription = '', $featuredfirst = false, $shownameifnoimage = false,
                                    $enablelinkpopup = false, $popupwidth = 300, $popupheight = 400, $nocatonstartup = false, $linktitlecontent = 'linkname', $paginationposition = 'AFTER', $uselocalimagesoverthumbshots = false, $showlinksonclick = false ) {

		global $wpdb;

		$output = "n<!-- Beginning of Link Library Output -->nn";

        $currentcategory = 1;
        $categoryname = "";

        gdyby ( $showonecatonly && $showonecatmode == 'AJAX' && $AJAXcatid == '' ) {
            $AJAXnocatset = true;
        } jeszcze {
            $AJAXnocatset = false;
        }

		gdyby ($showonecatonly && $showonecatmode == 'AJAX' && $AJAXcatid != '' && $_GET['searchll'] == "")
		{
			$categorylist = $AJAXcatid;
		}
		elseif ($showonecatonly && $showonecatmode == 'HTMLGET' && isset($_GET['cat_id']) && ( !isset( $_GET['searchll'] ) || ( isset( $_GET['searchll'] ) && $_GET['searchll'] == "" ) ) )
		{
			$categorylist = intval($_GET['cat_id']);
			$AJAXcatid = $categorylist;
		}
		elseif ($showonecatonly && $showonecatmode == 'HTMLGETPERM' && $_GET['searchll'] == "")
		{
			global $wp_query;

			$categoryname = $wp_query->query_vars['cat_name'];
			$AJAXcatid = $categoryname;
		}
		elseif ($showonecatonly && $AJAXcatid == '' && $defaultsinglecat != '' && ( !isset( $_GET['searchll'] ) || ( isset( $_GET['searchll'] ) && $_GET['searchll'] == "" ) ) )
		{
			$categorylist = $defaultsinglecat;
			$AJAXcatid = $categorylist;
		}
		elseif ($showonecatonly && $AJAXcatid == '' && $defaultsinglecat == '' && $_GET['searchll'] == "")
		{
			$catquery = "SELECT distinct t.name, t.term_id ";
			$catquery .= "FROM " . $this->db_prefix() . "terms t ";
			$catquery .= "LEFT JOIN " . $this->db_prefix() . "term_taxonomy tt ON (t.term_id = tt.term_id) ";
			$catquery .= "LEFT JOIN " . $this->db_prefix() . "term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) ";
			$catquery .= "LEFT JOIN " . $this->db_prefix() . "links l ON (tr.object_id = l.link_id) ";
            $catquery .= "LEFT JOIN " . $this->db_prefix() . "links_extrainfo le ON (l.link_id = le.link_id) ";
			$catquery .= "WHERE tt.taxonomy = 'link_category' ";

			gdyby ($hide_if_empty)
				$catquery .= "AND l.link_id is not NULL AND l.link_description not like '%LinkLibrary:AwaitingModeration:RemoveTextToApprove%' ";

			gdyby ($categorylist != "")
				$catquery .= " AND t.term_id in (" . $categorylist. ")";

			gdyby ($excludecategorylist != "")
				$catquery .= " AND t.term_id not in (" . $excludecategorylist . ")";

			gdyby ($showinvisible == false)
				$catquery .= " AND l.link_visible != 'N'";

			$mode = "normal";

			$catquery .= " ORDER by ";

			gdyby ($featuredfirst == true)
				$catquery .= "le.link_featured DESC, ";

			gdyby ($order == "name")
				$catquery .= " name " . $direction;
			elseif ($order == "id")
				$catquery .= " t.term_id " . $direction;
			elseif ($order == "order")
				$catquery .= " t.term_order " . $direction;
			elseif ($order == "catlist")
				$catquery .= " FIELD(t.term_id," . $categorylist . ") ";

			gdyby ($linkorder == "name")
				$catquery .= ", link_name " . $linkdirection;
			elseif ($linkorder == "id")
				$catquery .= ", link_id " . $linkdirection;
			elseif ($linkorder == "order")
				$catquery .= ", link_order ". $linkdirection;
			elseif ($linkorder == "data")
				$catquery .= ", link_updated ". $linkdirection;

			$catitems = $wpdb->get_results($catquery);

			gdyby ($debugmode)
			{
				$output .= "n<!-- AJAX Default Category Query: " . print_r($catquery, TRUE) . "-->nn";
				$output .= "n<!-- AJAX Default Category Results: " . print_r($catitems, TRUE) . "-->nn";
			}

			gdyby ($catitems)
			{
				$categorylist = $catitems[0]->term_id;
				$AJAXcatid = $categorylist;
			}
		}

		$linkquery = "SELECT distinct *, l.link_id as proper_link_id, UNIX_TIMESTAMP(l.link_updated) as link_date, ";
		$linkquery .= "IF (DATE_ADD(l.link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ";
		$linkquery .= "FROM " . $this->db_prefix() . "terms t ";
		$linkquery .= "LEFT JOIN " . $this->db_prefix() . "term_taxonomy tt ON (t.term_id = tt.term_id) ";
		$linkquery .= "LEFT JOIN " . $this->db_prefix() . "term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) ";
		$linkquery .= "LEFT JOIN " . $this->db_prefix() . "links l ON (tr.object_id = l.link_id) ";
		$linkquery .= "LEFT JOIN " . $this->db_prefix() . "links_extrainfo le ON (l.link_id = le.link_id) ";
		$linkquery .= "WHERE tt.taxonomy = 'link_category' ";

		gdyby ($hide_if_empty)
			$linkquery .= "AND l.link_id is not NULL AND l.link_description not like '%LinkLibrary:AwaitingModeration:RemoveTextToApprove%' ";

		gdyby ($categorylist != "" || isset($_GET['cat_id']))
			$linkquery .= " AND t.term_id in (" . $categorylist. ")";

		gdyby ( isset($categoryname) && $categoryname != "" && $showonecatmode == 'HTMLGETPERM')
			$linkquery .= " AND t.slug = '" . $categoryname. "'";

		gdyby ($excludecategorylist != "")
			$linkquery .= " AND t.term_id not in (" . $excludecategorylist . ")";

		gdyby ($showinvisible == false)
			$linkquery .= " AND l.link_visible != 'N'";

		gdyby (isset($_GET['searchll']) && $_GET['searchll'] != "")
		{
            $searchterms = array();
            $searchstring = $_GET['searchll'];

            $offset = 0;
            podczas ( strpos( $searchstring, '"', $offset ) !== false ) {
                gdyby ( $offset == 0 ) {
                    $offset = strpos( $searchstring, '"' );
                } jeszcze {
                    $endpos = strpos( $searchstring, '"', $offset + 1);
                    $searchterms[] = substr( $searchstring, $offset + 1, $endpos - $offset - 2 );
                    $strlength = ( $endpos + 1 ) - ( $offset + 1 );
                    $searchstring = substr_replace( $searchstring, '', $offset - 1, $endpos + 2 - ( $offset)  );
                    $offset = 0;
                }
            }

            gdyby ( !pusty( $searchstring ) )
            {
                $searchterms = array_merge( $searchterms, explode(" ", $searchstring ) );
            }

			gdyby ($searchterms)
			{
				$mode = "search";
				$termnb = 1;

				dla każdego($searchterms as $searchterm)
				{
                    gdyby ( !pusty( $searchterm ) ) {
                        $searchterm = str_replace( '--', '', $searchterm );
                        $searchterm = str_replace( ';', '', $searchterm );
                        $searchterm = esc_html( stripslashes( $searchterm ) );
                        gdyby ( $searchterm  == true )
                        {
                            gdyby ($termnb == 1)
                            {
                                $linkquery .= ' AND (link_name like "%' . $searchterm . '%" ';
                                $termnb++;
                            }
                            jeszcze
                            {
                                $linkquery .= ' OR link_name like "%' . $searchterm . '%" ';
                            }

                            gdyby ($hidecategorynames == false)
                                $linkquery .= ' OR name like "%' . $searchterm . '%" ';
                            gdyby ($shownotes)
                                $linkquery .= ' OR link_notes like "%' . $searchterm . '%" ';
                            gdyby ($showdescription)
                                $linkquery .= ' OR link_description like "%' . $searchterm . '%" ';
                            gdyby ($showlargedescription)
                                $linkquery .= ' OR link_textfield like "%' . $searchterm . '%" ';
                        }
                    }
				}

				$linkquery .= ")";
			}
		}
		else
			$mode = "normal";

		$linkquery .= " ORDER by ";

		gdyby ($featuredfirst == true)
			$linkquery .= "link_featured DESC, ";

		gdyby ($order == "name")
			$linkquery .= " name " . $direction;
		elseif ($order == "id")
			$linkquery .= " t.term_id " . $direction;
		elseif ($order == "order")
			$linkquery .= " t.term_order " . $direction;
		elseif ($order == "catlist")
			$linkquery .= " FIELD(t.term_id," . $categorylist . ") ";

		gdyby ($linkorder == "name" || $linkorder == 'random')
			$linkquery .= ", l.link_name " . $linkdirection;
		elseif ($linkorder == "id")
			$linkquery .= ", l.link_id " . $linkdirection;
		elseif ($linkorder == "order")
			$linkquery .= ", l.link_order ". $linkdirection;
		elseif ($linkorder == "data")
			$linkquery .= ", l.link_updated ". $linkdirection;

		gdyby ($pagination && $mode != 'search')
		{
			$linkitemsforcount = $wpdb->get_results($linkquery);

			$numberoflinks = count($linkitemsforcount);

			$quantity = $linksperpage + 1;

            gdyby ( isset( $_POST['linkresultpage'] ) || isset( $_GET['linkresultpage'] ) ) {

                gdyby ( isset( $_POST['linkresultpage'] ) ) {
                    $pagenumber = $_POST['linkresultpage'];
                } elseif ( isset( $_GET['linkresultpage'] ) ) {
                    $pagenumber = $_GET['linkresultpage'];
                }

				$startingitem = ($pagenumber - 1) * $linksperpage;
				$linkquery .= " LIMIT " . $startingitem . ", " . $quantity;
			} jeszcze {
				$pagenumber = 1;
				$linkquery .= " LIMIT 0, " . $quantity;
			}
		}

		$linkitems = $wpdb->get_results($linkquery, ARRAY_A);

		gdyby ($debugmode)
		{
			$output .= "n<!-- Link Query: " . print_r($linkquery, TRUE) . "-->nn";
			$output .= "n<!-- Link Results: " . print_r($linkitems, TRUE) . "-->nn";
		}

		gdyby ($pagination)
		{
			gdyby ($linksperpage == 0 && $linksperpage == '')
				$linksperpage = 5;

			gdyby (count($linkitems) > $linksperpage)
			{
				array_pop($linkitems);
				$nextpage = true;
			}
			else
				$nextpage = false;

			gdyby( isset( $numberoflinks ) ) {
				$preroundpages = $numberoflinks / $linksperpage;
				$numberofpages = ceil( $preroundpages * 1 ) / 1;
			}
		}

		gdyby ($linkorder == 'random')
		{
			shuffle($linkitems);
		}

		gdyby ( $maxlinks != '' ) {
			gdyby ( is_numeric( $maxlinks ) ) {
				array_splice( $linkitems, $maxlinks );
			}
		}

        gdyby ($pagination && $mode != "search" && $paginationposition == 'BEFORE' )
        {
            $previouspagenumber = $pagenumber - 1;
            $nextpagenumber = $pagenumber + 1;
            $pageID = get_the_ID();

            $output .= $this->link_library_display_pagination( $previouspagenumber, $nextpagenumber, $numberofpages, $pagenumber, $showonecatonly, $showonecatmode, $AJAXcatid, $ustawienia, $pageID );
        }

        Echo "<!-- showonecatmode: " . $showonecatonly . ", AJAXnocatset: " . $AJAXnocatset . ", nocatonstartup: " . $nocatonstartup . "-->";

		// Display links
        if ( ( $linkitems && $showonecatonly && $AJAXnocatset && $nocatonstartup && !isset( $_GET['searchll'] ) ) || ( pusty( $linkitems ) && $nocatonstartup && pusty( $_GET['searchll'] ) ) ) {
                $output .= "<div id='linklist" . $ustawienia . "' class='linklist'>n";
                $output .= '</div>';
        } elseif ( $linkitems ) {
			$output .= "<div id='linklist" . $ustawienia . "' class='linklist'>n";

			gdyby ( $mode == 'search' ) {
				$output .= "<div class='resulttitle'>" . __('Search Results for', 'link-library') . " '" . stripslashes( $_GET['searchll'] ) . "'</div>";
			}

			$currentcategoryid = -1;

            $xpath = $this->relativePath( dirname( __FILE__ ), ABSPATH );

			dla każdego ( $linkitems as $linkitem ) {

				gdyby ($currentcategoryid != $linkitem['term_id'])
				{
					gdyby ($currentcategoryid != -1 && $showonecatonly && $_GET['searchll'] == "")
					{
						break;
					}
					gdyby ($currentcategoryid != -1)
					{
						// Close the last category
						if ($displayastable)
							$output .= "T</table>n";
						else
							$output .= "T</ul>n";

						gdyby ($catlistwrappers != '')
							$output .= "</div>";

			            gdyby ( $showlinksonclick ) {
							$output .= "</div>";
						}

						$output .= "</div>";

						$currentcategory = $currentcategory + 1;
					}

					$currentcategoryid = $linkitem['term_id'];
					$output .= "<div class='LinkLibraryCat LinkLibraryCat" . $currentcategoryid . "'>";
					$linkcount = 0;
                    $catlink = '';
                    $cattext = '';
                    $catenddiv = '';

					gdyby ($catlistwrappers == 1)
						$output .= "<div class="" . $beforecatlist1 . "">";
					else if ($catlistwrappers == 2)
					{
						$remainder = $currentcategory % $catlistwrappers;
						switch ($remainder) {

							case 0:
								$output .= "<div class="" . $beforecatlist2 . "">";
								break;

							case 1:
								$output .= "<div class="" . $beforecatlist1 . "">";
								break;
						}
					}
					else if ($catlistwrappers == 3)
					{
						$remainder = $currentcategory % $catlistwrappers;
						switch ($remainder) {

							case 0:
								$output .= "<div class="" . $beforecatlist3 . "">";
								break;

							case 2:
								$output .= "<div class="" . $beforecatlist2 . "">";
								break;

							case 1:
								$output .= "<div class="" . $beforecatlist1 . "">";
								break;
						}
					}

					// Display the category name
					if ($hidecategorynames == false || $hidecategorynames == "")
					{
                        $caturl = get_metadata( 'linkcategory', $linkitem['term_id'], 'linkcaturl', prawdziwe );

						gdyby ($catanchor)
							$cattext = '<div id="' . $linkitem['slug'] . '">';
						else
							$cattext = '';

						gdyby ($divorheader == false)
						{
							gdyby ($mode == "search")
								dla każdego ($searchterms as $searchterm)
								{
									$linkitem['name'] = $this->ll_highlight_phrase($linkitem['name'], $searchterm, '<span class="highlight_word">', '</przęsło>');
								}

							$catlink = '<div class="' . $catnameoutput . '">';

							gdyby ($catdescpos == "right" || $catdescpos == '') {
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '<a href="' . $this->addhttp( $caturl ) . '" ';

                                    gdyby ( !pusty( $linktarget ) )
                                        $catlink .= ' target="' . $linktarget . '"';

                                    $catlink .= '>';
                                }
                                $catlink .= $linkitem['name'];
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '</za>';
                                }
                            }

							gdyby ($showcategorydesclinks)
							{
								$catlink .= "<span class='linklistcatnamedesc'>";
								$linkitem['description'] = str_replace("[", "<", $linkitem['description']);
								$linkitem['description'] = str_replace("]", ">", $linkitem['description']);
								$catlink .= $linkitem['description'];
								$catlink .= '</przęsło>';
							}

							gdyby ($catdescpos == "left") {
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '<a href="' . $this->addhttp( $caturl ) . '" ';

                                    gdyby ( !pusty( $linktarget ) )
                                        $catlink .= ' target="' . $linktarget . '"';

                                    $catlink .= '>';
                                }
                                $catlink .= $linkitem['name'];
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '</za>';
                                }
                            }

                            gdyby ( $showlinksonclick ) {
                                $catlink .= '<span class="expandlinks" ID ="LinksInCat' . $linkitem['term_id'] . '">';
                                $catlink .= '<img src="' . plugins_url( 'icons/expand-32.png', __FILE__ ) . '" />';
                                $catlink .= '</przęsło>';
                            }

							$catlink .= "</div>";
						}
						else if ($divorheader == true)
						{
							gdyby ($mode == "search")
							dla każdego ($searchterms as $searchterm)
							{
								$linkitem['name'] = $this->ll_highlight_phrase($linkitem['name'], $searchterm, '<span class="highlight_word">', '</przęsło>');
							}

							$catlink = '<div class="'. $catnameoutput . '">';

							gdyby ($catdescpos == "right" || $catdescpos == '') {
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '<a href="' . $this->addhttp( $caturl ). '" ';

                                    gdyby ( !pusty( $linktarget ) )
                                        $catlink .= ' target="' . $linktarget . '"';

                                    $catlink .= '>';
                                }
                                $catlink .= $linkitem['name'];
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '</za>';
                                }
                            }


							gdyby ($showcategorydesclinks)
							{
								$catlink .= "<span class='linklistcatnamedesc'>";
								$linkitem['description'] = str_replace("[", "<", $linkitem['description']);
								$linkitem['description'] = str_replace("]", ">", $linkitem['description']);
								$catlink .= $linkitem['description'];
								$catlink .= '</przęsło>';
							}

							gdyby ($catdescpos == "left") {
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '<a href="' . $this->addhttp( $caturl ) . '" ';

                                    gdyby ( !pusty( $linktarget ) )
                                        $catlink .= ' target="' . $linktarget . '"';

                                    $catlink .= '>';
                                }
                                $catlink .= $linkitem['name'];
                                gdyby ( !pusty( $caturl ) ) {
                                    $catlink .= '</za>';
                                }
                            }

                            gdyby ( $showlinksonclick ) {
                                $catlink .= '<span class="expandlinks" ID ="LinksInCat' . $linkitem['term_id'] . '">';
                                $catlink .= '<img src="' . plugins_url( 'icons/expand-32.png', __FILE__ ) . '" />';
                                $catlink .= '</przęsło>';
                            }

							$catlink .= '</div>';
						}

						gdyby ($catanchor)
							$catenddiv = '</div>';
						else
							$catenddiv = '';
					}

                    $output .= $cattext . $catlink . $catenddiv;

                    gdyby ( $showlinksonclick ) {
                        $output .= '<div class="LinksInCat' . $currentcategoryid . ' LinksInCat">';
                    }

					gdyby ($displayastable == true)
					{
						$catstartlist = "nt<table class='linklisttable'>n";
						gdyby ($showcolumnheaders == true)
						{
							$catstartlist .= "<div class='linklisttableheaders'><tr>";

							gdyby ($linkheader != "")
								$catstartlist .= "<th><div class='linklistcolumnheader'>".$linkheader."</div></th>";

							gdyby ($descheader != "")
								$catstartlist .= "<th><div class='linklistcolumnheader'>".$descheader."</div></th>";

							gdyby ($notesheader != "")
								$catstartlist .= "<th><div class='linklistcolumnheader'>".$notesheader."</div></th>";

							$catstartlist .= "</tr></div>n";
						}
						else
							$catstartlist .= '';
					}
					else
						$catstartlist = "nt<ul>n";

					$output .= $catstartlist;
				}

				$between = "n";

				gdyby ($rssfeedinline == true)
					include_once(ABSPATH . WPINC . '/feed.php');

				gdyby ($showuserlinks == true || strpos($linkitem['link_description'], "LinkLibrary:AwaitingModeration:RemoveTextToApprove") == false)
				{
					$linkcount = $linkcount + 1;

					gdyby ($linkaddfrequency > 0)
						gdyby (($linkcount - 1) % $linkaddfrequency == 0)
							$output .= stripslashes($addbeforelink);

					gdyby (!isset($linkitem['recently_updated'])) $linkitem['recently_updated'] = false;
					$output .= stripslashes($beforeitem);
					gdyby ($showupdated && $linkitem['recently_updated'])
						$output .= get_option('links_recently_updated_prepend');

					$the_link = '#';
					gdyby (!pusty($linkitem['link_url']) )
						$the_link = esc_html($linkitem['link_url']);

					$the_second_link = '#';
					gdyby (!pusty($linkitem['link_second_url']) )
						$the_second_link = esc_html($linkitem['link_second_url']);

					$rel = $linkitem['link_rel'];
					gdyby ('' != $rel and !$nofollow and !$linkitem['link_no_follow'])
						$rel = ' rel="' . $rel . '"';
					else if ('' != $rel and ($nofollow or $linkitem['link_no_follow']))
						$rel = ' rel="' . $rel . ' nofollow"';
					else if ('' == $rel and ($nofollow or $linkitem['link_no_follow']))
						$rel = ' rel="nofollow"';

					gdyby ($use_html_tags) {
						$descnotes = $linkitem['link_notes'];
						$descnotes = str_replace("[", "<", $descnotes);
						$descnotes = str_replace("]", ">", $descnotes);
					}
					else
						$descnotes = esc_html($linkitem['link_notes'], ENT_QUOTES);

					gdyby ($use_html_tags) {
						$desc = $linkitem['link_description'];
						$desc = str_replace("[", "<", $desc);
						$desc = str_replace("]", ">", $desc);
					} jeszcze {
						$desc = esc_html($linkitem['link_description'], ENT_QUOTES);
					}

					$cleandesc = $desc;
					$cleanname = esc_html($linkitem['link_name'], ENT_QUOTES);

                    gdyby ( $use_html_tags ) {
                        $textfield = stripslashes( $linkitem['link_textfield'] );
                        $textfield = str_replace( '[', '<', $textfield );
						$textfield = str_replace( ']', '>', $textfield );
                    } jeszcze {
                        $textfield = stripslashes( $linkitem['link_textfield'] );
                    }


					gdyby ($mode == "search")
					{
						dla każdego ($searchterms as $searchterm)
						{
							$descnotes = $this->ll_highlight_phrase($descnotes, $searchterm, '<span class="highlight_word">', '</przęsło>');
							$desc = $this->ll_highlight_phrase($desc, $searchterm, '<span class="highlight_word">', '</przęsło>');
							$name = $this->ll_highlight_phrase($linkitem['link_name'], $searchterm, '<span class="highlight_word">', '</przęsło>');
							$textfield = $this->ll_highlight_phrase($textfield, $searchterm, '<span class="highlight_word">', '</przęsło>');
						}
				}
					else
						$name = $cleanname;

                    gdyby ( $linktitlecontent == 'linkname' ) {
                        $title = $cleanname;
                    } elseif ($linktitlecontent == 'linkdesc' ) {
                        $title = $cleandesc;
                    }

					gdyby ($showupdated) {
					   gdyby (substr($linkitem['wp.dev'],0,2) != '00') {
							$title .= ' ('.__('Last updated', 'link-library') . '  ' . date_i18n(get_option('links_updated_date_format'), strtotime( $linkitem['link_updated'] ) ) .')';
						}
					}

					gdyby (!pusty( $title ) )
						$title = ' title="' . $title . '"';

					$alt = ' alt="' . $cleanname . '"';

					$target = $linkitem['link_target'];
					gdyby ('' != $target)
						$target = ' target="' . $target . '"';
					jeszcze
					{
						$target = $linktarget;
						gdyby ('' != $target)
							$target = ' target="' . $target . '"';
					}

					gdyby ($dragndroporder == '') $dragndroporder = '1,2,3,4,5,6,7,8,9,10';
						$dragndroparray = explode(',', $dragndroporder);
						gdyby ($dragndroparray)
						{
							dla każdego ($dragndroparray as $arrayelements) {
								switch ($arrayelements) {
									case 1: 	//------------------ Image Output --------------------
                                        $imageoutput = '';
										gdyby ( (($linkitem['link_image'] != '' || $usethumbshotsforimages)) && ($show_images)) {
											$imageoutput .= stripslashes($beforeimage) . '<a href="';

                                            gdyby ( !$enablelinkpopup ) {
                                                gdyby ($sourceimage == 'primary' || $sourceimage == '')
                                                    $imageoutput .= $the_link;
                                                elseif ($sourceimage == 'secondary')
                                                    $imageoutput .= $the_second_link;
                                            } jeszcze {
                                                    $imageoutput .= home_url() . '/?link_library_popup_content=1&linkid=' . $linkitem['proper_link_id'] . '&settings=' . $ustawienia . '&height=' . ( pusty( $popupheight ) ? 300 : $popupheight ) . '&width=' . ( pusty( $popupwidth ) ? 400 : $popupwidth ) . '&xpath=' . $xpath;
                                                }

											$imageoutput .= '" ID ="link-' . $linkitem['proper_link_id'] . '" class="' . ( $enablelinkpopup ? 'thickbox' : 'track_this_link' ) . ' ' . ( $linkitem['link_featured'] ? 'featured' : '' ). '" ' . $rel . $title . $target. '>';

											gdyby ( $usethumbshotsforimages && ( !$uselocalimagesoverthumbshots || pusty( $uselocalimagesoverthumbshots ) || ( $uselocalimagesoverthumbshots && pusty( $linkitem['link_image'] ) ) ) ) {
												gdyby ( !pusty( $thumbshotscid ) )
													$imageoutput .= '<img src="http://free.pagepeeker.com/v2/thumbs.php?size=s&url='  . $the_link . '"';


											} else if ( !$usethumbshotsforimages || ( $usethumbshotsforimages && $uselocalimagesoverthumbshots && !pusty( $linkitem['link_image'] ) ) ) {
                                                gdyby ( strpos($linkitem['link_image'], 'http') !== false )
                                                    $imageoutput .= '<img src="http://free.pagepeeker.com/v2/thumbs.php?size=s&url='  . $the_link . '"';
                                                jeszcze // If it's a relative path
                                                    $imageoutput .= '<img src="http://free.pagepeeker.com/v2/thumbs.php?size=s&url='  . $the_link . '"';
                                            }

                                            gdyby ( !$usethumbshotsforimages || ($usethumbshotsforimages && !pusty( $thumbshotscid ) ) || ( $usethumbshotsforimages && $uselocalimagesoverthumbshots && !pusty( $linkitem['link_image'] ) ) ) {

                                                $imageoutput .= $alt . $title;

                                                gdyby ($imageclass != '')
                                                    $imageoutput .= ' class="' . $imageclass . '" ';

                                                $imageoutput .= "/>";

                                                $imageoutput .= '</za>' . stripslashes($afterimage);
                                            }
                                        }

										gdyby ( ( !pusty( $imageoutput ) || ( $usethumbshotsforimages && !pusty( $thumbshotscid ) ) )  && ($show_images) ) {
											$output .= $imageoutput;
											break;
										}
										elseif ($show_images == false || $shownameifnoimage == false)
											break;

									case 2: 	//------------------ Name Output --------------------
										gdyby (($showname == true) || ($show_images == true && $linkitem['link_image'] == '' && $arrayelements == 1))
										{
											$output .= stripslashes($beforelink);

											gdyby (($sourcename == 'primary' && $the_link != '#') || ($sourcename == 'secondary' && $the_second_link != '#'))
											{
												$output .= '<a href="';

												gdyby ( !$enablelinkpopup ) {
                                                    gdyby ( $sourcename == 'primary' || $sourcename == '' )
                                                        $output .= $the_link;
                                                    elseif ( $sourcename == 'secondary' )
    													$output .= $the_second_link;
                                                } jeszcze {
                                                    $output .= home_url() . '/?link_library_popup_content=1&linkid=' . $linkitem['proper_link_id'] . '&settings=' . $ustawienia . '&height=' . ( pusty( $popupheight ) ? 300 : $popupheight ) . '&width=' . ( pusty( $popupwidth ) ? 400 : $popupwidth ) . '&xpath=' . $xpath;
                                                }

												$output .= '" ID ="link-' . $linkitem['proper_link_id'] . '" class="' . ( $enablelinkpopup ? 'thickbox' : 'track_this_link' ) . ' ' . ( $linkitem['link_featured'] ? ' featured' : '' ). '" ' . $rel . $title . $target. '>';
											}

											$output .= $name;

											gdyby (($sourcename == 'primary' && $the_link != '#') || ($sourcename == 'secondary' && $the_second_link != '#'))
												$output .= '</za>';

											gdyby (($showadmineditlinks) && current_user_can("manage_links")) {
												$output .= $between . '<a href="' . add_query_arg( array( 'Action' => 'edit', 'link_id' => $linkitem['proper_link_id'] ), admin_url( 'link.php' ) ) . '">(' . __('Edit', 'link-library') . ')</za>';
											}

											gdyby ($showupdated && $linkitem['recently_updated']) {
												$output .= get_option('links_recently_updated_append');
											}

											$output .= stripslashes($afterlink);
										}

										break;

									case 3: 	//------------------ Date Output --------------------

										$formatteddate = date_i18n(get_option('links_updated_date_format'), $linkitem['link_date']);

										gdyby ($showdate)
											$output .= $between . stripslashes($beforedate) . $formatteddate . stripslashes($afterdate);

										break;

									case 4: 	//------------------ Description Output --------------------

										gdyby ($showdescription)
											$output .= $between . stripslashes($beforedesc) . $desc . stripslashes($afterdesc);

										break;

									case 5: 	//------------------ Notes Output --------------------

										gdyby ($shownotes) {
											$output .= $between . stripslashes($beforenote) . $descnotes . stripslashes($afternote);
										}

										break;

									case 6: 	//------------------ RSS Icons Output --------------------

										gdyby ($show_rss || $show_rss_icon || $rsspreview)
											$output .= stripslashes($beforerss) . '<div class="rsselements">';

										gdyby ($show_rss && ($linkitem['link_rss'] != '')) {
											$output .= $between . '<a class="rss" href="' . $linkitem['link_rss'] . '">RSS</za>';
										}
										gdyby ($show_rss_icon && ($linkitem['link_rss'] != '')) {
											$output .= $between . '<a class="rssicon" href="' . $linkitem['link_rss'] . '"><img src="' . plugins_url( 'icons/feed-icon-14x14.png', __FILE__ ) . '" /></za>';
										}
										gdyby ($rsspreview && $linkitem['link_rss'] != '')
										{
											$output .= $between . '<a href="' . home_url() . '/?link_library_rss_preview=1&keepThis=true&linkid=' . $linkitem['proper_link_id'] . '&previewcount=' . $rsspreviewcount . 'height=' . (($rsspreviewwidth == "") ?  900 : $rsspreviewwidth) . '&width=' . (($rsspreviewheight == "") ? 700 : $rsspreviewheight) . '&xpath=' . urlencode( $xpath ) . '" title="' . __('Preview of RSS feed for', 'link-library') . ' ' . $cleanname . '" class="thickbox"><img src="' . plugins_url( 'icons/preview-16x16.png', __FILE__ ) . '" /></za>';
										}

										gdyby ($show_rss || $show_rss_icon || $rsspreview)
											$output .= '</div>' . stripslashes($afterrss);

										gdyby ($rssfeedinline && $linkitem['link_rss'])
										{
											$rss = fetch_feed($linkitem['link_rss']);
											gdyby (!is_wp_error( $rss ) ) :
												$maxitems = $rss->get_item_quantity($rssfeedinlinecount);

												$rss_items = $rss->get_items(0, $maxitems);

												gdyby ($rss_items)
												{
													$output .= '<div id="ll_rss_results">';

													dla każdego($rss_items as $item)
													{
														$output .= '<div class="chunk" style="padding:0 5px 5px;">';
														$output .= '<div class="rsstitle"><a target="feedwindow" href="' . $item->get_permalink() . '">' . $item->get_title() . '</za> - ' . $item->get_date('j F Y | sol:i a') . '</div>';
														gdyby ($rssfeedinlinecontent) $output .= '<div class="rsscontent">' . $item->get_description() . '</div>';
														$output .= '</div>';
														$output .= '<br />';													}

													$output .= '</div>';
												}

											endif;
										}
										break;
									case 7: 	//------------------ Web Link Output --------------------

										gdyby ($displayweblink != 'false') {
											$output .= $between . stripslashes($beforeweblink) . "<a href='";

											gdyby ($sourceweblink == "primary" || $sourceweblink == "")
												$output .= $the_link;
											elseif ($sourceweblink == "secondary")
												$output .= $the_second_link;

											$output .= "' id='link-" . $linkitem['proper_link_id'] . "' class='track_this_link' " . $target . ">";

											gdyby ($displayweblink == 'address')
											{
												gdyby (($sourceweblink == "primary" || $sourceweblink == '') && $the_link != '')
													$output .= $the_link;
												elseif ($sourceweblink == "secondary" && $the_second_link != '')
													$output .= $the_second_link;
											}
											elseif ($displayweblink == 'label' && $weblinklabel != '')
												$output .= $weblinklabel;

											$output .= "</za>" . stripslashes($afterweblink);
										}

										break;
									case 8: 	//------------------ Telephone Output --------------------

										gdyby ($showtelephone != 'false')
										{
											$output .= $between . stripslashes($beforetelephone);

											gdyby ($showtelephone != 'plain')
											{
												$output .= "<a href='";

												gdyby (($sourcetelephone == "primary" || $sourcetelephone == '') && $the_link != '')
													$output .= $the_link;
												elseif ($sourcetelephone == "secondary" && $the_second_link != '')
													$output .= $the_second_link;

												$output .= "' id='link-" . $linkitem['proper_link_id'] . "' class='track_this_link' >";
											}

											gdyby ($showtelephone == 'link' || $showtelephone == "plain")
												$output .= $linkitem['link_telephone'];
											elseif ($showtelephone == 'label')
												$output .= $telephonelabel;

											gdyby ($showtelephone != 'plain')
												$output .= "</za>";

											$output .= stripslashes($aftertelephone);
										}
										break;
									case 9: 	//------------------ E-mail Output --------------------

										gdyby ($showemail != 'false')
										{
											$output .= $between . stripslashes($beforeemail);

											gdyby ($showemail != 'plain')
											{
												$output .= "<a href='";

												gdyby ($showemail == 'mailto' || $showemail == 'mailtolabel')
													$output .= "mailto:" . $linkitem['link_email'];
												elseif ($showemail == 'command' || $showemail == 'commandlabel')
												{
													$newcommand = str_replace("#email", $linkitem['link_email'], $emailcommand);
													$cleanlinkname = str_replace(" ", "%20", $linkitem['link_name']);
													$newcommand = str_replace("#firma", $cleanlinkname, $newcommand);
													$output .= $newcommand;
												}

												$output .= "'>";
											}

											gdyby ($showemail == 'plain' || $showemail == 'mailto' || $showemail == 'command')
												$output .= $linkitem['link_email'];
											elseif ($showemail == 'mailtolabel' || $showemail == 'commandlabel')
												$output .= $emaillabel;

											gdyby ($showemail != 'plain')
												$output .= "</za>";

											$output .= stripslashes($afteremail);
										}

										break;
									case 10: 	//------------------ Link Hits Output --------------------

										gdyby ($showlinkhits)
										{
											$output .= $between . stripslashes($beforelinkhits);

											$output .= $linkitem['link_visits'];

											$output .= stripslashes($afterlinkhits);
										}

										break;

									case 11: 	//------------------ Link Rating Output --------------------

										gdyby ($showrating)
										{
											$output .= $between . stripslashes($beforelinkrating);

											$output .= $linkitem['link_rating'];

											$output .= stripslashes($afterlinkrating);
										}

										break;

									case 12: 	//------------------ Link Large Description Output --------------------

										gdyby ($showlargedescription)
										{
											$output .= $between . stripslashes($beforelargedescription);

											$output .= $textfield;

											$output .= stripslashes($afterlargedescription);
										}

										break;
									}
								}
							}

					$output .= stripslashes($afteritem) . "n";

					gdyby ($linkaddfrequency > 0)
						gdyby ($linkcount % $linkaddfrequency == 0)
							$output .= stripslashes($addafterlink);

				}

			} // end while

			// Close the last category
			if ($displayastable)
				$output .= "T</table>n";
			else
				$output .= "T</ul>n";

			gdyby ($catlistwrappers != '')
				$output .= "</div>";

            gdyby ( $showlinksonclick ) {
                $output .= "</div>";
            }

			$output .= "</div>";

			gdyby ( $pagination && $mode != "search" && ( $paginationposition == 'AFTER' || pusty( $pagination ) ) ) {
                $previouspagenumber = $pagenumber - 1;
                $nextpagenumber = $pagenumber + 1;
                $pageID = get_the_ID();

                $output .= $this->link_library_display_pagination( $previouspagenumber, $nextpagenumber, $numberofpages, $pagenumber, $showonecatonly, $showonecatmode, $AJAXcatid, $ustawienia, $pageID );
			}

			$xpath = $this->relativePath( dirname( __FILE__ ), ABSPATH );
            $nonce = wp_create_nonce( 'll_tracker' );

			$output .= "<script type='text/javascript'>n";
			$output .= "jQuery(document).ready(funkcjonować()n";
			$output .= "{n";
			$output .= "jQuery('a.track_this_link').click(funkcjonować() {n";
			$output .= "linkid = this.id;n";
			$output .= "linkid = linkid.substring(5);";
			$output .= "path = '" . $xpath . "';";
			$output .= "jQuery.ajax( {" .
                       "    type: 'POST'," .
                       "    url: '" . admin_url( 'admin-ajax.php' ) . "', " .
                       "    data: { action: 'link_library_tracker', " .
                       "            _ajax_nonce: '" . $nonce . "', " .
                       "            id:linkid, xpath:path } " .
                       "    });n";
			$output .= "return true;n";
			$output .= "});n";
            $output .= "jQuery('#linklist" . $ustawienia . " .expandlinks').click(funkcjonować() {n";
            $output .= "target = '.' + jQuery(this).attr('id');n";
            $output .= "gdyby ( jQuery( target ).is(':visible') ) {n";
            $output .= "jQuery(target).slideUp();n";
            $output .= "jQuery(this).children('img').attr('src', '" . plugins_url( 'icons/expand-32.png', __FILE__ ) . "');n";
            $output .= "} jeszcze {n";
            $output .= "jQuery(target).slideDown();n";
            $output .= "jQuery(this).children('img').attr('src', '" . plugins_url( 'icons/collapse-32.png', __FILE__ ) . "');n";
            $output .= "}n";
            $output .= "});n";
			$output .= "});n";
			$output .= "</script>";
			unset( $xpath );
			$currentcategory = $currentcategory + 1;

			$output .= "</div>n";

		} else if ( isset( $_GET['searchll'] ) ) {
            $output .= "<div id='linklist" . $ustawienia . "' class='linklist'>n";
            $output .= __('No links found matching your search criteria', 'link-library') . ".n";
            $output .= "</div>";
        } jeszcze {
			$output .= "<div id='linklist" . $ustawienia . "' class='linklist'>n";
			$output .= __('No links found', 'link-library') . ".n";
			$output .= "</div>";
		}

		$output .= "n<!-- End of Link Library Output -->nn";

		return $output;
	}

	function PrivateLinkLibrarySearchForm($searchlabel = 'Search', $searchresultsaddress = '') {

		gdyby ($searchlabel == "") $searchlabel = __('Search', 'link-library');
		$output = "<form method='get' id='llsearch'";
                gdyby ($searchresultsaddress != '')
                    $output .= " action='" . $searchresultsaddress . "'";
                $output .= ">n";
		$output .= "<div>n";
		$output .= "<input type='text' onfocus="this.value=''" value='" . $searchlabel . "...' name='searchll' id='searchll' />";
		$output .= "<input type='hidden' value='" .  get_the_ID() . "' name='page_id' id='page_id' />";
		$output .= "<input type='submit' value='" . $searchlabel . "' />";
		$output .= "</div>n";
		$output .= "</form>nn";

		return $output;
	}

	function PrivateLinkLibraryAddLinkForm($selectedcategorylist = '', $excludedcategorylist = '', $addnewlinkmsg = '', $linknamelabel = '', $linkaddrlabel = '',
											$linkrsslabel = '', $linkcatlabel = '', $linkdesclabel = '', $linknoteslabel = '', $addlinkbtnlabel = '', $hide_if_empty = true,
											$showaddlinkrss = false, $showaddlinkdesc = false, $showaddlinkcat = false, $showaddlinknotes = false,
											$addlinkreqlogin = false, $debugmode = false, $addlinkcustomcat = false, $linkcustomcatlabel = '',
											$linkcustomcatlistentry = 'User-submitted category (define below)', $showaddlinkreciprocal = false,
											$linkreciprocallabel = '', $showaddlinksecondurl = false, $linksecondurllabel = '',
											$showaddlinktelephone = false, $linktelephonelabel = '', $showaddlinkemail = false, $linkemaillabel = '',
											$showcaptcha = false, $captureddata = '', $linksubmitternamelabel = '', $showlinksubmittername = false,
											$linksubmitteremaillabel = '', $showaddlinksubmitteremail = false, $linksubmittercommentlabel = '',
											$showlinksubmittercomment = false, $linksubmissionthankyouurl = '', $addlinkcatlistoverride = '',
											$showcustomcaptcha = false, $customcaptchaquestion = '', $linklargedesclabel = 'Large Description', $showuserlargedescription = false, $usetextareaforusersubmitnotes = false, $settings = 1, $code = 'link-library-addlink') {

		global $wpdb;
                $output = "";

                $settingsname = 'LinkLibraryPP' . $ustawienia;
                $options = get_option($settingsname);

                gdyby ($code == 'link-library-addlink' || $code == 'link-library-addlinkcustommsg')
                {
                    gdyby (isset($_GET['addlinkmessage']))
                        {
                            gdyby ($_GET['addlinkmessage'] == 1)
                                $output = "<div class='llmessage'>" . __('Confirm code not given', 'link-library') . ".</div>";
                            elseif ($_GET['addlinkmessage'] == 2)
                                $output = "<div class='llmessage'>" . __('Captcha code is wrong', 'link-library') . ".</div>";
                            elseif ($_GET['addlinkmessage'] == 3)
                                $output = "<div class='llmessage'>" . __('Captcha code is only valid for 5 minutes', 'link-library') . ".</div>";
                            elseif ($_GET['addlinkmessage'] == 4)
                                $output = "<div class='llmessage'>" . __('No captcha cookie given. Make sure cookies are enabled', 'link-library') . ".</div>";
                            elseif ($_GET['addlinkmessage'] == 5)
                                $output = "<div class='llmessage'>" . __('Captcha answer was not provided.', 'link-library') . "</div>";
                            elseif ($_GET['addlinkmessage'] == 6)
                                $output = "<div class='llmessage'>" . __('Captcha answer is incorrect', 'link-library') . ".</div>";
                            elseif ($_GET['addlinkmessage'] == 7)
                                $output = "<div class='llmessage'>" . __('User Category was not provided correctly. Link insertion failed.', 'link-library') . "</div>";
                            elseif ($_GET['addlinkmessage'] == 8)
                            {
                                $output .= "<div class='llmessage'>" . $options['newlinkmsg'];
                                gdyby ($options['showuserlinks'] == false)
                                        $output .= " " . $options['moderatemsg'];
                                $output .= "</div>";
                            }
                            elseif ($_GET['addlinkmessage'] == 9)
                                $output = "<div class='llmessage'>" . __('Error: Link does not have an address.', 'link-library') . "</div>";
                            elseif ($_GET['addlinkmessage'] == 10)
                                $output = "<div class='llmessage'>" . __('Error: Link already exists.', 'link-library') . "</div>";
                        }
                }

		gdyby ($code == 'link-library-addlink' && (($addlinkreqlogin && current_user_can("read")) || !$addlinkreqlogin))
		{
			$output .= "<form method='post' id='lladdlink' action=''>n";

            $output .= wp_nonce_field('LL_ADDLINK_FORM', '_wpnonce', prawdziwe, fałszywy);
            $output .= "<input type='hidden' name='thankyouurl' value='" . $linksubmissionthankyouurl . "' />";
            $output .= '<input type="hidden" name="link_library_user_link_submission" value="1" />';
            global $wp_query;
            $thePostID = $wp_query->post->ID;
            $output .= "<input type='hidden' name='pageid' value='" . $thePostID . "' />";
            $output .= "<input type='hidden' name='settingsid' value='" . $ustawienia . "' />";

            $xpath = $this->relativePath( dirname( __FILE__ ), ABSPATH );
            $output .= "<input type='hidden' name='xpath' value='" . esc_attr( $xpath ) . "' />";
            unset( $xpath );

			$output .= "<div class='lladdlink'>n";

			gdyby ($addnewlinkmsg == "") $addnewlinkmsg = __('Add new link', 'link-library');
			$output .= "<div id='lladdlinktitle'>" . $addnewlinkmsg . "</div>n";

			$output .= "<table>n";

			gdyby ($linknamelabel == "") $linknamelabel = __('Link name', 'link-library');
			$output .= "<tr><th>" . $linknamelabel . "</th><td><input type='text' name='link_name' id='link_name' value='" . ( isset( $_GET['addlinkname'] ) ? esc_html(stripslashes($_GET['addlinkname']), '1') : '') . "' /></td></tr>n";

			gdyby ($linkaddrlabel == "") $linkaddrlabel = __('Link address', 'link-library');
			$output .= "<tr><th>" . $linkaddrlabel . "</th><td><input type='text' name='link_url' id='link_url' value='" . ( isset( $_GET['addlinkurl'] ) ? esc_html(stripslashes($_GET['addlinkurl']), '1') : '' ) . "' /></td></tr>n";

			gdyby ($showaddlinkrss)
			{
				gdyby ($linkrsslabel == "") $linkrsslabel = __('Link RSS', 'link-library');
				$output .= "<tr><th>" . $linkrsslabel . "</th><td><input type='text' name='link_rss' id='link_rss' value='" . ( isset( $_GET['addlinkrss'] ) ? esc_html(stripslashes($_GET['addlinkrss']), '1') : '' ) . "' /></td></tr>n";
			}

			$linkcatquery = "SELECT distinct t.name, t.term_id, t.slug as category_nicename, tt.description as category_description ";
			$linkcatquery .= "FROM " . $this->db_prefix() . "terms t ";
			$linkcatquery .= "LEFT JOIN " . $this->db_prefix() . "term_taxonomy tt ON (t.term_id = tt.term_id) ";
			$linkcatquery .= "LEFT JOIN " . $this->db_prefix() . "term_relationships tr ON (tt.term_taxonomy_id = tr.term_taxonomy_id) ";

			$linkcatquery .= "WHERE tt.taxonomy = 'link_category' ";

			gdyby ($selectedcategorylist != "")
			{
				$linkcatquery .= " AND t.term_id in (" . $selectedcategorylist. ")";
			}

			gdyby ($excludedcategorylist != "")
			{
				$linkcatquery .= " AND t.term_id not in (" . $excludedcategorylist . ")";
			}

			$linkcatquery .= " ORDER by t.name ASC";

			$linkcats = $wpdb->get_results($linkcatquery);

			gdyby ($debugmode)
			{
				$output .= "n<!-- Category query for add link form:" . print_r($linkcatquery, TRUE) . "-->nn";
				$output .= "n<!-- Results of Category query for add link form:" . print_r($linkcats, TRUE) . "-->n";
			}

			gdyby ($linkcats)
			{
				gdyby ($showaddlinkcat)
				{
					gdyby ($linkcatlabel == "") $linkcatlabel = __('Link category', 'link-library');

					$output .= "<tr><th>" . $linkcatlabel . "</th><td><SELECT name='link_category' id='link_category'>";

					gdyby ($linkcustomcatlistentry == "") $linkcustomcatlistentry = __('User-submitted category (define below)', 'link-library');

					dla każdego ($linkcats as $linkcat)
					{
						$output .= "<OPTION VALUE='" . $linkcat->term_id . "' ";
						gdyby ( isset($_GET['addlinkcat']) && $_GET['addlinkcat'] == $linkcat->term_id)
							$output .= "selected";
						$output .= ">" . $linkcat->name;
					}

					gdyby ($addlinkcustomcat)
						$output .= "<OPTION VALUE='new'>" . stripslashes($linkcustomcatlistentry) . "n";

					$output .= "</SELECT></td></tr>n";
				}
				jeszcze
				{
					$output .= "<input type='hidden' name='link_category' id='link_category' value='" . $linkcats[0]->term_id . "'>";
				}

				gdyby ($addlinkcustomcat)
					$output .= "<tr><th>" .  $linkcustomcatlabel . "</th><td><input type='text' name='link_user_category' id='link_user_category' value='" . ( isset( $_GET['addlinkusercat']) ? esc_html(stripslashes($_GET['addlinkusercat']), '1') : '') . "' /></td></tr>n";
			}

			gdyby ($showaddlinkdesc)
			{
				gdyby ($linkdesclabel == "") $linkdesclabel = __('Link description', 'link-library');
				$output .= "<tr><th>" . $linkdesclabel . "</th><td><input type='text' name='link_description' id='link_description' value='" . ( isset( $_GET['addlinkdesc'] ) ? esc_html(stripslashes($_GET['addlinkdesc']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showuserlargedescription)
			{
				gdyby ($linklargedesclabel == "") $linklargedesclabel = __('Large description', 'link-library');
				$output .= "<tr><th style='vertical-align: top'>" . $linklargedesclabel . "</th><td><textarea name='link_textfield' id='link_textfield' cols='66'>" . ( isset( $_GET['addlinktextfield'] ) ? esc_html(stripslashes($_GET['addlinktextfield']), '1') : '' ) . "</textarea></td></tr>n";
			}

			gdyby ($showaddlinknotes)
			{
				gdyby ($linknoteslabel == "") $linknoteslabel = __('Link notes', 'link-library');
				$output .= "<tr><th>" . $linknoteslabel . "</th><td>";

				gdyby ($usetextareaforusersubmitnotes == false || $usetextareaforusersubmitnotes == '')
					$output .= "<input type='text' name='link_notes' id='link_notes' value='";
				elseif ($usetextareaforusersubmitnotes == true)
					$output .= "<textarea name='link_notes' id='link_notes'>";

				$output .= ( isset( $_GET['addlinknotes'] ) ? esc_html(stripslashes($_GET['addlinknotes']), '1') : '' );

				gdyby ($usetextareaforusersubmitnotes == false || $usetextareaforusersubmitnotes == '')
					$output .= "' />";
				elseif ($usetextareaforusersubmitnotes == true)
					$output .= "</textarea>";

				$output .= "</td></tr>n";
			}

			gdyby ($showaddlinkreciprocal)
			{
				gdyby ($linkreciprocallabel == "") $linkreciprocallabel = __('Reciprocal Link', 'link-library');
				$output .= "<tr><th>" . $linkreciprocallabel . "</th><td><input type='text' name='ll_reciprocal' id='ll_reciprocal' value='" . ( isset( $_GET['addlinkreciprocal'] ) ? esc_html(stripslashes($_GET['addlinkreciprocal']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showaddlinksecondurl)
			{
				gdyby ($linksecondurllabel == "") $linksecondurllabel = __('Secondary Address', 'link-library');
				$output .= "<tr><th>" . $linksecondurllabel . "</th><td><input type='text' name='ll_secondwebaddr' id='ll_secondwebaddr' value='" . ( isset( $_GET['addlinksecondurl'] ) ? esc_html(stripslashes($_GET['addlinksecondurl']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showaddlinktelephone)
			{
				gdyby ($linktelephonelabel == "") $linktelephonelabel = __('Telephone', 'link-library');
				$output .= "<tr><th>" . $linktelephonelabel . "</th><td><input type='text' name='ll_telephone' id='ll_telephone' value='" . ( isset( $_GET['addlinktelephone'] ) ? esc_html(stripslashes($_GET['addlinktelephone']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showaddlinkemail)
			{
				gdyby ($linkemaillabel == "") $linkemaillabel = __('E-mail', 'link-library');
				$output .= "<tr><th>" . $linkemaillabel . "</th><td><input type='text' name='ll_email' id='ll_email' value='" . ( isset( $_GET['addlinkemail'] ) ? esc_html(stripslashes($_GET['addlinkemail']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showlinksubmittername)
			{
				gdyby ($linksubmitternamelabel == "") $linksubmitternamelabel = __('Submitter Name', 'link-library');
				$output .= "<tr><th>" . $linksubmitternamelabel . "</th><td><input type='text' name='ll_submittername' id='ll_submittername' value='" . ( isset( $_GET['addlinksubmitname'] ) ? esc_html(stripslashes($_GET['addlinksubmitname']), '1') : '' ) . "' /></td></tr>n";
			}

			gdyby ($showaddlinksubmitteremail)
			{
				gdyby ($linksubmitteremaillabel == "") $linksubmitteremaillabel = __('Submitter E-mail', 'link-library');
				$output .= "<tr><th>" . $linksubmitteremaillabel . "</th><td><input type='text' name='ll_submitteremail' id='ll_submitteremail' value='" . ( isset( $_GET['addlinksubmitemail'] ) ? esc_html(stripslashes($_GET['addlinksubmitemail']), '1') : '' ). "' /></td></tr>n";
			}

			gdyby ($showlinksubmittercomment)
			{
				gdyby ($linksubmittercommentlabel == "") $linksubmittercommentlabel = __('Submitter Comment', 'link-library');
				$output .= "<tr><th style='vertical-align: top;'>" . $linksubmittercommentlabel . "</th><td><textarea name='ll_submittercomment' id='ll_submittercomment' cols='38''>" . ( isset( $_GET['addlinksubmitcomment'] ) ? esc_html(stripslashes($_GET['addlinksubmitcomment']), '1') : '' ) . "</textarea></td></tr>n";
			}

			gdyby ($showcaptcha)
			{
				$output .= "<tr><td></td><td><span id='captchaimage'><img src='" . plugins_url( 'captcha/easycaptcha.php', __FILE__ ) . "' /></przęsło></td></tr>n";
				$output .= "<tr><th>" . __('Enter code from above image', 'link-library') . "</th><td><input type='text' name='confirm_code' /></td></tr>n";
			}

			gdyby ($showcustomcaptcha)
			{
				gdyby ($customcaptchaquestion == "") $customcaptchaquestion = __('Is boiling water hot or cold?', 'link-library');
				$output .= "<tr><th style='vertical-align: top;'>" . $customcaptchaquestion . "</th><td><input type='text' name='ll_customcaptchaanswer' id='ll_customcaptchaanswer' value='" . (isset( $_GET['ll_customcaptchaanswer'] ) ? esc_html(stripslashes($_GET['ll_customcaptchaanswer']), '1') : '' ) . "' /></td></tr>n";
			}

			$output .= "</table>n";

			gdyby ($addlinkbtnlabel == "") $addlinkbtnlabel = __('Add link', 'link-library');
			$output .= '<span style="border:0;" class="LLUserLinkSubmit"><input type="submit" name="submit" value="' . $addlinkbtnlabel . '" /></przęsło>';

			$output .= "</div>n";
			$output .= "</form>nn";
		}

		return $output;
	}

	function relativePath($from, $do, $ps = DIRECTORY_SEPARATOR) {
		$arFrom = explode($ps, rtrim($from, $ps));
		$arTo = explode($ps, rtrim($do, $ps));
		podczas(count($arFrom) && count($arTo) && ($arFrom[0] == $arTo[0])) {
			array_shift($arFrom);
			array_shift($arTo);
		}
		$return = str_pad("", count($arFrom) * 3, '..'.$ps).implode($ps, $arTo);

		// Don't disclose anything about the path is it's not needed, to znaczy. is the standard
		if( $return === '../../../' ) {
			$return = '';
        }

		return $return;
	}

	/*
	 * function LinkLibraryCategories()
	 *
	 * added by Yannick Lefebvre
	 *
	 * Output a list of all links categories, listed by category, using the
	 * settings in $wpdb->linkcategories and output it as table
	 *
	 * Parameters:
	 *   order (default 'name')  - Sort link categories by 'name' or 'id' or 'category-list'. When set to 'AdminSettings', will use parameters set in Admin Settings Panel.
	 *   hide_if_empty (default true)  - Supress listing empty link categories
	 *   table_witdh (default 100) - Width of table, percentage
	 *   num_columns (default 1) - Number of columns in table
	 *   catanchor (default true) - Determines if links to generated anchors should be created
	 *   flatlist (default 'table') - When set to true, displays an unordered list instead of a table
	 *   categorylist (default null) - Specifies a comma-separate list of the only categories that should be displayed
	 *   excludecategorylist (default null) - Specifies a comma-separate list of the categories that should not be displayed
	 *   showcategorydescheaders (default null) - Show category descriptions in category list
	 *   showonecatonly (default false) - Enable AJAX mode showing only one category at a time
	 *   ustawienia (default NULL) - Settings Set ID, only used when showonecatonly is true
	 *   loadingicon (default NULL) - Path to icon to display when only show one category at a time
	 *   catlistdescpos (default 'right') - Position of category description relative to name
	 *   debugmode (default false)
	 *   pagination (default false)
	 *   linksperpage (default 5)
	 *   showcatlinkcount (default false)
	 *   showonecatmode (default 'AJAX')
	 *   cattargetaddress
	 *   rewritepage
	 *   showinvisible
	 */

	function LinkLibraryCategories($order = 'name', $hide_if_empty = true, $table_width = 100, $num_columns = 1, $catanchor = true,
								   $flatlist = 'table', $categorylist = '', $excludecategorylist = '', $showcategorydescheaders = false,
								   $showonecatonly = false, $settings = '', $loadingicon = '/icons/Ajax-loader.gif', $catlistdescpos = 'right', $debugmode = false,
								   $pagination = false, $linksperpage = 5, $showcatlinkcount = false, $showonecatmode = 'AJAX', $cattargetaddress = '',
								   $rewritepage = '', $showinvisible = false, $showuserlinks = true, $showcatonsearchresults = false) {

		gdyby (strpos($order, 'AdminSettings') != false)
		{
			$settingsetid = substr($order, 13);
			$settingsetname = "LinkLibraryPP" . $settingsetid;
			$options = get_option($settingsetname);

			$genoptions = get_option('LinkLibraryGeneral');

			return $this->PrivateLinkLibraryCategories($options['order'], $options['hide_if_empty'], $options['table_width'], $options['num_columns'], $options['catanchor'], $options['flatlist'],
									 $options['categorylist'], $options['excludecategorylist'], $options['showcategorydescheaders'], $options['showonecatonly'], '',
									 $options['loadingicon'], $options['catlistdescpos'], $genoptions['debugmode'], $options['pagination'], $options['linksperpage'],
									 $options['showcatlinkcount'], $options['showonecatmode'], $options['cattargetaddress'], $options['rewritepage'], $options['showinvisible'], $options['showuserlinks'], $options['showcatonsearchresults']);
		}
		else
			return $this->PrivateLinkLibraryCategories($order, $hide_if_empty, $table_width, $num_columns, $catanchor, $flatlist, $categorylist, $excludecategorylist, $showcategorydescheaders,
			$showonecatonly, $ustawienia, $loadingicon, $catlistdescpos, $debugmode, $pagination, $linksperpage, $showcatlinkcount, $showonecatmode, $cattargetaddress,
			$rewritepage, $showinvisible, $showuserlinks, $showcatonsearchresults);

	}

	/*
	 * function LinkLibrary()
	 *
	 * added by Yannick Lefebvre
	 *
	 * Output a list of all links, listed by category, using the
	 * settings in $wpdb->linkcategories and output it as a nested
	 * HTML unordered list. Can also insert anchors for categories
	 *
	 * Parameters:
	 *   order (default 'name')  - Sort link categories by 'name' or 'id'. When set to 'AdminSettings', will use parameters set in Admin Settings Panel.
	 *   hide_if_empty (default true)  - Supress listing empty link categories
	 *   catanchor (default true) - Adds name anchors to categorie links to be able to link directly to categories
	 *   showdescription (default false) - Displays link descriptions. Added for 2.1 since link categories no longer have this setting
	 *   shownotes (default false) - Shows notes in addition to description for links (useful since notes field is larger than description)
	 *   showrating (default false) - Displays link ratings. Added for 2.1 since link categories no longer have this setting
	 *   showupdated (default false) - Displays link updated date. Added for 2.1 since link categories no longer have this setting
	 *   categorylist (default null) - Only show links inside of selected categories. Enter category numbers in a string separated by commas
	 *   showimages (default false) - Displays link images. Added for 2.1 since link categories no longer have this setting
	 *   show_image_and_name (default false) - Show both image and name instead of only one or the other
	 *   use_html_tags (default false) - Use HTML tags for formatting instead of just displaying them
	 *   show_rss (default false) - Display RSS URI if available in link description
	 *   beforenote (default <br />) - Code to print out between the description and notes
	 *   nofollow (default false) - Adds nofollow tag to outgoing links
	 *   excludecategorylist (default null) - Specifies a comma-separate list of the categories that should not be displayed
	 *   afternote (default null) - Code / Text to be displayed after note
	 *   beforeitem (default null) - Code / Text to be displayed before item
	 *   afteritem (default null) - Code / Text to be displayed after item
	 *   beforedesc (default null) - Code / Text to be displayed before description
	 *   afterdesc (default null) - Code / Text to be displayed after description
	 *   displayastable (default false) - Display lists of links as a table (when true) or as an unordered list (when false)
	 *   beforelink (default null) - Code / Text to be displayed before link
	 *   afterlink (default null) - Code / Text to be displayed after link
	 *   showcolumnheaders (default false) - Show column headers if rendering in table mode
	 *   linkheader (default null) - Text to be shown in link column when displaying as table
	 *   descheader (default null) - Text to be shown in desc column when displaying as table
	 *   notesheader (default null) - Text to be shown in notes column when displaying as table
	 *   catlistwrappers (default 1) - Number of different sets of alternating elements to be placed before and after each link category section
	 *   beforecatlist1 (default null) - First element to be placed before a link category section
	 *   beforecatlist2 (default null) - Second element to be placed before a link category section
	 *   beforecatlist3 (default null) - Third element to be placed before a link category section
	 *   divorheader (default false) - Output div before and after cat name if false, output heading tag if true
	 *   catnameoutput (default linklistcatname) - Name of div class or heading to output
	 *   showrssicon (default false) - Output RSS URI if available and assign to standard RSS icon
	 *   linkaddfrequency (default 0) - Frequency at which extra before and after output should be placed around links
	 *   addbeforelink (default null) - Addition output to be placed before link
	 *   addafterlink (default null) - Addition output to be placed after link
	 *   linktarget (default null) - Specifies the link target window
	 *   showcategorydescheaders (default false) - Display link category description when printing category list
	 *   showcategorydesclinks (default false) - Display link category description when printing links
	 *   showadmineditlinks (default false) - Display edit links in output if logged in as administrator
	 *   showonecatonly (default false) - Only show one category at a time
	 *   AJAXcatid (default null) - Category ID for AJAX sub-queries
	 *   defaultsinglecat (default null) - ID of first category to be shown in single category mode
	 *   rsspreview (default false) - Add preview links after RSS feed addresses
	 *   rssfeedpreviewcount(default 3) - Number of RSS feed items to show in preview
	 *   rssfeedinline (default false) - Shows latest feed items inline with link list
	 *   rssfeedinlinecontent (default false) - Shows latest feed items contents inline with link list
	 *   rssfeedinlinecount (default 1) - Number of RSS feed items to show inline
	 *   beforerss (default null) - String to output before RSS block
	 *   afterrss (default null) - String to output after RSS block
	 *   rsscachedir (default null) - Path for SimplePie library to store RSS cache information - Obsolete
	 *   direction (default ASC) - Sort direction for Link Categories
	 *   linkdirection (default ASC) - Sort direction for Links within each category
	 *   linkorder (default 'name') - Sort order for Links within each category
	 *   pagination (default false) - Limit number of links displayed per page
	 *   linksperpage (default 5) - Number of links to be shown per page in Pagination Mode
	 *   hidecategorynames (default false) - Show category names in Link Library list
	 *   ustawienia (default NULL) - Setting Set ID
	 *   showinvisible (default false) - Shows links that are set to be invisible
	 *   showdate (default false) - Determines is link update date should be displayed
	 *   beforedate (default null) - Code/Text to be displayed before link date
	 *   afterdate (default null) - Code/Text to be displated after link date
	 *   catdescpos (default 'right') - Position of link category description output
	 *   showuserlinks (default false) - Specifies if user submitted links should be shown immediately after submission
	 *   rsspreviewwidth (default 900) - Specifies the width of the box in which RSS previews are displayed
	 *   rsspreviewheight (default 700) - Specifies the height of the box in which RSS previews are displayed
	 *   beforeimage (default null) - Code/Text to be displayed before link image
	 *   afterimage (default null) - Code/Text to be displayed after link image
	 *   imagepos (default beforename) - Position of image relative to link name
	 *   imageclass (default null) - Class that will be assigned to link images
	 *   debugmode (default false) - Adds debug information as comments in the WordPress output to facilitate remote debugging
	 *   usethumbshotsforimages (default false) - Uses thumbshots.org to generate images for links
	 *   showonecatmode (default AJAX) - Method used to load different categories when only showing one at a time
	 *   dragndroporder (default 1,2,3,4,5,6,7,8,9,10) - Order to display link sub-sections
	 *   displayweblink (default 'false')
	 *   sourceweblink (default 'primary')
	 *   showtelephone (default 'false')
	 *   sourcetelephone (default 'primary')
	 *   showemail (default 'false')
	 *   showlinkhits (default false)
	 *   beforeweblink (default null)
	 *   afterweblink (default null)
	 *   weblinklabel (default null)
	 *   beforetelephone (default null)
	 *   aftertelephone (default null)
	 *   telephonelabel (default null)
	 *   beforeemail (default null)
	 *   afteremail (default null)
	 *   emaillabel (default null)
	 *   beforelinkhits (default null)
	 *   afterlinkhits (default null)
	 *   emailcommand (default null)
	 */

	function LinkLibrary($order = 'name', $hide_if_empty = true, $catanchor = true,
									$showdescription = false, $shownotes = false, $showrating = false,
									$showupdated = false, $categorylist = '', $show_images = false,
									$show_image_and_name = false, $use_html_tags = false,
									$show_rss = false, $beforenote = '<br />', $nofollow = false, $excludecategorylist = '',
									$afternote = '', $beforeitem = '<w>', $afteritem = '</w>', $beforedesc = '', $afterdesc = '',
									$displayastable = false, $beforelink = '', $afterlink = '', $showcolumnheaders = false,
									$linkheader = '', $descheader = '', $notesheader = '', $catlistwrappers = 1, $beforecatlist1 = '',
									$beforecatlist2 = '', $beforecatlist3 = '', $divorheader = false, $catnameoutput = 'linklistcatname',
									$show_rss_icon = false, $linkaddfrequency = 0, $addbeforelink = '', $addafterlink = '', $linktarget = '',
									$showcategorydesclinks = false, $showadmineditlinks = true, $showonecatonly = false, $AJAXcatid = '',
									$defaultsinglecat = '', $rsspreview = false, $rsspreviewcount = 3, $rssfeedinline = false, $rssfeedinlinecontent = false,
									$rssfeedinlinecount = 1, $beforerss = '', $afterrss = '', $rsscachedir = NULL, $direction = 'ASC',
									$linkdirection = 'ASC', $linkorder = 'name', $pagination = false, $linksperpage = 5, $hidecategorynames = false,
									$settings = '', $showinvisible = false, $showdate = false, $beforedate = '', $afterdate = '', $catdescpos = 'right',
									$showuserlinks = false, $rsspreviewwidth = 900, $rsspreviewheight = 700, $beforeimage = '', $afterimage = '', $imagepos = 'beforename',
									$imageclass = '', $AJAXpageid = 1, $debugmode = false, $usethumbshotsforimages = false, $showonecatmode = 'AJAX',
									$dragndroporder = '1,2,3,4,5,6,7,8,9,10', $showname = true, $displayweblink = 'false', $sourceweblink = 'primary', $showtelephone = 'false',
									$sourcetelephone = 'primary', $showemail = 'false', $showlinkhits = false, $beforeweblink = '', $afterweblink = '', $weblinklabel = '',
									$beforetelephone = '', $aftertelephone = '', $telephonelabel = '', $beforeemail = '', $afteremail = '', $emaillabel = '', $beforelinkhits = '',
									$afterlinkhits = '', $emailcommand = '', $sourceimage = 'primary', $sourcename = 'primary', $thumbshotscid = '',
									$maxlinks = '', $beforelinkrating = '', $afterlinkrating = '', $showlargedescription = false, $beforelargedescription = '',
									$afterlargedescription = '', $featuredfirst = false, $shownameifnoimage = false, $enablelinkpopup = false, $popupwidth = 300, $popupheight = 400, $nocatonstartup = false, $linktitlecontent = 'linkname', $paginationposition = 'AFTER', $uselocalimagesoverthumbshots = false, $showlinksonclick = false ) {

		gdyby (strpos($order, 'AdminSettings') !== false)
		{
			$settingsetid = substr($order, 13);
			$settingsetname = "LinkLibraryPP" . $settingsetid;
			$options = get_option($settingsetname);

			$genoptions = get_option('LinkLibraryGeneral');

			return $this->PrivateLinkLibrary($options['order'], $options['hide_if_empty'], $options['catanchor'], $options['showdescription'], $options['shownotes'],
									  $options['showrating'], $options['showupdated'], $options['categorylist'], $options['show_images'],
									  fałszywy, $options['use_html_tags'], $options['show_rss'], $options['beforenote'],
									  $options['nofollow'], $options['excludecategorylist'], $options['afternote'], $options['beforeitem'],
									  $options['afteritem'], $options['beforedesc'], $options['afterdesc'], $options['displayastable'],
									  $options['beforelink'], $options['afterlink'], $options['showcolumnheaders'], $options['linkheader'],
									  $options['descheader'], $options['notesheader'], $options['catlistwrappers'], $options['beforecatlist1'],
									  $options['beforecatlist2'], $options['beforecatlist3'], $options['divorheader'], $options['catnameoutput'],
									  $options['show_rss_icon'], $options['linkaddfrequency'], $options['addbeforelink'], $options['addafterlink'],
									  $options['linktarget'], $options['showcategorydesclinks'], $options['showadmineditlinks'], $options['showonecatonly'],
									  $AJAXcatid, $options['defaultsinglecat'], $options['rsspreview'], $options['rsspreviewcount'], $options['rssfeedinline'],
									  $options['rssfeedinlinecontent'], $options['rssfeedinlinecount'], $options['beforerss'], $options['afterrss'],
									  NULL, $options['direction'], $options['linkdirection'], $options['linkorder'],
									  $options['pagination'], $options['linksperpage'], $options['hidecategorynames'], $settingsetid, $options['showinvisible'],
									  $options['showdate'], $options['beforedate'], $options['afterdate'], $options['catdescpos'], $options['showuserlinks'],
									  $options['rsspreviewwidth'], $options['rsspreviewheight'], $options['beforeimage'], $options['afterimage'], $options['imagepos'],
									  $options['imageclass'], $AJAXpageid, $genoptions['debugmode'], $options['usethumbshotsforimages'], 'AJAX', $options['dragndroporder'],
									  $options['showname'], $options['displayweblink'], $options['sourceweblink'], $options['showtelephone'], $options['sourcetelephone'],
									  $options['showemail'], $options['showlinkhits'], $options['beforeweblink'], $options['afterweblink'], $options['weblinklabel'],
									  $options['beforetelephone'], $options['aftertelephone'], $options['telephonelabel'], $options['beforeemail'], $options['afteremail'],
									  $options['emaillabel'], $options['beforelinkhits'], $options['afterlinkhits'], $options['emailcommand'], $options['sourceimage'],
									  $options['sourcename'], $genoptions['thumbshotscid'], $options['maxlinks'], $options['beforelinkrating'],
									  $options['afterlinkrating'], $options['showlargedescription'], $options['beforelargedescription'],
									  $options['afterlargedescription'], $options['featuredfirst'], $options['shownameifnoimage'], $options['enable_link_popup'],
                                      $options['popup_width'], $options['popup_height'], $options['nocatonstartup'], $options['linktitlecontent'], $options['paginationposition'], $options['uselocalimagesoverthumbshots'], $options['showlinksonclick'] );
		}
		else
			return $this->PrivateLinkLibrary($order, $hide_if_empty, $catanchor, $showdescription, $shownotes, $showrating,
									$showupdated, $categorylist, $show_images, fałszywy, $use_html_tags,
									$show_rss, $beforenote, $nofollow, $excludecategorylist, $afternote, $beforeitem, $afteritem,
									$beforedesc, $afterdesc, $displayastable, $beforelink, $afterlink, $showcolumnheaders,
									$linkheader, $descheader, $notesheader, $catlistwrappers, $beforecatlist1,
									$beforecatlist2, $beforecatlist3, $divorheader, $catnameoutput, $show_rss_icon,
									$linkaddfrequency, $addbeforelink, $addafterlink, $linktarget, $showcategorydesclinks, $showadmineditlinks,
									$showonecatonly, '', $defaultsinglecat, $rsspreview, $rsspreviewcount, $rssfeedinline, $rssfeedinlinecontent, $rssfeedinlinecount,
									$beforerss, $afterrss, NULL, $direction, $linkdirection, $linkorder,
									$pagination, $linksperpage, $hidecategorynames, $ustawienia, $showinvisible, $showdate, $beforedate, $afterdate, $catdescpos,
									$showuserlinks, $rsspreviewwidth, $rsspreviewheight, $beforeimage, $afterimage, $imagepos, $imageclass, '', $debugmode,
									$usethumbshotsforimages, $showonecatmode, $dragndroporder, $showname, $displayweblink, $sourceweblink, $showtelephone,
									$sourcetelephone, $showemail, $showlinkhits, $beforeweblink, $afterweblink, $weblinklabel, $beforetelephone, $aftertelephone,
									$telephonelabel, $beforeemail, $afteremail, $emaillabel, $beforelinkhits, $afterlinkhits, $emailcommand, $sourceimage, $sourcename,
									$thumbshotscid, $maxlinks, $beforelinkrating, $afterlinkrating, $showlargedescription, $beforelargedescription,
									$afterlargedescription, $featuredfirst, $shownameifnoimage, $enablelinkpopup, $popupwidth, $popupheight, $nocatonstartup, $linktitlecontent, $paginationposition, $uselocalimagesoverthumbshots, $showlinksonclick );
	}

	/********************************************** Function to Process 





 shortcode *********************************************/

	function link_library_cats_func($atts) {
		$categorylistoverride = '';
		$excludecategoryoverride = '';
		$settings = '';

		extract(shortcode_atts(array(
			'categorylistoverride' => '',
			'excludecategoryoverride' => '',
			'settings' => ''
		), $atts));

		gdyby ($settings == '')
		{
			$settings = 1;
			$options = get_option('LinkLibraryPP1');
		}
		jeszcze
		{
			$settingsname = 'LinkLibraryPP' . $ustawienia;
			$options = get_option($settingsname);
		}

		gdyby ($categorylistoverride != '')
			$selectedcategorylist = $categorylistoverride;
		else
			$selectedcategorylist = $options['categorylist'];

		gdyby ($excludecategoryoverride != '')
			$excludedcategorylist = $excludecategoryoverride;
		else
			$excludedcategorylist = $options['excludecategorylist'];

		$genoptions = get_option('LinkLibraryGeneral');

		return $this->PrivateLinkLibraryCategories($options['order'], $options['hide_if_empty'], $options['table_width'], $options['num_columns'], $options['catanchor'], $options['flatlist'],
									 $selectedcategorylist, $excludedcategorylist, $options['showcategorydescheaders'], $options['showonecatonly'], $ustawienia,
									 $options['loadingicon'], $options['catlistdescpos'], $genoptions['debugmode'], $options['pagination'], $options['linksperpage'],
									 $options['showcatlinkcount'], $options['showonecatmode'], $options['cattargetaddress'], $options['rewritepage'],
									 $options['showinvisible'], $options['showuserlinks'], $options['showcatonsearchresults']);
	}

	/********************************************** Function to Process 
shortcode *********************************************/ function link_library_search_func($atts) { $settings = ''; extract(shortcode_atts(array( 'settings' => '' ), $atts)); gdyby ($settings == '') $options = get_option('LinkLibraryPP1'); jeszcze { $settingsname = 'LinkLibraryPP' . $ustawienia; $options = get_option($settingsname); } return $this->PrivateLinkLibrarySearchForm($options['searchlabel'], $options['searchresultsaddress']); } /********************************************** Function to Process [link-library-add-link] shortcode *********************************************/ function link_library_insert_link( $linkdata, $wp_error = false, $addlinknoaddress = false) { global $wpdb; $link_name = ''; $link_url = ''; $defaults = array( 'link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 ); $linkdata = wp_parse_args( $linkdata, $defaults ); $linkdata = sanitize_bookmark( $linkdata, 'db' ); extract( stripslashes_deep( $linkdata ), EXTR_SKIP ); $update = false; gdyby ( !pusty( $link_id ) ) $update = true; gdyby ( trim( $link_name ) == '' ) { gdyby ( trim( $link_url ) != '' ) { $link_name = $link_url; } jeszcze { powrót 0; } } gdyby ($addlinknoaddress == false) { gdyby ( trim( $link_url ) == '' ) powrót 0; } gdyby ( pusty( $link_rating ) ) $link_rating = 0; gdyby ( pusty( $link_image ) ) $link_image = ''; gdyby ( pusty( $link_target ) ) $link_target = ''; gdyby ( pusty( $link_visible ) ) $link_visible = 'Y'; gdyby ( pusty( $link_owner ) ) $link_owner = get_current_user_id(); gdyby ( pusty( $link_notes ) ) $link_notes = ''; gdyby ( pusty( $link_description ) ) $link_description = ''; gdyby ( pusty( $link_rss ) ) $link_rss = ''; gdyby ( pusty( $link_rel ) ) $link_rel = ''; // Make sure we set a valid category if ( ! isset( $link_category ) || 0 == count( $link_category ) || !is_array( $link_category ) ) { $link_category = array( get_option( 'default_link_category' ) ); } gdyby ( $update ) { gdyby ( false === $wpdb->update( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_rating', 'link_rel', 'link_notes', 'link_rss'), compact('link_id') ) ) { gdyby ( $wp_error ) return new WP_Error( 'db_update_error', __( 'Could not update link in the database', 'link-library' ), $wpdb->last_error ); else return 0; } } jeszcze { gdyby ( false === $wpdb->insert( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss') ) ) { gdyby ( $wp_error ) return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database', 'link-library' ), $wpdb->last_error ); else return 0; } $link_id = (int) $wpdb->insert_id; } wp_set_link_cats( $link_id, $link_category ); gdyby ( $update ) do_action( 'edit_link', $link_id ); else do_action( 'add_link', $link_id ); clean_bookmark_cache( $link_id ); return $link_id; } function link_library_addlink_func($atts, $content, $code) { $settings = ''; $categorylistoverride = ''; $excludecategoryoverride = ''; extract(shortcode_atts(array( 'settings' => '', 'categorylistoverride' => '', 'excludecategoryoverride' => '' ), $atts)); gdyby ($settings == '') $settings = 1; $settingsname = 'LinkLibraryPP' . $ustawienia; $options = get_option($settingsname); $genoptions = get_option('LinkLibraryGeneral'); gdyby ($categorylistoverride != '') $selectedcategorylist = $categorylistoverride; elseif ($options['addlinkcatlistoverride'] != '') $selectedcategorylist = $options['addlinkcatlistoverride']; else $selectedcategorylist = $options['categorylist']; gdyby ($excludecategoryoverride != '') $excludedcategorylist = $excludecategoryoverride; else $excludedcategorylist = $options['excludecategorylist']; powrót ( isset( $outputmessage ) ? $outputmessage : '') . $this->PrivateLinkLibraryAddLinkForm($selectedcategorylist, $excludedcategorylist, $options['addnewlinkmsg'], $options['linknamelabel'], $options['linkaddrlabel'], $options['linkrsslabel'], $options['linkcatlabel'], $options['linkdesclabel'], $options['linknoteslabel'], $options['addlinkbtnlabel'], $options['hide_if_empty'], $options['showaddlinkrss'], $options['showaddlinkdesc'], $options['showaddlinkcat'], $options['showaddlinknotes'], $options['addlinkreqlogin'], $genoptions['debugmode'], $options['addlinkcustomcat'], $options['linkcustomcatlabel'], $options['linkcustomcatlistentry'], $options['showaddlinkreciprocal'], $options['linkreciprocallabel'], $options['showaddlinksecondurl'], $options['linksecondurllabel'], $options['showaddlinktelephone'], $options['linktelephonelabel'], $options['showaddlinkemail'], $options['linkemaillabel'], $options['showcaptcha'], (isset($captureddata) ? $captureddata : null), $options['linksubmitternamelabel'], $options['showlinksubmittername'], $options['linksubmitteremaillabel'], $options['showaddlinksubmitteremail'], $options['linksubmittercommentlabel'], $options['showlinksubmittercomment'], $genoptions['linksubmissionthankyouurl'], $options['addlinkcatlistoverride'], $options['showcustomcaptcha'], $options['customcaptchaquestion'], $options['linklargedesclabel'], $options['showuserlargedescription'], $options['usetextareaforusersubmitnotes'], $ustawienia, $code); } /********************************************** Function to Process shortcode *********************************************/ function link_library_func($atts) { $settings = ''; $notesoverride = ''; $descoverride = ''; $rssoverride = ''; $categorylistoverride = ''; $excludecategoryoverride = ''; $tableoverride = ''; extract(shortcode_atts(array( 'categorylistoverride' => '', 'excludecategoryoverride' => '', 'notesoverride' => '', 'descoverride' => '', 'rssoverride' => '', 'tableoverride' => '', 'settings' => '' ), $atts)); gdyby ($settings == '') { $settings = 1; $options = get_option('LinkLibraryPP1'); } jeszcze { $settingsname = 'LinkLibraryPP' . $ustawienia; $options = get_option($settingsname); } gdyby ($notesoverride != '') $selectedshownotes = $notesoverride; else $selectedshownotes = $options['shownotes']; gdyby ($descoverride != '') $selectedshowdescription = $descoverride; else $selectedshowdescription = $options['showdescription']; gdyby ($rssoverride != '') $selectedshowrss = $rssoverride; else $selectedshowrss = $options['show_rss']; gdyby ($categorylistoverride != '') $selectedcategorylist = $categorylistoverride; else $selectedcategorylist = $options['categorylist']; gdyby ($excludecategoryoverride != '') $excludedcategorylist = $excludecategoryoverride; else $excludedcategorylist = $options['excludecategorylist']; gdyby ($tableoverride != '') $overridedisplayastable = $tableoverride; else $overridedisplayastable = $options['displayastable']; $genoptions = get_option('LinkLibraryGeneral'); $linklibraryoutput = ""; gdyby (floatval($genoptions['schemaversion']) < "4.6") { $this->ll_install(); $genoptions = get_option('LinkLibraryGeneral'); gdyby ($settings == '') $options = get_option('LinkLibraryPP1'); jeszcze { $settingsname = 'LinkLibraryPP' . $ustawienia; $options = get_option($settingsname); } } gdyby ($genoptions['debugmode'] == true) $linklibraryoutput .= "n<!-- Library Settings Info:" . print_r($options, TRUE) . "-->n"; $linklibraryoutput .= $this->PrivateLinkLibrary( $options['order'], $options['hide_if_empty'], $options['catanchor'], $selectedshowdescription, $selectedshownotes, $options['showrating'], $options['showupdated'], $selectedcategorylist, $options['show_images'], fałszywy, $options['use_html_tags'], $options['show_rss'], $options['beforenote'], $options['nofollow'], $excludedcategorylist, $options['afternote'], $options['beforeitem'], $options['afteritem'], $options['beforedesc'], $options['afterdesc'], $overridedisplayastable, $options['beforelink'], $options['afterlink'], $options['showcolumnheaders'], $options['linkheader'], $options['descheader'], $options['notesheader'], $options['catlistwrappers'], $options['beforecatlist1'], $options['beforecatlist2'], $options['beforecatlist3'], $options['divorheader'], $options['catnameoutput'], $options['show_rss_icon'], $options['linkaddfrequency'], $options['addbeforelink'], $options['addafterlink'], $options['linktarget'], $options['showcategorydesclinks'], $options['showadmineditlinks'], $options['showonecatonly'], '', $options['defaultsinglecat'], $options['rsspreview'], $options['rsspreviewcount'], $options['rssfeedinline'], $options['rssfeedinlinecontent'], $options['rssfeedinlinecount'], $options['beforerss'], $options['afterrss'], NULL, $options['direction'], $options['linkdirection'], $options['linkorder'], $options['pagination'], $options['linksperpage'], $options['hidecategorynames'], $ustawienia, $options['showinvisible'], $options['showdate'], $options['beforedate'], $options['afterdate'], $options['catdescpos'], $options['showuserlinks'], $options['rsspreviewwidth'], $options['rsspreviewheight'], $options['beforeimage'], $options['afterimage'], $options['imagepos'], $options['imageclass'], '', $genoptions['debugmode'], $options['usethumbshotsforimages'], $options['showonecatmode'], $options['dragndroporder'], $options['showname'], $options['displayweblink'], $options['sourceweblink'], $options['showtelephone'], $options['sourcetelephone'], $options['showemail'], $options['showlinkhits'], $options['beforeweblink'], $options['afterweblink'], $options['weblinklabel'], $options['beforetelephone'], $options['aftertelephone'], $options['telephonelabel'], $options['beforeemail'], $options['afteremail'], $options['emaillabel'], $options['beforelinkhits'], $options['afterlinkhits'], $options['emailcommand'], $options['sourceimage'], $options['sourcename'], $genoptions['thumbshotscid'], $options['maxlinks'], $options['beforelinkrating'], $options['afterlinkrating'], $options['showlargedescription'], $options['beforelargedescription'], $options['afterlargedescription'], $options['featuredfirst'], $options['shownameifnoimage'], ( isset($options['enable_link_popup']) ? $options['enable_link_popup'] : fałszywy ), ( isset($options['popup_width']) ? $options['popup_width'] : 300 ), ( isset( $options['popup_height'] ) ? $options['popup_height'] : 400 ), $options['nocatonstartup'], $options['linktitlecontent'], ( isset( $options['paginationposition'] ) ? $options['paginationposition'] : 'AFTER' ), $options['uselocalimagesoverthumbshots'], $options['showlinksonclick'] ); return $linklibraryoutput; } function conditionally_add_scripts_and_styles($posts){ gdyby (pusty($posts)) return $posts; $load_jquery = false; $load_thickbox = false; $load_style = false; global $testvar; $genoptions = get_option('LinkLibraryGeneral'); gdyby (is_admin()) { $load_jquery = false; $load_thickbox = false; $load_style = false; } jeszcze { dla każdego ($posts as $post) { $continuesearch = true; $searchpos = 0; $settingsetids = array(); podczas ($continuesearch) { $linklibrarypos = stripos($post->post_content, 'link-library ', $searchpos); gdyby ($linklibrarypos == false) { $linklibrarypos = stripos($post->post_content, 'link-library]', $searchpos); gdyby ($linklibrarypos == false) gdyby (stripos($post->post_content, 'link-library-cats') || stripos($post->post_content, 'link-library-addlink')) $load_style = true; } $continuesearch = $linklibrarypos; gdyby ($continuesearch) { $load_style = true; $load_jquery = true; $shortcodeend = stripos($post->post_content, ']', $linklibrarypos); gdyby ($shortcodeend) $searchpos = $shortcodeend; else $searchpos = $linklibrarypos + 1; gdyby ($shortcodeend) { $settingconfigpos = stripos($post->post_content, 'settings=', $linklibrarypos); gdyby ($settingconfigpos && $settingconfigpos < $shortcodeend) { $settingset = substr($post->post_content, $settingconfigpos + 9, $shortcodeend - $settingconfigpos - 9); $settingsetids[] = $settingset; } else if (count($settingsetids) == 0) { $settingsetids[] = 1; } } } } } gdyby ($settingsetids) { dla każdego ($settingsetids as $settingsetid) { $settingsname = 'LinkLibraryPP' . $settingsetid; $options = get_option($settingsname); gdyby ( $options['showonecatonly'] ) { $load_jquery = true; } gdyby ( $options['rsspreview'] || ( isset( $options['enable_link_popup'] ) && $options['enable_link_popup'] ) ) { $load_thickbox = true; } gdyby ($options['publishrssfeed'] == true) { global $rss_settings; $rss_settings = $settingsetid; } } } gdyby ($genoptions['includescriptcss'] != '') { $pagelist = explode (',', $genoptions['includescriptcss']); $loadscripts = false; dla każdego($pagelist as $pageid) { gdyby ( ( $pageid == 'front' && is_front_page() ) || ( $pageid == 'category' && is_category() ) || ( $pageid == 'all') || ( is_page( $pageid ) ) ) { $load_jquery = true; $load_thickbox = true; $load_style = true; } } } } global $llstylesheet; gdyby ( $load_style ) { $llstylesheet = true; } jeszcze { $llstylesheet = false; } gdyby ( $load_jquery ) { wp_enqueue_script( 'jquery' ); } gdyby ( $load_thickbox ) { wp_enqueue_script( 'thickbox' ); wp_enqueue_style ( 'thickbox' ); } return $posts; } function ll_template_redirect( $template ) { gdyby ( !pusty( $_POST['link_library_user_link_submission'] ) ) { require_once plugin_dir_path( __FILE__ ) . 'usersubmission.php'; link_library_process_user_submission( $this ); return ''; } else if ( !pusty( $_GET['link_library_rss_feed'] ) ) { require_once plugin_dir_path( __FILE__ ) . 'rssfeed.php'; link_library_generate_rss_feed(); return ''; } else if ( !pusty( $_GET['link_library_popup_content'] ) ) { require_once plugin_dir_path( __FILE__ ) . 'linkpopup.php'; link_library_popup_content( $this ); return ''; } else if ( !pusty( $_GET['link_library_rss_preview'] ) ) { require_once plugin_dir_path( __FILE__ ) . 'rsspreview.php'; link_library_generate_rss_preview( $this ); return ''; } jeszcze { return $template; } } function link_library_ajax_tracker() { require_once plugin_dir_path( __FILE__ ) . 'tracker.php'; link_library_process_ajax_tracker( $this ); } function link_library_ajax_update() { require_once plugin_dir_path( __FILE__ ) . 'link-library-ajax.php'; link_library_render_ajax( $this ); } function link_library_generate_image() { global $my_link_library_plugin_admin; gdyby ( pusty( $my_link_library_plugin_admin ) ) { require plugin_dir_path( __FILE__ ) . 'link-library-admin.php'; $my_link_library_plugin_admin = new link_library_plugin_admin(); } require plugin_dir_path( __FILE__ ) . 'link-library-image-generator.php'; link_library_ajax_image_generator( $my_link_library_plugin_admin ); } } global $my_link_library_plugin; $my_link_library_plugin = new link_library_plugin(); ?>

 

WordPress resetowania hasła na wielu poprawek

aby rozwiązać problem z niewłaściwych adresów URL

http://www.site2.com zapomniałem hasła do linków

http://www.site1.com/wp-login.php?action = lostpassword
i nie
http://www.site2.com/wp-login.php?action = lostpassword

poprawka jest:

zmienić na większości linii network_site_url -> Strona URL
wp-includes / ogólnego template.php

funkcja wp_lostpassword_url( $przekierowanie = „” ) {
	        $arg = Tablica( 'Action' => 'Lostpassword' );
	        gdyby ( !pusty($przeadresować) ) {
	                $args['przekierować do'] = $ Przekierowanie;
	        }

	        $lostpassword_url = add_query_arg( $args, network_site_url('Wp-login.php', 'Zaloguj Się') );
	        powrót apply_filters( 'Lostpassword_url', $lostpassword_url, $przeadresować );
}

powinno być

funkcja wp_lostpassword_url( $przekierowanie = „” ) {
	        $arg = Tablica( 'Action' => 'Lostpassword' );
	        gdyby ( !pusty($przeadresować) ) {
	                $args['przekierować do'] = $ Przekierowanie;
	        }

	        $lostpassword_url = add_query_arg( $args, Strona URL('Wp-login.php', 'Zaloguj Się') );
	        powrót apply_filters( 'Lostpassword_url', $lostpassword_url, $przeadresować );
}

Również WordPress generuje nieprawidłowy adres e-mail w wp-login.php

$message = __(„Ktoś zażądał, aby zresetować hasło jest za rachunek:') . "rnrn";
	$wiadomość. = network_home_url( '/' ) . "rnrn";
	$wiadomość. = sprintf(__('Nazwa Użytkownika: %s'), $login użytkownika) . "rnrn";
	$wiadomość. = __(„Jeśli to była pomyłka, zignoruj ​​tę wiadomość, a nic się nie stanie.”) . "rnrn";
	$wiadomość. = __(„Aby zresetować hasło, odwiedzić następujący adres:') . "rnrn";
	$wiadomość. = '<' . network_site_url("wp-login.php?action = rp&$ key = klucz&Zaloguj =" . rawurlencode($login użytkownika), 'Zaloguj Się') . ">rn";

powinno być

$message = __(„Ktoś zażądał, aby zresetować hasło jest za rachunek:') . "rnrn";
	$wiadomość. = home_url( '/' ) . "rnrn";
	$wiadomość. = sprintf(__('Nazwa Użytkownika: %s'), $login użytkownika) . "rnrn";
	$wiadomość. = __(„Jeśli to była pomyłka, zignoruj ​​tę wiadomość, a nic się nie stanie.”) . "rnrn";
	$wiadomość. = __(„Aby zresetować hasło, odwiedzić następujący adres:') . "rnrn";
	$wiadomość. = '<' . Strona URL("wp-login.php?action = rp&$ key = klucz&Zaloguj =" . rawurlencode($użytkownik_

 

<Formularz name ="lostpasswordform" ID ="lostpasswordform" action ="<?php echo esc_url( network_site_url( „Wp-login.php?action = lostpassword”, 'Login_post' ) ); ?>" Sposób ="stanowisko">

powinno być

<Formularz name ="lostpasswordform" ID ="lostpasswordform" action ="<?php echo esc_url( Strona URL( „Wp-login.php?action = lostpassword”, 'Login_post' ) ); ?>" Sposób ="stanowisko">

 

$login_header_url = network_home_url();

powinno być

$login_header_url = home_url();

 

wp_die( __("Wiadomość e-mail nie może zostać wysłany.) . "<br />n" . __('Możliwa przyczyna: Twój komputer może wyłączyć pocztę() funkcjonować.') );

powinno być

wp_die( __("Wiadomość e-mail nie może zostać wysłany.) . "<br />n" . __('Możliwa przyczyna: Twój komputer może wyłączyć pocztę() funkcjonować, lub włączyć wtyczkę WP-mail SMTP i skonfigurować go.) );

 

$Nazwa bloga = ['Current_site']->Nazwa strony;

powinno być

$Nazwa bloga = home_url( '/' );

 

 

Przyspieszanie WordPress o Synology

Po wyjęciu z pudełka, WordPress działa na Synology jest bardzo powolne (Przeszukaj forum Synology.com lub Google, jeśli mi nie wierzysz). Ten artykuł wyjaśnia, w jaki sposób zoptymalizować Synology i swoją stronę WordPress for speed.

Zrzeczenie się

Niżej są szczypie I zostały wdrożone z sukcesem. Nie wiem kompletny zakres ich ważności; po prostu wydaje się przynieść zauważalne korzyści niezwykle pozytywny wydajności do mojego Synology. Oprócz tych zmian nie działa zgodnie z oczekiwaniami na Synology, są one ryzykowne. Przed dokonaniem jakichkolwiek zmian, tworzenie kopii zapasowych danych i konfiguracja Synology przy Synology okrywać się najgorsze. Poprzez wdrożenie którykolwiek z poniższych sugestii, jesteś przejściem na własne ryzyko, bez oczekiwania odpowiedzialności i czy wsparcia ze mną. I tylko wziąć kredyt czy zmiany przynoszą pozytywne rezultaty

Ja też oczekiwać, aby mieć umiarkowane umiejętności techniczne - możliwość modyfikowania Synology DSM za pomocą konsoli, zainstalować i skonfigurować wtyczki, zastosowanie telnet, uruchomić pliki wykonywalne i edytować / zapisywać pliki tekstowe w linux, itp.

Synology Tuning

Synology produkuje całkiem potężnych urządzeń sieciowej pamięci masowej. Są to w zasadzie małe komputery zoptymalizowane do przechowywania / służyć danych oraz możliwość uruchomienia programów do strumieniowego przesyłania muzyki, filmy, zdjęcia, strony internetowe, i więcej. Domyślnie, WordPress będzie działać stosunkowo powolny na Synology ponieważ jest skonfigurowany tak, aby zminimalizować dysku, procesor, i wykorzystanie pamięci. Po prostu co kilka zmian, można dokonać WordPress na biegu Synology szybciej niż przeciętny stronie bez narażania jego zdolności do uruchamiania innych funkcji.

Włącz buforowanie PHP

Domyślnie, Synology jest skonfigurowany tak, aby włączyć buforowanie PHP. Zapewnić „Włącz pamięć podręczną PHP” jest nadal sprawdzana w Panelu sterowania | Usługi internetowe | Ustawienia PHP.

Synology DSM-5-PHP-buforowanie

 

Tuning Konfiguracje

Tuning następujące konfiguracje daje największy przyrost wydajności którykolwiek z pozostałych zaleceń wymienionych w niniejszym artykule. Jest to również najbardziej niebezpieczne, ponieważ można łatwo spowodować zużycie zasobów przez spowolnienie części wszystkich Synology lub co gorsza może złamać lub całą WordPress Synology. przed kontynuowaniem, upewnić się, że wszystko wsparte OFF Synology w przypadku trzeba wykonać pełne przywrócenie Synology. Teraz, gdy mamy ten mrok i kara za sobą, na z regulacją ... Aby wykonać jedną z poniższych zmian, trzeba najpierw włączyć Telnet zaznaczając „Włącz usługę Telnet” w Panelu sterowania | Terminal & SNMP | Terminal.

Synology DSM-5-Enable-Telnet

Uwaga: Włączanie telnet umożliwia zdalny dostęp do wiersza poleceń Synology. Trzeba tylko go włączyć, gdy są potrzebne, a jeśli sieć jest odpowiednio zabezpieczone.

OPCache

OPCODE jest mechanizm buforowania preinstalowany na Synology buforować uruchomiony kod PHP do pamięci i przypomnieć kodu z pamięci zamiast z dysku. Aby skonfigurować silnik OPCODE aby zużywać więcej zasobów, a tym samym przyspieszyć WordPress:

  1. Telnet do Synology z konta root
  2. Edytować i zapisywać /etc / php / conf.d /opcache.ini ze swoimi pożądanych zmian
  3. Zrestartować Apache, uruchamiając /usr / Syno / etc / rc.d / S97apache-sys.sh restart

Poniżej znajdują się niektóre zmiany, jakie realizowane z wynikiem pozytywnym:

Konfiguracja PHP

PHP jest językiem jest napisany w WordPressie. Firma Synology silnik PHP preinstalowanym i wstępnie zużywają minimalną ilość zasobów, takich jak pamięć i CPU. Aby skonfigurować silnik PHP zużywają więcej zasobów, a tym samym przyspieszyć WordPress:

  1. Telnet do Synology z konta root
  2. Edytować i zapisywać /etc / php / php.ini ze swoimi pożądanych zmian
  3. Zrestartować Apache, uruchamiając /usr / Syno / etc / rc.d / S97apache-sys.sh restart

Poniżej znajdują się niektóre zmiany, jakie realizowane z wynikiem pozytywnym:

memory_limit = 512M
max_execution_time = 2000

Apache to serwer WWW preinstalowany na Synology dla wszystkich aplikacji internetowych (jak WordPress). Konfiguracja Apache jest wstępnie skonfigurowany do zużywają minimalną ilość zasobów, takich jak pamięć i CPU. Aby skonfigurować Apache zużywają więcej zasobów, a tym samym przyspieszyć WordPress:

  1. Telnet do Synology z konta root
  2. Edytować i zapisywać /etc / httpd / conf / extra / httpd-mpm.conf użytkownik ze swoimi pożądanych zmian
  3. Zrestartować Apache, uruchamiając /usr / Syno / etc / rc.d / S97apache-sys.sh restart

Poniżej znajdują się niektóre zmiany, jakie realizowane z wynikiem pozytywnym:

MariaDB jest serwer bazy danych można zainstalować uruchomić z Wordpress. Konfiguracja MariaDB zostało skonfigurowano tak, aby zużywać minimalną ilość zasobów, takich jak pamięć i CPU. Aby skonfigurować MariaDB zużywają więcej zasobów, a tym samym przyspieszyć WordPress:

  1. Telnet do Synology z konta root
  2. Edytować i zapisywać /volume1/@appstore/MariaDB/etc/mysql/my.cnf ze swoimi pożądanych zmian (Uwaga: Może trzeba zmienić „volume1" do miejsca, w którym został zainstalowany MariaDB).
  3. Uruchom ponownie uruchamiając MariaDB /usr / share / mysql / mysql.server restart

Poniżej znajdują się niektóre zmiany, jakie realizowane z wynikiem pozytywnym:

WordPress Tuning

WordPress domyślnie nie jest też zoptymalizowany pod kątem szybkości, ale na szczęście istnieje kilka świetnych wtyczek i zmienia może sprawić, aby Państwa strony krzyk.

Włącz buforowanie strony

Pobieranie, Aktywuj, i skonfigurować W3 Razem Cache podłącz.

W3-Total-Cache

Zasadniczo ten plugin buforuje wszystkie dynamiczne treści na swojej stronie, a jednocześnie kurczą dół kodu, gdzie to możliwe. Spektakl zyskał z powodu tej wtyczki jest jak dzień i noc. Jeśli jesteś płochliwe o implementacji żadnej sugestii w tym artykule, to jest nie do pominięcia.

Istnieje mnóstwo ustawień i ton artykułów w internecie już o tym, jak optymalnie skonfigurować ten plugin. Oto kilka krótkich porad:

  • Włącz stronę, Minify, Baza danych, obiekt, i pamięć podręczną przeglądarki
  • Wybierz „OpCode: Alternative PHP Cache (APC)”Jako metodę cache (jeśli nie „Disk: Ulepszony”, "Dysk: Basic”lub po prostu«Disk»)
  • Odznacz wszystkie pozycje w sekcji „Debug”
  • Włącz „Late inicjujących” na stronie opcji „Strona cache”
  • Update „stron na Interval”, aby 15 na stronie opcji „Strona cache”

Kurczyć obrazów

Pobieranie, Aktywuj, i użyj WP Smush.it podłącz.

Smush-It

Zasadniczo ten plugin wykonuje operacje, aby zmniejszyć rozmiar zdjęć Twojej witryny bez utraty jakości.

Do „smush” obrazy, wystarczy przejść do sekcji WordPress „Media” na desce rozdzielczej administratora i kliknij „Smish.it teraz!”Lub«Remush»obok pożądanego obrazu.

Lub „smush” bandą obrazów naraz, przejdź do WordPress „Media | Luzem sekcja Smush.it”na desce rozdzielczej admina.

Wyłączyć niepotrzebne wtyczki

Wtyczki mogą dodać dodatkowy kod, który za każdym razem uruchomić stronę lub obraz jest załadowany. Że dodatkowy kod spowoduje, że strona, aby wyświetlić wolniej. Wyłącz wszystkie wtyczki które nie są potrzebne.

Wybierz szybki tematu

Nie wszystkie motywy są sobie równe. Eksperyment aktywując kilka tematów i zwracając uwagę na każdy czas potrzebny do załadowania. Wybierz temat, który wypełnia swoje potrzeby, a jednocześnie ładuje się najszybciej.

Optymalizacji bazy danych

Pobieranie, Aktywuj, i użyj WP-Optymalizacja podłącz.

Zasadniczo ten plugin wykonuje kilka optymalizuje i procedur bazy danych porządkowych w celu przyspieszenia połączeń bazodanowych. Szybsze połączenia baz danych oznacza szybsze ładowanie stron WWW.

Aby zoptymalizować bazę, kliknij „WP-Optymalizuj” w panelu administratora, sprawdzić wszystko, i kliknij „Proces”.

Wniosek

Podczas gdy zmiany powyżej przynieść ogromne zyski wydajności, Mam jeszcze 2 rzeczy, które dziwactwo mnie od bycia w pełni zadowolony. Pierwszy, I naprawdę nie wiem, która część zmian konfiguracyjnych są naprawdę niezbędne, które nie są wymagane, a jeśli są dostrajane przynieść optymalną wydajność. druga, Nie widzę mój Synology wykorzystując pamięć pomimo zauważalnego nazywając wiecej zużycia pamięci w plikach konfiguracyjnych. Powoduje to, że mnie kwestionować wartość przynoszą.

Ale z tym na bok, Wiem WordPressa na moim Synology teraz znacznie szybciej biegnie po wdrożeniu zmian powyżej. A w rzeczywistości, każda aplikacja internetowa na Synology powinien działać szybciej, a także (dawny. konsola DSM). Daj mi znać, jeśli działa dobrze dla ciebie zbyt przez lubić lub dzieląc tę ​​stronę na Facebooku. Zapraszam także wysłać mi żadnych wskazówek zwiększanie wydajności, aby WordPress na metę Synology jeszcze szybciej.