Exemplo n.º 1
0
	/**
	 * swfupload上传附件
	 */
	public function swfupload(){
		$grouplist = getcache('grouplist','member');			
		if(isset($_POST['dosubmit'])){
			if( $_POST['swf_auth_key'] != md5(pc_base::load_config('system','auth_key').$_POST['SWFUPLOADSESSID']) || ($_POST['isadmin']==0 && !$grouplist[$_POST['groupid']]['allowattachment'])) exit();
			pc_base::load_sys_class('attachment','',0);
			$attachment = new attachment($_POST['module'],$_POST['catid'],$_POST['siteid']);
			$attachment->set_userid($_POST['userid']);
			$aids = $attachment->upload('Filedata',$_POST['filetype_post'],'','',array($_POST['thumb_width'],$_POST['thumb_height']),$_POST['watermark_enable']);
			if($aids[0]) {
				$filename= (strtolower(CHARSET) != 'utf-8') ? iconv('gbk', 'utf-8', $attachment->uploadedfiles[0]['filename']) : $attachment->uploadedfiles[0]['filename'];
				if($attachment->uploadedfiles[0]['isimage']) {
					echo $aids[0].','.$this->upload_url.$attachment->uploadedfiles[0]['filepath'].','.$attachment->uploadedfiles[0]['isimage'].','.$filename;
				} else {
					$fileext = $attachment->uploadedfiles[0]['fileext'];
					if($fileext == 'zip' || $fileext == 'rar') $fileext = 'rar';
					elseif($fileext == 'doc' || $fileext == 'docx') $fileext = 'doc';
					elseif($fileext == 'xls' || $fileext == 'xlsx') $fileext = 'xls';
					elseif($fileext == 'ppt' || $fileext == 'pptx') $fileext = 'ppt';
					elseif ($fileext == 'flv' || $fileext == 'swf' || $fileext == 'rm' || $fileext == 'rmvb') $fileext = 'flv';
					else $fileext = 'do';
					echo $aids[0].','.$this->upload_url.$attachment->uploadedfiles[0]['filepath'].','.$fileext.','.$filename;
				}			
				exit;
			} else {
				echo '0,'.$attachment->error();
				exit;
			}

		} else {
			if($this->isadmin==0 && !$grouplist[$this->groupid]['allowattachment']) showmessage(L('att_no_permission'));
			$args = $_GET['args'];
			$authkey = $_GET['authkey'];
			if(upload_key($args)!=$authkey) showmessage(L('attachment_parameter_error'));
			extract(getswfinit($_GET['args']));
			$siteid = $this->get_siteid();
			$site_setting = get_site_setting($siteid);
			$file_size_limit = sizecount($site_setting['upload_maxsize']*1024);		
			$att_not_used = param::get_cookie('att_json');
			if(empty($att_not_used) || !isset($att_not_used)) $tab_status = ' class="on"';
			if(!empty($att_not_used)) $div_status = ' hidden';
			//获取临时未处理文件列表
			$att = $this->att_not_used();					
			include $this->admin_tpl('swfupload');
		}
	}
Exemplo n.º 2
0
/**
 * 读取swfupload配置类型
 * @param array $args flash上传配置信息
 */
