<span id="hits"></span>
...
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script></span>
2、主页、列表页获取的方法一样,通过查db获取:
{php $db = pc_base::load_model('hits_model'); $_r = $db->get_one(array('hitsid'=>'c-'.$modelid.'-'.$r[id])); $views = $_r[views]; }
<td class="hit" align="center">{$views}</td>
参数根据自己的实际情况酌情调整。(注$modelid默认都有值)