dedecms ajax 下載統計代碼

來源:互聯網
上載者:User

<?php
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once(DEDEINC."/channelunit.class.php");

 $aid = (isset($aid) && is_numeric($aid)) ? $aid : 0;
 
  $rand =mt_rand(10,80);
  
  $query = "select count(*) as dd from #@__downloads where id='$aid'";
  
  $row = $dsql->GetOne($query); 
 
  if($row['dd'] > 0)
  {
   $query = "update #@__downloads set downloads=downloads+$rand where id='$aid'";
   $dsql->ExecNoneQuery($query);
  }else {
   $query = "insert into #@__downloads(hash,id,downloads) values('null$aid','$aid',1)";
   $dsql->ExecNoneQuery($query);
  }
  

下面是執行個體方法。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"><script src="http://pstatic.xunlei.com/js/base64.js"><script language="javascript"  type="text/javascript">
var xmlHttp = false;

function ajaxcreate(){

try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
try {
  xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
 } catch (e2) {
  xmlHttp = false;
 }
 }

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
 }
if(!xmlHttp){alert('Create Xmlhttp Fail ');return false;}
}


function ajax_add(){ 
 ajaxcreate();
 var url="/ajax_down.php?aid="+encodeURI(5396)+"&rd="+Math.random();
 xmlHttp.open("POST",url,true);
 xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
 xmlHttp.send(null); 
}

</script>
<title>綠色版Apache+Php+Mysql V1.3 自動安裝版_下載地址清單_網站源碼下載-整站源碼下載-站長常用工具下載</title>
<link href="/templets/style/search.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>

<div class="header">
 <div class="toplogo">
  <h1><a href="http://down.111cn.net/">網站源碼下載-整站源碼下載-站長常用工具下載</a></h1>
 </div>
</div>

<div class="msgbar">
 <p>
  <strong>軟體名稱:<a href='/down/soft/server/2009/0629/5396.html'>綠色版Apache+Php+Mysql V1.3 自動安裝版</a></strong>
 </p>
</div>
<div class="advancedsearch">
  <table width="100%" border="0" align="center" cellspacing="2">
    <tr>
      <td height="30" bgcolor="#F2F7E6">下載地址清單:</td>
    </tr>
    <tr>
      <td height="78"><script language="javascript" src="/js/gg_bottom.js"></script>
<a href="#" class="red" thunderHref="thunder://QUFodHRwOi8vemp0ZWxlNC5za3ljbi5jb20vZG93bi9nZ2dBUE1zZXJ2ZXIuemlwWlo=" thunderPid="85957" thunderType="" thunderResTitle="" onClick="ajax_add();return OnDownloadClick_Simple(this,2);" oncontextmenu="ThunderNetwork_SetHref(this)" >[迅雷專用下載]</a>

<script type="text/javascript"><!--
google_ad_client = "pub-6219414158063594";
/* 336x280, 建立於 09-3-29 */
google_ad_slot = "8019903307";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<script type="text/javascript"><!--
  google_ad_client = "pub-6219414158063594";
  google_ad_format = "configurable_sdo";
  google_link_target = 2;
  google_color_bg = "ffffff";
  google_color_link = "000000";
  google_color_text = "000000";
  google_encoding = "GB2312";
  google_ad_channel = "5161927073";
  google_box_len = 40;
  google_logo_pos = "left";
  google_rs_pos = "below";
  google_ad_height = 65;
  google_ad_width = 500;
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_sdo.js">
</script>

</td>
    </tr>
  </table>
</div>
<div class="footer">
<p class="link">
  網站著作權資訊及免責聲明
  </p>

 <p class="powered">
  Copyright <a href="http://down.111cn.net" title="" target="_blank"><strong>down.<span>111cn.net</span></strong></a> &copy; 2004-2008  Inc.
<script language="javascript" src="/js/count.js"></script> 
</p><!-- /powered -->
 
</div>
<div id="tt" ></div>

</body>
</html>
 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.