Example #1
0
function template($file)
{
    global $template_loaded;
    $template_loaded = false;
    HOOK::run(str_replace('/', '_', "template_load_{$file}"));
    $template_name = defined('IN_ADMINCP') ? 'default' : getSetting('template');
    if (IN_MOBILE) {
        $mobilefile = ROOT . "./template/{$template_name}/mobile/{$file}.php";
        if (file_exists($mobilefile)) {
            return $mobilefile;
        }
        $mobilefile_default = ROOT . "./template/default/mobile/{$file}.php";
        if (file_exists($mobilefile_default)) {
            return $mobilefile_default;
        }
    }
    $path = ROOT . "./template/{$template_name}/{$file}.php";
    if (file_exists($path)) {
        return $path;
    }
    $path = ROOT . "./template/default/{$file}.php";
    if (file_exists($path)) {
        return $path;
    }
    error::system_error("Missing template '{$file}'.");
}
Example #2
0
function _do_register($username, $password, $email)
{
    $user = array('username' => $username, 'password' => 'FAKE_PASSWORD', 'email' => $email);
    $uid = DB::insert('member', $user);
    $user['uid'] = $uid;
    $password = Widget_Password::encrypt($user, $password);
    DB::query("UPDATE member SET password='******' WHERE uid='{$uid}'");
    DB::insert('member_setting', array('uid' => $uid, 'cookie' => ''));
    HOOK::run('register_user', true, $user);
    CACHE::update('username');
    CACHE::save('user_setting_' . $uid, '');
    return $uid;
}
Example #3
0
 public static function execute($file = null, $function = 0, $type = HOOK::MOD)
 {
     if (!($hook = HOOK::get_hooks())) {
         return $hook;
     }
     $hook = $hook[$type];
     static $loaded;
     if (empty($loaded)) {
         $loaded = array();
     }
     switch ($type) {
         case HOOK::MOD:
             if (WINDOWS) {
                 $file = str_replace('\\', '/', $file);
             }
             if (0 === strpos($file, BASEDIR) && ($file = str_replace(BASEDIR, '', $file)) && isset($hook[$file]) && isset($hook[$file][$function])) {
                 $modnum = count($hook[$file][$function]);
                 for ($to = 0; $to < $modnum; ++$to) {
                     //if (!file_exists($hook[$file][$to]['hfile'])) { return array(); }
                     if (!isset($loaded[$hook[$file][$to]['hfile']])) {
                         include_once $hook[$file][$to]['hfile'];
                         $loaded[$hook[$file][$to]['hfile']] = 1;
                     }
                     if (!empty($hook[$file][$function][$to]['hfunc'])) {
                         return call_user_func($hook[$file][$function][$to]['hfunc']);
                     }
                 }
             }
             break;
         case HOOK::TPL:
             if (!isset($hook[$file])) {
                 return array();
             }
             $tplnum = count($hook[$file]);
             for ($to = 0; $to < $tplnum; ++$to) {
                 //if (!file_exists($hook[$file][$to]['hfile'])) { return array(); }
                 if (!isset($loaded[$hook[$file][$to]['hfile']])) {
                     include_once $hook[$file][$to]['hfile'];
                     $loaded[$hook[$file][$to]['hfile']] = 1;
                 }
                 if (!empty($hook[$file][$to]['hfunc'])) {
                     return call_user_func($hook[$file][$to]['hfunc']);
                 }
             }
             break;
         default:
             return array();
     }
 }
