一覧で見出しの目次が横に長く並んでしまう

メッセージ

ページ一覧表示で見出しの目次が横に長く並んでレイアウトを乱すので、アルファベットは16個ずつで折り返すようにしてみました。

html.phpの525行めあたり。function get_list。

// 一覧の取得
 function get_list($withfilename)
 {
	global $script,$list_index,$top,$non_list,$whatsnew;
	global $_msg_symbol,$_msg_other;
	
	$retval = array();
	$files = get_existpages();
	foreach($files as $page) {
		if(preg_match("/$non_list/",$page) && !$withfilename) continue;
		if($page == $whatsnew) continue;
		$page_url = rawurlencode($page);
		$page2 = strip_bracket($page);
		$pg_passage = get_pg_passage($page);
		$file = encode($page).".txt";
		$retval[$page2] .= "<li><a href="$script?$page_url">".htmlspecialchars($page2,ENT_QUOTES)."</a>$pg_passage</li>n";
		if($withfilename)
		{
			$retval[$page2] .= "<ul><li>$file</li></ul>n";
		}
	}
	
	$retval = list_sort($retval);
	
	if($list_index)
	{
		$head_str = "";
		$etc_sw = 0;
		$symbol_sw = 0;
		$top_link = "";
		$link_counter = 0;
		foreach($retval as $page => $link)
		{
			$head = substr($page,0,1);
			if($head_str != $head && !$etc_sw)
			{
				$retval2[$page] = "";
				
				if(preg_match("/([A-Z])|([a-z])/",$head,$match))
				{
					if($match[1])
						$head_nm = "High:$head";
					else
						$head_nm = "Low:$head";
					
					if($head_str) $retval2[$page] = "</ul>n";
					$retval2[$page] .= "<li><a href="#top:$head_nm" id="$head_nm" name="$head_nm"><strong>$head</strong></a></li>n<ul>n";
					$head_str = $head;
					if($link_counter) $top_link .= "|";
					$link_counter = $link_counter + 1;
					$top_link .= "<a href="#$head_nm" name="top:$head_nm"><strong>&nbsp;".$head."&nbsp;</strong></a>";
					if($link_counter == 16){
						$top_link .= "<br />";
						$link_counter = 0;
					}
				}
				else if(preg_match("/[ -~]/",$head))
				{
					if(!$symbol_sw)
					{
						if($head_str) $retval2[$page] = "</ul>n";
						$retval2[$page] .= "<li><a href="#top:symbol" id="symbol" name="symbol"><strong>$_msg_symbol</strong></a></li>n<ul>n";						$head_str = $head;
						$top_link .= "<a href="#symbol" id="top:symbol" name="top:symbol"><strong>$_msg_symbol</strong></a><br />";
						$symbol_sw = 1;
					}
				}
				else
				{
					if($head_str) $retval2[$page] = "</ul>n";
					$retval2[$page] .= "<li><a href="#top:etc" id="etc" name="etc"><strong>$_msg_other</strong></a></li>n<ul>n";
					$etc_sw = 1;
					if($link_counter) $top_link .= "<br />";
					$top_link .= "<a href="#etc" id="top:etc" name="top:etc"><strong>$_msg_other</strong></a>";
				}
			}
			$retval2[$page] .= $link;
		}
		$retval2[] = "</ul>n";
		
		$top_link = "<div style="text-align:center"><a id="top" name="top">$top_link</a></div><br />n";
		
		array_unshift($retval2,$top_link);
	}
	else
	{
		$retval2 = $retval;
	}
	
	return join("",$retval2);
 }


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2002-07-16 (火) 18:23:07
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.300 sec.

SourceForge