############################################################################### # 寫入slider_home.html ############################################################################### function run_system_slider_home($sn, $name, $kind) { global $DIRNAME, $xoopsDB; #---- 過濾讀出的變數值 ---- $myts = MyTextSanitizer::getInstance(); #---- 檢查資料夾 mk_dir(XOOPS_ROOT_PATH . "/uploads/{$DIRNAME}/system"); mk_dir(XOOPS_ROOT_PATH . "/uploads/{$DIRNAME}/system/{$kind}"); $tbl = "ugm_creative_system"; $kind = "slider_home"; #---- 輪播圖 標題 $name = "system_slider_home_title"; $system_slider_home_title = $myts->htmlSpecialChars(get_modules_system_var($tbl, $kind, $name)); #---- 輪播圖 內容 $html = 1; $br = 0; $name = "system_slider_home_content"; $system_slider_home_content = $myts->displayTarea(get_modules_system_var($tbl, $kind, $name), $html, 1, 0, 1, $br); #---- 輪播圖 連結網址 $name = "system_slider_home_url"; $system_slider_home_url = $myts->htmlSpecialChars(get_modules_system_var($tbl, $kind, $name)); #---- 輪播圖 啟用狀態 $name = "system_slider_home_enable"; $system_slider_home_enable = intval(get_modules_system_var($tbl, $kind, $name)); #---- 輪播圖 外連狀態 $name = "system_slider_home_target"; $system_slider_home_target = intval(get_modules_system_var($tbl, $kind, $name)); $system_slider_home_target = $system_slider_home_target ? " target='_blank'" : ""; #---- 輪播 圖片 $name = "system_slider_home_pic"; $sql = "select file_name,sub_dir from " . $xoopsDB->prefix("ugm_creative_files_center") . " where col_name = '{$name}' order by sort "; $result = $xoopsDB->query($sql); $i = 0; $pic = ""; while ($row = $xoopsDB->fetchArray($result)) { $row['file_name'] = $myts->htmlSpecialChars($row['file_name']); $row['sub_dir'] = $myts->htmlSpecialChars($row['sub_dir']); $comma = $i ? "," : ""; $pic .= " {$comma}'" . XOOPS_UPLOAD_URL . "/" . $DIRNAME . $row['sub_dir'] . "/" . $row['file_name'] . "'\n"; $i++; } //print_r($pic);die(); $content = ""; $content = "\n"; $content .= "\n"; $content .= "\n"; $content .= " \n"; $content .= " \n"; $content .= " {$system_slider_home_title}\n"; $content .= " \n"; $content .= " {$system_slider_home_content}\n"; $content .= " Find Out More\n"; $content .= " \n"; $content .= " \n"; $content .= "\n"; $file = XOOPS_ROOT_PATH . "/uploads/ugm_creative/tpl/creative_header.html"; $f = fopen($file, 'w'); //以寫入方式開啟文件 fwrite($f, $content); //將新的資料寫入到原始的文件中 fclose($f); } ```
{$system_slider_home_content}