function getswfinit($args)
{
    $siteid = get_siteid();
    $site_setting = get_site_setting($siteid);
    $site_allowext = $site_setting['upload_allowext'];
    $args = explode(',', $args);
    $arr['file_upload_limit'] = intval($args[0]) ? intval($args[0]) : '8';
    $args['1'] = $args[1] != '' ? $args[1] : $site_allowext;
    $arr_allowext = explode('|', $args[1]);
    foreach ($arr_allowext as $k => $v) {
        $v = '*.' . $v;
        $array[$k] = $v;
    }
    $upload_allowext = implode(';', $array);
    $arr['file_types'] = $upload_allowext;
    $arr['file_types_post'] = $args[1];
    $arr['allowupload'] = intval($args[2]);
    $arr['thumb_width'] = intval($args[3]);
    $arr['thumb_height'] = intval($args[4]);
    $arr['watermark_enable'] = $args[5] == '' ? 1 : intval($args[5]);
    return $arr;
}
 public function upload()
 {
     header('Content-Type:text/html;charset=utf-8');
     if (IS_POST) {
         $data = array();
         $upload = new \Think\Upload();
         $site_setting = get_site_setting(get_siteid());
         $upload->maxSize = $site_setting['upload_maxsize'] * 1024;
         $upload->saveRule = "time";
         $upload->allowExts = array_intersect(explode('|', $_POST['filetype_post']), explode('|', $site_setting['upload_allowext']));
         $upload->rootPath = UPLOAD_PATH;
         if (isset($_FILES)) {
             $info = $upload->upload();
             if (!$info) {
                 // 上传错误提示错误信息
                 $data['status'] = 'error';
                 $data['error_info'] = $upload->getError();
             } else {
                 $attach_info = isset($info['0']) ? $info['0'] : $info['upload'];
                 // 将附件插入附件表
                 $attach_info = array('name' => empty($attach_info["name"]) ? $attach_info["savename"] : $attach_info["name"], 'path' => UPLOAD_PATH . $attach_info["savepath"] . $attach_info["savename"], 'url' => UPLOAD_URL . $attach_info["savepath"] . $attach_info["savename"], 'size' => $attach_info['size'], 'ext' => $attach_info['ext'], 'upload_time' => time(), 'upload_ip' => get_client_ip());
                 if (in_array($attach_info['ext'], array('jpg', 'gif', 'png', 'jpeg'))) {
                     // $mine_type = (version_compare(PHP_VERSION, '5.3.0') >= 0) ? finfo_file(finfo_open(FILEINFO_MIME_TYPE), $attach_info['path']) : mime_content_type($attach_info['path']);
                     $mine_type = mime_content_type($attach_info['path']);
                     $compression_filename = D("Attachment")->gd_compression_image(UPLOAD_PATH . $attach_info["savepath"], $mine_type, $attach_info["savename"]);
                     $attach_info['compression_image'] = UPLOAD_PATH . $attach_info["savepath"] . $compression_filename;
                     $attach_info['compression_url'] = UPLOAD_URL . $attach_info["savepath"] . $compression_filename;
                     $image_source = D("Attachment")->gd_create_image($mine_type, $attach_info['path']);
                     if ($image_source) {
                         $attach_info['width'] = imagesx($image_source);
                         $attach_info['height'] = imagesy($image_source);
                     }
                 }
                 if (isset($_SESSION['user_info'])) {
                     $attach_info['user_id'] = $_SESSION['user_info']['id'];
                     $attach_info['category_id'] = 1;
                 }
                 if ($attachment_id = D("Attachment")->add($attach_info)) {
                     $data['attachment_id'] = $attachment_id;
                     $data['stutas'] = 'success';
                     $attach_info['path'] = $attach_info['url'];
                     $data['attachment_info'] = $attach_info;
                 } else {
                     $data['status'] = 'error';
                     $data['error_info'] = $upload->getError();
                 }
             }
         } else {
             $data['stutas'] = 'error';
             $data['error_info'] = '请先选择图片!';
         }
         sleep(1);
         if (isset($_GET['CKEditor'])) {
             $funcNum = $_GET['CKEditorFuncNum'];
             $url = $data['attachment_info']['path'];
             $message = isset($data['error_info']) ? $data['error_info'] : "";
             $this->ajaxReturn("<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction({$funcNum}, '{$url}', '{$message}');</script>", 'EVAL');
         } else {
             $this->ajaxReturn(json_encode($data), 'EVAL');
         }
     } else {
         $args = $_GET['args'];
         $args = getswfinit($_GET['args']);
         $site_setting = get_site_setting(get_siteid());
         $file_size_limit = sizecount($site_setting['upload_maxsize'] * 1024);
         $this->assign('file_size_limit', $file_size_limit);
         $this->assign('args', $args);
         $this->display();
     }
 }
Exemplo n.º 4
0
//-- otherwise have them login again
if (!PGV_USER_GEDCOM_ADMIN) {
    header("Location: login.php?url=editgedcoms.php");
    exit;
}
print_header($pgv_lang["gedcom_adm_head"]);
print "<center>\n";
if ($action == "delete") {
    delete_gedcom($ged);
    print "<br />" . str_replace("#GED#", $ged, $pgv_lang["gedcom_deleted"]) . "<br />\n";
}
if ($action == "setdefault" && in_array($default_ged, get_all_gedcoms())) {
    set_site_setting('DEFAULT_GEDCOM', $default_ged);
    $DEFAULT_GEDCOM = $default_ged;
} else {
    $DEFAULT_GEDCOM = get_site_setting('DEFAULT_GEDCOM');
}
print "<br /><br />";
?>
<span class="subheaders"><?php 
print_text("current_gedcoms");
?>
</span><br />
<form name="defaultform" method="get" action="editgedcoms.php">
<input type="hidden" name="action" value="setdefault" />
<?php 
// Default gedcom choice
print "<br />";
if ($gBitUser->isAdmin() && count(get_all_gedcoms()) > 1) {
    print_help_link("default_gedcom_help", "qm");
    print $pgv_lang["DEFAULT_GEDCOM"] . "&nbsp;";
Exemplo n.º 5
0
/**
 * Print Review Changes Block
 *
 * Prints a block allowing the user review all changes pending approval
 */
function review_changes_block($block = true, $config = "", $side, $index)
{
    global $pgv_lang, $ctype, $QUERY_STRING, $factarray, $PGV_IMAGE_DIR, $PGV_IMAGES;
    global $pgv_changes, $TEXT_DIRECTION, $SHOW_SOURCES, $PGV_BLOCKS;
    global $PHPGEDVIEW_EMAIL;
    if (empty($config)) {
        $config = $PGV_BLOCKS["review_changes_block"]["config"];
    }
    if ($pgv_changes) {
        //-- if the time difference from the last email is greater than 24 hours then send out another email
        $LAST_CHANGE_EMAIL = get_site_setting('LAST_CHANGE_EMAIL');
        if (time() - $LAST_CHANGE_EMAIL > 60 * 60 * 24 * $config["days"]) {
            $LAST_CHANGE_EMAIL = time();
            set_site_setting('LAST_CHANGE_EMAIL', $LAST_CHANGE_EMAIL);
            write_changes();
            if ($config["sendmail"] == "yes") {
                // Which users have pending changes?
                $users_with_changes = array();
                foreach (get_all_users() as $user_id => $user_name) {
                    foreach (get_all_gedcoms() as $ged_id => $ged_name) {
                        if (exists_pending_change($user_id, $ged_id)) {
                            $users_with_changes[$user_id] = $user_name;
                            break;
                        }
                    }
                }
                foreach ($users_with_changes as $user_id => $user_name) {
                    //-- send message
                    $message = array();
                    $message["to"] = $user_name;
                    $message["from"] = $PHPGEDVIEW_EMAIL;
                    $message["subject"] = $pgv_lang["review_changes_subject"];
                    $message["body"] = $pgv_lang["review_changes_body"];
                    $message["method"] = get_user_setting($user_id, 'contactmethod');
                    $message["url"] = PGV_SCRIPT_NAME . "?" . html_entity_decode($QUERY_STRING);
                    $message["no_from"] = true;
                    addMessage($message);
                }
            }
        }
        if (PGV_USER_CAN_EDIT) {
            $id = "review_changes_block";
            $title = print_help_link("review_changes_help", "qm", "", false, true);
            if ($PGV_BLOCKS["review_changes_block"]["canconfig"]) {
                if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
                    if ($ctype == "gedcom") {
                        $name = PGV_GEDCOM;
                    } else {
                        $name = PGV_USER_NAME;
                    }
                    $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">";
                    $title .= "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/" . $PGV_IMAGES["admin"]["small"] . "\" width=\"15\" height=\"15\" border=\"0\" alt=\"" . $pgv_lang["config_block"] . "\" /></a>";
                }
            }
            $title .= $pgv_lang["review_changes"];
            $content = "";
            if (PGV_USER_CAN_ACCEPT) {
                $content .= "<a href=\"javascript:;\" onclick=\"window.open('edit_changes.php','_blank','width=600,height=500,resizable=1,scrollbars=1'); return false;\">" . $pgv_lang["accept_changes"] . "</a><br />";
            }
            if ($config["sendmail"] == "yes") {
                $content .= $pgv_lang["last_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL) . "<br />";
                $content .= $pgv_lang["next_email_sent"] . format_timestamp($LAST_CHANGE_EMAIL + 60 * 60 * 24 * $config["days"]) . "<br /><br />";
            }
            foreach ($pgv_changes as $cid => $changes) {
                $change = $changes[count($changes) - 1];
                if ($change["gedcom"] == PGV_GEDCOM) {
                    $record = GedcomRecord::getInstance($change['gid']);
                    if ($record->getType() != 'SOUR' || $SHOW_SOURCES >= PGV_USER_ACCESS_LEVEL) {
                        $content .= '<b>' . PrintReady($record->getFullName()) . '</b> ' . getLRM() . '(' . $record->getXref() . ')' . getLRM();
                        switch ($record->getType()) {
                            case 'INDI':
                            case 'FAM':
                            case 'SOUR':
                            case 'OBJE':
                                $content .= $block ? '<br />' : ' ';
                                $content .= '<a href="' . encode_url($record->getLinkUrl() . '&show_changes=yes') . '">' . $pgv_lang['view_change_diff'] . '</a>';
                                break;
                        }
                        $content .= '<br />';
                    }
                }
            }
            global $THEME_DIR;
            if ($block) {
                require $THEME_DIR . 'templates/block_small_temp.php';
            } else {
                require $THEME_DIR . 'templates/block_main_temp.php';
            }
        }
    }
}
Exemplo n.º 6
0
function get_site_email()
{
    return get_site_setting('site_email');
}
Exemplo n.º 7
0
function print_htmlplus_block($block = true, $config = '', $side, $index)
{
    global $ctype, $factarray, $GEDCOM, $HTML_BLOCK_COUNT, $PGV_BLOCKS, $PGV_IMAGE_DIR, $PGV_IMAGES, $pgv_lang, $TEXT_DIRECTION, $MULTI_MEDIA, $SHOW_ID_NUMBERS;
    // config sanity check
    if (empty($config)) {
        $config = $PGV_BLOCKS['print_htmlplus_block']['config'];
    } else {
        foreach ($PGV_BLOCKS['print_htmlplus_block']['config'] as $k => $v) {
            if (!isset($config[$k])) {
                $config[$k] = $v;
            }
        }
    }
    if (!isset($HTML_BLOCK_COUNT)) {
        $HTML_BLOCK_COUNT = 0;
    }
    $HTML_BLOCK_COUNT++;
    /*
     * Select GEDCOM
     */
    switch ($config['gedcom']) {
        case '__current__':
            break;
        case '':
            break;
        case '__default__':
            $GEDCOM = get_site_setting('DEFAULT_GEDCOM');
            if (!$GEDCOM) {
                foreach (get_all_gedcoms() as $gedcom) {
                    $GEDCOM = $gedcom;
                    break;
                }
            }
            break;
        default:
            if (get_gedcom_setting(get_gedcom_from_id($config['gedcom']), 'imported')) {
                $GEDCOM = $config['gedcom'];
            }
            break;
    }
    /*
     * Initiate the stats object.
     */
    if ($config['compat'] == 1) {
        require_once PGV_ROOT . 'includes/classes/class_stats_compat.php';
        $stats = new stats_compat($GEDCOM);
    } elseif ($config['ui'] == 1) {
        require_once PGV_ROOT . 'includes/classes/class_stats_ui.php';
        $stats = new stats_ui($GEDCOM);
    } else {
        $stats = new stats($GEDCOM);
    }
    // Make some values from the GEDCOM's 0 HEAD record visible to the world
    global $CREATED_SOFTWARE, $CREATED_VERSION, $CREATED_DATE;
    $CREATED_SOFTWARE = $stats->gedcomCreatedSoftware();
    $CREATED_VERSION = $stats->gedcomCreatedVersion();
    $CREATED_DATE = $stats->gedcomDate();
    /*
     * First Pass.
     * Handle embedded language, fact, global, etc. references
     *   This needs to be done first because the language variables could themselves
     *   contain embedded keywords.
     */
    // Title
    $config['title'] = print_text($config['title'], 0, 2);
    // Content
    $config['html'] = print_text($config['html'], 0, 2);
    /*
     * Second Pass.
     */
    list($new_tags, $new_values) = $stats->getTags("{$config['title']} {$config['html']}");
    // Title
    if (strstr($config['title'], '#')) {
        $config['title'] = str_replace($new_tags, $new_values, $config['title']);
    }
    // Content
    $config['html'] = str_replace($new_tags, $new_values, $config['html']);
    /*
     * Restore Current GEDCOM
     */
    $GEDCOM = PGV_GEDCOM;
    /*
     * Start Of Output
     */
    $id = "html_block{$HTML_BLOCK_COUNT}";
    $title = "";
    if ($config['title'] != '') {
        if (PGV_USER_GEDCOM_ADMIN) {
            $title .= print_help_link('index_htmlplus_ahelp', 'qm_ah', '', false, true);
        } else {
            $title .= print_help_link('index_htmlplus_help', 'qm', '', false, true);
        }
        if ($PGV_BLOCKS['print_htmlplus_block']['canconfig']) {
            if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
                if ($ctype == "gedcom") {
                    $name = PGV_GEDCOM;
                } else {
                    $name = PGV_USER_NAME;
                }
                $title .= "<a href=\"javascript: configure block\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=350,scrollbars=1,resizable=1'); return false;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" /></a>";
            }
        }
        $title .= $config['title'];
    }
    $content = $config['html'];
    if ($config['title'] == '' && $PGV_BLOCKS['print_htmlplus_block']['canconfig']) {
        if ($ctype == "gedcom" && PGV_USER_GEDCOM_ADMIN || $ctype == "user" && PGV_USER_ID) {
            if ($ctype == "gedcom") {
                $name = str_replace("'", "\\'", $GEDCOM);
            } else {
                $name = PGV_USER_NAME;
            }
            $content .= "<br />" . print_help_link('index_htmlplus_ahelp', 'qm_ah', '', false, true) . "<a href=\"javascript:;\" onclick=\"window.open('" . encode_url("index_edit.php?name={$name}&ctype={$ctype}&action=configure&side={$side}&index={$index}") . "', '_blank', 'top=50,left=50,width=600,height=500,scrollbars=1,resizable=1'); return false;\">" . "<img class=\"adminicon\" src=\"{$PGV_IMAGE_DIR}/{$PGV_IMAGES['admin']['small']}\" width=\"15\" height=\"15\" border=\"0\" alt=\"{$pgv_lang['config_block']}\" title=\"{$pgv_lang['config_block']}\" /></a>";
        }
    }
    global $THEME_DIR;
    if ($block) {
        require $THEME_DIR . 'templates/block_small_temp.php';
    } else {
        require $THEME_DIR . 'templates/block_main_temp.php';
    }
}
Exemplo n.º 8
0
 public function upload()
 {
     header('Content-Type:text/html;charset=utf-8');
     if (IS_POST) {
         import("ORG.Net.UploadFile");
         $savefolder = '/uploads/' . date("Y/m/d") . "/";
         $path = UPLOAD_PATH . $savefolder;
         $upload = new UploadFile();
         // 实例化上传类
         $site_setting = get_site_setting(get_siteid());
         $upload->maxSize = $site_setting['upload_maxsize'] * 1024;
         // 设置附件上传大小
         $upload->saveRule = "time";
         // 文件名设置
         $upload->allowExts = array_intersect(explode('|', $_POST['filetype_post']), explode('|', $site_setting['upload_allowext']));
         // 设置附件上传类型
         $upload->uploadReplace = $overflow;
         if (!is_dir($path)) {
             mkdir($path, 0777, true);
         }
         $data = array();
         $upload->savePath = $path;
         if (isset($_FILES)) {
             if (!$upload->upload()) {
                 // 上传错误提示错误信息
                 $data['status'] = 'error';
                 $data['error_info'] = $upload->getErrorMsg();
             } else {
                 // 上传成功 获取上传文件信息
                 $info = $upload->getUploadFileInfo();
                 // 将附件插入附件表
                 $attach_info = array('name' => $info[0]["name"], 'path' => $savefolder . $info[0]["savename"], 'url' => UPLOAD_URL . $savefolder . $info[0]["savename"], 'size' => $info[0]['size'], 'ext' => $info[0]['extension'], 'upload_time' => time(), 'upload_ip' => get_client_ip());
                 if (in_array($info[0]['extension'], array('jpg', 'gif', 'png', 'jpeg'))) {
                     $mine_type = mime_content_type($path . $info[0]["savename"]);
                     $compression_filename = D("Attachment")->gd_compression_image($path, $mine_type, $info[0]["savename"]);
                     $attach_info['compression_image'] = $savefolder . $compression_filename;
                     $attachment['compression_url'] = UPLOAD_URL . $savefolder . $compression_filename;
                     $image_source = D("Attachment")->gd_create_image($mine_type, $path . $info[0]["savename"]);
                     if ($image_source) {
                         $attach_info['width'] = imagesx($image_source);
                         $attach_info['height'] = imagesy($image_source);
                     }
                 }
                 if (isset($_SESSION['user_info'])) {
                     $attach_info['userid'] = $_SESSION['user_info']['id'];
                     $attach_info['category_id'] = 1;
                 }
                 if ($attachment_id = D("Attachment")->add($attach_info)) {
                     $data['attachment_id'] = $attachment_id;
                     $data['stutas'] = 'success';
                     $info[0]['path'] = $attach_info['url'];
                     $data['attachment_info'] = $info[0];
                 } else {
                     // echo M()->getLastSql();
                     $data['status'] = 'error';
                     $data['error_info'] = $upload->getErrorMsg();
                 }
             }
         } else {
             $data['stutas'] = 'error';
             $data['error_info'] = '请先选择图片!';
         }
         sleep(1);
         if (isset($_GET['CKEditor'])) {
             $funcNum = $_GET['CKEditorFuncNum'];
             $url = $data['attachment_info']['path'];
             $message = isset($data['error_info']) ? $data['error_info'] : "";
             exit("<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction({$funcNum}, '{$url}', '{$message}');</script>");
         } else {
             exit(json_encode($data));
         }
     } else {
         $args = $_GET['args'];
         $args = getswfinit($_GET['args']);
         $site_setting = get_site_setting(get_siteid());
         $file_size_limit = sizecount($site_setting['upload_maxsize'] * 1024);
         $this->assign('file_size_limit', $file_size_limit);
         $this->assign('args', $args);
         $this->display();
     }
 }
