Пример #1
0
 function get_channel()
 {
     global $_G;
     if (!class_exists('SpContentGetallclassRequest')) {
         include_once ROOT_PATH . 'top/request/SpContentGetallclassRequest.php';
     }
     $req = new SpContentGetallclassRequest();
     $req->setSiteKey($_G['setting'][sitekey]);
     $resp = $_G['TOP']->execute($req);
     top_check_error($resp, $this->show_error);
     $value = $this->parse($resp);
     if (is_array($value) && count($value) > 0) {
         $rs = implode(',', $value);
         if (!isset($_G['setting']['uz_type'])) {
             insert_setting('uz_type', $rs);
         } else {
             set_setting('uz_type', $rs);
         }
         loadcache('setting', 'update');
     }
     return $value;
 }
Пример #2
0
 function setting()
 {
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         insert_setting();
         cpmsg('修改成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__);
         return false;
     }
     $this->show();
 }
Пример #3
0
 function login_setting()
 {
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         insert_setting();
         cpmsg('修改成功', 'success', 'm=admin&a=login_setting');
         return false;
     }
     $this->show();
 }
Пример #4
0
 function gezi()
 {
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         $arr = array();
         foreach ($_POST[picurl] as $k => $v) {
             $tmp = array();
             $tmp['picurl'] = $_POST[picurl][$k];
             $tmp['url'] = $_POST[url][$k];
             $tmp['title'] = $_POST[title][$k];
             if ($_FILES['file' . $k]) {
                 $pic = upload($_FILES['file' . $k]);
                 if ($pic) {
                     $tmp['picurl'] = $pic;
                 }
             }
             if (!$tmp['picurl'] && $tmp['url']) {
                 continue;
             }
             $arr[] = $tmp;
         }
         $arr = serialize($arr);
         if (isset($_G['setting']['app_gezi'])) {
             set_setting('app_gezi', $arr);
         } else {
             insert_setting('app_gezi', $arr);
         }
         loadcache('setting', 'update');
         cpmsg('修改成功', 'success', 'm=apps&a=gezi');
         return false;
     }
     if ($_G[setting]['app_gezi']) {
         $hdp = dunserialize($_G[setting]['app_gezi']);
     } else {
         $hdp = array(array('picurl' => '', 'url' => ''));
     }
     $size = 6;
     $this->add(array('hdp' => $hdp, 'size' => $size));
     $this->show('apps/gezi');
 }
Пример #5
0
function insert_setting($name, $value)
{
    global $_G;
    if (!$name && !$value) {
        foreach ($_GET['postdb'] as $k => $v) {
            if (isset($_G['setting'][$k]) || array_key_exists($k, $_G['setting'])) {
                set_setting($k, $v);
            } else {
                insert_setting($k, $v);
            }
        }
    } else {
        if (isset($_G['setting'][$name]) || array_key_exists($name, $_G['setting'])) {
            set_setting($name, $value);
        } else {
            DB::insert('setting', array('name' => $name, 'value' => $value), true);
        }
    }
    loadcache('setting', 'update');
}
Пример #6
0
 function setting()
 {
     global $_G;
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         insert_setting();
         cpmsg('修改成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__);
         return false;
     }
     if ($_G['setting']['duihuan_status'] && is_array($_G['setting']['duihuan_status'])) {
         $_G[setting]['duihuan_status'] = implode(',', $_G[setting]['duihuan_status']);
     }
     $this->show();
 }