Example #1
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
$date = date('Ymd', TIMESTAMP + 900);
$count = DB::result_first("SELECT COUNT(*) FROM `zw_blockid_log` WHERE (status=0 AND retry<5 AND date='{$date}')");
if ($count) {
    while ($num++ < 25) {
        $offset = rand(1, $count) - 1;
        $block_info = DB::fetch_first("SELECT * FROM `zw_blockid_log` WHERE (status=0 AND retry<5 AND date='{$date}') LIMIT {$offset},1");
        if (!$block_info) {
            break;
        }
        $result = HOOK::getPlugin("zw_blockid")->blockid($block_info['fid'], $block_info['blockid'], 1, $block_info['uid']);
        if ($result['errno'] == 0) {
            DB::query("UPDATE zw_blockid_log SET status=1 WHERE id='{$block_info['id']}'");
        } else {
            DB::query("UPDATE zw_blockid_log SET retry=retry+1 WHERE id='{$block_info['id']}'");
        }
        if (!defined('SIGN_LOOP')) {
            break;
        }
    }
} else {
    define('CRON_FINISHED', true);
}
Example #2
0
<?php

if (!defined('IN_KKFRAME')) {
    exit('Access Denied!');
}
?>
<h2>豆票获取记录</h2><p style="color:#757575;font-size:12px">当前插件版本:<?php 
echo HOOK::getPlugin('x_tdou')->version;
?>
 | 更新日期:<?php 
echo HOOK::getPlugin('x_tdou')->update_time;
?>
 | Designed By <a href="http://tieba.baidu.com/home/main?un=%D0%C7%CF%D2%D1%A9&fr=index" target="_blank">@星弦雪</a> && <a href="http://www.ikk.me" target="_blank">@kookxiang</a></p>
<p>这个插件可以帮助你自动领取豆票在线奖励以及自动砸蛋</p>
<table>
	<thead><tr><td style="width:20px">日期</td><td>豆票数量</td></tr></thead>
	<tbody id="x_tdou_log">
		<tr><td colspan="2"><img src="./template/default/style/loading.gif">载入中,请稍候...</td></tr>
	</tbody>
