ALTER TABLE v9_download ADD `down_amount` int(10) unsigned NOT NULL DEFAULT '0'
对于没有生成静态页面的程序可以这么实现
对于没有生成静态页面的程序可以这么实现
phpcms\modules\content\down.php
//增加以下代码--插入数据库 public function download() {}里面
$var=explode("&",$a_k);
$arr1=$var[0];
$len=strlen($arr1);
$end=$len-2;
$id=substr($arr1,2,$end);
$MODEL = getcache('model','commons');//获取表名
$tablename = $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename'];//v9_download
$rs=$this->db->get_one(array('id'=>$id));
$down_amount=$rs['down_amount'];
$sql = array('down_amount'=>$down_amount+1,);
$this->db->update($sql, array('id'=>$id));
然后是页面输出
然后是页面输出
phpcms\modules\content\index.php添加
$r2 = $this->db->get_one(array('id'=>$id));
$rs = $r2 ? array_merge($r,$r2) : $r;//PS:可以 print_r($rs)看看有没需要的数据
$data['down_amount']=$rs['down_amount']; //需要添加的代码
然后静态页面show_download.html
输出{$down_amount}