Block("CurrentYearShow"); $tp->Apply(); $strOtherSql = "WHERE IsLocal = 'N' AND Active = 'Y' AND Title$strCurrentLangauge != '' AND ContentDate LIKE '$intCurrentYear-%' AND ContentCategoryId = $ContentCategoryId"; $objDb = mysql_connect($strCfgDbHost,$strCfgDbUser,$strCfgDbPass); mysql_select_db($strCfgDbName); //if (!$objDb) { die('Could not connect: ' . "" /*mysql_error()*/); } mysql_query("SET NAMES TIS620"); mysql_query("SET character_set_results=tis620"); $strDbTable = $strCfgDbTableNews; $strOrderBy = "ContentDate DESC, ContentId DESC"; $strPrimaryKey = "ContentId"; $strOtherSelect = "*"; # ลงท้ายด้วย , $strOtherSql = $strOtherSql; # WHERE, LEFT JOIN $strLinkParameter = "&ContentCategoryId=$ContentCategoryId&Year=$Year"; # &Temp=$Temp $intListPerPage = 10; $strTextPrev = "‹ Prev"; $strTextNext = "Next ›"; $strTextFirst = "« First"; $strTextLast = "Last »"; $strSplitPLeft = " l "; $strSplitPRight = ""; $intSplitTrim = 0; /* # --- Style 2 --- # $strTextPageNow = "หน้าที่"; $strTextPageOf = "/"; $strTextPageUnit = "หน้า"; $strTextPageGo = "ไป"; $sp->Style(2); $sp->Split($strDbTable,$strOrderBy,$strPrimaryKey,$strOtherSelect,$strOtherSql,$intListPerPage,$strLinkParameter); */ $sp = New SplitPage(); $sp->Style(1); $sp->Split($strDbTable,$strOrderBy,$strPrimaryKey,$strOtherSelect,$strOtherSql,$intListPerPage,$strLinkParameter,$strTextFirst,$strTextLast,$strTextPrev,$strTextNext,$strSplitPLeft,$strSplitPRight,$intSplitTrim,$strTextPageNow,$strTextPageOf,$strTextPageUnit,$strTextPageGo); $strPageLink = $sp->getPageLink(); $intRecordAll = $sp->getRecordAll(); $strSql = $sp->getSql(0); $tp->Block("Data"); $objResult = mysql_query($strSql); //if (!$objResult) { echo "$strSqlChangeMe"; die("Invalid query: " . "" /*mysql_error()*/); } while($row = mysql_fetch_array($objResult)) { $ContentId = $row[ContentId]; $Title = $row["Title$strCurrentLangauge"]; $ContentDate = $row[ContentDate]; $ContentDateShow = formatDateTimeString($ContentDate,$strCurrentLangauge); $tp->Apply(); } mysql_free_result($objResult); $strSql = "SELECT Categoryname$strCurrentLangauge FROM $strCfgDbTableNewsCategory WHERE ContentCategoryId = $ContentCategoryId"; $objResult = mysql_query($strSql); //if (!$objResult) { echo "$strSqlChangeMe"; die("Invalid query: " . "" /*mysql_error()*/); } while($row = mysql_fetch_array($objResult)) { $CategoryName = $row["Categoryname$strCurrentLangauge"]; } mysql_free_result($objResult); $strContentCategoryIdSelect = <<::: เลือก ::: Data; $strSql = "SELECT ContentCategoryId,Categoryname$strCurrentLangauge FROM $strCfgDbTableNewsCategory WHERE Active = 'Y' ORDER BY SortOrder"; $objResult = mysql_query($strSql); //if (!$objResult) { echo "$strSqlChangeMe"; die("Invalid query: " . "" /*mysql_error()*/); } while($row = mysql_fetch_array($objResult)) { $ContentCategoryIdTemp = $row[ContentCategoryId]; $CategoryNameTemp = $row["Categoryname$strCurrentLangauge"]; $strSelected = ""; if ($ContentCategoryIdTemp == $ContentCategoryId) { $strSelected = "selected"; } $strContentCategoryIdSelect .= <<$CategoryNameTemp Data; } mysql_free_result($objResult); mysql_close($objDb); $tp->Display(); exit; /*------------------------------------------------------------------*/ ?>