使用者工具

網站工具


syslog:code:pagecounter

function tpl_pageinfo($ret = false)
{
  $res = tpl_newpageinfo();
  if($res == false)
    return false;
  else
    return true;
}

function tpl_pageinfo_a($ret = false) {

略


function tpl_newpageinfo()
{
  global $lang;
  global $ID;

  $pinfo = tpl_pageinfo_a(true);
  if ($pinfo === false) return false;

  $viewcnt = p_get_metadata($ID, "viewcnt");
  if ($viewcnt == null) $viewcnt = 0;
  $viewcnt++;
  p_set_metadata($ID, array('viewcnt' => $viewcnt));

  $pinfo = str_replace(' · ', ' ('.$viewcnt.' '. tpl_getLang('views') .') · ', $pinfo);
  echo $pinfo;
  echo '(total visited:' . $viewcnt . ')';
}

syslog/code/pagecounter.txt · 上一次變更: 2019/07/02 15:01 由 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki