当前位置: 首页>>代码示例>>PHP>>正文


PHP getimportdata函数代码示例

本文整理汇总了PHP中getimportdata函数的典型用法代码示例。如果您正苦于以下问题:PHP getimportdata函数的具体用法?PHP getimportdata怎么用?PHP getimportdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getimportdata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onMobileModule

 public function onMobileModule()
 {
     global $_G;
     if (!$_G['setting']['plugins']['available']) {
         return '';
     }
     require_once libfile('function/admincp');
     loadcache('pluginlanguage_script', 1);
     $return = array();
     foreach ($_G['setting']['plugins']['available'] as $pluginid) {
         $row = array();
         $modulefile = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/discuz_mobile_' . $pluginid . '.xml';
         if (file_exists($modulefile)) {
             $_GET['importtxt'] = @implode('', file($modulefile));
             $pluginarray = getimportdata('Discuz! Mobile', 0, 1);
             if ($pluginarray) {
                 foreach ($pluginarray as $name => $value) {
                     $row[] = array('name' => isset($_G['cache']['pluginlanguage_script'][$pluginid][$name]) ? $_G['cache']['pluginlanguage_script'][$pluginid][$name] : $name, 'logo' => $value['logo'], 'url' => preg_match('/^http:\\/\\//', $value['url']) ? $value['url'] : $_G['siteurl'] . $value['url']);
                 }
             }
         }
         $return[$pluginid] = $row;
     }
     return $return;
 }
开发者ID:tang86,项目名称:discuz-utf8,代码行数:25,代码来源:Mobile.php

示例2: import_styles