</table>
<a href="plugin.php?id=x_tdou&action=test" class="btn" onclick="return msg_win_action(this.href)">测试</a>
<script type="text/javascript">
function load_x_tdou_log(){
	showloading();
	$.getJSON("plugin.php?id=x_tdou&action=show_log", function(result){
		$('#x_tdou_log').html('');
		if(result.count){
			$.each(result.logs, function(i, field){
			$("#x_tdou_log").append("<tr><td>"+field.date+"</td><td>"+field.num+"</td></tr>");
		});}else{
			$('#x_tdou_log').html('<tr><td colspan="2">暂无记录</td></tr>');
Example #3
0
require_once ROOT . './plugins/fsql_zan/zan.php';
$date = date('Ymd', TIMESTAMP + 900);
$count = DB::result_first("select COUNT(*) from fsql_zan_log where date = '{$date}'");
$endtime = TIMESTAMP + 45;
$sleep_set = HOOK::getPlugin('fsql_zan')->getSetting('sleep');
$sp_set = HOOK::getPlugin('fsql_zan')->getSetting('sp');
if ($count) {
    while ($endtime > time()) {
        $count = DB::result_first("select `sid` from fsql_zan_log where date='{$date}'");
        if ($count == 0) {
            break;
        }
        $offset = get_rand_bar();
        $cronzan = DB::fetch_first("select * from fsql_zan_bar where sid='{$offset}'");
        $sleep_set = HOOK::getPlugin('fsql_zan')->getSetting('sleep');
        $sp_set = HOOK::getPlugin('fsql_zan')->getSetting('sp');
        $result = 0;
        $result = fsql_zan_get_list($cronzan['uid'], $cronzan['name'], $sleep_set, $sp_set);
        DB::query("UPDATE fsql_zan_log SET count=count+{$result} WHERE sid='{$cronzan['sid']}' AND date='{$date}'");
    }
    echo 'ok' . "</br>";
}
function get_rand_bar()
{
    $date = date('Ymd', TIMESTAMP + 900);
    $query = DB::query("select `sid` from fsql_zan_log where date='{$date}'");
    $r = array();
    while ($row = DB::fetch($query)) {
        $r[] = $row;
    }
    $count = DB::result_first("select count(`sid`) from fsql_zan_log  where date='{$date}'");
Example #4
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
$date = date('Ymd', TIMESTAMP + 900);
DB::query("ALTER TABLE xxx_post_log CHANGE `date` `date` INT NOT NULL DEFAULT '{$date}'");
DB::query("INSERT IGNORE INTO xxx_post_log (sid, uid) SELECT sid, uid FROM xxx_post_posts");
$delete_date = date('Ymd', TIMESTAMP - 86400 * 10);
DB::query("DELETE FROM xxx_post_log WHERE date<'{$delete_date}'");
$setime = HOOK::getPlugin('xxx_post')->getSetting('se');
if (!$setime) {
    $setime = 21;
}
$nxrun = $today + $setime * 3600;
DB::query("update cron set nextrun='{$nxrun}' where id='xxx_post/c_se'");
cron_set_nextrun($tomorrow + 600);
Example #5
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
require_once ROOT . './plugins/xxx_post/core.php';
$date = date('Ymd', TIMESTAMP + 900);
$count = DB::result_first("select COUNT(*) from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.status<b.runtimes and a.retry<b.runtimes*2 and b.frequency<=2");
$first_end = HOOK::getPlugin('xxx_post')->getSetting('first_end');
if (!$first_end) {
    $first_end = 15;
}
$first_end_time = $today + $first_end * 3600;
if ($first_end_time < TIMPSTAMP) {
    $count = 0;
}
$endtime = TIMESTAMP + 45;
if ($count) {
    while ($endtime > time()) {
        $count = DB::result_first("select COUNT(*) from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.status<b.runtimes and a.retry<b.runtimes*2 and b.frequency<=2 and b.runtime<" . TIMESTAMP);
        if ($count == 0) {
            break;
        }
        $offset = rand(1, $count) - 1;
        $sid = DB::result_first("select sid from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.status<b.runtimes and a.retry<b.runtimes*2 and b.frequency<=2 and b.runtime<" . TIMESTAMP . " limit {$offset},1");
        if (!$sid) {
            break;
        }
        $tiezi = DB::fetch_first("SELECT * FROM xxx_post_posts WHERE sid='{$sid}'");
        if (!$tiezi) {
            DB::query("UPDATE xxx_post_log SET retry=retry+3 WHERE sid='{$sid}' AND date='{$date}'");
Example #6
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
$date = date('Ymd', TIMESTAMP + 900);
$count = DB::result_first("select COUNT(*) from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.retry<40 and b.frequency=4");
if (HOOK::getPlugin('xxx_post')->getSetting('sxbk') != 1) {
    cron_set_nextrun($tomorrow + 5400);
    $count = 0;
}
$endtime = TIMESTAMP + 45;
if ($count) {
    require_once ROOT . './plugins/xxx_post/core.php';
    while ($endtime > time()) {
        $count = DB::result_first("select COUNT(*) from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.retry<40 and b.runtime<" . TIMESTAMP . " and b.frequency=4");
        if ($count == 0) {
            break;
        }
        $offset = rand(1, $count) - 1;
        $sid = DB::result_first("select sid from xxx_post_log as a left join xxx_post_setting as b on a.uid=b.uid where a.date='{$date}' and a.retry<40 and b.runtime<" . TIMESTAMP . " and b.frequency=4 LIMIT {$offset},1");
        if (!$sid) {
            break;
        }
        $tiezi = DB::fetch_first("SELECT * FROM xxx_post_posts WHERE sid='{$sid}'");
        if (!$tiezi) {
            DB::query("UPDATE xxx_post_log SET retry=retry+1 WHERE sid='{$sid}' AND date='{$date}'");
            continue;
        }
        $x_content_count = DB::result_first("SELECT COUNT(*) FROM xxx_post_content WHERE uid='{$tiezi[uid]}'");
        $x_content_offset = rand(1, $x_content_count) - 1;
Example #7
0
            cron_set_nextrun($r);
        }
    } else {
        $num = 0;
        while ($num++ < 25) {
            $offset = rand(1, $count) - 1;
            $uid = DB::result_first("SELECT uid FROM `x_tdou_log` WHERE retry<5 and nextrun<{$now} AND date='{$date}' LIMIT {$offset},1");
            if (!$uid) {
                break;
            }
            list($statue, $score) = HOOK::getPlugin('x_tdou')->x_tdou_time($uid);
            $nextrun = TIMESTAMP + 300;
            switch ($statue) {
                case 1:
                case 2:
                    HOOK::getPlugin('x_tdou')->updateStat($score, $uid, $date);
                    break;
                case 3:
                    DB::query("UPDATE x_tdou_log SET retry=retry+1 WHERE uid='{$uid}' AND date='{$date}'");
                    break;
                case 4:
                    break;
            }
            DB::query("UPDATE x_tdou_log SET nextrun='{$nextrun}' WHERE uid='{$uid}' AND date='{$date}'");
            if (!defined('SIGN_LOOP')) {
                break;
            }
            $count--;
        }
    }
} else {
Example #8
0
<?php

define('IN_ADMINCP', true);
define('DISABLE_PLUGIN', true);
require_once './system/common.inc.php';
$plugin_id = htmlspecialchars($_GET['id']);
$plugins = CACHE::get('plugins');
foreach ($plugins as $plugin) {
    if ($plugin['id'] == $plugin_id) {
        $exists = true;
        break;
    }
}
if (!isset($exists)) {
    throw new Exception("Unknown plugin '{$plugin_id}'");
}
$obj = HOOK::getPlugin($plugin_id);
if ($obj instanceof Plugin) {
    $obj->handleAction();
} else {
    throw new Exception('This plugin doesn\'t support to be called directly.');
}