自作プラグイン/ref_csv
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
** ref_csv [#o77a69b9]
|RIGHT:100|LEFT:360|c
|~サマリ|添付のcsvファイルの表示|
|~リビジョン|1.0|
|~対応バージョン|?|
|~投稿者|[[すま]]|
|~投稿日|&new{2018-10-22 (月) 17:20:18};|
**概要 [#s659170c]
添付されているcsvをテーブルとしてページ内に表示するプラグ...
#ref_csv(添付ファイル名);
~
[[質問箱/2153]]にあったものを作りました。
プラグインは初めて作ったので、セキュリティなど問題あれば...
対応バージョンもわかりません。
自分のところのVersion 1.5.1では動いています。~
~
これ機能自体の意義はあまりありません。~
うちでは、csvデータのデータ定義(カラムごとのデータの意味...
**ソースコード plugin/ref_csv.inc.php [#p075d400]
<?php
///////////////////////////////////////////////////////
// 添付されているcsvをテーブルとして表示するプラグイン
///////////////////////////////////////////////////////
function plugin_ref_csv_convert()
{
global $vars;
if (func_num_args() == 0) {
return ''; // Show nothing
}
$args = func_get_args();
// check
$filename = UPLOAD_DIR.encode($vars[page]).'_'.encod...
if (!is_readable($filename))
return htmlspecialchars($args[0]). ' is not foun...
if (($data = file_get_contents($filename))) {
// encoding
$data = mb_convert_encoding($data,SOURCE_ENCODIN...
$tmp = tmpfile();
fwrite($tmp, $data);
rewind($tmp);
// print
$out = '<table class="style_table" cellspacing="...
while (($line = fgetcsv($tmp))) {
$out .= '<tr>';
foreach ($line as $one) {
$out .= '<td class="style_td">'.htmlspec...
}
$out .= "</tr>\n";
}
$out .= "</table>\n";
fclose($tmp);
return $out;
}
return 'error.';
}
?>
終了行:
** ref_csv [#o77a69b9]
|RIGHT:100|LEFT:360|c
|~サマリ|添付のcsvファイルの表示|
|~リビジョン|1.0|
|~対応バージョン|?|
|~投稿者|[[すま]]|
|~投稿日|&new{2018-10-22 (月) 17:20:18};|
**概要 [#s659170c]
添付されているcsvをテーブルとしてページ内に表示するプラグ...
#ref_csv(添付ファイル名);
~
[[質問箱/2153]]にあったものを作りました。
プラグインは初めて作ったので、セキュリティなど問題あれば...
対応バージョンもわかりません。
自分のところのVersion 1.5.1では動いています。~
~
これ機能自体の意義はあまりありません。~
うちでは、csvデータのデータ定義(カラムごとのデータの意味...
**ソースコード plugin/ref_csv.inc.php [#p075d400]
<?php
///////////////////////////////////////////////////////
// 添付されているcsvをテーブルとして表示するプラグイン
///////////////////////////////////////////////////////
function plugin_ref_csv_convert()
{
global $vars;
if (func_num_args() == 0) {
return ''; // Show nothing
}
$args = func_get_args();
// check
$filename = UPLOAD_DIR.encode($vars[page]).'_'.encod...
if (!is_readable($filename))
return htmlspecialchars($args[0]). ' is not foun...
if (($data = file_get_contents($filename))) {
// encoding
$data = mb_convert_encoding($data,SOURCE_ENCODIN...
$tmp = tmpfile();
fwrite($tmp, $data);
rewind($tmp);
// print
$out = '<table class="style_table" cellspacing="...
while (($line = fgetcsv($tmp))) {
$out .= '<tr>';
foreach ($line as $one) {
$out .= '<td class="style_td">'.htmlspec...
}
$out .= "</tr>\n";
}
$out .= "</table>\n";
fclose($tmp);
return $out;
}
return 'error.';
}
?>
ページ名: