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

📄 attach.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
字号:
<?php

class attach
{

	function attach( )
	{
		global $ibforums;
		global $DB;
		global $std;
		global $print;
		global $skin_universal;
		$ibforums->input['id'] = preg_replace( "/^(\\d+)\$/", "\\1", $ibforums->input['id'] );
		if ( $ibforums->input['id'] == "" )
		{
			$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
		}
		if ( $ibforums->input['type'] == "post" )
		{
			$DB->query( "SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'" );
			if ( !$DB->get_num_rows( ) )
			{
				$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
			}
			$post = $DB->fetch_row( );
			if ( $post['attach_id'] == "" )
			{
				$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
			}
			$file = $ibforums->vars['upload_dir']."/".$post['attach_id'];
			if ( file_exists( $file ) && $post['attach_type'] != "" )
			{
				$DB->query( "UPDATE ibf_posts SET attach_hits=attach_hits+1 WHERE pid='".$post['pid']."'" );
				@header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".( boolean )filesize( $file ) );
				$fh = fopen( $file, "rb" );
				fpassthru( $fh );
				@fclose( $fh );
			}
			else
			{
				$std->error( array( "LEVEL" => 1, "MSG" => "missing_files" ) );
			}
		}
	}

}

attach( );
$idx = new attach( );
echo "\r\n\r\n\r\n\r\n\r\n";
?>

⌨️ 快捷键说明

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