<?php
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$op = $_GET['op']?$_GET['op']:"list";
if(!in_array($op, array("add","list","edit","del"))){
$op = "list";
}
if($op == "list"){
$perpage = 10;
$page = intval ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1;
$start = ($page - 1) * $perpage;
if ($start < 0)
$start = 0;
$count = C::t("#tshuz_worship#worship")->count_by_uid($_G['uid']);
$multi= multi($count, $perpage, $page, "plugin.php?id=tshuz_worship&mod=".$mod );
$list = C::t("#tshuz_worship#worship")->fetach_all_by_uid_limit($_G['uid'],$start,$perpage);
foreach ($list as $key => $value) {
$list[$key]['info'] = $tshuz_worship[$value['pid']];
}
include template('tshuz_worship:main');
}elseif($op == 'del'){
if($_GET['hash'] != FORMHASH)
showmessage('submit_invalid');
$id = intval($_GET['item']);
if(!$id)
showmessage(dzlang(17));
$titleInfo = C::t("#tshuz_worship#worship")->fetch_by_id($id);
if(!$titleInfo || $titleInfo['uid'] != $_G['uid'])
showmessage(dzlang(18));
C::t("#tshuz_worship#worship")->delete($id);
unlink($titleInfo['pic']);
showmessage(dzlang(7),"plugin.php?id=tshuz_worship&mod=manage");
}elseif($op == "add"){
if(submitcheck('submit')){//提交操作
$data = array();
$get = $_GET['info'];
$data['name'] = addslashes($get['name']);//姓名
if(!$data['name']) showmessage(dzlang(1));
$data['type'] = intval($get['type']);//故人类型
$data['birth'] = addslashes($get['birth']);//生辰
$data['death'] = addslashes($get['death']);//忌日
if(!$data['birth']) showmessage(dzlang(2));
if(!$data['death']) showmessage(dzlang(3));
//if($data['death'] && $data['birth'] && $data['death'] <= $data['birth'] && $data['death'] < $_G['timestamp'])
//showmessage(dzlang(4));
$data['content'] = addslashes(strip_tags($get['content']));//生平
if(!$_FILES["pic"]['size']){
showmessage(dzlang(5));
}
//上传图片
$upload = new discuz_upload();
$upload->init($_FILES["pic"]);
$upload->save();
//移动文件
$pic = $upload->attach['attachment'];
if(!$pic){
showmessage(dzlang(6));
}
dmkdir($attachUrl.date("Ym/d/"));
$res = rename($_G['setting']['attachurl']."temp/".$pic,$attachUrl.date("Ym/d/").$pic);
if(!$res){
showmessage(dzlang(6));
}
$data['pic'] = $attachUrl.date("Ym/d/").$pic;
if($pvars['num2']){
$credit = getuserprofile("extcredits".$pvars['ext']);
if($credit-$pvars['num2']<0){
$extTitle = $_G['setting']['extcredits'][$pvars['ext']]['title'];
$extUnit = $_G['setting']['extcredits'][$pvars['ext']]['unit'];
$message = dzlang(33).$extTitle.dzlang(34).$pvars['num2'].$extUnit;
unlink($data['pic']);
showmessage($message);
}
//扣分
updatemembercount($_G['uid'], array('extcredits'.$pvars['ext'] => "-".$pvars['num2']), true, '', 0, '');
}
$data['uid'] = $_G['uid'];
$data['type'] = $data['status'] = 0;
C::t("#tshuz_worship#worship")->insert($data);
showmessage(dzlang(7), 'plugin.php?id=tshuz_worship&mod=manage');
}else{
include template('tshuz_worship:main');
}
}elseif($op == 'edit'){
$id = intval($_GET['item']);
if(!$id)
showmessage(dzlang(17));
$titleInfo = C::t("#tshuz_worship#worship")->fetch_by_id($id);
if(!$titleInfo || $titleInfo['uid'] != $_G['uid'])
showmessage(dzlang(18));
if(submitcheck('submit')){//提交操作
$data = array();
$get = $_GET['info'];
$data['name'] = addslashes($get['name']);//姓名
if(!$data['name']) showmessage(dzlang(1));
$data['type'] = intval($get['type']);//故人类型
$data['birth'] = addslashes($get['birth']);//生辰
$data['death'] = addslashes($get['death']);//忌日
if(!$data['birth']) showmessage(dzlang(2));
if(!$data['death']) showmessage(dzlang(3));
//if($data['death'] && $data['birth'] && $data['death'] <= $data['birth'] && $data['death'] < $_G['timestamp'])
// showmessage(dzlang(4));
$data['content'] = addslashes(strip_tags($get['content']));//生平
if($_FILES["pic"]['size']){
$upload = new discuz_upload();
$upload->init($_FILES["pic"]);
$upload->save();
//移动文件
$pic = $upload->attach['attachment'];
if(!$pic){
showmessage(dzlang(6));
}
dmkdir($attachUrl.date("Ym/d/"));
$res = rename($_G['setting']['attachurl']."temp/".$pic,$attachUrl.date("Ym/d/").$pic);
if(!$res){
showmessage(dzlang(6));
}
$data['pic'] = $attachUrl.date("Ym/d/").$pic;
unlink($titleInfo['pic']);
}
$data['uid'] = $_G['uid'];
$data['type'] = $data['status'] = 0;
C::t("#tshuz_worship#worship")->update($id,$data);
showmessage(dzlang(7), 'plugin.php?id=tshuz_worship&mod=manage');
}else{
include template('tshuz_worship:main');
}
}
?>
Discuz插件 网上祭祀祭拜扫墓 1.2
需积分: 50 132 浏览量
2016-09-29
15:22:19
上传
评论 2
收藏 572KB RAR 举报
mfy115
- 粉丝: 1
- 资源: 6
最新资源
- 基于JavaScript的访客预约系统设计源码
- 基于Vue和ECharts的工作租房数据可视化系统设计源码
- 1040g0cg310ravpiu6ibg5pg00tsipsln3ju2d0g 2
- 基于Python的SAR图像去噪CNN-NLM设计源码
- redhat6升级到redhat7,过程redhat6.x-> redhat6.10->rehat7.9 主版本最高版本
- 基于Django的流程引擎设计源码
- 基于Node.js的Express框架与MySQL的后台管理系统设计源码
- 基于Java的Flink流批一体数据处理快速集成开发框架设计源码
- FirstFilterOrderCompare
- Screenshot_2024-03-28-19-17-25-020_com.ss.android.lark.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