Example #4
0
function template($file)
{
    HOOK::run("template_load_{$file}");
    if (IN_MOBILE) {
        $mobilefile = ROOT . "./template/mobile/{$file}.php";
        if (file_exists($mobilefile)) {
            return $mobilefile;
        }
    }
    $path = ROOT . "./template/{$file}.php";
    if (file_exists($path)) {
        return $path;
    }
    error::system_error("Missing template '{$file}'.");
}
Example #5
0
function _delete_user($uid)
{
    if (!$uid) {
        return;
    }
    if (!is_array($uid)) {
        $uid = array($uid);
    }
    $uid = implode("', '", $uid);
    DB::query("DELETE FROM member WHERE uid IN ('{$uid}')");
    DB::query("DELETE FROM member_setting WHERE uid IN ('{$uid}')");
    DB::query("DELETE FROM my_tieba WHERE uid IN ('{$uid}')");
    DB::query("DELETE FROM sign_log WHERE uid IN ('{$uid}')");
    HOOK::run('delete_user', $uid);
}
Example #6
0
?>
<h1>注册</h1>
<form method="post" action="member.php?action=register">
<div class="login-info">
<p>用户名:</p>
<p><input type="text" name="<?php 
echo $form_username;
?>
" required tabindex="1" /></p>
<p>密码:</p>
<p><input type="password" name="<?php 
echo $form_password;
?>
" required tabindex="2" /></p>
<p>邮箱:</p>
<p><input type="text" name="<?php 
echo $form_email;
?>
" required tabindex="3" /></p>
<?php 
if ($invite_code) {
    echo '<p>邀请码:</p><p><input type="text" name="invite_code" required /></p>';
}
?>
<p>(此账号仅用于登陆代签系统,不同于百度通行证)</p>
<?php 
HOOK::run('register_form');
?>
</div>
<p><input type="submit" value="注册" tabindex="4" /></p>
</form>
Example #7
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
?>
<form method="post" action="member.php?action=login">
<div class="login-info">
<p><input type="text" name="username" required="" tabindex="1" placeholder="用户名"></p>
<p><input type="password" name="password" required="" tabindex="2" placeholder="密码"></p>
<?php 
HOOK::run('login_form');
?>
</div>
<p><input type="submit" value="登录" tabindex="3" /></p>
</form>
Example #8
0
 function login($relogin = false)
 {
     global $error_handler;
     Hook::Run("pre", "login", $this->user['folder']);
     $login = query("SELECT * FROM `" . $this->user['database'] . "`.accounts WHERE username=? AND password=?", array($_REQUEST['shipon_user'], md5($_REQUEST['shipon_pass'])));
     $account = fetch($login);
     $return = array();
     if (count($account) && $account['active'] == '1') {
         $group_result = query("SELECT * FROM `" . $this->user['database'] . "`.accounts\n\t\t\t\t\t       LEFT JOIN `" . $this->user['database'] . "`.account_groups \n\t\t\t\t\t       ON `" . $this->user['database'] . "`.accounts.group_id = `" . $this->user['database'] . "`.account_groups.id \n\t\t\t\t\t       WHERE `" . $this->user['database'] . "`.accounts.id=" . $account['id']);
         $group = fetch($group_result);
         $this->user['group'] = $group['group_id'];
         $this->user['name'] = $group['name'];
         $this->user['username'] = $group['username'];
         $this->user['phone'] = $group['phone'];
         $this->user['email'] = $group['email'];
         $this->user['ext'] = $group['ext'];
         $this->user['type'] = $account['type'];
         $this->user['uid'] = $account['id'];
         $this->user['bill_to_code'] = $group['bill_to_code'];
         // TO FIX: this shouldn't be done this way
         $this->user['carrier'] = $group['carrier'];
         $this->user['status'] = 1;
         $this->session = new Session($this->user);
         $this->session->Init();
         $this->return['auth'] = 1;
         if ($relogin == true) {
             $return['shipon_header'] = $this->parse_header_xml(true);
             // we do this incase the user changes and their access level is different
             $return['shipon_return'] = "<script type='text/javascript'>show_overlay('#shipon_wrapper'); jQuery(window).trigger('hashchange');</script>";
             $data = array('action' => 'relogin', 'view_action' => 'relogin', 'session_id' => $_REQUEST['sid'], 'data' => '', 'user_id' => $this->user['uid'], 'user_db' => $this->user['database'], 'browser' => $_REQUEST['browser'], 'browser_version' => $_REQUEST['browser_version'], 'os' => $_REQUEST['os'], 'ip' => $_REQUEST['ip']);
         } else {
             $return['shipon_header'] = $this->parse_header_xml();
             $data = array('action' => 'login', 'view_action' => 'login', 'session_id' => $_REQUEST['sid'], 'data' => '', 'user_id' => $this->user['uid'], 'user_db' => $this->user['database'], 'browser' => $_REQUEST['browser'], 'browser_version' => $_REQUEST['browser_version'], 'os' => $_REQUEST['os'], 'ip' => $_REQUEST['ip']);
         }
         HOOK::Log("post", "activitylog", $this->user['folder'], $data);
         if (!Hook::Run("post", "login", $this->user['folder'], $this->user, $this->session, $this->return)) {
             $this->return['auth'] = 0;
             query("DELETE FROM `" . $this->user['database'] . "`.sessions WHERE session_id='" . $_REQUEST['sid'] . "'");
             query("DELETE FROM `" . $this->user['database'] . "`.session_data WHERE session_id='" . $_REQUEST['sid'] . "'");
             unset($this->return['html']);
             print json_encode($this->return);
             return false;
         }
     } else {
         if ($relogin == true) {
             $return['shipon_return'] = "<script type='text/javascript'>jQuery('#ui-dialog-title-shipon_login_popup').html('Invalid user/password.'); shipon_open_popup('#shipon_login_popup'); </script>";
         } else {
             $this->return['auth'] = 0;
             $this->return['alert'] = "Invalid login credentials. Please try again.";
         }
     }
     $this->return['html'] = $return;
     $this->return['error'] = $error_handler->error_message;
     print json_encode($this->return);
 }
Example #9
0
?>
</div>
<div id="content-sign_log">
<?php 
include template('widget/sign_log');
?>
</div>
<div id="content-setting" class="hidden">
<?php 
include template('widget/setting');
?>
</div>
<div id="content-baidu_bind" class="hidden">
<?php 
include template('widget/bind_status');
?>
</div>
<?php 
HOOK::page_contents();
?>
<!-- 开发不易,跪求各位大大放俺一条生路 -->
<!-- 你可以在这加你自己的链接,但是麻烦保留下我的链接 Thanks -->
<p>贴吧签到助手 - Designed by <a href="http://ikk.me" rel="nofollow" target="_blank">kookxiang</a> - Modified by <a href="http://www.iwch.me" target="_blank">Zohar</a>. 2014 &copy; <a href="http://www.kookxiang.com" rel="nofollow" target="_blank">KK's Laboratory</a> - <a href="http://go.ikk.me/donate" rel="nofollow" target="_blank">赞助开发</a></p>
</div>
</div>
</div>
<?php 
include template('widget/footer');
?>
</body>
</html>
Example #10
0
?>
<a href="javascript:;" id="menu_lostpass">找回密码</a>
</p>
<div class="footer">
<ul>
<li>贴吧签到助手 <?php 
echo VERSION;
?>
</li>
<li>&copy;2014  <a href="http://www.ikk.me" target="_blank">kookxiang</a> - <a href="http://www.kookxiang.com" target="_blank">KK's Laboratory</a> - <a href="https://me.alipay.com/kookxiang" target="_blank">赞助开发</a><?php 
if (getSetting('beian_no')) {
    echo ' - <a href="http://www.miibeian.gov.cn/" target="_blank" rel="nofollow">' . getSetting('beian_no') . '</a>';
}
?>
</p></li>
</ul>
</div>
<script src="<?php 
echo jquery_path();
?>
"></script>
<script src="./template/simple/js/member.js?version=<?php 
echo VERSION;
?>
"></script>
<?php 
HOOK::run('member_footer');
?>
</div>
</body>
</html>
Example #11
0
"></script>
<script type="text/javascript">var formhash = '<?php 
echo $formhash;
?>
';var version = '<?php 
echo VERSION;
?>
';</script>
<script src="system/js/kk_dropdown.js?version=<?php 
echo VERSION;
?>
"></script>
<script src="system/js/main.js?version=<?php 
echo VERSION;
?>
"></script>
<script src="system/js/fwin.js?version=<?php 
echo VERSION;
?>
"></script>
<?php 
HOOK::run('page_footer_js');
if (defined('NEW_VERSION')) {
    echo '<script type="text/javascript">new_version = true</script>';
}
if (defined('CLOUD_NOT_INITED')) {
    echo '<div class="hidden"><img src="api.php?action=register_cloud" /></div>';
}
?>
</body>
</html>
Example #12
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 #13
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 #14
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 #15
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 #16
0
 function _load_module_hooks()
 {
     require_once SYSTEM_ROOT . './class/hooks.php';
     HOOK::INIT();
 }
