www.gusucode.com > HadSky PHP轻论坛系统源码 v2.4.2源码程序 > ytqlt_v2.4.2.0701/phpscript/slide.php

    <?php
if (!defined('puyuetian'))
	exit('403');

if ($_G['SET']['SLIDETYPE']) {
	//自定义轮播图片
	$jscode = $_G['SET']['SLIDEJSCODE'];
} else {
	//帖内热帖
	$shownum = Cnum($_G['SET']['SLIDESHOWNUM'], 4);
	if (!$shownum) {
		$shownum = 4;
	}
	$datas = $_G['TABLE']['UPLOAD'] -> getDatas(0, $shownum, "where `filesuffix`='jpg' or `filesuffix`='png' or `filesuffix`='bmp' or `filesuffix`='gif' order by `id` desc");
	if ($datas) {
		$jscode = "
		//幻灯片初始配置
		var \$slide_length = {$shownum};
		var \$slide = new Array();
		";
		$i = 0;
		foreach ($datas as $value) {
			$tdata = $_G['TABLE']['READ'] -> getData($value['rid']);
			if ($tdata) {
				$title = htmlspecialchars($tdata['title'], ENT_QUOTES) . " 发布时间:" . date('Y-m-d H:i:s', $tdata['posttime']);
			} else {
				$title = "not found the read";
			}
			$jscode .= "
			\$slide['src{$i}'] = '../../../uploadfiles/{$value['uid']}/{$value['filename']}';
			\$slide['href{$i}'] = '../../../" . ReWriteURL('read', "id={$value['rid']}&page=1") . "';
			\$slide['title{$i}'] = '{$title}';
			";
			$i++;
		}
	}
}
header("Content-Type:application/x-javascript");
exit($jscode);