var template='
 {title}
{contents}
{reply}
{fullname} {post_time} {ip}
'; //--------------------------------------------------------------- var current_page=1; var current_site_type; var t; function moven(d){ if(!$('pagenav').style.left){ l=0; }else{ l=parseInt($('pagenav').style.left); } if(d=='right'){ clearTimeout(t); navWidth=parseInt($('pagenav').offsetWidth); diffNavLen=navWidth - Math.abs(l); //alert(diffNavLen); if(diffNavLen > parseInt($('basef').offsetWidth)){ $('pagenav').style.left=l - 2 + 'px'; t=setTimeout("moven('right')",1); } }else{ clearTimeout(t); if(l!=0){ $('pagenav').style.left=l + 2 + 'px'; t=setTimeout("moven('left')",1); } } } function movenStop(){ clearTimeout(t); } function getcp(obj){ if($('cptr').style.display=='block'){return false} obj.style.fontWeight='bold'; obj.style.letterSpacing='2px'; recheckpic(); $('cptr').style.display='block'; } function recheckpic(){ $('cp').src='codepic.php?'+Math.random(); } function reloadThisPage(){ showcont(current_page); } function addok(){ showcont(1); loading('over','正在处理,请稍候...'); $('form1').reset(); $('cptr').style.display='none'; $('sbt').disabled=false; alert('操作成功,请等待管理员审核!'); } function checkLength(which) { var maxChars = 500; if (which.value.length > maxChars) which.value = which.value.substring(0,maxChars); var curr = maxChars - which.value.length; document.getElementById("chLeft").innerHTML = curr.toString(); } function showcont(page){ current_page=page; loading('start','正在载入内容,请稍候...'); LanLinGet('handle.php?action=getcontlist&page=' + page,"ajaxReturnFun","cacheit"); } function show_des(desid){ if($(desid).style.display=='none'){ $(desid).style.display=''; }else{ $(desid).style.display='none'; } } function openr(id){ url="reply.php?gid="+id; option="height=400,width=500,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,left="+ (screen.width-400)/2 +",top=" + (screen.height-450)/2; window.open(url,'',option); } function deleteIt(id){ if(!confirm('确定要删除该留言吗?')){ return false; } loading('start','正在删除数据,请稍候...'); LanLinGet('handle.php?action=deleteCont&id='+id,'deleteResult'); } function deleteResult(cont){ loading('over'); alert(cont); reloadThisPage(); } function passed(id,type){ loading('start','正在处理审核,请稍候...'); LanLinGet('handle.php?action=checkhandle&type='+type+'&id='+id,'checkResult'); } function checkResult(cont){ loading('over'); alert(cont); reloadThisPage(); } function ajaxReturnFun(ajax_returncontents){ var contStr='',nav=''; array=eval(ajax_returncontents); listArray=array[0]; if(!listArray){ loading("d","over"); return ; } var tempStr; for(i=0;i回复: ' + listArray[i].reply_contents + '',tempStr); }else{ tempStr=strReplace('{reply}','',tempStr); } contStr += tempStr; } loading('over','正在载入内容,请稍候...'); $('listcont').innerHTML=contStr; for(p=1;p<=array[1];p++){ bgcolor =''; if(p == current_page){ mouseOutColor="#D7EFFF"; }else{ mouseOutColor=""; } nav += "" + p +"  "; } $('pagetotal').innerHTML=array[1]; $('thispage').innerHTML=current_page; $('pagenav').innerHTML=nav; }