Example #17
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
?>
<h2>设置</h2>
<form method="post" action="index.php?action=update_setting" id="setting_form" onsubmit="return post_win(this.action, this.id)">
<input type="hidden" name="formhash" value="<?php 
echo $formhash;
?>
">
<p>签到方式:</p>
<p><label><input type="radio" name="sign_method" id="sign_method_3" value="3" checked readonly /> V3.0 (模拟客户端签到)</label></p>
<p>附加签到:</p>
<p><label><input type="checkbox" disabled name="wenku_sign" id="wenku_sign" value="1" /> 自动签到百度文库</label></p>
<p>报告设置:</p>
<p><label><input type="checkbox" checked disabled name="error_mail" id="error_mail" value="1" /> 当天有无法签到的贴吧时给我发送邮件</label></p>
<p><label><input type="checkbox" disabled name="send_mail" id="send_mail" value="1" /> 每日发送一封签到报告邮件</label></p>
<p><input type="submit" value="保存设置" /></p>
</form>
<?php 
HOOK::run('user_setting');
?>
<br>
<p>签到测试:</p>
<p>随机选取一个贴吧,进行一次签到测试,检查你的设置有没有问题</p>
<p><a href="index.php?action=test_sign&formhash=<?php 
echo $formhash;
?>
" class="btn" onclick="return msg_redirect_action(this.href)">测试签到</a></p>
Example #18
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 #19
0
<div id="content-setting" class="hidden">
<?php 
include template('widget/setting');
?>
</div>
<div id="content-baidu_bind" class="hidden">
<?php 
include template('widget/bind_status');
?>
</div>
<?php 
HOOK::page_contents();
?>
<p class="copyright"><span class="mobile_hidden">贴吧签到助手 - Designed</span> by <a href="http://www.ikk.me" target="_blank">kookxiang</a>. <?php 
echo date('Y', time());
?>
 &copy; <a href="http://www.kookxiang.com" target="_blank">KK's Laboratory</a> - <a href="http://go.ikk.me/donate" target="_blank">赞助开发</a><br>
<?php 
if (getSetting('beian_no')) {
    echo '<a href="http://www.miibeian.gov.cn/" target="_blank" rel="nofollow">' . getSetting('beian_no') . '</a> - ';
}
HOOK::run('page_footer');
?>
</p></div>
</div>
</div>
<?php 
include template('widget/footer');
?>
</body>
</html>
Example #20
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 #21
0
 function init_final()
 {
     define('SYSTEM_STARTED', true);
     @ignore_user_abort(true);
     if (getSetting('AFENABLED')) {
         define('AFENABLED', true);
     }
     HOOK::run('on_load');
 }
