產生系列數(1、2、3 ... N)應用執行個體,應用執行個體
取系列數@{sn:favorite},放到書包doc中
<bag id=doc><we name=we_id>@{sn:favorite}</we></bag>如果系列數@{doc:we_id}為空白,則查詢favorite_base表的主鍵we_id欄位的最大值初始化@{sn:favorite=
@{pk:favorite_id}}系列數
<if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if>把系統數及相關內容分別插入
favorite_base、
favorite_user表中
<ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql>完整代碼
<html><chtml><if x="@{session:user_id}" else=1><script>alert("請先登入!");top.location.href="@{sys:path}";</script><we><bag id=doc><we name=we_id>@{sn:favorite}</we></bag><if x="@{doc:we_id}"><we><esql module=base id=pk commit=true>Select max(WE_ID) as favorite_id from favorite_base</esql><bag id=doc><we name=we_id>@{sn:favorite=@{pk:favorite_id}}</we></bag></we></if><!-- 分詞 --><call>doc2words</call><ESql module=base act=edit commit=true>Insert Into favorite_base(we_id,title,words,content,words_content)Values(@{doc:we_id:int},@{pPage:title:string},@{pPage:words:string},@{pPage:content:memo},@{pPage:words_content:memo})</ESql><bag id=pPage><we name=content1>@{intLeft:@{pPage:content1}(580)}</we></bag><ESql module=base act=edit>Insert Into favorite_user(f_id,author,tree_id,ondate,memo)Values('@{doc:we_id}','@{session:user_id}','@{pPage:n}','@{sys:date}',@{pPage:content1:memo})</ESql><to>@{sys:path}@{sys:curPath}blogs.html?n=@{pPage:n}&myid=@{session:user_id}</to></we></if></chtml></html><chtml file="htm/doc2words.htm" onlycall id=doc2words />檔案(blog_add_save.chtml)在輕開B2C電子商務網站的site/blog目錄下,結合相關檔案實際體驗一下吧
輕鬆互連網開發平台(Easy Do IT)資源下載
平台及最新開發手冊免費下載:http://download.csdn.net/detail/tx18/8464425
開發執行個體:輕開B2C電子商務網站,免費下載:http://download.csdn.net/detail/tx18/8318585
輕開平台會不定期升級為大家提供更多強大而Easy的功能,請留意下載最新的版本