⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 import.inc.php

📁 Phpcms2008 是一款基于 PHP+Mysql 架构的网站内容管理系统
💻 PHP
字号:
<?php
defined('IN_PHPCMS') or exit('Access Denied');
define('CACHE_IMPORT_PATH', PHPCMS_ROOT.'data/cache_import/');
require 'admin/import_funcs.inc.php';
if(!class_exists('import'))
{
	require 'admin/import.class.php';
}
$import = new import();

if(!class_exists('member_api'))
{
	require PHPCMS_ROOT.'member/api/member_api.class.php';
}
$member_api = new member_api();

if(!class_exists('attachment'))
{
	require 'attachment.class.php';
}
$attachment = new attachment($mod);

if(!$action) $action = 'manage';
switch ($action)
{
	case 'import':
		$sameserver = 0;
		$import_info = $import->view($name, $type);
		if($import_info['expire']) set_time_limit($import_info['expire']);
		$name = $import_info['name'];
	    $number = $import_info['number'];
	    $offset = isset($offset) ? intval($offset) : 0 ;
		if($type == 'content')
		{
			if(!class_exists('content'))
			{
				require 'admin/content.class.php';
			}
			$content = new content();
			$result = $import->add_content($import_info, $offset);
		}
		elseif ($type == 'member')
		{
			if(!class_exists('member_api'))
			{
				require 'member_api.class.php';
			}
			if(!class_exists('member_input'))
			{
				require CACHE_MODEL_PATH.'member_input.class.php';
			}
			if(!class_exists('member_update'))
			{
				require CACHE_MODEL_PATH.'member_update.class.php';
			}
			$result = $import->add_member($import_info, $offset);
		}
		if(!$result) showmessage($import->msg());
	    list($finished, $total) = explode('-', $result);
		$newoffset = $offset + $number;
		$start = $offset + 1;
		$end = $finished ? ($offset + $importnum) : $newoffset;
		$forward = $finished ? "?mod=$mod&file=$file&action=manage&type=$type" : "?mod=$mod&file=$file&action=$action&name=$name&type=$type&offset=$newoffset&total=$total";
		showmessage($LANG['total_import'].$total.$LANG['record'].'<br />'.$LANG['from'].$start.$LANG['to'].$end.$LANG['load_data_success'], $forward);
		break;
	case 'choice':
		$import_info = $import->view($name, $type);
		@extract($import_info);
		include admin_tpl('import_choice');
		break;
	case 'setting':
		if ($dosubmit)
		{
			if(empty($setting['name']))
			{
				showmessage($LANG['invalid_name']);
			}
			$import->setting($setting, $type);
			showmessage('鎿嶄綔鎴愬姛', $forward.'&type='.$type);
		}
		else
		{
			if(!$type) showmessage('璇烽

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -