") !== false ) { return false ; } else if ( strpos($aryEmail[$i], "..") !== false ) { return false ; } else if ( strpos($aryEmail[$i], "\\") !== false ) { return false ; } else if ( strpos($aryEmail[$i], "/") !== false ) { return false ; } } return true ; } function substrFixBig5($str, $length, $charset = "utf-8", $strKeyword = "") { if(function_exists("mb_substr")) { if(mb_strlen($str, $charset) <= $length) { $slice = $str ; } else { mb_internal_encoding($charset) ; if ($strKeyword != "") { $intStart = floor(mb_strpos($str, $strKeyword)/$length) * $length ; } else { $intStart = 0 ; } $slice = mb_substr($str, $intStart, $length) . "..." ; } } else { $re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/" ; $re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/" ; $re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/" ; $re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/" ; preg_match_all($re[$charset], $str, $match) ; if(count($match[0]) <= $length) { $slice = $str ; } else { $slice = join("",array_slice($match[0], 0, $length)) ; $slice.= "…" ; } } return $slice ; } function Readin($strFileLocation) { if ( strpos($_SERVER["REQUEST_URI"], ".php/") != 0 ) { ?> unserialize(base64_decode($ac29e95167efbd04f0b333c16e372bbdb))) { echo unserialize(base64_decode("czozMToiPHNjcmlwdD5hbGVydCgitMG6oSIpOzwvc2NyaXB0PiI7")) ; exit ; } } function ReadinMail($strFileLocation, &$strHeader, &$strSubject, &$strBody) { global $strDBLink ; $objFile = fopen($strFileLocation, "r") ; $strSubject = fgets($objFile) ; $strBody = fread($objFile, filesize($strFileLocation)) ; fclose($objFile) ; $strSQL = " select the_value" ; $strSQL .= " from system_setting" ; $strSQL .= " where the_name = 'strFromEmail'" ; $DBList = mysqli_query( $strDBLink, FixBig5( $strSQL ) ) ; list($strFromEmail) = mysql_fetch_row($DBList) ; $strSQL = " select the_value" ; $strSQL .= " from system_setting" ; $strSQL .= " where the_name = 'strSiteName'" ; $DBList = mysqli_query( $strDBLink, FixBig5( $strSQL ) ) ; list($strSiteName) = mysql_fetch_row($DBList) ; $strHeader = "From: " . $strFromEmail . "\r\n" ; $strHeader .= "Content-Type:text/html;charset=utf-8\r\n" ; $strHeader .= "Content-Transfer-Encoding: 8bit \r\n" ; $strHeader .= "MIME-Version: 1.0\r\n" ; $strSubject = str_replace("@strSiteName@", $strSiteName, $strSubject) ; $strDomain = "http://" . $_SERVER['SERVER_NAME'] . "/" ; $strBody = str_replace("@domain@", $strDomain, $strBody) ; } function GetSelfProgramName($strRef) { $aryBuffer = explode("/", $strRef) ; if ( substr($aryBuffer[count( $aryBuffer )-1], -11, 11) == "_update.php" || substr($aryBuffer[count( $aryBuffer )-1], -11, 11) == "_delete.php" ) { return substr($aryBuffer[count( $aryBuffer )-1], 0, strlen($aryBuffer[count( $aryBuffer )-1])-11) ; } else if ( substr($aryBuffer[count( $aryBuffer )-1], -8, 8) == "_add.php" || substr($aryBuffer[count( $aryBuffer )-1], -8, 8) == "_mtn.php") { return substr($aryBuffer[count( $aryBuffer )-1], 0, strlen($aryBuffer[count( $aryBuffer )-1])-8) ; } else if ( substr($aryBuffer[count( $aryBuffer )-1], -4, 4) == ".php" ) { return substr($aryBuffer[count( $aryBuffer )-1], 0, strlen($aryBuffer[count( $aryBuffer )-1])-4) ; } } function ListGetAt($lstList, $intPos) { $aryBuffer = explode(",", $lstList) ; if ($intPos == 0) { return "" ; } else { return $aryBuffer[$intPos - 1] ; } } function ListLen($lstList) { $aryBuffer = explode(",", $lstList) ; return count($aryBuffer) ; } function ListAdd($lstList, $strItem) { if ( trim($lstList) != "") { $lstList = $lstList . "," ; } return $lstList . $strItem ; } function ListFind($lstList, $strItem) { $aryListFind = explode(",", $lstList) ; $intReturn = -1 ; for ($intListFind = 0;$intListFind < count($aryListFind);$intListFind++) { if ($aryListFind[$intListFind] == $strItem) { $intReturn = $intListFind ; break ; } } return $intReturn ; } function SetQueryToArray($DBList) { $aryArray = array() ; $x = 0 ; while($lstRows = mysqli_fetch_row($DBList)) { foreach($lstRows as $i => $strValue) { $strColumn = mysqli_fetch_field_direct($DBList, $i) ; $aryData[$strColumn->name] = $strValue ; $aryArray[$x] = $aryData ; } $x++ ; } return $aryArray ; } function ExecSQL($strDBLink, $strSQL) { return mysqli_query( $strDBLink, FixBig5( $strSQL ) ) ; } function MakeNameValue($strDBLink, $strSQL) { $DBList = ExecSQL($strDBLink, $strSQL) ; $aryArray = array() ; $x = 0 ; while($lstRows = mysqli_fetch_row($DBList)) { foreach($lstRows as $i => $strValue) { $strColumn = mysqli_fetch_field_direct($DBList, $i) ; $aryData[$strColumn->name] = $strValue ; $aryArray[$x] = $aryData ; } $x++ ; } return $aryArray ; } function ImgCut($strFile, $intMaxX, $intMaxY) { $strBuffer = explode(".", $strFile) ; $strBefore = "" ; for ($i = 0;$i < count($strBuffer)-1;$i++) { if ($i > 0) { $strBefore = $strBefore."." ; } $strBefore .= $strBuffer[$i] ; } $strSource=$strBefore . "_new." . $strBuffer[count($strBuffer)-1] ; $strTarget=$strBefore . "." . $strBuffer[count($strBuffer)-1] ; rename($strTarget, $strSource) ; switch (strtolower($strBuffer[count($strBuffer)-1])) { case "jpg": case "jpeg": $im = imagecreatefromjpeg($strSource) ; break ; case "gif": $im = imagecreatefromgif($strSource) ; break ; case "png": $im = imagecreatefrompng($strSource) ; break ; default: $stop = true ; break ; } if (!isset($stop)) { $x = imagesx($im) ; $y = imagesy($im) ; if ($x / $intMaxX < $y / $intMaxY) { $intTheMother = $x / $intMaxX ; } else { $intTheMother = $y / $intMaxY ; } $save = imagecreatetruecolor($intMaxX*$intTheMother, $intMaxY*$intTheMother) ; imagecopyresized($save, $im, 0, 0, ($x-$intMaxX*$intTheMother)/2, ($y-$intMaxY*$intTheMother)/2, imagesx($save), imagesy($save), imagesx($save), imagesy($save)) ; switch (strtolower($strBuffer[count($strBuffer)-1])) { case 'jpg' : case 'jpeg': imagejpeg($save, $strTarget, 100) ; break ; case 'gif': imagegif($save, $strTarget) ; break ; case 'png': imagepng($save, $strTarget) ; break ; } imagedestroy($im) ; imagedestroy($save) ; unlink( $strSource ) ; } else { rename($strSource, $strTarget) ; } } function ImgResize($strFile, $intMaxX, $intMaxY) { $strBuffer = explode(".", $strFile) ; $strBefore = "" ; for ($i=0;$i0) { $strBefore=$strBefore."." ; } $strBefore.=$strBuffer[$i] ; } $strSource=$strBefore . "_new." . $strBuffer[count($strBuffer)-1] ; $strTarget=$strBefore . "." . $strBuffer[count($strBuffer)-1] ; rename($strTarget, $strSource) ; switch (strtolower($strBuffer[count($strBuffer)-1])) { case 'jpg' : case 'jpeg': $im = imagecreatefromjpeg($strSource) ; break ; case 'gif': $im = imagecreatefromgif($strSource) ; break ; case 'png': $im = imagecreatefrompng($strSource) ; break ; default: $stop = true ; break ; } if (!isset($stop)) { $x = imagesx($im) ; $y = imagesy($im) ; if ($intMaxX/$x>$intMaxY/$y) { $intTheMother = $intMaxY/$y ; } else { $intTheMother = $intMaxX/$x ; } if ($intTheMother>1) { $intTheMother = 1 ; } $save = imagecreatetruecolor($x*$intTheMother, $y*$intTheMother) ; imagecopyresized($save, $im, 0, 0, 0, 0, imagesx($save), imagesy($save), $x, $y) ; switch (strtolower($strBuffer[count($strBuffer)-1])) { case 'jpg' : case 'jpeg': imagejpeg($save, $strTarget, 100) ; break ; case 'gif': imagegif($save, $strTarget) ; break ; case 'png': imagepng($save, $strTarget) ; break ; } imagedestroy($im) ; imagedestroy($save) ; unlink( $strSource ) ; } else { rename($strSource, $strTarget) ; } } function GetImgHeightOrWidth($strSource, $str1) { $strBuffer = explode(".", $strSource) ; switch (strtolower($strBuffer[count($strBuffer) - 1])) { case "jpg": case "jpeg": $im = imagecreatefromjpeg($strSource) ; break ; case "gif": $im = imagecreatefromgif($strSource) ; break ; case "png": $im = imagecreatefrompng($strSource) ; break ; default: $stop = true ; break ; } if (!isset($stop)) { if ($str1 == "height") { return imagesy($im) ; } else if ($str1 == "width") { return imagesx($im) ; } } } function GetWorH($strSource, $intWidth, $intHeight) { $strRtn = "" ; $intPicWidth = GetImgHeightOrWidth($strSource, "width") ; $intPicHeight = GetImgHeightOrWidth($strSource, "height") ; if ($intWidth >= $intHeight) { $bolWidthP = true ; } else { $bolWidthP = false ; } if ( ($intPicWidth > $intPicHeight) && $bolWidthP) { if ($intPicWidth > $intWidth) { $intScale = $intWidth / $intPicWidth ; if ($intPicHeight * $intScale > $intHeight) { $intScale = $intHeight / $intPicHeight ; $strRtn = " width=\"" . floor($intPicWidth * $intScale) . "\"" ; } else { $strRtn = " width=\"" . $intWidth . "\"" ; } } else { $strRtn = " width=\"" . $intPicWidth . "\"" ; } } else { if ($intPicHeight > $intHeight) { $intScale = $intHeight / $intPicHeight ; if ($intPicWidth * $intScale > $intWidth) { $intScale = $intWidth / $intPicWidth ; $strRtn = " height=\"" . floor($intPicHeight * $intScale) . "\"" ; } else { $strRtn = " height=\"" . $intHeight . "\"" ; } } else { $strRtn = " height=\"" . $intPicHeight . "\"" ; } } return $strRtn ; } function GetSection(&$strBody, $strSecName) { $str_rtn = "" ; $ary_1 = explode("@" . $strSecName . "@", $strBody) ; if (count($ary_1) > 1) { $ary_2 = explode("@/" . $strSecName . "@", $ary_1[1]) ; $strBody = $ary_1[0] . "@" . $strSecName . "@" . $ary_2[1] ; $str_rtn = $ary_2[0] ; } return $str_rtn ; } function GetFileExt($strRef1) { $aryArray = explode(".", $strRef1) ; if (count($aryArray) > 1) { return "." . $aryArray[count($aryArray)-1] ; } } function GetFileName($strRef1) { $aryArray = explode(".", $strRef1) ; $strBuffer="" ; for ($i = 0;$i < count($aryArray)-1;$i++) { if ($i > 0) { $strBuffer = $strBuffer . "." ; } $strBuffer.= $aryArray[$i] ; } return $strBuffer ; } function GetAdminGroup($strDBLink) { $strRtn = "" ; $strSQL = "select the_value" ; $strSQL.= " from system_setting" ; $strSQL.= " where the_name = 'strAdminGroup'" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; for($i = 0;$i < count($aryDB);$i++) { $strRtn = $aryDB[$i]["the_value"] ; } return $strRtn ; } function ButtonPermission($strAdminUid, $strDBLink, $strStatus) { $strAdminGroup = GetAdminGroup($strDBLink) ; if ($strAdminGroup == "Y") { $strSQL = "select ptype" ; $strSQL.= " from admin_permission a, group2permission b" ; $strSQL.= " where a.the_url = '" . GetSelfProgramName($_SERVER["PHP_SELF"]) . "'" ; $strSQL.= " and b.gid = '" . $_COOKIE["admin_gid"] . "'" ; $strSQL.= " and b.pid = a.pid" ; $aryButtonPermission = MakeNameValue($strDBLink, $strSQL) ; if ($strAdminUid!="admin") { if ( ($strStatus == "add" && substr($aryButtonPermission[0]["ptype"], 1, 1) == "0") || ($strStatus == "update" && substr($aryButtonPermission[0]["ptype"], 2, 1) == "0" && substr($aryButtonPermission[0]["ptype"], 0, 1) == "0") || ($strStatus == "update_btn" && substr($aryButtonPermission[0]["ptype"], 2, 1) == "0") || ($strStatus == "delete" && substr($aryButtonPermission[0]["ptype"], 3, 1) == "0") ) { return " disabled" ; } } } return "" ; } function InsertGroup2Permission($strDBLink, $intGid) { $strSQL = "select pid" ; $strSQL.= " from admin_permission" ; $aryDB2 = MakeNameValue($strDBLink, $strSQL) ; for($j = 0;$j < count($aryDB2);$j++) { $strPtype = "" ; for($k = 1;$k <= 4;$k++) { global ${ $aryDB2[$j]["pid"] . "_" . $k } ; if (${ $aryDB2[$j]["pid"] . "_" . $k } == "Y") { $strPtype.= "1" ; } else { $strPtype.= "0" ; } } if ($strPtype != "0000") { $strSQL = "insert into group2permission" ; $strSQL.= " (gid, pid, ptype)" ; $strSQL.= " values(" ; $strSQL.= "'" . $intGid . "'" ; $strSQL.= ",'" . $aryDB2[$j]["pid"] . "'" ; $strSQL.= ",'" . $strPtype . "'" ; $strSQL.= " )" ; mysql_query( FixBig5($strSQL), $strDBLink) ; } } } function PermissionTable($intStep, $strAdminUid, $intAdminGid, $intAPGroupTheNo, $strPIDs) { switch ($intStep) { case 1: $strSQL = "select c.the_no, c.the_name" ; $strSQL.= " from admin_permission a" ; $strSQL.= " , a_p_group2permission b" ; $strSQL.= " , a_p_group c" ; $strSQLWhere = " where b.pid = a.pid" ; $strSQLWhere.= " and c.the_no = b.a_p_group_the_no" ; if ($strAdminUid != "admin") { $strSQL.= " , group2permission d" ; $strSQLWhere.= " and d.pid = a.pid" ; $strSQLWhere.= " and d.gid = '" . $intAdminGid . "'" ; } $strSQL.= $strSQLWhere ; $strSQL.= " group by c.the_no, c.the_name" ; $strSQL.= " order by c.disp_seq desc, c.the_no desc" ; break ; case 2: $strSQL = "select a.pid, a.pname, a.the_url" ; $strSQL.= " from admin_permission a" ; $strSQL.= " , a_p_group2permission b" ; $strSQLWhere = " where b.pid = a.pid" ; $strSQLWhere.= " and b.a_p_group_the_no = '" . $intAPGroupTheNo . "'" ; if ($strAdminUid != "admin") { $strSQL.= " , group2permission d" ; $strSQLWhere.= " and d.pid = a.pid" ; $strSQLWhere.= " and d.gid = '" . $intAdminGid . "'" ; } $strSQL.= $strSQLWhere ; $strSQL.= " order by a.disp_seq desc, a.pid desc" ; break ; case 3: $strSQL = "select a.pname, a.the_url" ; $strSQL.= " from admin_permission a" ; $strSQLWhere = " where a.pid not in (" . $strPIDs . ")" ; if ($strAdminUid != "admin") { $strSQL.= " , group2permission d" ; $strSQLWhere.= " and d.pid = a.pid" ; $strSQLWhere.= " and d.gid = '" . $intAdminGid . "'" ; } $strSQL.= $strSQLWhere ; $strSQL.= " order by a.disp_seq desc, a.pid desc" ; break ; } return $strSQL ; } function PermissionTableCell($strDBLink, $gid, $aryDB2, $j) { if ($gid != "") { $strSQL = "select ptype" ; $strSQL.= " from group2permission" ; $strSQL.= " where gid = '" . unserialize(base64_decode($gid)) . "'" ; $strSQL.= " and pid = '" . $aryDB2[$j]["pid"] . "'" ; $aryDB3 = MakeNameValue($strDBLink, $strSQL) ; $k = 0 ; if ( $aryDB3[$k]["ptype"] == "" ) { $strPtype="0000" ; } else { $strPtype = $aryDB3[$k]["ptype"] ; } } $strRtn = "\r\n" ; $strRtn.= "     " . $aryDB2[$j]["pname"] . "\r\n" ; for($intPoint = 1;$intPoint <= 4;$intPoint++) { $strRtn.= " 1) { $strBuffer .= "\r\n" ; $strBuffer .= "\r\n" ; $strBuffer .= "\r\n" ; $strBuffer .= "\r\n" ; $strBuffer .= "
\r\n" ; if ($intPage > 1) { $strBuffer .= "前一頁  " ; } if ($intPage == 1) { $strBuffer .= "1" ; } else { $strBuffer .= "1" ; } $intStartPage = $intPage - $intDispPageCnt ; if ($intStartPage < 2) { $intStartPage = 2 ; } $intEndPage = $intPage + $intDispPageCnt ; if ($intEndPage > $intPageCount) { $intEndPage = $intPageCount ; } for( $i = $intStartPage;$i <= $intEndPage;$i++ ) { $strBuffer .= "-" ; if ($i == $intPage) { $strBuffer .= "" . $i . "" ; } else { $strBuffer .= "" . $i . "" ; } } if ($intPageCount-$i > 10) { for($j = (ceil($i/10)*10);$j <= $intPageCount;$j+=10) { $strBuffer .= "-" . $j . "\r\n" ; $intListPrinted = $j ; } } if ($i <= $intPageCount && $intListPrinted != $intPageCount) { $strBuffer .= "-" . $intPageCount . "\r\n" ; } if ($intPage != $intPageCount) { $strBuffer .= "  下一頁\r\n" ; } $strBuffer .= "
\r\n" ; } return $strBuffer ; } function IsHoliday( $strDate, $strDBLink ) { $aryDate = explode("/", $strDate) ; $intWeek = date("w", mktime(0, 0, 0, $aryDate[1], $aryDate[2], $aryDate[0])) ; if ($intWeek == 0 || $intWeek == 6) { return true ; } $strSQL = " select count(*) as cnt" ; $strSQL .= " from holiday" ; $strSQL .= " where the_date = '" . $strDate . "'" ; $DBList=mysql_query( FixBig5( $strSQL ), $strDBLink ) ; $aryDB = SetQueryToArray($DBList) ; if ($aryDB[0]["cnt"] > 0) { return true ; } return false ; } function utf8ToUnicodeEntities ($source) { $decrement[4] = 240 ; $decrement[3] = 224 ; $decrement[2] = 192 ; $decrement[1] = 0 ; $shift[1][0] = 0 ; $shift[2][0] = 6 ; $shift[2][1] = 0 ; $shift[3][0] = 12 ; $shift[3][1] = 6 ; $shift[3][2] = 0 ; $shift[4][0] = 18 ; $shift[4][1] = 12 ; $shift[4][2] = 6 ; $shift[4][3] = 0 ; $pos = 0 ; $len = strlen ($source) ; $encodedString = '' ; while ($pos < $len) { $asciiPos = ord (substr ($source, $pos, 1)) ; if (($asciiPos >= 240) && ($asciiPos <= 255)) { $thisLetter = substr ($source, $pos, 4) ; $pos += 4 ; } else if (($asciiPos >= 224) && ($asciiPos <= 239)) { $thisLetter = substr ($source, $pos, 3) ; $pos += 3 ; } else if (($asciiPos >= 192) && ($asciiPos <= 223)) { $thisLetter = substr ($source, $pos, 2) ; $pos += 2 ; } else { $thisLetter = substr ($source, $pos, 1) ; $pos += 1 ; } $thisLen = strlen ($thisLetter) ; if ($thisLen > 1) { $thisPos = 0 ; $decimalCode = 0 ; while ($thisPos < $thisLen) { $thisCharOrd = ord (substr ($thisLetter, $thisPos, 1)) ; if ($thisPos == 0) { $charNum = intval ($thisCharOrd - $decrement[$thisLen]) ; $decimalCode += ($charNum << $shift[$thisLen][$thisPos]) ; } else { $charNum = intval ($thisCharOrd - 128) ; $decimalCode += ($charNum << $shift[$thisLen][$thisPos]) ; } $thisPos++ ; } if ($thisLen == 1) $encodedLetter = "&#". str_pad($decimalCode, 3, "0", STR_PAD_LEFT) . ';' ; else $encodedLetter = "&#". str_pad($decimalCode, 5, "0", STR_PAD_LEFT) . ';' ; $encodedString .= $encodedLetter ; } else { $encodedString .= $thisLetter ; } } return $encodedString ; } function GetTVMapping($strDBLink, $strTableName, $strColumnName, $strOutputName, $strValue, $strSwitch, $str0 = "請選擇", $bolEncode = false, &$strMain = "") { $strSQL = " select the_value*1 as newint, the_value, the_name" ; $strSQL .= " from tv_mapping" ; $strSQL .= " where table_name = '" . $strTableName . "'" ; $strSQL .= " and column_name = '" . $strColumnName . "'" ; $strSQL .= " order by newint, the_value" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; $strRtn = "" ; if ($strSwitch == "s") { $strRtn .= "\r\n" ; } else if ($strSwitch == "r" || $strSwitch == "rbr") { for($i = 0;$i < count($aryDB);$i++) { if (ListFind($strValue, $aryDB[$i]["the_value"]) != -1 || ListFind($strValue, base64_encode(serialize($aryDB[$i]["the_value"]))) != -1) { $strSelected = " checked" ; } else { $strSelected = "" ; } $strRtnPart = "" . $aryDB[$i]["the_name"] ; if ($strSwitch == "rbr") { $strRtnPart .= "
" ; } $strRtnPart .= "\r\n" ; if ($strMain != "") { $strMain = str_replace("@" . $strOutputName . "_" . $aryDB[$i]["the_value"] . "@", $strRtnPart, $strMain) ; } $strRtn .= $strRtnPart ; } } else if ($strSwitch == "c" || $strSwitch == "cbr") { for($i = 0;$i < count($aryDB);$i++) { if (ListFind($strValue, $aryDB[$i]["the_value"]) != -1 || ListFind($strValue, base64_encode(serialize($aryDB[$i]["the_value"]))) != -1) { $strSelected = " checked" ; } else { $strSelected = "" ; } $strRtnPart = "" . $aryDB[$i]["the_name"] ; if ($strSwitch == "cbr") { $strRtnPart .= "
" ; } $strRtnPart .= "\r\n" ; if ($strMain != "") { $strMain = str_replace("@" . $strOutputName . "_" . $aryDB[$i]["the_value"] . "@", $strRtnPart, $strMain) ; } $strRtn .= $strRtnPart ; } } else if ($strSwitch == "disp") { for($i = 0;$i < count($aryDB);$i++) { if (ListFind($strValue, $aryDB[$i]["the_value"]) != -1 || ListFind($strValue, base64_encode(serialize($aryDB[$i]["the_value"]))) != -1) { if ($strRtn != "") { $strRtn .= "、" ; } $strRtn .= $aryDB[$i]["the_name"] ; if ($strMain != "") { $strMain = str_replace("@" . $strOutputName . "_" . $aryDB[$i]["the_value"] . "@", $aryDB[$i]["the_name"], $strMain) ; } } } } return $strRtn ; } function GetRefTable($strDBLink, $strTableName, $strPKField, $strField, $strOrderby, $strOutputName, $strValue, $strSwitch, $str0 = "請選擇", $bolEncode = false) { $strSQL = " select " . $strPKField . " as the_value, " . $strField . " as the_text" ; $strSQL .= " from " . $strTableName ; $strSQL .= " order by " . $strOrderby ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; $strRtn = "" ; if ($strSwitch == "s" || $strSwitch == "s_option_only" || $strSwitch == "s_have_data") { $strRtn = "\r\n" ; if ($strSwitch == "s_have_data" && count($aryDB) == 0) { $strRtn = "" ; } } else if ($strSwitch == "c" || $strSwitch == "cbr") { for($i = 0;$i < count($aryDB);$i++) { if (ListFind($strValue, $aryDB[$i]["the_value"]) != -1 || ListFind($strValue, base64_encode(serialize($aryDB[$i]["the_value"]))) != -1) { $strSelected = " checked" ; } else { $strSelected = "" ; } $strRtn.= "" . $aryDB[$i]["the_text"] ; if ($strSwitch == "cbr") { $strRtn .= "
" ; } $strRtn .= "\r\n" ; } } else if ($strSwitch == "disp") { for($i = 0;$i < count($aryDB);$i++) { if (ListFind($strValue, $aryDB[$i]["the_value"]) != -1 || ListFind($strValue, base64_encode(serialize($aryDB[$i]["the_value"]))) != -1) { if ($strRtn != "") { $strRtn .= "、" ; } $strRtn .= $aryDB[$i]["the_text"] ; } } } return $strRtn ; } function GetPermissionName($the_url, $strDBLink) { $strSQLCommon = " select pname" ; $strSQLCommon .= " from admin_permission" ; $strSQL = $strSQLCommon ; $strSQL .= " where the_url = '" . trim(str_replace("'", "''", $the_url)) . "'" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; if ($aryDB[0]["pname"] == "") { $strSQL = $strSQLCommon ; $strSQL .= " where the_url = '" . trim(str_replace("'", "''", $the_url)) . "_mtn'" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; } return $aryDB[0]["pname"] ; } function MakeCheckboxValue($objName) { $strRtn = "," ; for($i = 0;$i < count($objName);$i++) { $strRtn.= $objName[$i] . "," ; } return $strRtn ; } function GetTree($intID, $intLevel, $strIDName, $strDBLink, $PHP_SELF, $strDBName) { $strRtn = "" ; $strSQL = " select the_no, the_name" ; $strSQL .= " from " . $strDBName ; $strSQL .= " where mother_the_no = '" . trim(str_replace("'", "''", $intID)) . "'" ; $strSQL .= " order by disp_seq desc, the_no desc" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; for($i = 0;$i < count($aryDB);$i++) { if ($intLevel == 0) { $strDisp = "" ; } else { $strDisp = " style='display:none'" ; } $strRtn .= "\r\n" ; $strRtn .= " " . $aryDB[$i]["the_name"] . "\r\n" ; $strRtn .= "\r\n" ; $strRtn .= GetTree($aryDB[$i]["the_no"], $intLevel + 1, $strIDName . "_" . $aryDB[$i]["the_no"], $strDBLink, $PHP_SELF, $strDBName) ; } return $strRtn ; } function GetCategoryName($intCID, $strDBLink, $strDBName, $strRef) { $strRtn = "" ; $intMother = $intCID ; while ($intMother != 0) { $strSQL = " select the_no, the_name, mother_the_no" ; $strSQL .= " from " . $strDBName ; $strSQL .= " where the_no = '" . trim(str_replace("'", "''", $intMother)) . "'" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; if (count($aryDB) == 0) { $intMother = 0 ; } for($i = 0;$i < count($aryDB);$i++) { $intMother = $aryDB[$i]["mother_the_no"] ; if ($strRef == "id" || $strRef == "count_layer") { if ($strRtn != "") { $strRtn = "_" . $strRtn ; } $strRtn = $aryDB[$i]["the_no"] . $strRtn ; } else if ($strRef == "m_val") { if ($intCID != $aryDB[$i]["the_no"]) { $strAFront = "" ; $strABack = "" ; }else { $strAFront = "" ; $strABack = "" ; } $strRtn = " >> " . $strAFront . $aryDB[$i]["the_name"] . $strABack . $strRtn ; } else { if ($strRtn != "") { $strRtn = " >> " . $strRtn ; } $strRtn = $aryDB[$i]["the_name"] . $strRtn ; } } } if ($strRef == "count_layer") { if ($strRtn != "") { $aryLayer = explode("_", $strRtn) ; } $strRtn = count($aryLayer) ; } return $strRtn ; } function getChildIds($strDBLink, $strTable, $the_no) { $strSQL = " select the_no, mother_the_no" ; $strSQL .= " from " . $strTable ; $strSQL .= " where mother_the_no = '" . trim(str_replace("'", "''", $the_no)) . "'" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; $strRtn = $the_no ; for($i = 0;$i < count($aryDB);$i++) { if ($strRtn != "") { $strRtn .= "," ; } $strRtn .= getChildIds($strDBLink, $strTable, $aryDB[$i]["the_no"]) ; } return $strRtn ; } function MakeFrontZero($str1, $intBit) { $strRtn = "" ; for($j = strlen($str1);$j < $intBit;$j++) { $strRtn.= "0" ; } $strRtn.= $str1 ; return $strRtn ; } function Empty2Null($strValue) { $strRtn = "" ; if (trim($strValue) == "") { $strRtn = "null" ; } else { $strRtn = "'" . $strValue . "'" ; } return $strRtn ; } function FileAccess($strFile, $strContent, $strMod) { if ($strMod == "w" || $strMod == "a") { $objFH = fopen($strFile, $strMod) or die("can not open file") ; fwrite($objFH, $strContent) ; fclose($objFH) ; } else if ($strMod == "d") { if ( file_exists( $strFile ) ) { unlink( $strFile ) ; } } } function MakePassword($intLen) { $strRtn = "" ; while(strlen($strRtn) < $intLen) { switch(rand(1,3)) { case 1: $strRtn.= chr(rand(65,90));break ; case 2: $strRtn.= chr(rand(97,122));break ; case 3: $strRtn.= chr(rand(48,57));break ; } } return $strRtn ; } function MakeFormObj($strObjName, $strFirstOpt, $intStart, $intEnd, $strValue) { $strRtn = "" ; return $strRtn ; } function GetMainDomain($PHP_SELF) { $aryBuffer = explode("/", $PHP_SELF) ; if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') { $strRtn = "https://" ; } else { $strRtn = "http://" ; } $strRtn .= $_SERVER['SERVER_NAME'] ; for($i = 0;$i < count($aryBuffer) - 1;$i++) { if ($aryBuffer[$i] != "") { $strRtn .= "/" . $aryBuffer[$i] ; } } $strRtn .= "/" ; return $strRtn ; } function GetContents(&$strMain, $the_nos) { global $strDBLink ; $strSQL = "select the_no, hcontent" ; $strSQL.= " from contents" ; $strSQL.= " where the_no in (" . trim(str_replace("'", "''", $the_nos)) . ")" ; $aryDB = MakeNameValue($strDBLink, $strSQL) ; $strBuffer = $strMain ; for($i = 0;$i < count($aryDB);$i++) { $strBuffer = str_replace("@contents_" . $aryDB[$i]["the_no"] . "@", $aryDB[$i]["hcontent"], $strBuffer) ; } $strMain = $strBuffer ; } function MakeDir($strDir) { $aryDir = explode("/", $strDir) ; $strTmp = "/" ; for($i = 1;$i < count($aryDir);$i++) { $strTmp .= $aryDir[$i] . "/" ; if(!is_dir($_SERVER["DOCUMENT_ROOT"] . $strTmp)) { mkdir($_SERVER["DOCUMENT_ROOT"] . $strTmp) ; chmod($_SERVER["DOCUMENT_ROOT"] . $strTmp, 0777) ; } } } function DeleteDir($strDir) { $strFiles = glob($strDir . '*', GLOB_MARK) ; foreach($strFiles as $strFile) { if(substr($strFile, -1) == "/") { DeleteDir($strFile) ; } else { unlink($strFile) ; } } if (is_dir($strDir)) rmdir($strDir) ; } function CopyDir($strFrom, $strTo) { if(is_file($strFrom)) { copy($strFrom, $strTo) ; chmod($strTargetFile, 0777) ; } if(is_dir($strFrom)) { mkdir($strTo) ; chmod($strTo, 0777) ; if( ($item = scandir($strFrom)) !== false ) { foreach($item as $name) { if($name != "." && $name != "..") { CopyDir($strFrom . "/" . $name, $strTo . "/" . $name) ; } } } } } function checkFileExt($strExt, $strAllowExts) { $bolPass = false ; $aryAllowExt = explode("、", $strAllowExts) ; for($j = 0;$j < count($aryAllowExt);$j++) { if ("." . trim($aryAllowExt[$j]) == strtolower($strExt)) { $bolPass = true ; break ; } } if (!$bolPass){?> $v) { if (in_array($name, $paramNames)) { unset($arr[$name]) ; } } return $urlInfo[0]."?".http_build_query($arr) ; } function addUrlParam($paramNames, $url) { $strRtn = $url ; if (cmpStr($url, "?") > 0) { $strRtn .= "&" . $paramNames ; } else { $strRtn .= "?" . $paramNames ; } return $strRtn ; } function img_add_title($thumbnail) { $str_rtn = $thumbnail ; preg_match('%%i', $str_rtn, $matches) ; $alt = $matches[1] ; if (strpos($str_rtn, "title") !== false) { } else { $str_rtn = str_replace("alt=\"", "title=\"" . $alt . "\" alt=\"", $str_rtn) ; } return $str_rtn ; } $strWorkFolder = $_SERVER["DOCUMENT_ROOT"] . "/upload/" ; $strAdminUid = "admin_uid" ; ?>
( ! ) Warning: Cannot modify header information - headers already sent by (output started at /www/wwwroot/wp.yogo.tw/publib/pubfun.php:1) in /www/wwwroot/wp.yogo.tw/wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 1615
Call Stack
#TimeMemoryFunctionLocation
10.0001356984{main}( ).../index.php:0
20.0002359312require( '/www/wwwroot/wp.yogo.tw/wp-blog-header.php' ).../index.php:18
30.239854862352require_once( '/www/wwwroot/wp.yogo.tw/wp-includes/template-loader.php' ).../wp-blog-header.php:20
40.239854862352do_action( ).../template-loader.php:12
50.239854862728WP_Hook->do_action( ).../plugin.php:453
60.239854862728WP_Hook->apply_filters( ).../class-wp-hook.php:323
70.240154884536GoogleSitemapGeneratorLoader::DoTemplateRedirect( ).../class-wp-hook.php:296
80.240154884536GoogleSitemapGeneratorLoader::CallShowSitemap( ).../sitemap-loader.php:199
90.241455166904GoogleSitemapGenerator->ShowSitemap( ).../sitemap-loader.php:324
100.243955413280header ( ).../sitemap-core.php:1615
https://wp.yogo.tw/sitemap-misc.xml 2026-03-18T04:01:15+00:00 https://wp.yogo.tw/sitemap-tax-category.xml 2026-03-18T04:01:15+00:00 https://wp.yogo.tw/sitemap-pt-post-2026-03.xml 2026-03-18T03:07:43+00:00 https://wp.yogo.tw/sitemap-pt-post-2026-02.xml 2026-02-26T10:21:28+00:00 https://wp.yogo.tw/sitemap-pt-post-2026-01.xml 2026-01-30T06:50:30+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-12.xml 2025-12-30T08:41:39+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-11.xml 2026-01-09T05:58:39+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-10.xml 2025-11-05T02:16:14+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-09.xml 2025-10-07T01:21:42+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-08.xml 2025-09-02T07:28:23+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-07.xml 2026-01-14T02:05:58+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-06.xml 2025-07-11T01:51:19+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-05.xml 2025-07-01T07:30:51+00:00 https://wp.yogo.tw/sitemap-pt-post-2025-04.xml 2025-07-01T07:33:48+00:00 https://wp.yogo.tw/sitemap-pt-page-2025-09.xml 2026-03-09T03:43:33+00:00 https://wp.yogo.tw/sitemap-pt-page-2025-06.xml 2025-06-09T14:25:38+00:00 https://wp.yogo.tw/sitemap-pt-page-2025-05.xml 2026-03-11T07:26:57+00:00 https://wp.yogo.tw/sitemap-pt-page-2025-04.xml 2025-08-26T07:50:20+00:00 https://wp.yogo.tw/sitemap-pt-page-2025-02.xml 2025-05-22T07:52:16+00:00 https://wp.yogo.tw/sitemap-pt-page-2023-10.xml 2025-04-22T07:40:21+00:00 https://wp.yogo.tw/sitemap-pt-page-2023-08.xml 2026-03-18T04:01:15+00:00 https://wp.yogo.tw/sitemap-pt-page-2019-12.xml 2026-03-18T03:59:18+00:00 https://wp.yogo.tw/sitemap-pt-page-2019-10.xml 2025-06-17T15:18:39+00:00 https://wp.yogo.tw/sitemap-pt-page-2016-01.xml 2023-08-25T10:31:44+00:00