$col_monthhits = $pre . '_monthhits'; $col_hitstime = $pre . '_hitstime'; $sql = 'SELECT ' . $col_hits . ',' . $col_dayhits . ',' . $col_weekhits . ',' . $col_monthhits . ',' . $col_hitstime . ' FROM {pre}' . $tab . ' WHERE ' . $col_id . '=' . $id; $row = $db->getRow($sql); if ($row) { $hits = $row[$col_hits]; $dayhits = $row[$col_dayhits]; $weekhits = $row[$col_weekhits]; $monthhits = $row[$col_monthhits]; $path = MAC_ROOT . "/inc/config/hitstime_" . $tab . ".txt"; if (file_exists($path)) { $hitstime = @file_get_contents($path); } if (!isN($hitstime)) { if (date('m', time()) != date('m', $hitstime)) { $db->Update("{pre}" . $tab, array($col_monthhits), array(0), $col_id . ">0"); $monthhits = 0; } if (date('W', time()) != date('W', $hitstime)) { $db->Update("{pre}" . $tab, array($col_weekhits), array(0), $col_id . ">0"); $weekhits = 0; } if (date('d', time()) != date('d', $hitstime)) { $db->Update("{pre}" . $tab, array($col_dayhits), array(0), $col_id . ">0"); $dayhit = 0; } } $res = $hits + 1; $res1 = $dayhits + 1; $res2 = $weekhits + 1; $res3 = $monthhits + 1;
$msg = "对不起,您的积分不够,无法下载收费数据,请推荐本站给您的好友、赚取更多积分"; } } $upoint = $rowu["u_points"] - $row["d_stint"]; } if (!empty($msg)) { alertUrl($msg, MAC_PATH . "index.php?m=user-index.html"); exit; } if (strpos("," . $rowu["u_downs"], $downf) > 0) { $stat = true; } if (!$stat) { $udowns = "," . $rowu["u_downs"] . $downf; $udowns = str_replace(",,", ",", $udowns); $db->Update("{pre}user", array("u_points", "u_downs"), array($upoint, $udowns), "u_id=" . $uid); } } unset($rowu); } $tpl->T = $MAC_CACHE['vodtype'][$row['d_type']]; $tpl->D = $row; unset($row); $tpl->loadvod("down"); $tpl->replaceVod(); $tpl->playdownlist("down"); $tpl->H = str_replace("[vod:downnum]", $tpl->P["num"], $tpl->H); $tpl->H = str_replace("[vod:downsrc]", $tpl->P["src"], $tpl->H); $tpl->getUrlName("down"); $tpl->H = str_replace("[vod:downinfo]", "<script>" . $tpl->getUrlInfo("down") . " </script>" . "\n", $tpl->H); $tpl->H = str_replace('[vod:downer]', '<script src="' . $MAC['site']['installdir'] . 'js/playerconfig.js"></script><script src="' . $MAC['site']['installdir'] . 'js/player.js"></script>' . "\n", $tpl->H);
$u_flag = 0; $u_start = ""; $u_end = ""; } else { $u_start = $row["u_start"]; $u_end = $row["u_end"]; } } else { $ugroup = $row["u_group"]; } $_SESSION["userid"] = $row["u_id"]; $_SESSION["username"] = $row["u_name"]; $_SESSION["usergroup"] = $row["u_group"]; $_SESSION["usercheck"] = md5($randnum . $row["u_id"]); sCookie('userid', $row["u_id"]); $db->Update("{pre}user", array("u_logintime", "u_loginip", "u_random", "u_loginnum", "u_flag", "u_start", "u_end"), array(time(), ip2long(getIP()), $randnum, $row["u_loginnum"] + 1, $u_flag, $u_start, $u_end), "u_id=" . $row["u_id"]); unset($row); if ($MAC['connect']['uc']['status'] == 1) { list($uid, $username, $password, $email) = uc_user_login($u_name, $u_password); if ($uid > 0) { $ucsynlogin = uc_user_synlogin($uid); } } if (isN($backurl)) { if ($flag == "iframe") { showMsg($ucsynlogin . '登录成功', 'index.php?m=user-iframe.html'); //redirect('index.php?m=user-iframe.html'); } else { showMsg($ucsynlogin . '登录成功', 'index.php?m=user-index.html'); //redirect('index.php?m=user-index.html','top.'); }