diff --git a/datelink.inc.php b/datelink.inc.php new file mode 100644 index 0000000..d07f78a --- /dev/null +++ b/datelink.inc.php @@ -0,0 +1,65 @@ += 4 && $m < 9 + || $m == 9 && $d < 20; +// 4/1 -> prior +// 5/17 -> prior +// 9/20 -> prior +// 9/21 -> latter (in this plugin: not typical) +// 10/10 -> latter +// 1/2 -> latter +// 3/31 -> latter +} + + + +function plugin_datelink_inline() { + $args = func_get_args(); + $result = FALSE; + $argnum = func_num_args(); + $year = get_date('Y'); + $month = get_date('m'); + $day = get_date('d'); + + // for test -- link with given date + if($argnum == 4) { + $year = $args[0]; + $month = $args[1]; + $day = $args[2]; + $argnum = 1; + } + if($argnum == 1) { + $nendo = $year; + if($month == '01' || $month == '02' || $month == '03') { + $nendo -= 1; + } + $semester = 'b'; + if(prior_semester($month, $day)) { + $semester = 'a'; + } + $result = $args[func_num_args()-1]; + $result = str_replace('YYYY', $year, $result); + $result = str_replace('MM', $month, $result); + $result = str_replace('DD', $day, $result); + $result = str_replace('NNNN', $nendo, $result); + $result = str_replace('SS', $semester, $result); + $result = str_replace(array('[', ']'), '', $result); + $result = convert_html('[['.$result.']]'); + //convert_html (always?) adds p-tag and newline. We don't need. + $result = str_replace(array("
", "
", "\r", "\n"), '', $result); + } + + return $result; +} +?> diff --git a/datestr.inc.php b/datestr.inc.php new file mode 100644 index 0000000..49ef99a --- /dev/null +++ b/datestr.inc.php @@ -0,0 +1,19 @@ + diff --git a/insert_border.inc.php b/insert_border.inc.php new file mode 100644 index 0000000..5e2ddca --- /dev/null +++ b/insert_border.inc.php @@ -0,0 +1,77 @@ + + function insertBorder(alert_mode, tblIndex){ + var today = new Date(); + today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); + var tblNodes = document.getElementsByTagName("table"); + var trNodes = tblNodes[tblIndex].getElementsByTagName("tr"); + var idx = 0; + var comp = 0; + if (today.getMonth()+1 < 4) {comp = 1;} + if(trNodes.length != 1){ + for(i=1;i.*(\/\/\sstart.*?\/\/\send).*<\/pre>/s', '\1', $body); + if (!$updated) { + $body = preg_replace('/(.*?)<\/span>/', '\1', $body); + // $body = preg_replace('/(.*?)<\/span>/', '\1', $body); + } + + $contents = $navi . $body; + + } else { + $contents = 'usage error'; + } + + unlink($cookie_path); //����ե������� + + $msg = mb_convert_encoding($wikiname_dst, 'EUC-JP', 'UTF-8') . ' ���ѹ���'; + + return array('msg' => $msg, 'body' => $contents); +} + +function url_get_contents($url, $cookie_path, $data_array=NULL) { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + if (!is_null($data_array)) { + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data_array)); + } + curl_setopt($ch, CURLOPT_COOKIEFILE,$cookie_path); + curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path); + $html = curl_exec($ch); + curl_close($ch); + return $html; +} +?>