1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

phpbb and pagination urls question:

Discussion in 'phpBB' started by cgo85, Jan 31, 2006.

  1. #1
    on the forum i'm building the pagination urls create something like this:

    /viewtopic.php?t=11&postdays=0&postorder=asc&start=0

    Where it is the same page as:

    /viewtopic.php?t=11

    I'm concerned that this will cause duplicate content to the SE's... is there anyway around this? Or does anyone know how to change pagination to write the urls differently for example instead of:

    /viewtopic.php?t=11&postdays=0&postorder=asc&start=10
    it would be:

    /viewtopic.php?t=11&start=10


    The DP forum looks like it is successfully doing this with its pagination.
     
    cgo85, Jan 31, 2006 IP
  2. RectangleMan

    RectangleMan Notable Member

    Messages:
    2,825
    Likes Received:
    132
    Best Answers:
    0
    Trophy Points:
    210
    #2
    This should be ok.

    For most of my phpbb links I change them for guests.

    Take a look at http://www.pspforums.com/forums/

    Notice many of the links are not active but if you login much of the site opens up included signatures, links, and such.

    Google never logs in so focus on making the site guest friendly and that will also take care of google and other search engines.
     
    RectangleMan, Jan 31, 2006 IP
  3. cgo85

    cgo85 Peon

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you're saying that this won't be looked at as dupe content. I've modded alot of stuff so that it is more SE friendly but even at DP here the pagination is doing what I'm talking about.

    For the most part I've fixed it now except for when you click on the page 1 intead of showing: /viewtopic.php?t=8

    it shows: /viewtopic.php?t=8&start=0

    Other people have had to think about this, so someone must have a solution at hand... any help would be appreciated.
     
    cgo85, Feb 1, 2006 IP
  4. cgo85

    cgo85 Peon

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is the code that I think I may need to alter... I just don't know how (It's alot to look at):

    // Pagination routine, generates
    // page number sequence
    //
    function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
    {
    	global $lang;
    
    	$total_pages = ceil($num_items/$per_page);
    
    	if ( $total_pages == 1 )
    	{
    		return '';
    	}
    
    	$on_page = floor($start_item / $per_page) + 1;
    
    	$page_string = '';
    	if ( $total_pages > 10 )
    	{
    		$init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages;
    
    		for($i = 1; $i < $init_page_max + 1; $i++)
    		{
    			$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
    			if ( $i <  $init_page_max )
    			{
    				$page_string .= ", ";
    			}
    		}
    
    		if ( $total_pages > 3 )
    		{
    			if ( $on_page > 1  && $on_page < $total_pages )
    			{
    				$page_string .= ( $on_page > 5 ) ? ' ... ' : ', ';
    
    				$init_page_min = ( $on_page > 4 ) ? $on_page : 5;
    				$init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4;
    
    				for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++)
    				{
    					$page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
    					if ( $i <  $init_page_max + 1 )
    					{
    						$page_string .= ', ';
    					}
    				}
    
    				$page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', ';
    			}
    			else
    			{
    				$page_string .= ' ... ';
    			}
    
    			for($i = $total_pages - 2; $i < $total_pages + 1; $i++)
    			{
    				$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>'  : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
    				if( $i <  $total_pages )
    				{
    					$page_string .= ", ";
    				}
    			}
    		}
    	}
    	else
    	{
    		for($i = 1; $i < $total_pages + 1; $i++)
    		{
    			$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';
    			if ( $i <  $total_pages )
    			{
    				$page_string .= ', ';
    			}
    		}
    	}
    
    	if ( $add_prevnext_text )
    	{
    		if ( $on_page > 1 )
    		{
    			$page_string = ' <a href="' . append_sid($base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a>&nbsp;&nbsp;' . $page_string;
    		}
    
    		if ( $on_page < $total_pages )
    		{
    			$page_string .= '&nbsp;&nbsp;<a href="' . append_sid($base_url . "&amp;start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>';
    		}
    
    	}
    
    	$page_string = $lang['Goto_page'] . ' ' . $page_string;
    
    	return $page_string;
    }
    Code (markup):
     
    cgo85, Feb 1, 2006 IP