$pagesl = $i + ($page - 1) * $pagesize; $iij = $i % 2; if ($iij == 0) { echo '<div class="row">'; } else { echo '<div class="box">'; } if ($myrow['type'] == 1) { $qq = $myrow['proxy']; $row = $DB->get_row("SELECT * FROM wjob_qq WHERE qq='{$qq}' limit 1"); if ($row['lx'] == $gl) { $myrow['url'] = str_replace('[sid]', $row['sid'], $myrow['url']); } } if ($myrow['type'] == 3) { $qqjob = qqjob_decode($myrow['url']); echo $pagesl . '.' . $myrow['mc'] . '<br>' . $qqjob['info']; } else { echo $pagesl . '.' . $myrow['mc'] . '<br>网址:<a href="' . $myrow['url'] . '" target="_blank">' . $myrow['url'] . '</a>'; } echo '<br>创建时间:' . $myrow['timea'] . '<br>执行次数:' . $myrow['times'] . '<br>上次执行:' . dgmdate($myrow['timeb']) . '<br>运行时间:'; if ($myrow['zt'] == '1') { echo '暂停运行...'; } else { echo $myrow['start'] . '时 - ' . $myrow['stop'] . '时'; if ($myrow['pl'] != 0) { echo '<br>运行频率:' . $myrow['pl'] . '秒/次'; } echo '<br>已开启:'; } if ($myrow['usep'] == 1) {
function run_basic($sysid) { //普通模式运行 global $DB, $t, $rs, $date, $siteurl; while ($row = $DB->fetch($rs)) { $time = time(); if ($row['time'] + $row['pl'] <= $time) { if ($row['type'] == 1) { //QQ挂机sid替换 $qq = $row['proxy']; $rows = $DB->get_row("SELECT * FROM wjob_qq WHERE qq='{$qq}' limit 1"); $row['url'] = str_replace('[sid]', $rows['sid'], $row['url']); } if ($row['type'] == 3) { //QQ挂机模式 $qqjob = qqjob_decode($row['url']); $row['url'] = $qqjob['url']; if ($row['url'] == 'no') { continue; } } if ($row['type'] != 0) { $row['post'] = 1; $row['postfields'] = 'backurl=' . urlencode($siteurl); } $curl = curl_init(); if ($row['usep'] == 1) { curl_setopt($curl, CURLOPT_PROXY, $row['proxy']); } curl_setopt($curl, CURLOPT_URL, $row['url']); curl_setopt($curl, CURLOPT_TIMEOUT, 1); curl_setopt($curl, CURLOPT_NOBODY, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_AUTOREFERER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); if ($row['referer'] != '') { curl_setopt($curl, CURLOPT_REFERER, $row['referer']); } if ($row['useragent'] != '') { curl_setopt($curl, CURLOPT_USERAGENT, $row['useragent']); } if ($row['cookie'] != '') { curl_setopt($curl, CURLOPT_COOKIE, $row['cookie']); } if ($row['post'] == 1) { $postfields = str_replace('[时间]', $date, $row['postfields']); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields); } curl_exec($curl); curl_close($curl); $id = $row['jobid']; $DB->query("update `wjob_job` set `times`=`times`+1,`timeb`='{$date}',`time`='{$time}' where `jobid`='{$id}'"); } } }