group_index.htm 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <!--{if $status != 2}-->
  2. <!--{if $livethread}-->
  3. <div id="livethread" class="tl bm bmw cl" style="padding:10px 15px;">
  4. <div class="livethreadtitle vm">
  5. <span class="replynumber xg1">{lang reply} <span id="livereplies" class="xi1">$livethread[replies]</span></span>
  6. <a href="forum.php?mod=viewthread&tid=$livethread[tid]" target="_blank">$livethread[subject]</a> <img src="{IMGDIR}/livethreadtitle.png" />
  7. </div>
  8. <div class="livethreadcon">$livemessage</div>
  9. <div id="livereplycontentout">
  10. <div id="livereplycontent">
  11. </div>
  12. </div>
  13. <div id="liverefresh">{lang group_live_newreply_refresh}</div>
  14. <div id="livefastreply">
  15. <form id="livereplypostform" method="post" action="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$livethread[tid]&replysubmit=yes&infloat=yes&handlekey=livereplypost&inajax=1" onsubmit="return livereplypostvalidate(this)">
  16. <div id="livefastcomment">
  17. <textarea id="livereplymessage" name="message" style="color:gray;<!--{if !$liveallowpostreply}-->display:none;<!--{/if}-->">{lang group_live_fastreply_notice}</textarea>
  18. <!--{if !$liveallowpostreply}-->
  19. <div>
  20. <!--{if !$_G[uid]}-->
  21. {lang login_to_reply} <a href="member.php?mod=logging&action=login" onclick="showWindow('login', this.href)" class="xi2">{lang login}</a> | <a href="member.php?mod={$_G[setting][regname]}" class="xi2">$_G['setting']['reglinkname']</a>
  22. <!--{else}-->
  23. {lang no_permission_to_post}<a href="javascript:;" onclick="ajaxpost('livereplypostform', 'livereplypostreturn', 'livereplypostreturn', 'onerror', $('livereplysubmit'));" class="xi2">{lang click_to_show_reason}</a>
  24. <!--{/if}-->
  25. </div>
  26. <!--{/if}-->
  27. </div>
  28. <div id="livepostsubmit" style="display:none;">
  29. <!--{if $secqaacheck || $seccodecheck}-->
  30. <!--{block sectpl}--><sec> <span id="sec<hash>" onclick="showMenu(this.id)"><sec></span><div id="sec<hash>_menu" class="p_pop p_opt" style="display:none"><sec></div><!--{/block}-->
  31. <div class="mtm sec" style="text-align:right;"><!--{subtemplate common/seccheck}--></div>
  32. <!--{/if}-->
  33. <p class="ptm pnpost" style="margin-bottom:10px;">
  34. <button type="submit" name="replysubmit" class="pn pnc vm" style="float:right;" value="replysubmit" id="livereplysubmit">
  35. <strong>{lang group_live_post}</strong>
  36. </button>
  37. </p>
  38. </div>
  39. <input type="hidden" name="formhash" value="{FORMHASH}">
  40. <input type="hidden" name="subject" value=" ">
  41. </form>
  42. </div>
  43. <span id="livereplypostreturn"></span>
  44. </div>
  45. <script type="text/javascript" src="{$_G['setting']['jspath']}seditor.js?{VERHASH}"></script>
  46. <script type="text/javascript">
  47. var postminchars = parseInt('$_G['setting']['minpostsize']');
  48. var postmaxchars = parseInt('$_G['setting']['maxpostsize']');
  49. var disablepostctrl = parseInt('{$_G['group']['disablepostctrl']}');
  50. var replycontentlist = new Array();
  51. var addreplylist = new Array();
  52. var timeoutid = timeid = movescrollid = waitescrollid = null;
  53. var replycontentnum = 0;
  54. getnewlivepostlist(1);
  55. timeid = setInterval(getnewlivepostlist, 5000);
  56. $('livereplycontent').style.width = ($('livereplycontentout').clientWidth - 50) + 'px';
  57. $('livereplymessage').onfocus = function() {
  58. if(this.style.color == 'gray') {
  59. this.value = '';
  60. this.style.color = 'black';
  61. $('livepostsubmit').style.display = 'block';
  62. this.style.height = '56px';
  63. $('livefastcomment').style.height = '57px';
  64. }
  65. };
  66. $('livereplymessage').onblur = function() {
  67. if(this.value == '') {
  68. this.style.color = 'gray';
  69. this.value = '{lang group_live_fastreply_notice}';
  70. }
  71. };
  72. $('liverefresh').onclick = function() {
  73. $('livereplycontent').style.position = 'absolute';
  74. getnewlivepostlist();
  75. this.style.display = 'none';
  76. };
  77. $('livereplycontentout').onmouseover = function(e) {
  78. if($('livereplycontent').style.position == 'absolute' && $('livereplycontent').clientHeight > 215) {
  79. $('livereplycontent').style.position = 'static';
  80. this.scrollTop = this.scrollHeight;
  81. }
  82. if(this.scrollTop + this.clientHeight != this.scrollHeight) {
  83. clearInterval(timeid);
  84. clearTimeout(timeoutid);
  85. clearInterval(movescrollid);
  86. timeid = timeoutid = movescrollid = null;
  87. if(waitescrollid == null) {
  88. waitescrollid = setTimeout(function() {
  89. $('liverefresh').style.display = 'block';
  90. }, 60000 * 10);
  91. }
  92. } else {
  93. clearTimeout(waitescrollid);
  94. waitescrollid = null;
  95. }
  96. };
  97. $('livereplycontentout').onmouseout = function(e) {
  98. if(this.scrollTop + this.clientHeight == this.scrollHeight) {
  99. $('livereplycontent').style.position = 'absolute';
  100. clearInterval(timeid);
  101. timeid = setInterval(getnewlivepostlist, 10000);
  102. }
  103. };
  104. function getnewlivepostlist(first) {
  105. var x = new Ajax('JSON');
  106. x.getJSON('forum.php?mod=misc&action=livelastpost&fid=$livethread[fid]', function(s, x) {
  107. var count = s.data.count;
  108. $('livereplies').innerHTML = count;
  109. var newpostlist = s.data.list;
  110. for(i in newpostlist) {
  111. var postid = i;
  112. var postcontent = '';
  113. postcontent += '<dt><a href="home.php?mod=space&uid=' + newpostlist[i].authorid + '" target="_blank">' + newpostlist[i].avatar + '</a></dt>';
  114. postcontent += '<dd><a href="home.php?mod=space&uid=' + newpostlist[i].authorid + '" target="_blank">' + newpostlist[i].author + '</a></dd>';
  115. postcontent += '<dd>' + newpostlist[i].message + '</dd>';
  116. postcontent += '<dd class="dateline">' + newpostlist[i].dateline + '</dd>';
  117. if(replycontentlist[postid]) {
  118. $('livereply_' + postid).innerHTML = postcontent;
  119. continue;
  120. }
  121. addreplylist[postid] = '<dl id="livereply_' + postid + '">' + postcontent + '</dl>';
  122. }
  123. if(first) {
  124. for(i in addreplylist) {
  125. replycontentlist[i] = addreplylist[i];
  126. replycontentnum++;
  127. var div = document.createElement('div');
  128. div.innerHTML = addreplylist[i];
  129. $('livereplycontent').appendChild(div);
  130. delete addreplylist[i];
  131. }
  132. } else {
  133. livecontentfacemove();
  134. }
  135. });
  136. }
  137. function livecontentfacemove() {
  138. //note 从队列中取出数据
  139. var reply = '';
  140. for(i in addreplylist) {
  141. reply = replycontentlist[i] = addreplylist[i];
  142. replycontentnum++;
  143. delete addreplylist[i];
  144. break;
  145. }
  146. if(reply) {
  147. var div = document.createElement('div');
  148. div.innerHTML = reply;
  149. var oldclientHeight = $('livereplycontent').clientHeight;
  150. $('livereplycontent').appendChild(div);
  151. $('livereplycontentout').style.overflowY = 'hidden';
  152. $('livereplycontent').style.bottom = oldclientHeight - $('livereplycontent').clientHeight + 'px';
  153. if(replycontentnum > 20) {
  154. $('livereplycontent').removeChild($('livereplycontent').firstChild);
  155. for(i in replycontentlist) {
  156. delete replycontentlist[i];
  157. break;
  158. }
  159. replycontentnum--;
  160. }
  161. if(!movescrollid) {
  162. movescrollid = setInterval(function() {
  163. if(parseInt($('livereplycontent').style.bottom) < 0) {
  164. $('livereplycontent').style.bottom =
  165. ((parseInt($('livereplycontent').style.bottom) + 5) > 0 ? 0 : (parseInt($('livereplycontent').style.bottom) + 5)) + 'px';
  166. } else {
  167. $('livereplycontentout').style.overflowY = 'auto';
  168. clearInterval(movescrollid);
  169. movescrollid = null;
  170. timeoutid = setTimeout(livecontentfacemove, 1000);
  171. }
  172. }, 100);
  173. }
  174. }
  175. }
  176. function livereplypostvalidate(theform) {
  177. var s;
  178. if(theform.message.value == '' || $('livereplymessage').style.color == 'gray') {
  179. s = '{lang group_live_nocontent_error}';
  180. }
  181. if(s) {
  182. showError(s);
  183. doane();
  184. $('livereplysubmit').disabled = false;
  185. return false;
  186. }
  187. $('livereplysubmit').disabled = true;
  188. theform.message.value = theform.message.value.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/ig, '$1[img]$2[/img]');
  189. theform.message.value = parseurl(theform.message.value);
  190. ajaxpost('livereplypostform', 'livereplypostreturn', 'livereplypostreturn', 'onerror', $('livereplysubmit'));
  191. return false;
  192. }
  193. function succeedhandle_livereplypost(url, msg, param) {
  194. $('livereplymessage').value = '';
  195. $('livereplycontent').style.position = 'absolute';
  196. if(param['sechash']) {
  197. updatesecqaa(param['sechash']);
  198. updateseccode(param['sechash']);
  199. }
  200. getnewlivepostlist();
  201. }
  202. </script>
  203. <!--{/if}-->
  204. <!--{if helper_access::check_module('group')}-->
  205. <div id="pgt" class="bm bw0 pgs cl">
  206. <div class="pg">
  207. <a href="forum.php?mod=forumdisplay&action=list&fid=$_G[fid]" class="nxt">{lang view_all_threads}</a>
  208. </div>
  209. <a href="javascript:;" id="newspecial" onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu({'ctrlid':this.id})" onclick="showWindow('newthread', 'forum.php?mod=post&action=newthread&fid=$_G[fid]')" title="{lang send_posts}"><img src="{IMGDIR}/pn_post.png" alt="{lang send_posts}" /></a>
  210. </div>
  211. <!--{/if}-->
  212. <div class="tl bm bml">
  213. <div class="th">
  214. <table cellpadding="0" cellspacing="0" border="0">
  215. <thead>
  216. <tr>
  217. <td class="icn">&nbsp;</td>
  218. <th>{lang latest_threads}</th>
  219. <td class="by">{lang author}/{lang dateline_range}</td>
  220. <td class="num">{lang replies}</td>
  221. <td class="by">{lang lastpost}</td>
  222. </tr>
  223. </thead>
  224. </table>
  225. </div>
  226. <div class="bm_c">
  227. <!--{if $newthreadlist['dateline']['data']}-->
  228. <table cellpadding="0" cellspacing="0" border="0">
  229. <tbody id="$thread[id]">
  230. <!--{loop $newthreadlist['dateline']['data'] $thread}-->
  231. <tr>
  232. <td class="icn">
  233. <a href="forum.php?mod=viewthread&tid=$thread[tid]" title="{lang target_blank}" target="_blank">
  234. <!--{if $thread[folder] == 'lock'}-->
  235. <img src="{IMGDIR}/folder_lock.gif" />
  236. <!--{elseif $thread['special'] == 1}-->
  237. <img src="{IMGDIR}/pollsmall.gif" alt="{lang thread_poll}" />
  238. <!--{elseif $thread['special'] == 2}-->
  239. <img src="{IMGDIR}/tradesmall.gif" alt="{lang thread_trade}" />
  240. <!--{elseif $thread['special'] == 3}-->
  241. <img src="{IMGDIR}/rewardsmall.gif" alt="{lang thread_reward}" />
  242. <!--{elseif $thread['special'] == 4}-->
  243. <img src="{IMGDIR}/activitysmall.gif" alt="{lang thread_activity}" />
  244. <!--{elseif $thread['special'] == 5}-->
  245. <img src="{IMGDIR}/debatesmall.gif" alt="{lang thread_debate}" />
  246. <!--{elseif in_array($thread['displayorder'], array(1, 2, 3, 4))}-->
  247. <img src="{IMGDIR}/pin_$thread[displayorder].gif" alt="$_G[setting][threadsticky][3-$thread[displayorder]]" />
  248. <!--{else}-->
  249. <img src="{IMGDIR}/folder_$thread[folder].gif" />
  250. <!--{/if}-->
  251. </a>
  252. </td>
  253. <th>
  254. <span id="thread_$thread[tid]"><a href="forum.php?mod=viewthread&tid=$thread[tid]" class="xst">$thread[subject]</a></span>
  255. </th>
  256. <td class="by">
  257. <cite>
  258. <!--{if $thread['authorid'] && $thread['author']}-->
  259. <a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a>
  260. <!--{else}-->
  261. <!--{if $_G['forum']['ismoderator']}-->
  262. <a href="home.php?mod=space&uid=$thread[authorid]">{lang anonymous}</a>
  263. <!--{else}-->
  264. {lang anonymous}
  265. <!--{/if}-->
  266. <!--{/if}-->
  267. </cite>
  268. <em>$thread[dateline]</em>
  269. </td>
  270. <td class="num">
  271. <a class="xi2" href="forum.php?mod=viewthread&tid=$thread[tid]">$thread[allreplies]</a><em>$thread[views]</em>
  272. </td>
  273. <td class="by">
  274. <cite>
  275. <!--{if $thread['lastposterenc']}-->
  276. <a href="{if $thread[digest] != -2}home.php?mod=space&username=$thread[lastposterenc]{else}forum.php?mod=viewthread&tid=$thread[tid]&page={echo max(1, $thread[pages]);}{/if}">$thread[lastposter]</a>
  277. <!--{else}-->
  278. {lang anonymous}
  279. <!--{/if}-->
  280. </cite>
  281. <em><a href="{if $thread[digest] != -2}forum.php?mod=redirect&tid=$thread[tid]&goto=lastpost#lastpost{else}forum.php?mod=viewthread&tid=$thread[tid]&page={echo max(1, $thread[pages]);}{/if}">$thread[lastpost]</a></em>
  282. </td>
  283. </tr>
  284. <!--{/loop}-->
  285. </tbody>
  286. <!--{if $_G['forum']['threads'] > 10}-->
  287. <tbody>
  288. <tr class="bw0_all">
  289. <td colspan="5" class="ptm"><a href="forum.php?mod=forumdisplay&action=list&fid=$_G[fid]#groupnav" class="y xi2">{lang click_to_readmore}</a></td>
  290. </tr>
  291. </tbody>
  292. <!--{/if}-->
  293. </table>
  294. <!--{else}-->
  295. <p class="emp">{lang forum_nothreads}</p>
  296. <!--{/if}-->
  297. </div>
  298. </div>
  299. <div class="bm bml">
  300. <div class="bm_h cl">
  301. <h2>{lang group_member_status}</h2>
  302. </div>
  303. <div class="bm_c">
  304. <!--{if $groupfeedlist}-->
  305. <ul class="el">
  306. <!--{loop $groupfeedlist $feed}-->
  307. <li>
  308. <img src="$feed[icon_image]" class="t" />
  309. <!--{if !empty($feed[title_template])}-->$feed[title_template]<!--{/if}--> <!--{if !empty($feed[body_data][subject])}-->$feed[body_data][subject]<!--{/if}-->
  310. </li>
  311. <!--{/loop}-->
  312. </ul>
  313. <!--{else}-->
  314. <p class="emp">{lang group_no_latest_feeds}</p>
  315. <!--{/if}-->
  316. </div>
  317. </div>
  318. <!--{if $_G['group']['allowpost'] && ($_G['group']['allowposttrade'] || $_G['group']['allowpostpoll'] || $_G['group']['allowpostreward'] || $_G['group']['allowpostactivity'] || $_G['group']['allowpostdebate'] || $_G['setting']['threadplugins'] || $_G['forum']['threadsorts'])}-->
  319. <ul class="p_pop" id="newspecial_menu" style="display: none">
  320. <!--{if !$_G['forum']['allowspecialonly']}--><li><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]" onclick="showWindow('newthread', this.href);doane(event)">{lang post_newthread}</a></li><!--{/if}-->
  321. <!--{if $_G['group']['allowpostpoll']}--><li class="poll"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=1">{lang post_newthreadpoll}</a></li><!--{/if}-->
  322. <!--{if $_G['group']['allowpostreward']}--><li class="reward"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=3">{lang post_newthreadreward}</a></li><!--{/if}-->
  323. <!--{if $_G['group']['allowpostdebate']}--><li class="debate"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=5">{lang post_newthreaddebate}</a></li><!--{/if}-->
  324. <!--{if $_G['group']['allowpostactivity']}--><li class="activity"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=4">{lang post_newthreadactivity}</a></li><!--{/if}-->
  325. <!--{if $_G['group']['allowposttrade']}--><li class="trade"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&special=2">{lang post_newthreadtrade}</a></li><!--{/if}-->
  326. <!--{if $_G['setting']['threadplugins']}-->
  327. <!--{loop $_G['forum']['threadplugin'] $tpid}-->
  328. <!--{if array_key_exists($tpid, $_G['setting']['threadplugins']) && @in_array($tpid, $_G['group']['allowthreadplugin'])}-->
  329. <li class="popupmenu_option"{if $_G['setting']['threadplugins'][$tpid][icon]} style="background-image:url($_G[setting][threadplugins][$tpid][icon])"{/if}><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&specialextra=$tpid">{$_G[setting][threadplugins][$tpid][name]}</a></li>
  330. <!--{/if}-->
  331. <!--{/loop}-->
  332. <!--{/if}-->
  333. <!--{if $_G['forum']['threadsorts'] && !$_G['forum']['allowspecialonly']}-->
  334. <!--{loop $_G['forum']['threadsorts']['types'] $id $threadsorts}-->
  335. <!--{if $_G['forum']['threadsorts']['show'][$id]}-->
  336. <li class="popupmenu_option"><a href="forum.php?mod=post&action=newthread&fid=$_G[fid]&extra=$extra&sortid=$id">$threadsorts</a></li>
  337. <!--{/if}-->
  338. <!--{/loop}-->
  339. <!--{/if}-->
  340. </ul>
  341. <!--{/if}-->
  342. <!--{/if}-->