Exemplo n.º 1
0
 function tminisave($have)
 {
     global $_M;
     //新方法
     $this->iniclass->tminisave($have);
     $wap_ok = 0;
     $cglist = $this->configlist;
     if ($have['mobile'] == '1') {
         $have['wap_skin_user'] = $have['met_skin_user'];
         $have['wap_skin_css'] = $have['met_skin_css'];
         $cglist = $this->mobile_configlist;
         //$have['flash_10001'] = $_M['config']['flash_10001'];
         $have['flash_10001'] = '1|' . $have['met_flash_10001_y'];
         $wap_ok = 1;
     } else {
         /*备用字段*/
         $preview['otherinfo']['imgurl1'] = $have['imgurl1'];
         $preview['otherinfo']['imgurl2'] = $have['imgurl2'];
         $query = "update {$_M[table][otherinfo]} SET ";
         for ($i = 1; $i <= 10; $i++) {
             $infoval = $have['info' . $i];
             if (isset($have['info' . $i])) {
                 $query .= "info{$i} = '{$infoval}',";
             }
         }
         $query .= "\n\t\t\t\timgurl1 = '{$have['imgurl1']}',\n\t\t\t\timgurl2 = '{$have['imgurl2']}'\n\t\t\t\twhere id='{$have['otherinfoid']}'\n\t\t\t";
         DB::query($query);
         load::sys_func('file');
         delfile(PATH_WEB . "cache/otherinfo_{$this->lang}.inc.php");
         $have['flash_10001'] = '1|' . $have['met_flash_10001_x'] . '|' . $have['met_flash_10001_y'] . '|' . $have['met_flash_10001_imgtype'];
     }
     $cglist[] = 'met_productTabok';
     $cglist[] = 'met_productTabname';
     $cglist[] = 'met_productTabname_1';
     $cglist[] = 'met_productTabname_2';
     $cglist[] = 'met_productTabname_3';
     $cglist[] = 'met_productTabname_4';
     configsave($cglist, $have, $this->lang);
     /*保存系统配置*/
     /*保存banner设置*/
     $nowidold = array();
     $bannerid = DB::get_all("select * from {$_M[table][flash]} where wap_ok='{$wap_ok}' and (module like '%,10001,%' or module = 'metinfo') and lang='{$this->lang}' and img_path!='' order by no_order ");
     foreach ($bannerid as $key => $val) {
         $nowidold[] = $val['id'];
     }
     $nowidnew = array();
     $have['indexbannerlist'] = str_replace("\\", "", $have['indexbannerlist']);
     $bannerlist = json_decode($have['indexbannerlist'], true);
     foreach ($bannerlist as $key => $val) {
         if ($val['img_path'] != '') {
             if (!strstr($val['img_path'], "../")) {
                 $val['img_path'] = '../' . $val['img_path'];
             }
             if ($val['id']) {
                 $query = "update {$_M[table][flash]} SET \n\t\t\t\t\timg_title = '{$val['img_title']}',\n\t\t\t\t\timg_path  = '{$val['img_path']}',\n\t\t\t\t\timg_link  = '{$val['img_link']}',\n\t\t\t\t\tno_order  = '{$key}'\n\t\t\t\t\tWHERE id  = '{$val['id']}'";
                 $nowidnew[] = $val['id'];
             } else {
                 $query = "INSERT INTO {$_M[table][flash]} SET \n\t\t\t\t\timg_title = '{$val['img_title']}',\n\t\t\t\t\timg_path  = '{$val['img_path']}',\n\t\t\t\t\timg_link  = '{$val['img_link']}',\n\t\t\t\t\tno_order  = '{$key}',\n\t\t\t\t\tmodule    = ',10001,',\n\t\t\t\t\twap_ok    = '{$wap_ok}',\n\t\t\t\t\tlang      = '{$this->lang}'";
             }
             DB::query($query);
         }
     }
     $nowid = array_diff($nowidold, $nowidnew);
     if ($nowid) {
         foreach ($nowid as $key => $val) {
             $query = "delete from {$_M[table][flash]} where id='{$val}'";
             DB::query($query);
         }
     }
 }
Exemplo n.º 2
0
 function dotpeditor()
 {
     global $_M;
     $configlist = array();
     $configlist[] = 'met_headstat';
     $configlist[] = 'met_footstat';
     configsave($configlist);
     /*保存系统配置*/
     turnover("{$_M[url][own_form]}a=dothirdparty", $_M['word']['jsok']);
 }
Exemplo n.º 3
0
<?php