Example #22
0
     $user = DB::fetch_first("SELECT * FROM member WHERE uid='{$uid}'");
     if (!$_POST['old_password']) {
         showmessage('请输入旧密码', './#setting', 1);
     }
     if (!$_POST['new_password']) {
         showmessage('请输入新密码', './#setting', 1);
     }
     if ($_POST['new_password'] != $_POST['new_password2']) {
         showmessage('两次输入的新密码不一样,请检查', './#setting', 1);
     }
     if (!Widget_Password::verify($user, $_POST['old_password'])) {
         showmessage('旧密码错误!请检查输入', './#setting', 1);
     }
     $newpassword = Widget_Password::encrypt($user, $_POST['new_password']);
     DB::update('member', array('password' => $newpassword), "uid='{$uid}'");
     HOOK::run('change_password', true, $uid);
     showmessage('您的密码已经更新', './#setting', 1);
     break;
 case 'reset_failure':
     if ($formhash != $_GET['formhash']) {
         showmessage('请稍候...', '?action=reset_failure&formhash=' . $formhash, 0);
     }
     $date = date('Ymd');
     DB::query("UPDATE sign_log SET status='0', retry='0' WHERE uid='{$uid}' AND date='{$date}' AND status<0");
     showmessage('已经重置失败状态,稍后系统将自动重试', './#signlog', 1);
     break;
 case 'refresh_liked_tieba':
     if ($formhash != $_GET['formhash']) {
         showmessage('刷新中,请稍候...', '?action=refresh_liked_tieba&formhash=' . $formhash, 0);
     }
     list($insert, $deleted) = update_liked_tieba($uid);
Example #23
0
            }
            if (strlen($username) > 24) {
                showmessage('用户名过长,请修改', dreferer(), 5);
            }
            $un = strtolower($username);
            if (strexists($un, 'admin') || strexists($un, 'guanli')) {
                showmessage('用户名不和谐,请修改', dreferer(), 5);
            }
            $user = DB::fetch_first("SELECT * FROM member WHERE username='******'");
            if ($user) {
                showmessage('用户名已经存在', 'member.php');
            }
            HOOK::run('before_register');
            $uid = do_register($username, $_POST['password'], $email);
            do_login($uid);
            HOOK::run('register_finish', $uid);
            showmessage("注册成功,您的用户名是 <b>{$username}</b> 记住了哦~!", dreferer(), 3);
        }
    }
    header('Location: member.php');
    exit;
} elseif ($_POST) {
    if ($_POST['username'] && $_POST['password']) {
        $username = daddslashes($_POST['username']);
        $un = strtolower($username);
        if (strlen($username) > 24) {
            showmessage('用户名过长,请修改', dreferer(), 5);
        }
        $user = DB::fetch_first("SELECT * FROM member WHERE username='******' OR email='{$username}'");
        $verified = Widget_Password::verify($user, $_POST['password']);
        if ($verified) {
Example #24
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 #25
0
<?php

if (!defined('IN_KKFRAME')) {
    exit;
}
?>
<ul id="menu" class="menu">
<?php 
if (get_cookie($uid) == "") {
    echo '<li id="menu_guide"><a href="#guide">配置向导</a></li>';
} else {
    $uinfo = get_baidu_userinfo($uid);
    $uinfo = $uinfo['data']['user_name_show'];
    echo '<li id="menu_user_info"><a href="#user_info">' . $uinfo . '</a></li>';
}
?>
<li id="menu_sign_log"><a href="#sign_log">签到记录</a></li>
<li id="menu_liked_tieba"><a href="#liked_tieba">喜欢的吧</a></li>
<li id="menu_baidu_bind"><a href="#baidu_bind">贴吧绑定</a></li>
<?php 
HOOK::page_menu();
?>
<li id="menu_setting"><a href="#setting">个人设置</a></li>
<?php 
if (is_admin($uid)) {
    echo '<li id="menu_admincp"><a href="admin.php">管理面板</a></li>';
}
//<li id="menu_updater"><a href="admin.php#updater">检查更新</a></li>
?>
</ul>
Example #26
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.');
}