<?php
if(!defined('R_P')) exit('Access Denied');
$id = intval($_GET['id']);
$cid = 0;
$_output = qbase::get_object('content', $channelid, $id)->get();
if (empty($_output)) qbase::showmsg("没有找到您要找的" . $channeltitle, $skin , toPath($channelid));
$cid = $_output['cid'];

if(!$_output['size']) $_output['size'] = '未知';
$_output['stars_img']   = "<img src='".W_P."images/" . $_output['stars'] . "star.gif' />";
$_output['systems']  = qbase::substrs($_output['systems'],30);
if(!$_output['thumb']) $_output['thumb']  = W_P . 'images/nopic.gif';
$_output['authorhttp'] = $_output['authorhttp'] ? $_output['authorhttp'] : W_P;

$_category_info = getCidInfo( $channelid, $cid);
if(empty($_category_info)) qbase::showmsg("提交了错误参数");

$field = array('language','softtype','use_type','plugin', 'systems');
foreach($field as $v){
	$_output['op_' . $v] = qbase::formatSet($v, $_output[$v]);
}

$iif = !( $_category_info['pur_browse'] || $_category_info['html'] || $_output['pay'] );

if (($_category_info['pur_browse'] || $_output['pay']) && !qbase::is_admin()) { // 权限检测
	require_once(R_P . '/include/class.userpay.php');
	$pay_purview = array(
		'id' => $id,
		'cid' => $cid,
		'point' => $_output['requirepoint'],
		'read_purview' => $_output['read_purview'],
		'pay_type' => $_output['pay_type'],
		'read_last' => $_output['read_last'],
	);
	$_output['paid'] = 1;
	$_output['pay_param'] = '';
	$purview = new userpay($channelid, $pay_purview);
	$_output['pay_param'] = $purview->createSureLink('check');
} 

$showphp = '';
if($_output['showphp']){
	$showphp = $_output['showphp'];
}elseif($info['showmessage']){
	$showphp = $info['showmessage'];
}else{
	$showphp = qbase::GetCidSkin(2);
}
$title = strip_tags($_output['subject']);
$keyword = $description = $title .",". qbase::substrs(strip_tags($_output['description']), 200);
include qbase::template( $showphp);
qbase::obHtml(3);
?>