Beispiel #1
0
function update_news_pos($pos)
{
    $db = get_db();
    $category = new category_class('news');
    if ($pos == 1) {
        $category_id = $category->find_by_name('富豪报道');
        $category_id = $category_id->id;
        $type = 'richindex_news_';
    } else {
        $category_id = $category->find_by_name('创富者说');
        $category_id = $category_id->id;
        $type = 'richindex_news1_';
    }
    $table = new table_class('fb_page_pos');
    $db->echo_sql = true;
    $items = $db->query("select id,title,created_at,description,author from fb_news where category_id={$category_id} order by created_at desc limit 6");
    $exist_items = $table->find('all', array('conditions' => "name like '{$type}%' and (end_time <= now() or end_time is null)", 'order' => "name"));
    $db->echo_sql = false;
    $len = empty($exist_items) ? 0 : count($exist_items);
    for ($i = 0; $i < $len; $i++) {
        $exist_items[$i]->display = $items[$i]->title;
        $exist_items[$i]->description = $items[$i]->description;
        $exist_items[$i]->href = dynamic_news_url($items[$i]);
        $exist_items[$i]->statci_href = static_news_url($items[$i]);
        $exist_items[$i]->title = $items[$i]->title;
        $exist_items[$i]->alias = $items[$i]->author;
        $exist_items[$i]->end_time = dt_increase(1, 'h', $exist_itmes->end_time);
        $exist_items[$i]->save();
    }
}
Beispiel #2
0
function update_list_pos($pos)
{
    global $db;
    $table = new table_class('fb_page_pos');
    $type = pos_type($pos);
    $items = $db->query("select name,comment,image_src,id from fb_custom_list_type where position = {$pos} order by created_at desc limit 4");
    $exist_items = $table->find('all', array('conditions' => "name like 'listindex_{$type}%' and (end_time <= now() or end_time is null)", 'order' => "name"));
    $len = empty($exist_items) ? 0 : count($exist_items);
    for ($i = 0; $i < $len; $i++) {
        $exist_items[$i]->display = $items[$i]->name;
        $exist_items[$i]->description = $items[$i]->comment;
        $exist_items[$i]->href = '/list/show_list.php?id=' . $items[$i]->id;
        $exist_items[$i]->image1 = $items[$i]->image_src;
        $exist_items[$i]->title = $items[$i]->name;
        $exist_items[$i]->end_time = dt_increase(1, 'h', $exist_itmes->end_time);
        $exist_items[$i]->save();
    }
}
Beispiel #3
0
    alert('用户名和注册邮箱不匹配');
    redirect('index.php');
    die;
}
$mail = $_POST['email'];
if (strlen($mail) > 30) {
    alert('用户名和注册邮箱不匹配');
    redirect('index.php');
    die;
}
$db = get_db();
$user = $db->query("select id from fb_yh where name='{$name}' and email='{$mail}'");
if ($db->record_count == 1) {
    $verify = rand_str();
    $gp = new table_class('fb_get_pwd');
    $gp->user_id = $user[0]->id;
    $gp->verify = $verify;
    $gp->end_time = dt_increase(4, 'h');
    $gp->save();
    $content = "欢迎进行福布斯中文网密码重置过程,请点击下面的链接:<br/><a href='http://61.129.115.239/getpwd/get_pwd.php?verify={$verify}'>http://61.129.115.239/getpwd/get_pwd.php?verify={$verify}</a><br>如果点击以上链接不起作用,请将此网址复制并粘贴到新的浏览器窗口中。如果您意外地收到此邮件,很可能是其他用户在尝试重设密码时,误输入了您的电子邮件地址。如果您没有提出此请求,则无需做进一步的操作,可以放心地忽略此电子邮件。";
    send_mail('smtp.163.com', 'sauger', 'auden6666', '*****@*****.**', $mail, '福布斯中文网', $content);
    alert("请尽快登录到" . $mail . "完成剩余操作!");
    redirect('/');
} else {
    alert('用户名和注册邮箱不匹配');
    redirect('index.php');
    die;
}
?>
</body>
</html>
Beispiel #4
0
function update_click($limit, $position_name)
{
    $db = get_db();
    $date = dt_increase(-30, 'd');
    $sql = "select distinct(title) as title,id,short_title,created_at,description,video_photo_src from fb_news where 1=1 and is_adopt=1 and created_at > '{$date}' order by click_count desc,created_at desc limit {$limit}";
    $news = $db->query($sql);
    $news_count = $db->record_count;
    for ($i = 0; $i < $news_count; $i++) {
        for ($j = 0; $j < $limit; $j++) {
            $pos_name = $position_name . $j;
            $record = $db->query("select id,end_time from fb_page_pos where name='{$pos_name}'");
            if ($db->record_count == 1) {
                if ($record[0]->end_time > now()) {
                } else {
                    $pos = new table_class('fb_page_pos');
                    $pos->find($record[0]->id);
                    $end_time = date('Y-m-d H:00:00', strtotime("+1hours", time()));
                    $pos->end_time = $end_time;
                    $pos->display = $news[$i]->title;
                    $pos->title = $news[$i]->title;
                    $pos->image1 = $news[$i]->video_photo_src;
                    $pos->description = $news[$i]->description;
                    $pos->href = dynamic_news_url($news[$i]);
                    $pos->static_href = static_news_url($news[$i]);
                    $pos->save();
                    break;
                }
            } else {
                $pos = new table_class('fb_page_pos');
                $pos->name = $pos_name;
                $end_time = date('Y-m-d H:00:00', strtotime("+1hours", time()));
                $pos->end_time = $end_time;
                $pos->display = $news[$i]->title;
                $pos->title = $news[$i]->title;
                $pos->image1 = $news[$i]->video_photo_src;
                $pos->description = $news[$i]->description;
                $pos->href = dynamic_news_url($news[$i]);
                $pos->static_href = static_news_url($news[$i]);
                $pos->comment = $category_name . $i;
                $pos->save();
                break;
            }
        }
    }
}