Exemplo n.º 9
0
/**
* Delete a gedcom from the database and the system
* Does not delete the file from the file system
* @param string $ged  the filename of the gedcom to delete
*/
function delete_gedcom($ged)
{
    global $TBLPREFIX, $pgv_changes, $GEDCOMS, $gBitDb;
    if (!isset($GEDCOMS[$ged])) {
        return;
    }
    $ged_id = get_id_from_gedcom($ged);
    $gBitDb->query("DELETE FROM {$TBLPREFIX}blocks        WHERE b_username=?", array($ged));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}dates         WHERE d_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}families      WHERE f_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}favorites     WHERE fv_file   =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}individuals   WHERE i_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}link          WHERE l_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}media         WHERE m_gedfile =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}media_mapping WHERE mm_gedfile=?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}name          WHERE n_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}news          WHERE n_username=?", array($ged));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}nextid        WHERE ni_gedfile=?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}other         WHERE o_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}placelinks    WHERE pl_file   =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}places        WHERE p_file    =?", array($ged_id));
    $gBitDb->query("DELETE FROM {$TBLPREFIX}sources       WHERE s_file    =?", array($ged_id));
    if (isset($pgv_changes)) {
        //-- erase any of the changes
        foreach ($pgv_changes as $cid => $changes) {
            if ($changes[0]["gedcom"] == $ged) {
                unset($pgv_changes[$cid]);
            }
        }
        write_changes();
    }
    unset($GEDCOMS[$ged]);
    store_gedcoms();
    if (get_site_setting('DEFAULT_GEDCOM') == $ged) {
        set_site_setting('DEFAULT_GEDCOM', '');
    }
}
Exemplo n.º 10
0
/**
* 读取upload配置类型
* @param array $args 上传配置信息
*/
function getUploadParams($args)
{
    $siteid = get_siteid();
    $site_setting = get_site_setting($siteid);
    $site_allowext = $site_setting['upload_allowext'];
    $args = explode(',', $args);
    // $allowupload = empty($args[2]) ? $site_setting['upload_maxsize'] : $args[2];
    $allowupload = $site_setting['upload_maxsize'];
    $watermark_enable = empty($args[5]) ? $site_setting['watermark_enable'] : $args['5'];
    $arr['file_upload_limit'] = intval($args[0]) ? intval($args[0]) : '8';
    $args['1'] = empty($args[1]) ? $site_allowext : $args[1];
    $arr_allowext = explode('|', $args[1]);
    $allowexts = array();
    foreach ($arr_allowext as $k => $v) {
        $allowexts[] = '*.' . $v;
    }
    $upload_allowext = implode(';', $allowexts);
    $arr['file_types'] = $upload_allowext;
    $arr['file_types_post'] = $args[1];
    $arr['allowupload'] = sizecount($allowupload * 1024);
    $arr['thumb_width'] = intval($args[3]);
    $arr['thumb_height'] = intval($args[4]);
    $arr['watermark_enable'] = $watermark_enable;
    return $arr;
}