- 2009-08-07 (Fri) 23:06
- Nucleus
Nucleus スキン中で使用可能な<%if%><%elseif%><%else%><%endif%>タグは、HTML 出力時に空行に置換される。このため、複雑なスキンを使用している場合、無駄な空行が多く、HTML の可読性が低い。これを改善する。
nucleus/libs/PARSER.php を編集する。
これにより、無駄な空行が表示されなくなる。なお、下記のコードは、タグ括弧<>が全角なので、半角に修正すること。
function parse(&$contents) {
// modified for html readability by frostfrog
$contents = preg_replace("@r@", "", $contents);
$search = array("@n[ t]*<%if((.*))%>n@",
"@n[ t]*<%elseif((.*))%>n@",
"@n[ t]*<%else%>n@",
"@n[ t]*<%endif%>n@");
$replace = array("n<%if($1)%>",
"n<%elseif($1)%>",
"n<%else%>",
"n<%endif%>");
$contents = preg_replace($search, $replace, $contents);
// modified end










