root/ip/trunk/includes/functions_topics_list.php

133159
411
		}
411
		}
412
412
413
		// generate list of page for the topic
413
		// generate list of page for the topic
414
		$goto_page = '';
414
		$topic_pagination = generate_topic_pagination($forum_id, $topic_id, $replies);
415
		if(($replies + 1) > $config['posts_per_page'])
416
		{
417
			$total_pages = ceil(($replies + 1) / $config['posts_per_page']);
418
			$goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';
419
			$times = 1;
420
			for($j = 0; $j < $replies + 1; $j += $config['posts_per_page'])
421
			{
422
				$goto_page .= '<a href="' . append_sid(CMS_PAGE_VIEWTOPIC . "?" . POST_TOPIC_URL . "=" . $topic_id . "&amp;start=$j") . '">' . $times . '</a>';
423
				if($times == 1 && $total_pages > 4)
424
				{
425
					$goto_page .= ' ... ';
426
					$times = $total_pages - 3;
427
					$j += ($total_pages - 4) * $config['posts_per_page'];
428
				}
429
				else if ($times < $total_pages)
430
				{
431
					//$goto_page .= ', ';
432
					$goto_page .= ' ';
433
				}
434
				$times++;
435
			}
436
			$goto_page .= ' ] ';
437
		}
438
415
439
		$topic_author = '';
416
		$topic_author = '';
440
		$first_post_time = '';
417
		$first_post_time = '';
...
...
669
			'TOPIC_FOLDER_IMG' => $folder_image,
646
			'TOPIC_FOLDER_IMG' => $folder_image,
670
			'TOPIC_AUTHOR' => $topic_author,
647
			'TOPIC_AUTHOR' => $topic_author,
671
			'TOPIC_DESCRIPTION' => $topic_desc,
648
			'TOPIC_DESCRIPTION' => $topic_desc,
672
			'GOTO_PAGE' => !empty($goto_page) ? '<br />' . $goto_page : '',
649
			'GOTO_PAGE' => $topic_pagination['base'],
650
			'GOTO_PAGE_FULL' => $topic_pagination['full'],
673
			'TOPIC_NAV_TREE' => !empty($nav_tree) ? (empty($goto_page) ? '<br />' : '') . $nav_tree : '',
651
			'TOPIC_NAV_TREE' => !empty($nav_tree) ? (empty($goto_page) ? '<br />' : '') . $nav_tree : '',
674
			'REPLIES' => $replies,
652
			'REPLIES' => $replies,
675
			'NEWEST_POST_IMG' => $newest_post_img,
653
			'NEWEST_POST_IMG' => $newest_post_img,