function import_styles($ignoreversion = 1, $dir = '')
{
    global $db, $tablepre, $version, $importtxt, $stylearray;
    if (!isset($dir)) {
        $stylearrays = array(getimportdata('Discuz! Style'));
    } else {
        $dir = str_replace(array('/', '\\'), '', $dir);
        $templatedir = DISCUZ_ROOT . './templates/' . $dir;
        $searchdir = dir($templatedir);
        $stylearrays = array();
        while ($searchentry = $searchdir->read()) {
            if (substr($searchentry, 0, 13) == 'discuz_style_' && fileext($searchentry) == 'xml') {
                $importfile = $templatedir . '/' . $searchentry;
                $importtxt = implode('', file($importfile));
                $stylearrays[] = getimportdata('Discuz! Style');
            }
        }
    }
    foreach ($stylearrays as $stylearray) {
        if (empty($ignoreversion) && strip_tags($stylearray['version']) != strip_tags($version)) {
            cpmsg('styles_import_version_invalid', '', 'error');
        }
        $renamed = 0;
        if ($stylearray['templateid'] != 1) {
            $templatedir = DISCUZ_ROOT . './' . $stylearray['directory'];
            if (!is_dir($templatedir)) {
                if (!@mkdir($templatedir, 0777)) {
                    $basedir = dirname($stylearray['directory']);
                    cpmsg('styles_import_directory_invalid', '', 'error');
                }
            }
            if (!($templateid = $db->result_first("SELECT templateid FROM {$tablepre}templates WHERE name='{$stylearray['tplname']}'"))) {
                $db->query("INSERT INTO {$tablepre}templates (name, directory, copyright)\r\n\t\t\t\t\tVALUES ('{$stylearray['tplname']}', '{$stylearray['directory']}', '{$stylearray['copyright']}')");
                $templateid = $db->insert_id();
            }
        } else {
            $templateid = 1;
        }
        if ($db->result_first("SELECT COUNT(*) FROM {$tablepre}styles WHERE name='{$stylearray['name']}'")) {
            $stylearray['name'] .= '_' . random(4);
            $renamed = 1;
        }
        $db->query("INSERT INTO {$tablepre}styles (name, templateid)\r\n\t\t\tVALUES ('{$stylearray['name']}', '{$templateid}')");
        $styleidnew = $db->insert_id();
        foreach ($stylearray['style'] as $variable => $substitute) {
            $substitute = @htmlspecialchars($substitute);
            $db->query("INSERT INTO {$tablepre}stylevars (styleid, variable, substitute)\r\n\t\t\t\tVALUES ('{$styleidnew}', '{$variable}', '{$substitute}')");
        }
    }
    updatecache('styles');
    updatecache('settings');
    return $renamed;
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:53,代码来源:importdata.func.php

示例3: build_cache_plugin

function build_cache_plugin()
{
    global $importtxt;
    $data = array();
    $query = DB::query("SELECT * FROM " . DB::table('common_plugin') . " WHERE available='1'");
    $pluginsetting = array();
    while ($plugin = DB::fetch($query)) {
        $dir = substr($plugin['directory'], 0, -1);
        $plugin['modules'] = unserialize($plugin['modules']);
        if ($plugin['modules']['extra']['langexists']) {
            require_once libfile('function/plugin');
            require_once libfile('function/admincp');
            $file = DISCUZ_ROOT . './source/plugin/' . $dir . '/discuz_plugin_' . $dir . ($plugin['modules']['extra']['installtype'] ? '_' . $plugin['modules']['extra']['installtype'] : '') . '.xml';
            $importtxt = @implode('', file($file));
            $pluginarray = getimportdata('Discuz! Plugin', 1, 1);
            if ($pluginarray) {
                updatepluginlanguage($pluginarray);
            }
        }
        $queryvars = DB::query("SELECT * FROM " . DB::table('common_pluginvar') . " WHERE pluginid='{$plugin['pluginid']}'");
        while ($var = DB::fetch($queryvars)) {
            $data[$plugin['identifier']][$var['variable']] = $var['value'];
            if (in_array(substr($var['type'], 0, 6), array('group_', 'forum_'))) {
                $stype = substr($var['type'], 0, 5) . 's';
                $type = substr($var['type'], 6);
                if ($type == 'select') {
                    foreach (explode("\n", $var['extra']) as $key => $option) {
                        $option = trim($option);
                        if (strpos($option, '=') === FALSE) {
                            $key = $option;
                        } else {
                            $item = explode('=', $option);
                            $key = trim($item[0]);
                            $option = trim($item[1]);
                        }
                        $var['select'][] = array($key, $option);
                    }
                }
                $pluginsetting[$stype][$plugin['identifier']]['name'] = $plugin['name'];
                $pluginsetting[$stype][$plugin['identifier']]['setting'][$var['pluginvarid']] = array('title' => $var['title'], 'description' => $var['description'], 'type' => $type, 'select' => $var['select']);
            }
        }
    }
    writetocache('pluginsetting', getcachevars(array('pluginsetting' => $pluginsetting)));
    save_syscache('plugin', $data);
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:46,代码来源:cache_plugin.php

示例4: showtablefooter

        showtablefooter();
        showformfooter();
    }
} elseif ($operation == 'import') {
    if (!submitcheck('importsubmit')) {
        shownav('tools', 'nav_javascript');
        showsubmenu('nav_javascript', array(array('config', 'jswizard&operation=config', 0), $infosidemenu, array('admin', 'jswizard', 0), array(array('menu' => 'jswizard_addmodule', 'submenu' => $addmenu), '', 0), array('jswizard_module', 'jswizard&type=module', 0), array('import', 'jswizard&operation=import', 1)));
        showformheader('jswizard&operation=import', 'enctype');
        showtableheader('jswizard_import');
        showimportdata();
        showtablerow('', 'class="rowform"', mradio('importrewrite', array(0 => lang('jswizard_import_default'), 1 => lang('jswizard_import_norewrite'), 2 => lang('jswizard_import_rewrite')), 0, FALSE));
        showsubmit('importsubmit');
        showtablefooter();
        showformfooter();
    } else {
        $importarray = getimportdata(0);
        $keys = implode("','", array_keys($importarray));
        if ($importrewrite != 2) {
            $query = $db->query("SELECT variable FROM {$tablepre}request WHERE variable IN ('{$keys}')");
            $existkeyarray = array();
            while ($existkey = $db->fetch_array($query)) {
                if ($importrewrite == 1) {
                    unset($importarray[$existkey['variable']]);
                } else {
                    $existkeyarray[] = $existkey['variable'];
                }
            }
            if ($importrewrite == 0 && $existkeyarray) {
                $existkeys = implode(", ", $existkeyarray);
                cpmsg('jswizard_import_exist', '', 'error');
            }
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:jswizard.inc.php

示例5: showmessage

        showmessage('应用卸载成功', ADMINSCRIPT . '?mod=app&op=list&do=available', array(), array('alert' => 'right'));
    }
} elseif ($do == 'upgrade') {
    $appid = intval($_GET['appid']);
    if (!($app = C::t('app_market')->fetch($appid))) {
        showmessage('应用不存在,或已删除');
    }
    $finish = FALSE;
    $msg = '应用升级成功!';
    $entrydir = DZZ_ROOT . './dzz/' . $app['identifier'];
    $file = $entrydir . '/dzz_app_' . $app['identifier'] . '.xml';
    if (!file_exists($file)) {
        showmessage('应用配置文件不存在,请将应用配置文件放入应用目录后重试');
    }
    $importtxt = @implode('', file($file));
    $apparray = getimportdata('Dzz! app', 0, 0, $importtxt);
    $filename = $apparray['app']['extra']['upgradefile'];
    $toversion = $apparray['app']['version'];
    if (!empty($apparray['app']['extra']['upgradefile']) && preg_match('/^[\\w\\.]+$/', $apparray['app']['extra']['upgradefile'])) {
        $filename = $entrydir . '/' . $apparray['app']['extra']['upgradefile'];
        if (file_exists($filename)) {
            @(include $filename);
        } else {
            $finish = TRUE;
        }
    } else {
        $finish = TRUE;
    }
    if ($finish) {
        C::t('app_market')->update($appid, array('version' => $toversion));
        showmessage('应用升级成功', ADMINSCRIPT . '?mod=app&op=list&do=updatelist', array(), array('alert' => 'right'));
开发者ID:druphliu,项目名称:dzzoffice,代码行数:31,代码来源:cp.php

示例6: dir

    $plugindir = DZZ_ROOT . './dzz';
    $pluginsdir = dir($plugindir);
    $newplugins = array();
    $list = array();
    while ($entry = $pluginsdir->read()) {
        if (!in_array($entry, array('.', '..')) && is_dir($plugindir . '/' . $entry) && !in_array($entry, $identifiers)) {
            $entrydir = DZZ_ROOT . './dzz/' . $entry;
            $d = dir($entrydir);
            $filemtime = filemtime($entrydir);
            $entrytitle = $entry;
            $entryversion = $entrycopyright = $importtxt = '';
            if (file_exists($entrydir . '/dzz_app_' . $entry . '.xml')) {
                $importtxt = @implode('', file($entrydir . '/dzz_app_' . $entry . '.xml'));
            }
            if ($importtxt) {
                $pluginarray = getimportdata('Dzz! app', 0, 1);
                if (!empty($pluginarray['plugin']['name'])) {
                    $pluginarray['plugin']['name'] = dhtmlspecialchars($pluginarray['plugin']['name']);
                    $pluginarray['plugin']['version'] = dhtmlspecialchars($pluginarray['plugin']['version']);
                    $pluginarray['plugin']['copyright'] = dhtmlspecialchars($pluginarray['plugin']['copyright']);
                }
                $list[$entry] = $pluginarray;
            }
        }
    }
} elseif ($do == 'upgrade') {
    $sql = '';
    if ($group) {
        $sql = " and `group` = '{$group}'";
    }
    if ($count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('app_market') . " WHERE 1 {$sql}")) {
开发者ID:druphliu,项目名称:dzzoffice,代码行数:31,代码来源:import.php

示例7: cloudaddons_clear

function cloudaddons_clear($type, $id)
{
    global $_G;
    if (isset($_G['config']['plugindeveloper']) && $_G['config']['plugindeveloper'] > 0) {
        return;
    }
    $dirs = array('plugin' => array('plugin', './source/plugin/'), 'template' => array('style', './template/'));
    if ($dirs[$type] && cloudaddons_getmd5($id . '.' . $type)) {
        $entrydir = DISCUZ_ROOT . $dirs[$type][1] . $id;
        $d = dir($entrydir);
        $filedeleted = false;
        while ($f = $d->read()) {
            if (preg_match('/^discuz\\_' . $dirs[$type][0] . '\\_' . $id . '(\\_\\w+)?\\.xml$/', $f)) {
                @unlink($entrydir . '/' . $f);
                if ($type == 'plugin' && !$filedeleted) {
                    @unlink($entrydir . '/' . $f);
                    $importtxt = @implode('', file($entrydir . '/' . $f));
                    $pluginarray = getimportdata('Discuz! Plugin');
                    if ($pluginarray['installfile']) {
                        @unlink($entrydir . '/' . $pluginarray['installfile']);
                    }
                    if ($pluginarray['upgradefile']) {
                        @unlink($entrydir . '/' . $pluginarray['upgradefile']);
                    }
                    $filedeleted = true;
                }
            }
        }
    }
}
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:30,代码来源:function_cloudaddons.php

示例8: libfile

require_once libfile('function/block');
blockclass_cache();
if ($_G['config']['output']['tplrefresh']) {
    cleartemplatecache();
}
$plugins = array('qqconnect', 'cloudstat', 'soso_smilies', 'cloudsearch', 'qqgroup', 'security', 'xf_storage', 'mobile');
$opens = array('mobile');
require_once libfile('function/plugin');
require_once libfile('function/admincp');
foreach ($plugins as $pluginid) {
    $importfile = DISCUZ_ROOT . './source/plugin/' . $pluginid . '/discuz_plugin_' . $pluginid . '.xml';
    if (!file_exists($importfile)) {
        continue;
    }
    $importtxt = @implode('', file($importfile));
    $pluginarray = getimportdata('Discuz! Plugin', $importtxt);
    $plugin = C::t('common_plugin')->fetch_by_identifier($pluginid);
    if ($plugin) {
        $modules = unserialize($plugin['modules']);
        if ($modules['system'] > 0) {
            if ($pluginarray['plugin']['version'] != $plugin['version']) {
                pluginupgrade($pluginarray, '');
                if ($pluginarray['upgradefile']) {
                    $plugindir = DISCUZ_ROOT . './source/plugin/' . $pluginarray['plugin']['directory'];
                    if (file_exists($plugindir . '/' . $pluginarray['upgradefile'])) {
                        @(include_once $plugindir . '/' . $pluginarray['upgradefile']);
                    }
                }
            }
            if ($modules['system'] != 2) {
                $modules['system'] = 2;
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:misc_initsys.php

示例9: cpmsg

            }
        }
        cpmsg('project_update_forum', $BASESCRIPT . '?action=project', 'succeed');
    }
} elseif ($operation == 'import') {
    if (!submitcheck('importsubmit')) {
        shownav('tools', 'project_scheme');
        showsubmenu('project_scheme', array($allowforumsedit ? array('project_forum_scheme', 'project&type=forum', $type == 'forum') : array(), $allowusergroups ? array('project_group_scheme', 'project&type=group', $type == 'group') : array(), $allowcreditwizard ? array('project_extcredit_scheme', 'project&type=extcredit', $type == 'extcredit') : array(), array('project_import_stick', 'project&operation=import', $operation == 'import')));
        showformheader('project&operation=import', 'enctype');
        showtableheader('project_import_stick');
        showimportdata();
        showsubmit('importsubmit');
        showtablefooter();
        showformfooter();
    } else {
        $projectarray = getimportdata();
        if (strip_tags($projectarray['version']) != strip_tags($version)) {
            cpmsg('project_export_version_invalid', '', 'error');
        } else {
            $db->query("INSERT INTO {$tablepre}projects (name, type, description, value) VALUES ('{$projectarray['name']}', '{$projectarray['type']}', '{$projectarray['description']}', '{$projectarray['value']}')");
            cpmsg('project_import_succeed', $BASESCRIPT . '?action=project', 'succeed');
        }
    }
} elseif ($operation == 'add') {
    $delfields = array('forum' => array('fid', 'fup', 'type', 'name', 'status', 'displayorder', 'threads', 'posts', 'todayposts', 'lastpost', 'description', 'password', 'icon', 'redirect', 'moderators', 'rules', 'threadtypes'), 'group' => array('groupid', 'radminid', 'type', 'system', 'grouptitle', 'creditshigher', 'creditslower', 'stars', 'color', 'groupavatar'));
    if (!submitcheck('addsubmit')) {
        shownav('tools', 'project_scheme_add');
        showsubmenu('project_scheme_add');
        if (!empty($projectid)) {
            $query = $db->query("SELECT name, description, value FROM {$tablepre}projects WHERE id='{$projectid}'");
            $project = $db->fetch_array($query);
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:project.inc.php

示例10: pluginvalidator

function pluginvalidator($identifier)
{
    global $importtxt;
    $validatorkey = '';
    if (file_exists(DISCUZ_ROOT . './source/plugin/' . $identifier . '/validator.xml')) {
        $importtxt = file_get_contents(DISCUZ_ROOT . './source/plugin/' . $identifier . '/validator.xml');
        $validatorarray = getimportdata('Discuz! Plugin Validator');
        if (!empty($validatorarray) && is_array($validatorarray)) {
            $md5 = '';
            foreach ($validatorarray as $file) {
                $md5 .= file_exists(DISCUZ_ROOT . $file) ? @md5_file($file) : '';
            }
            $validatorkey = md5(md5($md5) . $identifier);
        }
    }
    return $validatorkey;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:17,代码来源:function_plugin.php

示例11: dheader

    dheader('Content-Type: ' . (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
    echo $plugin_export;
    dexit();
} elseif ($operation == 'import') {
    if (!submitcheck('importsubmit')) {
        shownav('extended', 'nav_plugins');
        showsubmenu('nav_plugins', array(array('config', 'plugins&operation=config', 0), array('admin', 'plugins', 0), array('import', 'plugins&operation=import', 1)));
        showformheader('plugins&operation=import', 'enctype');
        showtableheader('plugins_import', 'fixpadding');
        showimportdata();
        showtablerow('', '', '<input type="checkbox" name="ignoreversion" value="1" class="checkbox" /> ' . lang('plugins_import_ignore_version'));
        showsubmit('importsubmit');
        showtablefooter();
        showformfooter();
    } else {
        $pluginarray = getimportdata();
        if (empty($ignoreversion) && strip_tags($pluginarray['version']) != strip_tags($version)) {
            cpmsg('plugins_import_version_invalid', '', 'error');
        }
        $query = $db->query("SELECT pluginid FROM {$tablepre}plugins WHERE identifier='{$pluginarray[plugin][identifier]}' LIMIT 1");
        if ($db->num_rows($query)) {
            cpmsg('plugins_import_identifier_duplicated', '', 'error');
        }
        $sql1 = $sql2 = $comma = '';
        foreach ($pluginarray['plugin'] as $key => $val) {
            if ($key == 'directory') {
                //compatible for old versions
                $val .= !empty($val) && substr($val, -1) != '/' ? '/' : '';
            }
            $sql1 .= $comma . $key;
            $sql2 .= $comma . '\'' . $val . '\'';
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:plugins.inc.php

示例12: import_styles

function import_styles($ignoreversion = 1, $dir = '', $restoreid = 0, $updatecache = 1)
{
    global $_G, $importtxt, $stylearray;
    if (!isset($dir)) {
        $stylearrays = array(getimportdata('Discuz! Style'));
    } else {
        if (!$restoreid) {
            $dir = str_replace(array('/', '\\'), '', $dir);
            $templatedir = DISCUZ_ROOT . './template/' . $dir;
        } else {
            $templatedir = DISCUZ_ROOT . $dir;
        }
        $searchdir = dir($templatedir);
        $stylearrays = array();
        while ($searchentry = $searchdir->read()) {
            if (substr($searchentry, 0, 13) == 'discuz_style_' && fileext($searchentry) == 'xml') {
                $importfile = $templatedir . '/' . $searchentry;
                $importtxt = implode('', file($importfile));
                $stylearrays[] = getimportdata('Discuz! Style');
            }
        }
    }
    foreach ($stylearrays as $stylearray) {
        if (empty($ignoreversion) && strip_tags($stylearray['version']) != strip_tags($_G['setting']['version'])) {
            cpmsg('styles_import_version_invalid', '', 'error', array('cur_version' => $stylearray['version'], 'set_version' => $_G['setting']['version']));
        }
        if (!$restoreid) {
            $renamed = 0;
            if ($stylearray['templateid'] != 1) {
                $templatedir = DISCUZ_ROOT . './' . $stylearray['directory'];
                if (!is_dir($templatedir)) {
                    if (!@mkdir($templatedir, 0777)) {
                        $basedir = dirname($stylearray['directory']);
                        cpmsg('styles_import_directory_invalid', '', 'error', array('basedir' => $basedir, 'directory' => $stylearray['directory']));
                    }
                }
                if (!($templateid = DB::result_first("SELECT templateid FROM " . DB::table('common_template') . " WHERE name='{$stylearray['tplname']}'"))) {
                    DB::query("INSERT INTO " . DB::table('common_template') . " (name, directory, copyright)\r\n\t\t\t\t\t\tVALUES ('{$stylearray['tplname']}', '{$stylearray['directory']}', '{$stylearray['copyright']}')");
                    $templateid = DB::insert_id();
                }
            } else {
                $templateid = 1;
            }
            if (DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_style') . " WHERE name='{$stylearray['name']}'")) {
                $stylearray['name'] .= '_' . random(4);
                $renamed = 1;
            }
            DB::query("INSERT INTO " . DB::table('common_style') . " (name, templateid)\r\n\t\t\t\tVALUES ('{$stylearray['name']}', '{$templateid}')");
            $styleidnew = DB::insert_id();
        } else {
            $styleidnew = $restoreid;
            DB::query("DELETE FROM " . DB::table('common_stylevar') . " WHERE styleid='{$styleidnew}'");
        }
        foreach ($stylearray['style'] as $variable => $substitute) {
            $substitute = @htmlspecialchars($substitute);
            DB::query("INSERT INTO " . DB::table('common_stylevar') . " (styleid, variable, substitute)\r\n\t\t\t\tVALUES ('{$styleidnew}', '{$variable}', '{$substitute}')");
        }
    }
    if ($updatecache) {
        updatecache('styles');
        updatecache('setting');
    }
    return $renamed;
}
开发者ID:v998,项目名称:discuzx-en,代码行数:64,代码来源:function_importdata.php

示例13: elseif

        }
    }
} elseif ($operation == 'import') {
    if (!submitcheck('importsubmit') && !isset($dir)) {
        shownav('style', 'styles_admin');
        showsubmenu('styles_admin', array(array('admin', 'styles', '0'), array('import', 'styles&operation=import', '1')));
        showformheader('styles&operation=import', 'enctype');
        showtableheader('styles_import');
        showimportdata();
        showtablerow('', '', '<input class="checkbox" type="checkbox" name="ignoreversion" id="ignoreversion" value="1" /><label for="ignoreversion"> ' . lang('styles_import_ignore_version') . '</label>');
        showsubmit('importsubmit');
        showtablefooter();
        showformfooter();
    } else {
        if (!isset($dir)) {
            $stylearrays = array(getimportdata());
        } else {
            $dir = str_replace(array('/', '\\'), '', $dir);
            $templatedir = DISCUZ_ROOT . './templates/' . $dir;
            $searchdir = dir($templatedir);
            $stylearrays = array();
            while ($searchentry = $searchdir->read()) {
                if (substr($searchentry, 0, 13) == 'discuz_style_' && fileext($searchentry) == 'txt') {
                    $importfile = $templatedir . '/' . $searchentry;
                    $styledata = preg_replace("/(#.*\\s+)*/", '', @implode('', file($importfile)));
                    $style = daddslashes(unserialize(base64_decode($styledata)), 1);
                    if (!is_array($style)) {
                        cpmsg('import_data_invalid', '', 'error');
                    }
                    $stylearrays[] = $style;
                }
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:styles.inc.php

示例14: cpmsg

    } else {
        cpmsg('smilies_update_error', '', 'error');
    }
} elseif ($operation == 'import') {
    if (!submitcheck('importsubmit')) {
        shownav('style', 'smilies_edit');
        showsubmenu('nav_smilies', array(array('smilies_type', 'smilies', 0), array('smilies_import', 'smilies&operation=import', 1)));
        showtips('smilies_tips_import');
        showformheader('smilies&operation=import', 'enctype');
        showtableheader('smilies_import');
        showimportdata();
        showsubmit('importsubmit');
        showtablefooter();
        showformfooter();
    } else {
        $smileyarray = getimportdata();
        $renamed = 0;
        if ($db->result_first("SELECT COUNT(*) FROM {$tablepre}imagetypes WHERE type='smiley' AND name='{$smileyarray['name']}'")) {
            $smileyarray['name'] .= '_' . random(4);
            $renamed = 1;
        }
        $db->query("INSERT INTO {$tablepre}imagetypes (name, type, directory)\r\n\t\t\tVALUES ('{$smileyarray['name']}', 'smiley', '{$smileyarray['directory']}')");
        $typeid = $db->insert_id();
        foreach ($smileyarray['smilies'] as $key => $smiley) {
            $db->query("INSERT INTO {$tablepre}smilies (type, typeid, displayorder, code, url)\r\n\t\t\t\tVALUES ('smiley', '{$typeid}', '{$smiley['displayorder']}', '', '{$smiley['url']}')");
        }
        $db->query("UPDATE {$tablepre}smilies SET code=CONCAT('{:', typeid, '_', id, ':}') WHERE typeid='{$typeid}'");
        updatecache(array('smileytypes', 'smilies', 'smileycodes', 'smilies_js'));
        cpmsg($renamed ? 'smilies_import_succeed_renamed' : 'smilies_import_succeed', $BASESCRIPT . '?action=smilies', 'succeed');
    }
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:smilies.inc.php

示例15: template

    include template('common/header');
    echo $optionlist;
    include template('common/footer');
    exit;
} elseif ($operation == 'sortlist') {
    $optionid = $_GET['optionid'];
    $option = C::t('forum_typeoption')->fetch($optionid);
    include template('common/header');
    $option['type'] = $lang['threadtype_edit_vars_type_' . $option['type']];
    $option['available'] = 1;
    showtablerow('', array('class="td25"', 'class="td28 td23"'), array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"{$option['optionid']}\" " . ($option['model'] ? 'disabled' : '') . ">", "<input type=\"text\" class=\"txt\" size=\"2\" name=\"displayorder[{$option['optionid']}]\" value=\"{$option['displayorder']}\">", "<input class=\"checkbox\" type=\"checkbox\" name=\"available[{$option['optionid']}]\" value=\"1\" " . ($option['available'] ? 'checked' : '') . " " . ($option['model'] ? 'disabled' : '') . ">", dhtmlspecialchars($option['title']), $option[type], "<input class=\"checkbox\" type=\"checkbox\" name=\"required[{$option['optionid']}]\" value=\"1\" " . ($option['required'] ? 'checked' : '') . " " . ($option['model'] ? 'disabled' : '') . ">", "<input class=\"checkbox\" type=\"checkbox\" name=\"unchangeable[{$option['optionid']}]\" value=\"1\" " . ($option['unchangeable'] ? 'checked' : '') . ">", "<input class=\"checkbox\" type=\"checkbox\" name=\"search[{$option['optionid']}][form]\" value=\"1\" " . (getstatus($option['search'], 1) == 1 ? 'checked' : '') . ">", "<input class=\"checkbox\" type=\"checkbox\" name=\"search[{$option['optionid']}][font]\" value=\"1\" " . (getstatus($option['search'], 2) == 1 ? 'checked' : '') . ">", "<input class=\"checkbox\" type=\"checkbox\" name=\"subjectshow[{$option['optionid']}]\" value=\"1\" " . ($option['subjectshow'] ? 'checked' : '') . ">", "<a href=\"" . ADMINSCRIPT . "?action=threadtypes&operation=optiondetail&optionid={$option['optionid']}\" class=\"act\">" . $lang['edit'] . "</a>"));
    include template('common/footer');
    exit;
} elseif ($operation == 'import') {
    $sortid = 0;
    $newthreadtype = getimportdata('Discuz! Threadtypes');
    if ($newthreadtype) {
        $idcmp = $searcharr = $replacearr = $indexoption = array();
        $create_tableoption_sql = $separator = '';
        $i = 0;
        foreach ($newthreadtype as $key => $value) {
            if (!$i) {
                if ($newname1 = trim(strip_tags($value['name']))) {
                    $findname = 0;
                    $tmpnewname1 = $newname1;
                    $decline = '_';
                    while (!$findname) {
                        if (C::t('forum_threadtype')->checkname($tmpnewname1)) {
                            $tmpnewname1 = $newname1 . $decline;
                            $decline .= '_';
                        } else {
开发者ID:deepziyu,项目名称:JX3PVE,代码行数:31,代码来源:admincp_threadtypes.php


注:本文中的getimportdata函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。