Пример #1
0
         case 'show':
             $db->update("UPDATE pw_advert SET ifshow=1 WHERE type=1 AND etime>{$timestamp} AND id IN ({$selid})");
             break;
         case 'hide':
             $db->update("UPDATE pw_advert SET ifshow=0 WHERE type=1 AND id IN ({$selid})");
             break;
     }
     updatecache_c();
     adminmsg('operate_success', "{$basename}&action=");
 } elseif ($job == 'check') {
     S::gp(array('uid'), 'GP', 2);
     !$uid && adminmsg('unituser_username_empty');
     $buyer = $db->get_one("SELECT b.*,m.username FROM pw_buyadvert b LEFT JOIN pw_members m USING(uid) WHERE b.id=" . S::sqlEscape($id) . "AND b.uid=" . S::sqlEscape($uid));
     !$buyer && adminmsg('unituser_newname_error');
     $buyer_config = unserialize($buyer['config']);
     HtmlConvert($buyer_config);
     $buyer_config['days'] = (int) $buyer_config['days'];
     !$buyer_config['days'] && adminmsg('advert_days_error');
     $usercredit = array();
     foreach ($credit->get($uid) as $key => $value) {
         $usercredit[$key] = $value;
     }
     !array_key_exists($config['creditype'], $usercredit) && adminmsg('advert_creditype_error');
     $price = 0;
     if ($config['price']) {
         $config['price'] = (int) $config['price'];
         $price = $config['price'] * $buyer_config['days'];
         $price > $usercredit[$config['creditype']] && adminmsg('advert_creditype_lack');
     }
     $begintime = $db->get_value("SELECT lasttime FROM pw_buyadvert WHERE id=" . S::sqlEscape($id) . " ORDER BY lasttime DESC");
     if ($begintime && $begintime > $timestamp) {
Пример #2
0
function HtmlConvert(&$array)
{
    if (is_array($array)) {
        foreach ($array as $key => $value) {
            if (!is_array($value)) {
                $array[$key] = htmlspecialchars($value);
            } else {
                HtmlConvert($array[$key]);
            }
        }
    } else {
        $array = htmlspecialchars($array);
    }
}
Пример #3
0
    }
    include_once PrintEot('filterAjax');
    ajax_footer();
} elseif ($action == 'synchronous') {
    if ($admin_gid == 3) {
        $appclient = L::loadClass('AppClient');
        $sitehash = $appclient->getApicode();
        if ($job == 'confirm') {
            define('AJAX', 1);
            $ft_update_num = getWordUpdate();
            if ($ft_update_num) {
                $classdb = array();
                $sql = "SELECT * FROM pw_filter_class";
                $query = $db->query($sql);
                while ($rt = $db->fetch_array($query)) {
                    HtmlConvert($rt);
                    $classdb[$rt['id']] = $rt;
                }
            } else {
                $job = 'notupdate';
            }
            include_once PrintEot('filterAjax');
            ajax_footer();
        } else {
            define('AJAX', 1);
            S::gp(array('state', 'class', 'newclass'));
            //插入新分类
            if ($newclass) {
                $class = newClass($newclass);
            }
            $class_title = $db->get_value("SELECT title FROM pw_filter_class WHERE id=" . S::sqlEscape($class));
Пример #4
0
    require_once R_P . 'require/credit.php';
    include_once D_P . 'data/bbscache/forumcache.php';
    $advert = array('stime' => get_date($timestamp, 'Y-m-d'), 'etime' => get_date($timestamp + 31536000, 'Y-m-d'));
    $config['type'] = 'txt';
    $advert['orderby'] = 0;
    $type_txt = $ifshow_Y = 'checked';
    $selThread_page = $selFids_all = 'selected';
} elseif ($action == 'edit') {
    require_once R_P . 'require/credit.php';
    include_once D_P . 'data/bbscache/forumcache.php';
    InitGP(array('id'));
    $advert = $db->get_one("SELECT * FROM pw_advert WHERE type=3 AND id=" . pwEscape($id));
    !$advert && adminmsg('advert_id_error');
    $config = unserialize($advert['config']);
    HtmlConvert($advert);
    HtmlConvert($config);
    $advert['etime'] = get_date($advert['etime'], 'Y-m-d');
    $advert['stime'] = get_date($advert['stime'], 'Y-m-d');
    ifcheck($advert['ifshow'], 'ifshow');
    ${'type_' . $config['type']} = 'checked';
    /* bug fixed lh*/
    $optCates = '';
    foreach ($cates as $v) {
        $selected = $advert['ckey'] == $v['ckey'] ? "selected=selected" : "";
        $optCates .= "<option value=\"{$v['ckey']}\" " . $selected . ">" . $v['name'] . "</option>";
    }
    $CreditList = '';
    foreach ($credit->cType as $key => $value) {
        $CreditList .= "<option value=\"{$key}\"" . ($config['creditype'] == $key ? ' selected' : '') . ">{$value}</option>";
    }
    if ($config['mode']) {