require_once "admin_conn.php";
require_once "tools/Crontab.php";
chkLogin();
$action = be("get", "action");
switch (trim($action)) {
    case "configsave":
        configsave();
        break;
    case "configplaysave":
        configplaysave();
        break;
    case "configconnectsave":
        configconnectsave();
        break;
    case "configplay":
        headAdmin("播放器设置");
        configplay();
        break;
    case "configconnect":
        headAdmin("一键登录设置");
        configconnect();
        break;
    default:
        headAdmin("站点设置");
        config();
        break;
}
dispseObj();
function config()
Exemplo n.º 4
0
 function dositemapeditor()
 {
     global $_M;
     $configlist = array();
     $configlist[] = 'met_sitemap_auto';
     $configlist[] = 'met_sitemap_not1';
     $configlist[] = 'met_sitemap_not2';
     $configlist[] = 'met_sitemap_lang';
     $configlist[] = 'met_sitemap_xml';
     $configlist[] = 'met_sitemap_txt';
     configsave($configlist);
     /*保存系统配置*/
     load::sys_func('file');
     /*验证读写权限*/
     function yanquan($fname)
     {
         global $_M;
         $r = false;
         if (!file_exists(PATH_WEB . $fname)) {
             file_put_contents(PATH_WEB . $fname, 'metinfo');
             $str = 'metinfo';
         } else {
             $str = file_get_contents(PATH_WEB . $fname);
         }
         if (!file_put_contents(PATH_WEB . $fname, $str)) {
             $r = true;
         }
         return $r;
     }
     $err = false;
     if (!$_M['form']['met_sitemap_xml']) {
         delfile(PATH_WEB . "/sitemap.xml");
     } else {
         $err = yanquan('sitemap.xml');
     }
     if (!$_M['form']['met_sitemap_txt']) {
         delfile(PATH_WEB . "/sitemap.txt");
     } else {
         $err = yanquan('sitemap.txt');
     }
     if ($err) {
         turnover("{$_M[url][own_form]}a=dositemap", $_M['form']['otherinfocache2']);
     } else {
         $sitemaptype = $_M['form']['met_sitemap_xml'] ? 'xml' : ($_M['form']['met_sitemap_txt'] ? 'txt' : 0);
         sitemap_robots($sitemaptype);
         if ($_M['form']['met_sitemap_xml'] || $_M['form']['met_sitemap_txt']) {
             $gent = "sitemap/index.php?lang={$_M[lang]}&htmsitemap={$_M['config']['met_member_force']}";
             $curl = load::sys_class('curl', 'new');
             $curl->set('host', $_M['url']['site']);
             $curl->set('file', $gent);
             $post = array('post' => '');
             $curl->curl_post($post);
         }
         turnover("{$_M[url][own_form]}a=dositemap");
     }
 }
Exemplo n.º 5
0
 public function doopensave()
 {
     global $_M;
     $configlist = array();
     $configlist[] = 'met_weixin_appid';
     $configlist[] = 'met_weixin_appsecret';
     $configlist[] = 'met_weixin_gz_appid';
     $configlist[] = 'met_weixin_gz_appsecret';
     $configlist[] = 'met_weibo_appkey';
     $configlist[] = 'met_weibo_appsecret';
     $configlist[] = 'met_qq_appid';
     $configlist[] = 'met_qq_appsecret';
     $configlist[] = 'met_weixin_open';
     $configlist[] = 'met_weibo_open';
     $configlist[] = 'met_qq_open';
     configsave($configlist);
     turnover("{$_M[url][own_form]}a=doopen");
 }
        $wp_root_path = SHARIFF_WP_ROOT_PATH;
        if (!file_exists($wp_root_path . '/wp-blog-header.php')) {
            // search for it
            $wp_load = rsearch($wp_root_path, '/wp-load.php/');
            // set $wp_root_path to the location of wp-load.php
            $wp_root_path = $wp_load['path'];
            // save it to shariff-config.php
            configsave($wp_root_path);
        }
    } else {
        // search for it
        $wp_load = rsearch($wp_root_path, '/wp-load.php/');
        // set $wp_root_path to the location of wp-load.php
        $wp_root_path = $wp_load['path'];
        // save it to shariff-config.php
        configsave($wp_root_path);
    }
}
// search in the subfolders of $wp_root_path for a given file (regex)
function rsearch($folder, $pattern)
{
    $dir = new RecursiveDirectoryIterator($folder);
    $iterator = new RecursiveIteratorIterator($dir);
    $files = new RegexIterator($iterator, $pattern, RegexIterator::GET_MATCH);
    $fileList = array();
    foreach ($files as $file) {
        $fileList[] = array('file' => $file, 'path' => $iterator->getPath());
    }
    // return only the first result
    return $fileList[0];
}