ForumHome.js 29 KB

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