U.D.PB.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. Namespace.register("U.MD.D.PB"); //初始化pb区域
  2. //#region 初始化pb数据
  3. //版块窗体化
  4. U.MD.D.PB.CTBK = function () {
  5. var _UDOD = $("#UD_SYSXZBYP")[0],
  6. _UDE = U.UF.UI.Form({ s: U.MD.D.PB.CTGDCL, resize: U.UF.M.apply(this, [[U.MD.D.PB.NSYPBL, [$("#UD_SYSXZBYPR")[0], 0]]]), style: { overflow: "hidden", width: "90%", height: "85%" },
  7. id: "UD_PB", content: _UDOD, title: "<div class='UD_SYF_STI'>云端版块</div>", hst: { style: { "padding": "0"} }
  8. });
  9. _UDOD.style.display = "block";
  10. U.MD.D.PB.RMZXSX(1);
  11. return _UDE.be;
  12. }
  13. //初始化板块内容分页
  14. U.MD.D.PB.RMZXSX = function (UP) {
  15. if (UP <= 5 || !U.MD.U.L.isLogin(3)) {//未登录的用户只允许查看5页信息
  16. var _UTF, _UDID, _UDBD,
  17. _UDOD = $("#UD_SYSXZBYP"),
  18. _UDSD = $("#UD_SYSXZBYPL"),
  19. _UDTD = $("#UD_SYSXZBYPO"),
  20. _UGE = U.MD.D.H.ET["NT"]["PB"],
  21. _UDE = _UGE["DBK"],
  22. _USID = _UGE["USID"];
  23. //数据已加载
  24. if (_UGE["RM"]) {
  25. (!_UDSD.Child().length) && (_UDBD = U.MD.D.PB.PBCKMU(_UDSD[0], _$(_UGE["BK"]).Select({ "PublishedParentID": US.FORUMROOTID }))); //初始化导航数据
  26. //指定的板块查看
  27. if ((_UDID = _UGE["UHID"])) {
  28. if (_UDID) { U.MD.D.PB.YMHBK(_UDID); }
  29. else if (_UDBD) { _UDBD.onclick(); }
  30. }
  31. //查看本人 搜索的帖子
  32. else if (((_USID && (_USID.length == 36 || (_USID[1] && _USID[1].length == 36))) || _UDE) && !(_UTF = U.MD.D.PB.FYYMHBK(UP))) {
  33. return _UTF;
  34. }
  35. //打印版块发布
  36. else {
  37. U.MD.D.PB.NRMZXSX(UP);
  38. }
  39. }
  40. //数据未加载
  41. else {
  42. U.MD.D.PB.PBload(U.UF.M.apply(this, [[U.MD.D.PB.RMZXSX, [UP]]])); //数据请求加载
  43. }
  44. }
  45. }
  46. //初始化板块页面
  47. U.MD.D.PB.PBload = function (UCB) {
  48. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_PBload"], U.MD.D.PB.AsynPBload, [[$("#UD_SYSXZBYPO")[0], true], UCB]);
  49. }
  50. //初始化板块异步
  51. U.MD.D.PB.AsynPBload = function (r) {
  52. var context = r.context,
  53. _UCB = context[1];
  54. r = r.value;
  55. if (r) { //加载数据
  56. U.MD.D.PB.AsynGHBK({ context: "", value: r[0] }); //板块信息加载
  57. U.MD.D.PB.AsynTD({ context: "", value: [r[1], [], r[2], [], r[3], [], []] }); //论坛信息
  58. }
  59. (_UCB) && (_UCB());
  60. }
  61. //异步获取版块信息
  62. U.MD.D.PB.AsynGHBK = function (r) {
  63. var context = r.context || [, US.FORUMROOTID, , true],
  64. _UDID = context[1],
  65. _UCB = context[2],
  66. _UTF = context[3],
  67. _UGE = U.MD.D.H.ET["NT"]["PB"],
  68. _UDE = _UGE["BK"];
  69. r = r.value; (_UTF) && (r[r.length - 1].PublishedParentID = US.FORUMROOTID, _UDE.unshift(_UGE["DBK"] = r.splice(r.length - 1, 1)[0]));
  70. _UGE["BK"] = _UDE.concat(r); r = U.MD.D.PB.CGHBK(r, _UDID, _UTF) || r; (_UCB) && (_UCB(r)); //回调使用
  71. }
  72. //异步获取最新讨论
  73. U.MD.D.PB.AsynTD = function (r) {
  74. var _UDE = U.MD.D.H.ET["NT"]["PB"]; r = r.value;
  75. if (r) {
  76. _UDE["RM"] = [r[0].slice(0, 50), r[0].slice(50, 100)];
  77. _UDE["TJ"] = r[1];
  78. //_UDE["DBK"]["IF"] = r[2];
  79. _UDE["FC"] = r[3];
  80. _UDE["BC"] = r[4];
  81. _UDE["KC"] = [r[5], r[6]]; //初始化数据
  82. }
  83. }
  84. //生成目录 上下级目录形成
  85. U.MD.D.PB.CGHBK = function (UDE, UDID, UTF) {
  86. var i, _UGE = U.MD.D.H.ET["NT"]["PB"]["BK"],
  87. _UKE = _$(_UGE).Select({ UserDirectoryID: UDID });
  88. (!_UKE.length) && (_UKE = [{ UserDirectoryID: UDID}]);
  89. for (i = 0; (i < _UKE.length && UDE.length); i++) {
  90. _UKE[i].Next = _$(UDE).Delete({ PublishedParentID: _UKE[i].UserDirectoryID });
  91. _UKE = _UKE.concat(_UKE[i].Next);
  92. }
  93. return _UKE[0].Next;
  94. }
  95. //窗体滚动处理
  96. U.MD.D.PB.CTGDCL = function () {
  97. var _USE = { "position": "" }, UDOD = $("#UD_SYSXZBYPLT"), _UDPD = UDOD.Parent({ "usbody": "true" }), _UH = _UDPD.offsetHeight, _USH = UDOD.height(), _UT = UDOD.top(), _UGT = _UDPD.scrollTop;
  98. if ((_UGT + _USH > _UH) && (_UT < 0 ? 0 : _UT) + _USH < _UDPD.scrollTop + _UH - 20) { _USE["position"] = "absolute"; _USE[_UH > _USH ? "top" : "bottom"] = "5px"; } UDOD.css(_USE);
  99. }
  100. //#endregion
  101. //#region 导航处理区域
  102. //初始化导航
  103. U.MD.D.PB.PBCKMU = function (UDOD, UDE, userid, UTF) {
  104. var i, _UDRD, _UDTD, _UDSD,
  105. _UDE = U.MD.D.H.ET["NT"]["PB"]["DBK"],
  106. _UDID = _UDE ? _UDE["UserDirectoryID"] : "",
  107. _UDFD = $$("frag");
  108. (UTF !== true) && (UDOD.innerText = "");
  109. for (i = 0; i < UDE.length; i++) {
  110. _UDTD = $$("div", { "className": "UD_SYSXZBYPLA UTDF" + ((_UDID == UDE[i].UserDirectoryID) ? " UD_SYSXZBYPLOO" : ""), "onclick": userid ? [[U.MD.D.PB.CKWDFB, [1, UDE[i], userid]]] : [[U.MD.D.PB.DJPBCKMU, [UDE[i], null, "this"]]] }, _UDFD); //
  111. _UDSD = $$("div", { "className": "UD_SYSXZBYPLAI" }, _UDTD); (UDE[i].UserDirectoryUrl) && ($$("img", { "src": "http://" + UDE[i].UserDirectoryUrl }, _UDSD));
  112. $$("div", { "className": "UD_SYSXZBYPLO UTDF", "title": UDE[i].UserDirectoryName, "innerHTML": UDE[i].UserDirectoryName }, _UDTD); ((_UDID == UDE[i].UserDirectoryID)) && (_UDRD = _UDTD);
  113. }
  114. UDOD.appendChild(_UDFD);
  115. $(UDOD).Parent().style.display = UDE.length ? "block" : "none";
  116. return (_UDRD || _UDTD);
  117. }
  118. //查看我的发布
  119. U.MD.D.PB.CKWDFB = function (UP, UDE, userid) {
  120. if (!U.MD.U.L.isLogin(3) && UP) {//用户必须登录查看
  121. var _UKE, _UPE = US.userInfo.PB,
  122. _UGE = U.MD.D.H.ET["NT"]["PB"],
  123. _UDOD = $("#UD_SYSXZBY"),
  124. _UDPD = _UDOD.Parent(3),
  125. _UDAD = _UDOD.Child(),
  126. _UDTD = $("#UD_SYSXZBYPL")[0];
  127. userid = userid || US.userInfo.userid;
  128. $("#UD_SYSXZBYT")[0].innerHTML = "";
  129. (!_UPE || !_UPE[0] || !_UPE[0].length) && ($(_UDTD).Parent().style.display = "none");
  130. _UGE["DBK"] = UDE;
  131. _UGE["USID"] = userid;
  132. _UDID = UDE ? UDE["UserDirectoryID"] : US.EMPTYGUID;
  133. _UKE = U.MD.D.D.FYGBL(_UPE ? _UPE[1][_UDID] : null, UP, [10, 100]);
  134. (UP == 1) && (U.MD.D.PB.CKBKTZCL(_UDOD, UDE)); //初始化数据和按钮 _UDAD[1].innerText = ""
  135. if (_UKE[0]) { //打印我的发布
  136. if (UP == 1) {
  137. _UDAD[1].innerHTML = "";
  138. _UDAD[1].scrollTop = 0;
  139. U.MD.D.PB.NSYPBL(_UDAD[1], _UKE[0], UDE || _UPE[1][_UDID][_UKE[1]]);
  140. if (!_UKE[0].length) { //暂无帖子查看
  141. U.MD.D.PB.PMHBKK(_UDAD[1], UDE ? null : { "onclick": [[U.UF.Ut.AddObj, [_UGE, { "USID": ""}]], , [U.MD.D.PB.PBCKZXR, [$("#UD_SYSXZBTOC").Child()[1]]]] });
  142. }
  143. U.MD.D.PB.PBCKMU(_UDTD, _UPE[0], userid);
  144. }
  145. }
  146. else { //请求数据
  147. if (!$("div#loadImg", _UDPD)[0]) {
  148. U.UF.A.Request(US.AUTH, ["GetMeA", userid, _UDID, (_UKE[1] - 1) * 100, _UKE[1] * 100, _UPE ? false : true], U.MD.D.PB.AsynCKWDFB, [[UP == 1 ? _UDPD : _UDAD[2], true], _UDID, UP, _UKE[1], UDE, userid]);
  149. }
  150. }
  151. return true;
  152. }
  153. }
  154. //首页目录点击
  155. U.MD.D.PB.YMHBK = U.MD.D.PB.DJPBCKMU = function (UDE, UFN, UDOD, userid) {
  156. (typeof UDE == "string") && (UDE = { "UserDirectoryID": UDE });
  157. var _UAE, _UBE,
  158. _UDTD = $("#UD_SYSXZBY"),
  159. _UGE = U.MD.D.H.ET["NT"]["PB"];
  160. (!(_UBE = _$(_UGE["BK"]).Select({ "UserDirectoryID": UDE["UserDirectoryID"] })[0])) && (_UGE["BK"].push(UDE));
  161. UDE = _UBE || UDE;
  162. _UAE = UDE["IF"];
  163. $("#UD_SYSXZBYPLT").css("position", "", 0);
  164. _UGE["DBK"] = UDE;
  165. _UGE["USID"] = userid || "";
  166. (UDOD) && (U.UF.MR.DHQH(UDOD, "UD_SYSXZBYPLOO"));
  167. U.MD.D.PB.Pa.XSYCBK(_UDTD.Parent());
  168. _UGE["UHID"] = ""; //切换展示
  169. if (_UAE) {
  170. (!US.userInfo.userid) && (U.MD.D.H.ET.DLHD = [U.UF.M.apply(this, [[U.MD.D.PB.DJPBCKMU, [UDE, UFN, UDOD, userid]]])]); //点击查看目录信息
  171. if (_UAE[2] == 2 && userid) { //获取是否收藏了本模块
  172. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_IFPBCollect", UDE.UserDirectoryID, US.userInfo.userid || US.EMPTYGUID]), U.MD.D.PB.CMHBK, ["", U.UF.M.apply(this, [[U.MD.D.PB.DJPBCKMU, [UDE, UFN, UDOD, userid]]])];
  173. // U.UF.A.Request(US.AUTH,"pb.IFCollect", [UDE.UserDirectoryID, US.userInfo.userid || US.EMPTYGUID]), U.MD.D.PB.CMHBK, ["", U.UF.M.apply(this, [[U.MD.D.PB.DJPBCKMU, [UDE, UFN, UDOD, userid]]])];
  174. }
  175. else { //打印目录信息
  176. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_B_S_GetNexDiretory", UDE.UserDirectoryID || UDE.PublishedDirectoryID, US.EMPTYGUID]), U.MD.D.PB.AsynGetND, ["", UDE];
  177. // U.UF.A.Request(US.AUTH,"pb.GetND", [UDE.UserDirectoryID || UDE.PublishedDirectoryID, US.EMPTYGUID]), U.MD.D.PB.AsynGetND, ["", UDE];
  178. U.MD.D.PB.FYYMHBK(1); //获取下级目录
  179. _UDTD = U.MD.D.PB.CKBKTZCL(_UDTD, UDE);
  180. U.MD.D.PB.XJBKMU(_UDTD[0], UDE["Child"], UDE);
  181. U.MD.N.UrlWrite(["pb", UDE.UserDirectoryID], UDE.UserDirectoryName + "板块");
  182. (U.UF.Ut.isFunction(UFN)) && (UFN()) //信息输出 //打印目录信息 //URL地址重写
  183. }
  184. }
  185. else {
  186. (_UDTD = $("#UD_SYSXZBYPR"))[0].innerText = ""; UDE["IF"] = [];
  187. U.UF.A.Request(US.AUTH, ["GBKSJ", UDE.UserDirectoryID || UDE.PublishedDirectoryID, userid || US.EMPTYGUID]), U.MD.D.PB.AsynYMHBK, [[_UDTD[0], true], UDE, null, userid, U.UF.M.apply(this, [[U.MD.D.PB.DJPBCKMU, [UDE, UFN, UDOD, userid]]]), UDOD];
  188. } //获取版块信息
  189. }
  190. //判断用户是否添加
  191. U.MD.D.PB.CMHBK = function (r) {
  192. var context = r.context, UDE = context[1];
  193. context[1]["IF"][2] = r.value[0];
  194. U.MD.D.PB.YMHBK(UDE);
  195. }
  196. //异步获取板块数据
  197. U.MD.D.PB.AsynYMHBK = function (r) {
  198. var context = r.context, _UGE = U.MD.D.H.ET["NT"]["PB"], _UDE = context[1], _UFN = context[2], _userid = context[3], _UCB = context[4]; r = r.value;
  199. U.MD.D.PB.CLYMHBK(_UGE["BK"], _UDE, r, _UDE.PublishedParentID); (_UGE["DBK"] == _UDE && ((_UCB || U.MD.D.PB.YMHBK)(_UDE, _UFN, null, _userid))); //获取后打印版块信息
  200. }
  201. //获取目录的处理
  202. U.MD.D.PB.CLYMHBK = function (UGE, UDE, UKE, UDID) {
  203. UDE = UDE || {}; U.UF.Ut.AddObj(UDE, UKE[3]); UDE["IF"] = UKE; UDE["IF"][0] = [, UKE[0][0]]; UDE.PublishedParentID = UDID || UDE.UserDirectoryID; UDE["Child"] = UKE[4]; UDE["IF"].splice(3, 2);
  204. (UGE && !_$(UGE).Select({ "UserDirectoryID": UDE.UserDirectoryID })[0]) && (UGE.push(UDE)); _$(UGE).Delete({ "PublishedParentID": UDE.UserDirectoryID }); UGE = UGE.concat(UDE["Child"])
  205. }
  206. //下级版块目录展示
  207. U.MD.D.PB.XJBKMU = function (UDOD, UDE, UBE) {
  208. var _UCE, i = 0, _UGE = U.MD.D.H.ET["NT"]["PB"]["BK"], _USID = _UGE["USID"], _userid = US.userInfo.userid, _UDFD = $$("div", { "className": "UD_SYSXZBYTC" }); UDOD.innerText = ""; (!UDE) && (UDE = []); (UBE.PublishedParentID != US.FORUMROOTID) && (i--);
  209. for (i; i < UDE.length; i++) { _UCE = i < 0 ? _$(_UGE).Select({ "UserDirectoryID": UBE.PublishedParentID })[0] : UDE[i]; $$("div", { "className": "UD_SYSXZBYTO", "innerHTML": i < 0 ? "< 返回上一层" : UDE[i].UserDirectoryName, "onclick": (_userid && _USID == _userid) ? [[U.MD.D.PB.CKWDFB, [1, _UCE, _userid]]] : [[U.MD.D.PB.DJPBCKMU, [_UCE]]] }, _UDFD); }
  210. (i || UBE.PublishedParentID != US.FORUMROOTID) ? (UDOD.style.display = "block", UDOD.appendChild(_UDFD)) : UDOD.style.display = "none";
  211. }
  212. //版块初始加载处理
  213. U.MD.D.PB.CKBKTZCL = function (UDOD, UDE) {
  214. var _UDPD, _UDAD = UDOD.Child(); _UDAD[0].style.display = UDE ? "block" : "none"; $(UDOD.Parent(5)).addAttrArray({ "UH": "", "UPL": "" }); //是否显示发帖和版块切换
  215. if ((_UDPD = $(UDOD).Parent(3)).id == "UD_SYSXZBYP") { _UDPD.UPL = 1; }; _UDAD = $(_UDAD[0]).Child(); //设置取消分页记录
  216. U.MD.D.PB.CSYMHBK(_UDAD[1], UDE); return _UDAD; //设置切换和发帖
  217. //(_UDBD = $("#UD_SYSXZBFCTA")[0]).onclick = U.UF.M.apply(_UDBD, [[U.UF.M.StopBubble], [U.MD.D.PB.A.FBTZMU, [UDE, _UDBD]]]);
  218. }
  219. //设置版块功能切换
  220. U.MD.D.PB.CSYMHBK = function (UDOD, UDE) {
  221. var i, _userid = US.userInfo.userid, _UDAD = $(UDOD).Child(), _UKE = ["GX", "Img", "Rm", "Me", "Disk"];
  222. for (i = 0; i < 5; i++) { (_UDAD[i]) && (_UDAD[i].onclick = U.UF.M.apply(_UDAD[i], [[U.MD.D.PB.GNXZCK, [_UKE[i], _UDAD[i], UDE]]])); } //切换效果
  223. }
  224. //下级目录获取更新
  225. U.MD.D.PB.AsynGetND = function (reuqest) {
  226. var i, j, _UFE, _UCE, _UGE = U.MD.D.H.ET["NT"]["PB"], context = reuqest.context, _UDE = context[1], _UAE = _UDE.Child; reuqest = reuqest.value;
  227. if (reuqest) {
  228. if (_UAE.length) {
  229. _UFE: for (i = 0; i < _UAE.length; i++) {
  230. for (j = 0; j < reuqest.length; j++) {
  231. if (_UAE[i].UserDirectoryID == reuqest[j].UserDirectoryID) { U.UF.Ut.AddObj(_UAE[i], reuqest.splice(j, 1)[0]); continue _UFE; }
  232. if (i == _UAE.length - 1 && j == reuqest.length - 1) { _UAE = _UAE.concat(reuqest); }
  233. }
  234. _UAE.splice(i, 1); i--;
  235. }
  236. }
  237. else { _UAE = _UAE.concat(reuqest); }
  238. _UDE["Child"] = _UAE; (_UGE["DBK"] == _UDE) && (U.MD.D.PB.XJBKMU($("#UD_SYSXZBYT")[0], _UAE, _UDE));
  239. }
  240. }
  241. //#endregion
  242. //#region 帖子处理区域
  243. //点击我的发布
  244. U.MD.D.PB.CKWDFBDJ = function (UDOD) {
  245. if (U.MD.D.PB.CKWDFB(1)) {
  246. U.MD.D.PB.PBCKZXR(UDOD);
  247. }
  248. }
  249. //帖子分页
  250. U.MD.D.PB.FYYMHBK = function (UP, UCB) {
  251. UP = UP || "";
  252. var _UTF,
  253. _UPE,
  254. _userid = US.userInfo.userid,
  255. _UGE = U.MD.D.H.ET["NT"]["PB"],
  256. _USID = _UGE["USID"],
  257. _UDE = _UGE["DBK"];
  258. (UP == 1) && ($("#UD_SYSXZBYP").Parent().onscroll = U.UF.M.SSCH({ "AF": U.UF.M.apply(null, function () { U.MD.D.PB.FYYMHBK(this.P + 2, UCB); }) }).SCH()); //滚动加载函数加载
  259. if (_userid && _USID && (_USID == _userid || _USID[1] == _userid)) { //查看本人帖子
  260. U.MD.D.PB.PBCKZXR($("#UD_SYSXZBTOC").Child()[0], true);
  261. U.MD.D.PB.CKWDFB(UP, _UDE);
  262. }
  263. else if (_USID && (_USID[1] && _USID[1].length == 36 && _USID[1] != _userid)) { //搜索分页查看搜索
  264. U.MD.D.PB.A.FTZSS(_USID[0], UP, _USID[1], _USID[2]);
  265. }
  266. else { //普通帖子察看
  267. U.MD.D.PB.PBCK(UP, _UDE);
  268. }
  269. }
  270. //最新发布和最热门切换样式
  271. U.MD.D.PB.PBCKZXR = function (UDOD, UTF) {
  272. var _UIE,
  273. _UDAD = $($(UDOD).Parent()).Child(),
  274. _UDPD = $(UDOD).Parent(3), _UAE = ["O", "O", "T"];
  275. for (i = 0; i < _UDAD.length; i++) { $(_UDAD[i])[(UDOD == _UDAD[i]) ? (_UIE = i, "addClass") : "removeClass"]("UD_SYSXZBTN" + _UAE[i]); } //添加className
  276. if (!UTF) { $(_UDPD).Parent(3).UH = _UDPD.UPL = ""; (_UIE) && (U.MD.D.PB.NRMZXSX(1, _UIE)); } //切换同时查看最新最热
  277. }
  278. //初始化查看
  279. U.MD.D.PB.PBCK = function (UP, UDE) {
  280. if (UDE) {
  281. var _UTF,
  282. _UGE = U.MD.D.H.ET["NT"]["PB"],
  283. _USID = _UGE["USID"];
  284. if (UP == 1) { //促使化导航
  285. U.MD.D.PB.PBCKMU($("#UD_SYSXZBYPL")[0], _$(_UGE["BK"]).Select({ "PublishedParentID": US.FORUMROOTID }));
  286. }
  287. if (UDE["IF"]) {
  288. _UTF = U.MD.D.PB.GNXZCK(_USID, null, UDE, UP);
  289. }
  290. else {
  291. U.MD.D.PB.YMHBK(UDE);
  292. }
  293. return _UTF;
  294. }
  295. }
  296. //查看帖子
  297. U.MD.D.PB.GNXZCK = function (UTF, UDOD, UDE, UP) {
  298. var _UCE, _UKE, _UPE, _UFT, _UAID = US.EMPTYGUID,
  299. _UBE = US.userInfo.PB,
  300. _userid = US.userInfo.userid,
  301. _UDID = UDE.UserDirectoryID,
  302. _UDTD = $("#UD_SYSXZBYPR")[0],
  303. _UVT = (UDOD && UDOD.className == "UD_SYSXZBECTC UD_SYSXZBECTO"),
  304. _UGE = U.MD.D.H.ET["NT"]["PB"];
  305. UP = UP || 1; UTF = UTF || "GX";
  306. switch (UTF) {
  307. case "GX": _UCE = ["Publicpage", 0, 0]; break;
  308. case "Img": _UCE = ["GetPATImg", 4, 1]; break;
  309. case "Rm": _UCE = ["RPHotPost", 3, 2]; break;
  310. case "Disk": U.MD.D.I.YYDK("PDisk", [0]); return; break;
  311. case "Me": if (U.MD.U.L.isLogin(3)) { return; }
  312. _UCE = ["GetMeA", 5, 3]; break;
  313. } //获取数据的形式
  314. (_UCE && _UCE[2] != null) && U.MD.D.PB.SPMHBK(UDOD || $("#UD_SYSXZBALCB").Child()[_UCE[2]]);
  315. _UGE["USID"] = (_userid && (_UGE["USID"] == _userid || _UGE["USID"][1] == _userid)) ? (_UFT = true, [UTF, _userid]) : UTF;
  316. _UKE = (_UFT ? (UTF == "GX" ? _UBE[1][_UDID] : (_UBE[1][UTF] ? _UBE[1][UTF][_UDID] : null)) : (UDE["IF"] && UDE["IF"][_UCE[1]]));
  317. if (_UKE || UP == 1) { //加载数据
  318. _UPE = U.MD.D.D.FYGBL(_UKE, UP, [20, 100]); //分页获取值
  319. if (!_UPE[0] || _UVT) {//更新数据 或者获取数据
  320. _UCE[2] = [_UDID, (_UPE[1] - 1) * 100, _UPE[1] * 100];
  321. if (_UCE[0] == "Publicpage") { _UCE[2].push(1); }
  322. else if (_UCE[0] == "GetMeA") { _UCE[2].unshift(US.userInfo.userid); }; //获取数据前处理
  323. (_UVT && _UKE && _UKE[1] && _UKE[1][0]) && (_UAID = _UKE[1][0].ArticleID);
  324. _UCE[2].push(_UAID); _UCE[2].push(_UFT ? _userid : US.EMPTYGUID); //是否更新数据
  325. _UCE[2].unshift(_UCE[0]);
  326. U.UF.A.Request(US.AUTH, (_UCE[2]), U.MD.D.PB.AsynTMTZ, [!_UVT ? [UP == 1 ? _UDTD : $("#UD_SYSXZBYPD")[0], true] : "", UDE, _UCE[1], UP, UTF, _UPE[1], _UDTD, _UDID, _UFT, _UFT ? _UBE[1] : null]); //请求数据
  327. }
  328. else { (UP == 1) && (_UDTD.innerText = ""); if (UP == 1 && !_UPE[0].length) { U.MD.D.PB.PMHBKK(_UDTD); } else if (_UPE[0].length) { U.MD.D.PB.NSYPBL(_UDTD, _UPE[0], UDE); } } //切换数据查看
  329. }
  330. else { U.Alert("数据加载中,请稍候"); return false; }
  331. }
  332. //帖子更新
  333. U.MD.D.PB.AsynTMTZ = function (r) {
  334. var _UDE, context = r.context, _UDE = context[1], _ITF = context[2], _UP = context[3], _UTF = context[4], _UIP = context[5], _UDOD = context[6], _UDID = context[7], _UFT = context[8], _UBE = context[9], _UTP = _ITF, _UPE = _UFT ? _UBE : _UDE;
  335. r = r.value; if (_UFT) { (_UTF != "GX") && (_UPE = _UPE[_UTF] = _UPE[_UTF] || {}); _UTP = _UDID } else { _UPE = _UPE["IF"]; }; //选择添加区域
  336. if (!_UPE[_UTP]) { _UPE[_UTP] = [null, r]; } else if (_UIP > 1) { _UPE[_UTP][_UIP] = r; } else { _UPE[_UTP][1] = r.concat(_UPE[_UTP][1]); } //添加信息
  337. if (_UTF == "GX" && r.length && _UPE["IF"]) { _UPE["ACF"] = r[0].AllCount || _UPE["ACF"]; } U.MD.D.PB.GNXZCK(_UTF, null, _UDE, _UP); //打印帖子信息
  338. }
  339. //空帖子打印
  340. U.MD.D.PB.PMHBKK = function (UDOD, UDE) {
  341. var _UDTD, _UDSD, _UDCD = $("#UD_SYSXZBFCAC")[0];
  342. _UDTD = $$("div", { "className": "UD_SYSXZBECCT" }, UDOD);
  343. $$("div", { "className": "UD_SYSXZBECCTS", "innerHTML": "这里暂时没有任何内容哦! !" }, _UDTD);
  344. _UDSD = $$("div", { "className": "UD_SYSXZBECCTX", "innerHTML": "赶紧抢先: " }, _UDTD);
  345. $$("span", { "innerHTML": "发布分享", "onclick": (UDE && UDE.onclick) ? UDE.onclick : [[U.UF.M.StopBubble], [U.UF.M.IEVENT, [_UDCD, "mousedown"]], [U.UF.M.IEVENT, [_UDCD, "focus"]]] }, _UDSD);
  346. }
  347. //切换版块信息
  348. U.MD.D.PB.SPMHBK = function (UDOD) {
  349. var i, _TF, _UDAD = $($(UDOD).Parent()).Child();
  350. for (i = 0; i < _UDAD.length - 3; i++) { _UDAD[i].className = "UD_SYSXZBALCO" + (_UDAD[i] == UDOD ? " UD_SYSXZBALCOO" : ""); }
  351. }
  352. //查看本人信息异步
  353. U.MD.D.PB.AsynCKWDFB = function (r) {
  354. var _UGE, context = r.context,
  355. _UDID = context[1],
  356. _UP = context[2],
  357. _UTP = context[3],
  358. _UDE = context[4],
  359. _userid = context[5];
  360. r = r.value;
  361. if (r[1]) { //目录和文章同时设置
  362. US.userInfo.PB = [r[0], {}];
  363. US.userInfo.PB[1][_UDID] = [null, r[1]]
  364. }
  365. else { //设置文章
  366. _UGE = US.userInfo.PB[1];
  367. (!_UGE[_UDID]) && (_UGE[_UDID] = []);
  368. _UGE[_UDID][_UTP] = r[0];
  369. };
  370. U.MD.D.PB.CKWDFB(_UP, _UDE, _userid); //打印我的发布
  371. }
  372. //版块文章信息输出
  373. U.MD.D.PB.NSYPBL = function (UDOD, UDE, UBE, UTF) {
  374. UDOD = $(UDOD);
  375. var _ULT, i = 0,
  376. _UDFD = $$("frag"),
  377. _UME = U.MD.D.H.ET["NT"]["PB"]["DBK"],
  378. _UDPD = UDOD.Parent(2),
  379. _UDMD = UDOD.Parent({ usform: "true" }),
  380. _UDAD = UDOD.Child(),
  381. _UW = _UDMD.offsetWidth - 150,
  382. _UH = _UDMD.offsetHeight,
  383. _UIE = Math.floor(_UW / 366) || 1, _UL = ((UTF || U.UF.Ut.isNumber(UDE)) ? (UTF ? 0 : UDE) : _UDAD.length);
  384. if ((UDE && UDE.length)) {//添加
  385. for (; i < UDE.length; i++) {
  386. U.MD.D.PB.PBSYWZ(UDE[i], _UDFD, UBE);
  387. }
  388. UDOD.append(_UDFD, 0, UTF ? UDOD[0].firstChild : null); _UDAD = UDOD.Child();
  389. }
  390. for (i = _UL; i < _UDAD.length; i++) { //位置定位
  391. $(_UDAD[i]).addAttrArray({ "style": { "marginRight": ((i + 1) % _UIE) ? "" : "0px", "marginTop": (!_UME && (i < _UIE)) ? "0px" : ""} });
  392. }
  393. ((_UH = _UH - 250) > 0) && (_ULT = 366 + (_UIE < 2 ? 200 : 0), UDOD.css({ "marginTop": _UME ? "" : "0px", "width": _UDPD.style.width = ($(UDOD).Parent().style.width = ((_UW = _ULT * _UIE - 20)) + "px") }), $(_UDPD).Parent().style.width = _UW + 170 + "px"); //大小位置排位
  394. }
  395. //文章打印
  396. U.MD.D.PB.PBSYWZ = function (UDE, UDOD, UBE) {
  397. var _UTF, _UDTD, _UDPD, _UDSD, _UDID, _UDQD, _UDVD, _UDHD, _UDLD, _UDBD, _UDKD, _UDRD, _UDCD, _UDMD, _UDGD, _UDED, _UIMG, _userid = US.userInfo.userid, _UN = UDE.UserNickName || UDE.UserName;
  398. _UDTD = $$("div", { "onclick": [[U.MD.D.PB.A.WAPMHBK, [UDE, UBE, null, "this"]]], "className": "UD_SYSXZBPO" }, UDOD);
  399. _UDPD = $$("div", { "className": "UD_SYSXZBMCOS" }, _UDTD);
  400. _UDSD = $$("div", { "className": "UD_SYSXZBMCOT UD_SYSXZBMCOTB" }, _UDPD);
  401. _UDID = $$("div", { "className": "UD_SYSXZBMCOTL" }, _UDSD);
  402. $$("img", { "onerror": U.UF.M.ImgError, "alt": _UN, "title": _UN, "onclick": [[U.UF.M.StopBubble], [U.MD.U.I.ViewOtherUserInfo, [UDE.UserID]]], "src": U.UF.M.GetImgU(UDE.UserThumbnailImageHead) }, _UDID);
  403. _UDQD = $$("div", { "className": "UD_SYSXZBMCOCA" }, _UDSD);
  404. _UDVD = $$("div", { "className": "UD_SYSXZBMCOCAO UD_SYSXZBMCOCAT" }, _UDQD);
  405. _UDHD = $$("div", { "className": "UD_SYSXZBPOCLS UTDF", "innerHTML": UDE.ArticleTitle }, _UDVD); _UDHD.innerText = _UDHD.innerText;
  406. $$("div", { "className": "UD_SYSXZBPOTM UTDF", "innerHTML": (UDE.UserDirectoryName || (UBE ? UBE.UserDirectoryName : "学习系统")), "onclick": [[U.UF.M.StopBubble], [U.MD.D.PB.PBSYWZML, [UDE, UBE]]] }, _UDPD);
  407. (_userid && UDE.UserID == _userid) && ($$("div", { "className": "UD_SYSXZLRSRDTRZTI UD_SYSXZLRSRDTRZTIS UD_SYSXZLRSRDTRZTIO UD_SYI", "onclick": [[U.UF.M.StopBubble], [U.UF.UI.Confirm, ["是否删除该消息", [U.MD.D.Blog.F.SCPGBL, [UDE, _UDTD, UBE]]]]], "title": "移除消息" }, _UDSD));
  408. _UDVD = $$("div", { "className": "UD_SYSXZBMCOCB" }, _UDQD);
  409. $$("div", { "className": "UD_SYSXZBMCOTZ UTDF", "innerHTML": _UN }, _UDVD);
  410. $$("div", { "className": "UD_SYSXZBMCOTR", "innerHTML": U.UF.D.getDateInterval(UDE.ArticleAddTime) }, _UDVD);
  411. _UDHD = $$("div", { "className": "UD_SYSXZBPOC" }, _UDTD);
  412. _UDLD = $$("div", { "className": "UD_SYSXZBPOCL" }, _UDHD);
  413. _UDBD = $$("div", { "className": "UD_SYSXZBPOCLX", "innerHTML": UDE.ArticleContentBrief }, _UDLD); _UIMG = $("img", _UDBD)[0]; _UDBD.innerText = _UDBD.innerText.trim();
  414. if (_UIMG) { if ((_UDBD.innerText = _UDBD.innerText.addEllipsis(200)) == "") { _UDBD.style.display = "none"; _UTF = true; }; _UDKD = $$("div", { "className": "UD_SYSXZBPOCR", "style": { "marginTop": _UTF ? "0px" : "", "height": (222 - Math.ceil(_UDBD.innerText.count() / 52) * 20) + "px"} }, _UDHD); _UDRD = $$("div", { "onclick": U.UF.M.apply() }, _UDKD); U.MD.D.H.JZTPJS(_UIMG.src, _UDRD, UDE); }
  415. else { $(_UDBD).addAttrArray({ "innerText": _UDBD.innerText, "style": { "height": (_UDLD.style.maxHeight = "100%")} }); }
  416. _UDCD = $$("div", { "className": "UD_SYSXZBPOD" }, _UDTD);
  417. _UDMD = $$("div", { "className": "UD_SYSXZBPODL" }, _UDCD);
  418. _UDGD = $$("div", { "className": "UD_SYSXZBPODR" }, _UDCD);
  419. _UDED = $$("div", { "className": "UD_SYSXZZXRCDO" }, _UDGD);
  420. $$("div", { "className": "UD_SYSXZZXRCDOI UD_SYI" }, _UDED);
  421. $$("div", { "innerHTML": "查看(" + UDE.AricitleReadNumber + ")" }, _UDED);
  422. _UDED = $$("div", { "className": "UD_SYSXZZXRCDT" }, _UDGD);
  423. $$("div", { "className": "UD_SYSXZZXRCDTI UD_SYI" }, _UDED);
  424. $$("div", { "innerHTML": "评论(" + (UDE.ArticleReplayNumber < 0 ? 0 : UDE.ArticleReplayNumber) + ")" }, _UDED);
  425. return _UDTD;
  426. }
  427. //目录文章点击
  428. U.MD.D.PB.PBSYWZML = function (UDE, UBE) {
  429. var _UGE = U.MD.D.H.ET["NT"]["PB"], _UDID = UDE["PublishedDirectoryID"] || UDE["UserDirectoryID"]; UBE = UBE || _$(_UGE["BK"]).Select({ "UserDirectoryID": _UDID })[0];
  430. U.MD.D.PB.DJPBCKMU(UBE || { "UserDirectoryID": _UDID, "UserDirectoryName": UDE["UserDirectoryName"] }, null, null, _UGE["USID"] == US.userInfo.userid ? _UGE["USID"] : null); //查看目录信息
  431. }
  432. //#endregion
  433. //#region 查看最新和热门
  434. //版块内容热门分页
  435. U.MD.D.PB.NRMZXSX = function (UP, UTF) {
  436. var i, _UE = UP * 10, _UDOD, _UGE = U.MD.D.H.ET["NT"]["PB"], _UDE = _UGE["RM"]; _UGE["DBK"] = null;
  437. if (!UTF) { _UDOD = $("#UD_SYSXZBTOC").Child(); for (i = 0; i < _UDOD.length; i++) { if ($(_UDOD[i]).hasClass("UD_SYSXZBTNO") || $(_UDOD[i]).hasClass("UD_SYSXZBTC")) { break; } }; UTF = i; } //点亮图标
  438. if (UTF) {
  439. _UDOD = $("#UD_SYSXZBY").Child(); _UDOD[0].style.display = "none";
  440. if ((_UDE = _UDE[UTF - 1]).length >= _UE) { (UP == 1) && (_UDOD[1].innerText = ""); U.MD.D.PB.NSYPBL(_UDOD[1], _UDE.slice(_UE - 10, _UE), null); } //打印热门或者最新发布
  441. else { U.MD.D.PB.HRMZXSX(Math.ceil(_UDE.length / 50) + 1, UTF - 1, UP); } //获取最新数据
  442. (UP == 1) && (U.MD.D.PB.PBCKMU($("#UD_SYSXZBYPL")[0], _$(_UGE["BK"]).Select({ "PublishedParentID": US.FORUMROOTID }))); //目录查看
  443. }
  444. else { _UDCD[0].onclick(); } //查看我的发布
  445. }
  446. //获取最新和最热消息
  447. U.MD.D.PB.HRMZXSX = function (UIE, UTF, UP) {
  448. var _UE = UIE * 50;
  449. U.UF.A.Request(US.CROSSDOMAIN, [US.DB, "UseStudio_Blog", "UB_P_S_NewAndHpPost", _UE - 50, _UE, UTF], U.MD.D.PB.AsynHRMZXSX, [[$("#UD_SYSXZBYPD")[0], true], UIE, UTF, UP]);
  450. //U.UF.A.Request(US.AUTH,"pb.UB_P_S_NewAndHpPost", [_UE - 50, _UE, UTF], U.MD.D.PB.AsynHRMZXSX, [[$("#UD_SYSXZBYPD")[0], true], UIE, UTF, UP]); //获取更新数据
  451. }
  452. //获取消息异步
  453. U.MD.D.PB.AsynHRMZXSX = function (r) {
  454. var context = r.context, _UIE = context[1], UTF = context[2], _UP = context[3], _UCE = U.MD.D.H.ET["NT"]["PB"]["RM"];
  455. r = r.value; _UCE[UTF] = _UCE[UTF].concat(r); U.MD.D.PB.RMZXSX(_UP, UTF + 1); //热门或者最新查看
  456. }
  457. //#endregion
  458. //#region 功能区域
  459. //意见反馈点击
  460. U.MD.D.PB.YJYMHBK = function (UDID, UFN) {
  461. try { U.MD.D.H.ET["NT"]["PB"]["UHID"] = UDID; U.MD.D.I.YYDK("PB"); } catch (e) { U.Alert("未加载完..请等待"); }
  462. }
  463. //#endregion