首先到plus文件夾下復(fù)制一份digg_ajax.php,,重命名為indexdigg.php, 在indexdigg.php中找到如下代碼:
- $digg = '<div class="diggbox digg_good" onmousemove="this.style.backgroundPosition=\'left bottom\';" onmouseout="this.style.backgroundPosition=\'left top\';" onclick="postDigg(\'good\','.$id.')">
- <div class="digg_act">頂一下</div>
- <div class="digg_num">('.$row['goodpost'].')</div>
- <div class="digg_percent">
- <div class="digg_percent_bar"><span style="width:'.$row['goodper'].'%"></span></div>
- <div class="digg_percent_num">'.$row['goodper'].'%</div>
- </div>
- </div>
- <div class="diggbox digg_bad" onmousemove="this.style.backgroundPosition=\'right bottom\';" onmouseout="this.style.backgroundPosition=\'right top\';" onclick="postDigg(\'bad\','.$id.')">
- <div class="digg_act">踩一下</div>
- <div class="digg_num">('.$row['badpost'].')</div>
- <div class="digg_percent">
- <div class="digg_percent_bar"><span style="width:'.$row['badper'].'%"></span></div>
- <div class="digg_percent_num">'.$row['badper'].'%</div>
- </div>
- </div>';
替換為:
- <script language="javascript" type="text/javascript">
- <!--
- function postDigg(ftype,aid)
- {
- var taget_obj = document.getElementById("digg"+aid);
- var saveid = GetCookie('diggid');
- if(saveid != null)
- {
- var saveidsaveids = saveid.split(',');
- var hasid = false;
- saveid = '';
- j = 1;
- for(i=saveids.length-1;i>=0;i--)
- {
- if(saveids==aid && hasid) continue;
- else {
- if(saveids==aid && !hasid) hasid = true;
- saveid += (saveid=='' ? saveids : ','+saveids);
- j++;
- if(j==20 && hasid) break;
- if(j==19 && !hasid) break;
- }
- }
- if(hasid) { alert("您已經(jīng)頂過該帖,,請不要重復(fù)頂帖 ,!"); return; }
- else saveid += ','+aid;
- SetCookie('diggid',saveid,1);
- }
- else
- {
- SetCookie('diggid',aid,1);
- }
- myajax = new DedeAjax(taget_obj,false,false,'','','');
- var url = "{dede:global.cfg_phpurl/}/indexdigg.php?action="+ftype+"&id="+aid;
- myajax.SendGet2(url);
- }
- function getDigg(aid)
- {
- var taget_obj = document.getElementById('newdigg');
- myajax = new DedeAjax(taget_obj,false,false,'','','');
- myajax.SendGet2("{dede:global.cfg_phpurl/}/indexdigg.php?id="+aid);
- DedeXHTTP = null;
- }
- -->
- </script>
頂一下排行榜代碼:
- <div id="newdigg"><span class=dinga>
- <span class=shuzi id='digg[field:id/]'>[field:goodpost/]</span>人喜歡此文章</span>
- <span class=ding><a href="javascript:postDigg('good',[field:id/]);">頂一下!</a></span>
- </div>
|