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

📄 output.inc.php

📁 是一个基于PHP+Mysql架构的开源内容管理系统
💻 PHP
字号:
	function images($field, $value)
	{
		global $attachment, $contentid, $show_url_path, $mod, $C, $PHPCMS, $MODULE;
		if(!$this->contentid) return false;
		$r = $this->data;
		$value = '';
		if(is_array($C))
		{
			$modelid = $C['modelid'];
		}
		else
		{
			$modelid = $this->modelid;
		}
		$modelcache = cache_read('model_'.$modelid.'.php');
        if(!is_object($attachment))
        {
            include 'attachment.class.php';
            $attachment = new attachment();
        }
		$images = $attachment->listinfo("contentid=$this->contentid AND field='$field'", 'aid,filepath,description','listorder,aid');
		$images_number = count($images);

		if($modelcache['ishtml'] && $this->fields[$field]['ishtml'] && $show_url_path)
		{
			$ishtml = 1;
			$array_images = $images;
			@extract($this->data);
			$updatetime = date('Y-m-d');
			$userid = $this->userid('userid', $userid);
			$copyfrom = $this->copyfrom('copyfrom',$copyfrom);
			$head['title'] = $title.' - '.$PHPCMS['sitename'];
			$head['keywords'] = $keywords;
			$head['description'] = $this->data['title'];
			ob_start();
			foreach($images AS $page=>$v)
			{
				$filename = PHPCMS_ROOT.$show_url_path.'_'.$page.'.'.$PHPCMS['fileext'];
				include template('phpcms', $GLOBALS['template_show_images']);
				$data = ob_get_contents();
				ob_clean();
				dir_create(dirname($filename));
				file_put_contents($filename, $data);
				@chmod($filename, 0777);
			}
		}
		else
		{
			foreach($images as $a)
			{
				$thumb = UPLOAD_URL.$attachment->get_thumb(UPLOAD_PATH.$a['filepath']);
				$url = 'images.php?aid='.$a['aid'];
				$value .= "<a href='$url' target='_blank'><img src='$thumb' border='0' alt='$a[description]'></a><br/>$a[description]<br/>";
			}
		}
		$GLOBALS['array_images'] = $images;
		$GLOBALS['images_number'] = $images_number;
		return $images;
	}

⌨️ 快捷键说明

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