/**
* Example Application
* @package Example-application
*/
header('Content-type: text/html; charset=gb2312');
require("inc/common.inc.php");
require('libs/Smarty.class.php');
$smarty = new Smarty;
define("ROOT", str_replace("\\", "/", dirname(__FILE__)).'/');
$smarty->setTemplateDir(ROOT.'templates/');
//添加留言信息
if ($actions == "save") {
if ($title==""){
$fun->popmassage("您没有填写标题,请重新输入!","","popback");
exit();
}
if ($contents==""){
$fun->popmassage("您没有填写内容,请重新输入!","","popback");
exit();
}
//读取自定义字段信息
$sql = "select top 1 * from mx_message_add where shanghuid ='".$shanghuid."'";
$ly_info = $db -> get_one ($sql);
$ly_list = empty($ly_info['content']) ? "" : explode(',',$ly_info['content']);
//组合自定义字段的值
$addcontent = "";
foreach ($ly_list as $key => $val) {
if ($addcontent == "") {
$addcontent.= $val."#:#".$addlist[$key];
} else {
$addcontent.= "#,#".$val."#:#".$addlist[$key];
}
}
$sql = "insert into mx_message (title,addlist,content,posttime,yz,shanghuid) values ('".$title."', '".$addcontent."', '".$contents."', '".date("Y-m-d H:i:s",time())."', 0, '".$shanghuid."')";
$db -> excu ($sql);
$fun->popmassage("留言成功!","","popback");
exit ();
}
$smarty -> assign("shanghu_info", $shanghu_info);
$smarty -> assign("muban", $muban);
$class_now=$db->getinfo("select top 1 * from mx_articleclass where classtype='3' and shanghuid='$shanghuid' order by fid desc");
if (!is_array($class_now)){
$class_now=array(
"name"=>"在线留言",
"picurl_b"=>$shanghu_info['web_adpic'],
"descrip"=>$shanghu_info['srealname'],
);
}
else{
$class_now["picurl_b"]=get_photourl($class_now['picurl_b']);
}
if (trim($class_now["picurl_b"])==""){$class_now["picurl_b"]=$shanghu_info['web_adpic'];}
$class_now["olddescrip"]=$class_now["descrip"];
$class_now["descrip"]=trim(dvhtmlcode(strip_tags($class_now["descrip"])));
$smarty -> assign("class_now", $class_now);
//幻灯片
$sql = "select top 6 * from mx_indexad where shanghuid = '".$shanghuid."' order by orderid asc";
$hdp_query = $db -> excu ($sql);
if ($db -> num_rows ($hdp_query) == 0) {
$hdp_info = array();
while ($hdp_rsdb = $db -> fetch_array($hdp_query)) {
//格式化分类图片
$hdp_rsdb["logo"]=get_photourl($hdp_rsdb["logo"]);
array_push ($hdp_info,$hdp_rsdb);
}
} else {
$hdp_info = "";
}
$smarty->assign("hdp_info", $hdp_info);
//留言信息列表 js调用
//留言列列表
$sql = "select top 1 * from mx_message_add where shanghuid = '".$shanghuid."'";
$ly_info = $db -> get_one ($sql);
$ly_list = empty($ly_info['content']) ? "" : explode(',',$ly_info['content']);
$smarty->assign("ly_list", $ly_list);
$smarty->display($muban.'/message.html');
?>
一键复制
编辑
Web IDE
原始数据
按行查看
历史