質問箱/3227
の編集
Top
/
質問箱
/
3227
[
トップ
] [
編集
|
差分
|
履歴
|
添付
|
リロード
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
Wikiを試したい方へ:
「この」Wikiは、
PukiWiki
のための公式Wikiです。
テスト書き込みなどは
お試しサイト
https://pukiwiki.osdn.jp/_trial/
をご利用ください
**[[質問箱/3227]] [#v7df5e63] |RIGHT:70|LEFT:410|c |~カテゴリ|| |~サマリ|表組みに背景画像を使用したい| |~バージョン|1.4.5| |~投稿者|[[荻]]| |~状態|質問| |~投稿日|&new{2005-10-22 (土) 18:57:55};| ***質問 [#o657a49c] タイトルの通りです。 表組みではBGCOLOR(色):を使って背景色指定ができますが、 これと同じような方法で表組みに背景画像指定をすることはできませんか? 分かる方、よろしくお願いします。 ***回答 [#b6dbd135] - 基本機能ではできないはず。本体の一部改造で対応できましたので参考になれば↓ -- [[0]] &new{2005-11-22 (火) 01:04:49}; -while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)):(.*)$/', +while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)|BG\((.*)\)):(.*)$/', $text, $matches)) { if ($matches[1]) { $this->style['align'] = 'text-align:' . strtolower($matches[1]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[3]) { $name = $matches[2] ? 'background-color' : 'color'; $this->style[$name] = $name . ':' . htmlspecialchars($matches[3]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[4]) { $this->style['size'] = 'font-size:' . htmlspecialchars($matches[4]) . 'px;'; - $text = $matches[5]; + $text = $matches[6]; + } elseif ($matches[5]) { + $this->style['bg'] = 'background: url(' . htmlspecialchars($matches[5]) . ');'; + $text = $matches[6]; } } -- ↑上記は“lib/convert_html.php”の470行目付近です。テーブルに対して一つの背景画像((例: <table style="background:url(image)">))を使いたいのかどうか悩みましたが、同じような方法とあったので、セルごとの背景画像指定にしました。 -- &new{2005-11-22 (火) 01:16:12}; #comment
**[[質問箱/3227]] [#v7df5e63] |RIGHT:70|LEFT:410|c |~カテゴリ|| |~サマリ|表組みに背景画像を使用したい| |~バージョン|1.4.5| |~投稿者|[[荻]]| |~状態|質問| |~投稿日|&new{2005-10-22 (土) 18:57:55};| ***質問 [#o657a49c] タイトルの通りです。 表組みではBGCOLOR(色):を使って背景色指定ができますが、 これと同じような方法で表組みに背景画像指定をすることはできませんか? 分かる方、よろしくお願いします。 ***回答 [#b6dbd135] - 基本機能ではできないはず。本体の一部改造で対応できましたので参考になれば↓ -- [[0]] &new{2005-11-22 (火) 01:04:49}; -while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)):(.*)$/', +while (preg_match('/^(?:(LEFT|CENTER|RIGHT)|(BG)?COLOR\(([#\w]+)\)|SIZE\((\d+)\)|BG\((.*)\)):(.*)$/', $text, $matches)) { if ($matches[1]) { $this->style['align'] = 'text-align:' . strtolower($matches[1]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[3]) { $name = $matches[2] ? 'background-color' : 'color'; $this->style[$name] = $name . ':' . htmlspecialchars($matches[3]) . ';'; - $text = $matches[5]; + $text = $matches[6]; } else if ($matches[4]) { $this->style['size'] = 'font-size:' . htmlspecialchars($matches[4]) . 'px;'; - $text = $matches[5]; + $text = $matches[6]; + } elseif ($matches[5]) { + $this->style['bg'] = 'background: url(' . htmlspecialchars($matches[5]) . ');'; + $text = $matches[6]; } } -- ↑上記は“lib/convert_html.php”の470行目付近です。テーブルに対して一つの背景画像((例: <table style="background:url(image)">))を使いたいのかどうか悩みましたが、同じような方法とあったので、セルごとの背景画像指定にしました。 -- &new{2005-11-22 (火) 01:16:12}; #comment
テキスト整形のルールを表示する