<%
Function autoMake(Contentid,classid)
	if runMode =0 then Exit Function
	select case aotoMakehtml
		case "1" :	makeContent Contentid, 1, 1	
		case "2" :  makeContent Contentid, 1, 1 : autoMakeListBySort(classid)
		case "3" :  makeContent Contentid, 1, 1 : autoMakeListBySort(classid) : makeIndex
	end select
End Function 

Function aotoMakeAbout(classid)	
	if runMode =0 then Exit Function
	makeAbout classid, 0, 1
End Function 

Sub autoMakeListBySort(classid)	
	dim sortids,topsortid,sql,rs
	topsortid = conn.exec("select TopSortID from {prefix}Sort where SortID="&classid,"r1")(0)
	sortids=getSubSort(topsortid, 1)
	sql="select SortID,SortType,SortName from {prefix}Sort where SortType<>1 and SortType<>7 and GroupID<3 and LanguageID="&cint(session("languageID"))&" and SortID in ("&sortids&") order by SortID"
	set rs=conn.Exec(sql,"r1")
	Do While not rs.Eof
		makeList( rs("SortID"))
		'echo "生成"""&rs("SortName")&"""成功<br>"
		rs.movenext
	Loop
	rs.close : set rs =nothing
End Sub

'生成首页
Sub makeIndex
	dim templateobj,templatePath : set templateobj = new TemplateClass	
	templatePath=sitePath&"/"&"templates/"&setting.defaultTemplate&"/"&setting.htmlFilePath&"/index.html"	
	'die templatePath
	if not CheckTemplateFile(templatePath) then echo "index.html"&err_16	
	with templateObj 
		.content=loadFile(templatePath) 
		.parseHtml()	
		.indexpath	
		.parseCommon		
		createTextFile  .content, sitePath&setting.LanguagePath&"index"&FileExt,""
	end with	
	set templateobj =nothing	
End Sub
%>
