WordPress.org

Ready to get started?Download WordPress

Forums

File Gallery
No space between the attribute (3 posts)

  1. bayuah
    Member
    Posted 1 year ago #

    I have a problem "no space between the attribute" in the markup validation page in the page pagination. So I change the core code of this plugin. But I'm afraid when there are updates plugin, these improvements will go back to the origin. Any solution?

    http://wordpress.org/extend/plugins/file-gallery/

  2. Aesqe
    Member
    Plugin Author

    Posted 1 year ago #

    @bayuah: could you paste the changed code here, or email it to me, so I can add it to the plugin?

    thanks! :)

  3. bayuah
    Member
    Posted 1 year ago #

    Sorry I forgot the part where I edit, so I include the whole function.
    Maybe you could look inside the 'wp-pagenavi' especially anchor tag attributes.

    [ Moderator note: pre works but please use the code button or backtick character instead. ]

    <?php
    // file: '/includes/templating.php':
    function file_gallery_do_pagination( $total = 0, $page = 0 )
    {
    	if( 0 < $total && 0 < $page )
    	{
    		remove_query_arg('page');
    
    		$options = get_option('file_gallery');
    		$out = array('<span class="current">' . $page . '</span>');
    
    		if( ! isset($options['pagination_count']) || empty($options['pagination_count']) || 0 >= $options['pagination_count'] )
    			$limit = 9;
    		else
    			$limit = $options['pagination_count'];
    
    		$c = 0;
    		$l = $limit;
    		$end = false;
    		$start = false;
    		$current = $page;
    
    		$sides = ($limit - 1) / 2;
    		$sl = ceil($sides);
    		$sr = floor($sides);
    
    		// skip to first page link
    		if( ($limit - $sl) < $current )
    			$start = true;
    
    		// skip to last page link
    		if( ($total - $sr) > $current )
    			$end = true;
    
    		// left side
    		if( 1 < $current )
    		{
    			$current--;
    
    			while( 0 < $current && 0 < $sl)
    			{
    				array_unshift($out, str_replace('<a>');
    
    				$current--;
    				$sl--;
    				$limit--;
    			}
    
    			$c = $current;
    		}
    
    		$current = $page + 1;
    		$sr += $sl;
    
    		// right side
    		while( $current <= $total && 0 < $sr )
    		{
    			array_push($out, str_replace('</a><a>');
    
    			$current++;
    			$sr--;
    			$limit--;
    		}
    
    		// leftovers
    		while( 1 < $limit && 0 < $c )
    		{
    			array_unshift($out, str_replace('</a><a>');
    
    			$c--;
    			$limit--;
    		}
    
    		if( $start )
    			array_unshift($out, str_replace('</a><a title="' . __('Skip to first page', 'file-gallery') . '">');
    
    		if( $end )
    			array_push($out, str_replace('</a><a title="' . __('Skip to last page', 'file-gallery') . '">');
    
    		if( 'rtl' == get_bloginfo('text_direction') )
    			$out = array_reverse($out);
    
    		return '<div class="wp-pagenavi">' . "\n" . implode("\n", $out) . "\n</div>";
    	}
    
    	return '';
    }
    </a>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic