[Erro] Parse error: syntax error, unexpected $end in

Discussion in 'PHP' started by nicky s, Sep 19, 2010.

  1. #1
    hey

    i am getting this erro from a phpbb3 forum file

    Parse error: syntax error, unexpected $end in /forums/includes/functions_display.php on line 1326

    now all that is on line 1326 is ?>

    now looking over the net i have decided that i am missing a }

    i did a search on dreamweaver and it tells me i have 174 { but only 173 } so i spose it must be that.

    i dont know a lot about php at all so if im wrong please tell me

    here is the code

    ..... could not ad to post as was to long so attached

    View attachment functions_display.php

    cheers nicky s
     
    nicky s, Sep 19, 2010 IP
  2. tewman

    tewman Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The function topic_generate_pagination does not have a closed brace.
     
    tewman, Sep 19, 2010 IP
  3. sunlcik

    sunlcik Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Correct.

    
    /**
    * Generate topic pagination
    */
    function topic_generate_pagination($replies, $url)
    {
    	global $config, $user;
    	// www.phpBB-SEO.com SEO TOOLKIT BEGIN
    	global $phpbb_seo, $phpEx;
    	// www.phpBB-SEO.com SEO TOOLKIT END
    	// Make sure $per_page is a valid value
    	$per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
    
    	if (($replies + 1) > $per_page)
    	{
    		$total_pages = ceil(($replies + 1) / $per_page);
    		$pagination = '';
    
    		$times = 1;
    		for ($j = 0; $j < $replies + 1; $j += $per_page)
    		{
    			$pagination .= '<a href="' . $url . '&amp;start=' . $j . '">' . $times . '</a>';
    			if ($times == 1 && $total_pages > 5)
    			{
    				$pagination .= ' ... ';
    
    				// Display the last three pages
    				$times = $total_pages - 3;
    				$j += ($total_pages - 4) * $per_page;
    			}
    			else if ($times < $total_pages)
    			{
    				$pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
    			}
    			$times++;
    		}		// www.phpBB-SEO.com SEO TOOLKIT BEGIN
    		if (!empty($phpbb_seo->seo_opt['url_rewrite'])) {
    			static $pagin_find = array();
    			static $pagin_replace = array();
    			if (empty($pagin_find)) {
    				$pagin_find = array('`(https?\://[a-z0-9_/\.-]+/[a-z0-9_\.-]+)(\.(?!' . $phpEx . ')[a-z0-9]+)(\?[\w\#$%&~\-;:=,@+\.]+)?(&amp;|\?)start=([0-9]+)`i', '`(https?\://[a-z0-9_/\.-]+/[a-z0-9_\.-]+)/(\?[\w\#$%&~\-;:=,@+\.]+)?(&amp;|\?)start=([0-9]+)`i' );
    				$pagin_replace = array( '\1' . $phpbb_seo->seo_delim['start'] . '\5\2\3', '\1/' . $phpbb_seo->seo_static['pagination'] . '\4' . $phpbb_seo->seo_ext['pagination'] . '\2' );
    			}
    			$pagination = str_replace( '&amp;start=0', '', $pagination );
    			$pagination = preg_replace( $pagin_find, $pagin_replace, $pagination );
    		}
    		// www.phpBB-SEO.com SEO TOOLKIT END
    	}
    	else
    	{
    		$pagination = '';
    	}
    }
    
    PHP:
     
    sunlcik, Sep 19, 2010 IP