| @@ -17,7 +17,7 @@ | |||||
| >t_New>新建任意栏目 | >t_New>新建任意栏目 | ||||
| >t_Edit>修改任意栏目 | >t_Edit>修改任意栏目 | ||||
| >t_Move>移动任意栏目 | >t_Move>移动任意栏目 | ||||
| >t_Del>删除任意栏目[br] | |||||
| >t_Del>删除任意栏目 | |||||
| >t_AccList>列出授权栏目 | >t_AccList>列出授权栏目 | ||||
| >t_AccNew>新建授权子栏目 | >t_AccNew>新建授权子栏目 | ||||
| >t_AccEdit>修改授权子栏目 | >t_AccEdit>修改授权子栏目 | ||||
| @@ -30,12 +30,12 @@ | |||||
| >a_Edit>修改任意文档 | >a_Edit>修改任意文档 | ||||
| >a_Del>删除任意文档 | >a_Del>删除任意文档 | ||||
| >a_Commend>推荐任意文档 | >a_Commend>推荐任意文档 | ||||
| >a_Check>审核任意文档[br] | |||||
| >a_Check>审核任意文档 | |||||
| >a_AccNew>发布授权文档 | >a_AccNew>发布授权文档 | ||||
| >a_AccList>列出授权文档 | >a_AccList>列出授权文档 | ||||
| >a_AccEdit>修改授权文档 | >a_AccEdit>修改授权文档 | ||||
| >a_AccDel>删除授权文档 | >a_AccDel>删除授权文档 | ||||
| >a_AccCheck>审核授权文档[br] | |||||
| >a_AccCheck>审核授权文档 | |||||
| >a_MyList>列出我发布的文档 | >a_MyList>列出我发布的文档 | ||||
| >a_MyEdit>修改我发布的文档 | >a_MyEdit>修改我发布的文档 | ||||
| >a_MyDel>删除我发布的文档 | >a_MyDel>删除我发布的文档 | ||||
| @@ -48,7 +48,7 @@ | |||||
| >co_Switch>导入外部数据 | >co_Switch>导入外部数据 | ||||
| >co_AddNote>增加采集节点 | >co_AddNote>增加采集节点 | ||||
| >co_EditNote>修改采集节点 | >co_EditNote>修改采集节点 | ||||
| >co_PlayNote>采集数据[br] | |||||
| >co_PlayNote>采集数据 | |||||
| >co_ListNote>列出采集节点 | >co_ListNote>列出采集节点 | ||||
| >co_ViewNote>管理已下载内容 | >co_ViewNote>管理已下载内容 | ||||
| >co_Export>采集内容入库 | >co_Export>采集内容入库 | ||||
| @@ -78,18 +78,18 @@ | |||||
| >sys_Group>系统组管理 | >sys_Group>系统组管理 | ||||
| >sys_MdPwd>更改个人密码 | >sys_MdPwd>更改个人密码 | ||||
| >sys_DelUpload>删除附件 | >sys_DelUpload>删除附件 | ||||
| >sys_Task>计划任务管理[br] | |||||
| >sys_Task>计划任务管理 | |||||
| >sys_Edit>修改系统参数 | >sys_Edit>修改系统参数 | ||||
| >sys_Log>管理日志 | >sys_Log>管理日志 | ||||
| >sys_plus>插件管理 | >sys_plus>插件管理 | ||||
| >sys_Data>数据备份还原[br] | |||||
| >sys_Data>数据备份还原 | |||||
| >sys_Att>自定义文档属性 | >sys_Att>自定义文档属性 | ||||
| >sys_ArcBatch>文档批量维护 | >sys_ArcBatch>文档批量维护 | ||||
| >sys_ArcTj>文档信息统计[br] | |||||
| >sys_ArcTj>文档信息统计 | |||||
| >sys_Source>新闻来源 | >sys_Source>新闻来源 | ||||
| >sys_Writer>作者管理 | >sys_Writer>作者管理 | ||||
| >sys_SoftConfig>软件频道参数 | >sys_SoftConfig>软件频道参数 | ||||
| >sys_Keyword>关键字管理[br] | |||||
| >sys_Keyword>关键字管理 | |||||
| >sys_MakeHtml>更新HTML | >sys_MakeHtml>更新HTML | ||||
| >sys_Feedback>评论管理 | >sys_Feedback>评论管理 | ||||
| >sys_Upload>管理任意上传 | >sys_Upload>管理任意上传 | ||||
| @@ -201,12 +201,6 @@ $actionSearch[5] = array( | |||||
| 'purview' =>'member_Type', | 'purview' =>'member_Type', | ||||
| 'linkurl' =>'member_scores.php' | 'linkurl' =>'member_scores.php' | ||||
| ), | ), | ||||
| 3 => array( | |||||
| 'title' =>'会员模型管理', | |||||
| 'description' =>'为会员制定不同的会员分类,默认有个人,企业两种用户类型,并且同时可以为用户模型添加不同的字段', | |||||
| 'purview' =>'member_Type', | |||||
| 'linkurl' =>'member_model_main.php' | |||||
| ), | |||||
| 4 => array( | 4 => array( | ||||
| 'title' =>'会员短信管理', | 'title' =>'会员短信管理', | ||||
| 'description' =>'会员之间发送的短消息管理,其中包含群发短消息和对单个会员发送短消息两种', | 'description' =>'会员之间发送的短消息管理,其中包含群发短消息和对单个会员发送短消息两种', | ||||
| @@ -61,7 +61,6 @@ $adminMenu2 = "<m:top item='7_' name='模板管理' display='none' rank='temp_On | |||||
| <m:item name='系统基本参数' link='sys_info.php' rank='sys_Edit' target='main' /> | <m:item name='系统基本参数' link='sys_info.php' rank='sys_Edit' target='main' /> | ||||
| <m:item name='系统用户管理' link='sys_admin_user.php' rank='sys_User' target='main' /> | <m:item name='系统用户管理' link='sys_admin_user.php' rank='sys_User' target='main' /> | ||||
| <m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' /> | <m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' /> | ||||
| <m:item name='服务器分布/远程' link='sys_multiserv.php' rank='sys_Group' target='main' /> | |||||
| <m:item name='系统日志管理' link='log_list.php' rank='sys_Log' target='main' /> | <m:item name='系统日志管理' link='log_list.php' rank='sys_Log' target='main' /> | ||||
| <m:item name='验证安全设置' link='sys_safe.php' rank='sys_verify' target='main' /> | <m:item name='验证安全设置' link='sys_safe.php' rank='sys_verify' target='main' /> | ||||
| <m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | <m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | ||||
| @@ -154,7 +153,6 @@ $adminMenu1 | |||||
| <m:item name='注册会员列表' link='member_main.php' rank='member_List' target='main' /> | <m:item name='注册会员列表' link='member_main.php' rank='member_List' target='main' /> | ||||
| <m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' /> | <m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' /> | ||||
| <m:item name='积分头衔设置' link='member_scores.php' rank='member_Type' target='main' /> | <m:item name='积分头衔设置' link='member_scores.php' rank='member_Type' target='main' /> | ||||
| <m:item name='会员模型管理' link='member_model_main.php' rank='member_Type' target='main' /> | |||||
| <m:item name='会员短信管理' link='member_pm.php' rank='member_Type' target='main' /> | <m:item name='会员短信管理' link='member_pm.php' rank='member_Type' target='main' /> | ||||
| </m:top> | </m:top> | ||||
| @@ -107,7 +107,6 @@ $menusMain = " | |||||
| <m:item name='注册会员列表' link='member_main.php' rank='member_List' target='main' /> | <m:item name='注册会员列表' link='member_main.php' rank='member_List' target='main' /> | ||||
| <m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' /> | <m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' /> | ||||
| <m:item name='积分头衔设置' link='member_scores.php' rank='member_Type' target='main' /> | <m:item name='积分头衔设置' link='member_scores.php' rank='member_Type' target='main' /> | ||||
| <m:item name='会员模型管理' link='member_model_main.php' rank='member_Type' target='main' /> | |||||
| <m:item name='会员短信管理' link='member_pm.php' rank='member_Type' target='main' /> | <m:item name='会员短信管理' link='member_pm.php' rank='member_Type' target='main' /> | ||||
| </m:top> | </m:top> | ||||
| @@ -1,70 +0,0 @@ | |||||
| <?php | |||||
| /** | |||||
| * 会员模型管理 | |||||
| * | |||||
| * @version $Id: member_model_add.php 1 11:17 2010年7月19日Z tianya $ | |||||
| * @package DedeCMS.Administrator | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('c_New'); | |||||
| $mysql_version = $dsql->GetVersion(); | |||||
| $mysql_versions = explode(".", trim($mysql_version)); | |||||
| $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | |||||
| if(empty($action)) | |||||
| { | |||||
| $row = $dsql->GetOne("SELECT id FROM #@__member_model ORDER BY id DESC LIMIT 0,1 "); | |||||
| if(is_array($row)) $newid = $row['id']+1; | |||||
| else $newid = 1; | |||||
| include(DEDEADMIN."/templets/member_model_add.htm"); | |||||
| } else { | |||||
| if(preg_match("#[^0-9-]#", $id) || empty($id)) | |||||
| { | |||||
| ShowMsg("<font color=red>'会员模型ID'</font>必须为数字!","-1"); | |||||
| exit(); | |||||
| } | |||||
| if($table=="") | |||||
| { | |||||
| ShowMsg("表名不能为空!","-1"); | |||||
| exit(); | |||||
| } | |||||
| $state = isset($state) && is_numeric($state) ? $state : 0; | |||||
| $name = dede_htmlspecialchars($name); | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$id' OR `table` LIKE '$table' OR name LIKE '$name' "); | |||||
| if(is_array($row)) | |||||
| { | |||||
| ShowMsg("可能会员模型的‘ID’、‘名称’在数据库中已存在,不能重复使用!","-1"); | |||||
| exit(); | |||||
| } | |||||
| $query = "SHOW TABLES FROM {$dsql->dbName} "; | |||||
| $dsql->SetQuery($query); | |||||
| $dsql->Execute(); | |||||
| while($row = $dsql->GetArray()) | |||||
| { | |||||
| if(empty($row[0])) $row[0] = ''; | |||||
| if($table == $row[0]) | |||||
| { | |||||
| ShowMsg('指定的表在数据库中重复', '-1'); | |||||
| exit(); | |||||
| } | |||||
| } | |||||
| $sql = "CREATE TABLE IF NOT EXISTS `$table`( | |||||
| `mid` int(10) unsigned NOT NULL auto_increment, | |||||
| "; | |||||
| if($mysql_version < 4.1){ | |||||
| $sql .= " PRIMARY KEY (`mid`)\r\n) TYPE=MyISAM; "; | |||||
| }else{ | |||||
| $sql .= " PRIMARY KEY (`mid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; | |||||
| } | |||||
| if($dsql->ExecNoneQuery($sql)){ | |||||
| $query = "INSERT INTO #@__member_model (`id`, `name`, `table`, `description`, `issystem`, `state`) VALUES ('$id', '$name', '$table', '$description', 0, '$state')"; | |||||
| $dsql->ExecNoneQuery($query); | |||||
| //更新会员模型缓存 | |||||
| UpDateMemberModCache(); | |||||
| ShowMsg('会员模型创建成功,请自行添加字段', 'member_model_main.php'); | |||||
| }else{ | |||||
| ShowMsg('会员模型创建失败', '-1'); | |||||
| } | |||||
| } | |||||
| @@ -1,221 +0,0 @@ | |||||
| <?php | |||||
| /** | |||||
| * 会员模型编辑 | |||||
| * | |||||
| * @version $Id: member_model_edit.php 1 11:20 2010年7月20日Z tianya $ | |||||
| * @package DedeCMS.Administrator | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('c_Edit'); | |||||
| require_once(DEDEINC."/dedetag.class.php"); | |||||
| require_once(DEDEINC."/oxwindow.class.php"); | |||||
| if(empty($dopost)) $dopost=""; | |||||
| $id = (empty($id) ? 0 : intval($id)); | |||||
| /*---------------- | |||||
| function __SaveEdit() | |||||
| -----------------*/ | |||||
| if($dopost=="save") | |||||
| { | |||||
| $state = isset($state) && is_numeric($state) ? $state : 1; | |||||
| $description = dede_htmlspecialchars($description); | |||||
| $name = dede_htmlspecialchars($name); | |||||
| $query = "UPDATE `#@__member_model` SET name = '$name', description = '$description', state='$state' WHERE id='$id' "; | |||||
| $dsql->ExecuteNoneQuery($query); | |||||
| //更新会员模型缓存 | |||||
| UpDateMemberModCache(); | |||||
| ShowMsg("成功更改一个会员模型!", "member_model_main.php"); | |||||
| exit(); | |||||
| } | |||||
| /*---------------- | |||||
| function __Disabled() | |||||
| -----------------*/ | |||||
| else if($dopost=="disabled") | |||||
| { | |||||
| @set_time_limit(0); | |||||
| CheckPurview('c_Del'); | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$id'"); | |||||
| $statenum = ($row['state']==0)? 1 : 0; | |||||
| $statestr = ($row['state']==0)? '启用' : '禁用'; | |||||
| //禁用模型 | |||||
| $dsql->ExecuteNoneQuery("UPDATE #@__member_model SET state={$statenum} WHERE id='$id' "); | |||||
| //更新会员模型缓存 | |||||
| UpDateMemberModCache(); | |||||
| ShowMsg("成功{$statestr}一个会员模型!","member_model_main.php"); | |||||
| exit(); | |||||
| } | |||||
| /*---------------- | |||||
| function __Copy() | |||||
| -----------------*/ | |||||
| else if($dopost=="copy") | |||||
| { | |||||
| @set_time_limit(0); | |||||
| CheckPurview('c_Del'); | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$id'"); | |||||
| $thisname = $row['name']; | |||||
| $thistable = $row['table']; | |||||
| $thisinfo = $row['info']; | |||||
| $row = $dsql->GetOne("SELECT id From #@__member_model ORDER BY id DESC LIMIT 0,1 "); | |||||
| if(is_array($row)) $newid = $row['id'] + 1; | |||||
| else $newid = 1; | |||||
| if(empty($job)) $job=""; | |||||
| //确认提示 | |||||
| if($job=="") | |||||
| { | |||||
| $wintitle = "会员模型管理-复制会员模型"; | |||||
| $wecome_info = "<a href='member_model_main.php'>会员模型管理</a>::复制会员模型"; | |||||
| $win = new OxWindow(); | |||||
| $win->Init("member_model_edit.php","js/blank.js","POST"); | |||||
| $win->AddHidden("job","yes"); | |||||
| $win->AddHidden("dopost",$dopost); | |||||
| $win->AddHidden("id",$id); | |||||
| $win->AddTitle("你确实要复制 \"".$thisname."\" 这个会员模型?"); | |||||
| $msg =""; | |||||
| $msg.="<table width='460' border='0' cellspacing='0' cellpadding='0'>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td width='170' height='24' align='center'>新模型ID:</td>\r\n"; | |||||
| $msg.=" <td width='230'><input name='newid' type='text' id='newid' size='6' value='{$newid}'/></td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td height='24' align='center'>新模型名称:</td>\r\n"; | |||||
| $msg.=" <td><input name='newname' type='text' id='newname' value='{$thisname}{$newid}' style='width:250px'/></td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td height='24' align='center'>模型数据表:</td>\r\n"; | |||||
| $msg.=" <td><input name='newtable' type='text' id='newtable' value='{$thistable}{$newid}' style='width:250px'/></td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td height='24' align='center'>模型字段:</td>\r\n"; | |||||
| $msg.=" <td><font color='red'>模型字段默认已经复制,请在编辑当前模型中查看</font></td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td height='24' align='center'>新模型描述:</td>\r\n"; | |||||
| $msg.=" <td><label>\r\n"; | |||||
| $msg.=" <textarea name=\"description\" id=\"description\" cols=\"45\" rows=\"5\" onClick=\"this.value=''\">新模型描述</textarea>\r\n"; | |||||
| $msg.=" </label></td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="<tr>\r\n"; | |||||
| $msg.=" <td height='24' align='center'>模型状态:</td>\r\n"; | |||||
| $msg.=" <td><input name='state' type='radio' id='copytemplet' value='1' class='np' checked='checked'/>\r\n"; | |||||
| $msg.=" 启用\r\n"; | |||||
| $msg.=" \r\n"; | |||||
| $msg.=" <input name='state' type='radio' id='copytemplet' class='np' value='0'/>\r\n"; | |||||
| $msg.=" 禁用</td>\r\n"; | |||||
| $msg.="</tr>\r\n"; | |||||
| $msg.="</table>"; | |||||
| $win->AddMsgItem("<div style='padding:20px;line-height:300%'>$msg</div>"); | |||||
| $winform = $win->GetWindow("ok"); | |||||
| $win->Display(); | |||||
| exit(); | |||||
| } | |||||
| //操作 | |||||
| else if($job=="yes") | |||||
| { | |||||
| if(preg_match("#[^0-9-]#", $newid) || empty($newid)) | |||||
| { | |||||
| ShowMsg("<font color=red>'会员模型ID'</font>必须为数字!","-1"); | |||||
| exit(); | |||||
| } | |||||
| if($newtable=="") | |||||
| { | |||||
| ShowMsg("表名不能为空!", "-1"); | |||||
| exit(); | |||||
| } | |||||
| $state = isset($state) && is_numeric($state) ? $state : 0; | |||||
| $newname = dede_htmlspecialchars($newname); | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$newid' OR `table` LIKE '$newtable' OR name LIKE '$newname' "); | |||||
| if(is_array($row)) | |||||
| { | |||||
| ShowMsg("可能会员模型的‘ID’、‘名称’在数据库中已存在,不能重复使用!","-1"); | |||||
| exit(); | |||||
| } | |||||
| //拷贝数据表 | |||||
| if(!$dsql->IsTable($newtable)) | |||||
| { | |||||
| $dsql->Execute('me',"SHOW CREATE TABLE {$dsql->dbName}.{$thistable}"); | |||||
| $row = $dsql->GetArray('me', MYSQL_BOTH); | |||||
| $tableStruct = $row[1]; | |||||
| $tb = str_replace('#@__', $cfg_dbprefix, $thistable); | |||||
| $tableStruct = preg_replace("/CREATE TABLE `$thistable`/iU","CREATE TABLE `$newtable`",$tableStruct); | |||||
| $dsql->ExecuteNoneQuery($tableStruct); | |||||
| } | |||||
| $query = "INSERT INTO #@__member_model (`id`, `name`, `table`, `description`, `issystem`, `state`, `info`) VALUES ('$newid', '$newname', '$newtable', '$description', 0, '$state','$thisinfo')"; | |||||
| $rs = $dsql->ExecuteNoneQuery($query); | |||||
| if($rs) | |||||
| { | |||||
| UpDateMemberModCache(); | |||||
| ShowMsg("成功复制会员模型,现转到详细参数页... ","member_model_edit.php?id={$newid}&dopost=edit"); | |||||
| exit(); | |||||
| } | |||||
| else | |||||
| { | |||||
| $errv = $dsql->GetError(); | |||||
| ShowMsg("系统出错,请把错误代码发送到官方论坛,以检查原因!<br /> 错误代码:member_model_edit.php?dopost=copy $errv","javascript:;"); | |||||
| exit(); | |||||
| } | |||||
| //echo "Do it!";exit(); | |||||
| } | |||||
| } | |||||
| /*---------------- | |||||
| function __Delete() | |||||
| -----------------*/ | |||||
| else if($dopost=="delete") | |||||
| { | |||||
| @set_time_limit(0); | |||||
| CheckPurview('c_Del'); | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$id'"); | |||||
| if($row['issystem'] == 1) | |||||
| { | |||||
| ShowMsg("系统模型,禁止删除!","-1"); | |||||
| exit(); | |||||
| } | |||||
| if(empty($job)) $job=""; | |||||
| //确认提示 | |||||
| if($job=="") | |||||
| { | |||||
| $wintitle = "会员模型管理-删除会员模型"; | |||||
| $wecome_info = "<a href='member_model_main.php'>会员模型管理</a>::删除会员模型"; | |||||
| $win = new OxWindow(); | |||||
| $win->Init("member_model_edit.php","js/blank.js","POST"); | |||||
| $win->AddHidden("job","yes"); | |||||
| $win->AddHidden("dopost",$dopost); | |||||
| $win->AddHidden("id",$id); | |||||
| $win->AddTitle("!将删除所有与该会员模型相关的文件和数据<br />你确实要删除 \"".$row['name']."\" 这个会员模型?"); | |||||
| $winform = $win->GetWindow("ok"); | |||||
| $win->Display(); | |||||
| exit(); | |||||
| } | |||||
| //操作 | |||||
| else if($job=="yes") | |||||
| { | |||||
| $row = $dsql->GetOne("SELECT `table` FROM `#@__member_model` WHERE id='$id'",MYSQL_ASSOC); | |||||
| if(!is_array($row)) | |||||
| { | |||||
| ShowMsg("你所指定的会员模型信息不存在!","-1"); | |||||
| exit(); | |||||
| } | |||||
| //删除表 | |||||
| $dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$row['table']}`;"); | |||||
| //删除频道配置信息 | |||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__member_model` WHERE id='$id'"); | |||||
| UpDateMemberModCache(); | |||||
| ShowMsg("成功删除一个会员模型!","member_model_main.php"); | |||||
| exit(); | |||||
| } | |||||
| } | |||||
| /*---------------- | |||||
| function edit() | |||||
| -----------------*/ | |||||
| $row = $dsql->GetOne("SELECT * FROM #@__member_model WHERE id='$id'"); | |||||
| include DEDEADMIN."/templets/member_model_edit.htm"; | |||||
| @@ -1,121 +0,0 @@ | |||||
| <?php | |||||
| /** | |||||
| * 会员模型字段增加 | |||||
| * | |||||
| * @version $Id: member_model_field_add.php 1 11:20 2010年7月20日Z tianya $ | |||||
| * @package DedeCMS.Administrator | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once(dirname(__FILE__)."/config.php"); | |||||
| //增加权限检查 | |||||
| require_once(DEDEADMIN.'/inc/inc_admin_channel.php'); | |||||
| if(empty($action)) $action = ''; | |||||
| $mysql_version = $dsql->GetVersion(); | |||||
| $mysql_versions = explode(".",trim($mysql_version)); | |||||
| $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | |||||
| /*---------------------- | |||||
| function Save() | |||||
| ---------------------*/ | |||||
| if($action=='save') | |||||
| { | |||||
| //模型信息 | |||||
| $fieldname = strtolower($fieldname); | |||||
| $row = $dsql->GetOne("SELECT `table`,`info` FROM #@__member_model WHERE id='$id'"); | |||||
| $fieldset = $row['info']; | |||||
| require_once(DEDEINC."/dedetag.class.php"); | |||||
| $dtp = new DedeTagParse(); | |||||
| $dtp->SetNameSpace("field","<",">"); | |||||
| $dtp->LoadSource($fieldset); | |||||
| $trueTable = $row['table']; | |||||
| //修改字段配置信息 | |||||
| $dfvalue = trim($vdefault); | |||||
| $isnull = ($isnull==1 ? "true" : "false"); | |||||
| $mxlen = $maxlength; | |||||
| //检测被修改的字段类型 | |||||
| $fieldinfos = GetFieldMake($dtype, $fieldname, $dfvalue, $mxlen); | |||||
| $ntabsql = $fieldinfos[0]; | |||||
| $buideType = $fieldinfos[1]; | |||||
| $rs = $dsql->ExecuteNoneQuery(" ALTER TABLE `$trueTable` ADD $ntabsql "); | |||||
| if(!$rs) | |||||
| { | |||||
| $gerr = $dsql->GetError(); | |||||
| ShowMsg("增加字段失败,错误提示为:".$gerr,"javascript:;"); | |||||
| exit(); | |||||
| } | |||||
| $ok = false; | |||||
| //检测旧配置信息,并替换为新配置 | |||||
| if(is_array($dtp->CTags)) | |||||
| { | |||||
| //遍历旧配置 | |||||
| foreach($dtp->CTags as $tagid=>$ctag) | |||||
| { | |||||
| if($fieldname == strtolower($ctag->GetName())) | |||||
| { | |||||
| $dtp->Assign($tagid,stripslashes($fieldstring),false); | |||||
| $ok = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| $oksetting = $ok ? $dtp->GetResultNP() : $fieldset."\n".stripslashes($fieldstring); | |||||
| } | |||||
| else | |||||
| { | |||||
| //原来的配置为空 | |||||
| $oksetting = $fieldset."\n".stripslashes($fieldstring); | |||||
| } | |||||
| $addlist = GetAddFieldList($dtp, $oksetting); | |||||
| $oksetting = addslashes($oksetting); | |||||
| $rs = $dsql->ExecuteNoneQuery("UPDATE #@__member_model SET `info`='$oksetting' WHERE id='$id' "); | |||||
| if(!$rs) | |||||
| { | |||||
| $grr = $dsql->GetError(); | |||||
| ShowMsg("保存节点配置出错!".$grr,"javascript:;"); | |||||
| exit(); | |||||
| } | |||||
| ShowMsg("成功增加一个字段!","member_model_edit.php?id=$id"); | |||||
| exit(); | |||||
| } | |||||
| //检测模型相关信息,并初始化相关数据 | |||||
| /*---------------------- | |||||
| function ShowPage() | |||||
| ---------------------*/ | |||||
| $row = $dsql->GetOne("SELECT `table` FROM #@__member_model WHERE id='$id'"); | |||||
| $trueTable = $row['table']; | |||||
| $tabsql = "CREATE TABLE IF NOT EXISTS `$trueTable`( | |||||
| `mid` int(10) unsigned NOT NULL auto_increment, | |||||
| "; | |||||
| if($mysql_version < 4.1) | |||||
| { | |||||
| $tabsql .= " PRIMARY KEY (`mid`)\r\n) TYPE=MyISAM; "; | |||||
| } | |||||
| else | |||||
| { | |||||
| $tabsql .= " PRIMARY KEY (`mid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; | |||||
| } | |||||
| $dsql->ExecuteNoneQuery($tabsql); | |||||
| //检测附加表里含有的字段 | |||||
| $fields = array(); | |||||
| $rs = $dsql->SetQuery("SHOW fields FROM `$trueTable`"); | |||||
| $dsql->Execute('a'); | |||||
| while($nrow = $dsql->GetArray('a',MYSQL_ASSOC)) | |||||
| { | |||||
| $fields[strtolower($nrow['Field'])] = 1; | |||||
| } | |||||
| $f = ''; | |||||
| foreach($fields as $k=>$v) | |||||
| { | |||||
| $f .= ($f=='' ? $k : ' '.$k); | |||||
| } | |||||
| require_once(DEDEADMIN."/templets/member_model_field_add.htm"); | |||||
| @@ -1,161 +0,0 @@ | |||||
| <?php | |||||
| /** | |||||
| * 会员模型字段编辑 | |||||
| * | |||||
| * @version $Id: member_model_field_edit.php 1 11:24 2010年7月20日Z tianya $ | |||||
| * @package DedeCMS.Administrator | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once(dirname(__FILE__)."/config.php"); | |||||
| //增加权限检查 | |||||
| require_once(DEDEINC."/dedetag.class.php"); | |||||
| require_once(DEDEADMIN."/inc/inc_admin_channel.php"); | |||||
| if(empty($action)) $action = ''; | |||||
| //获取模型信息 | |||||
| $mysql_version = $dsql->GetVersion(); | |||||
| $mysql_versions = explode(".", trim($mysql_version)); | |||||
| $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | |||||
| $row = $dsql->GetOne("SELECT `table`,`info` FROM #@__member_model WHERE id='$id'"); | |||||
| $fieldset = $row['info']; | |||||
| $trueTable = $row['table']; | |||||
| $dtp = new DedeTagParse(); | |||||
| $dtp->SetNameSpace("field", "<",">"); | |||||
| $dtp->LoadSource($fieldset); | |||||
| foreach($dtp->CTags as $ctag) | |||||
| { | |||||
| if(strtolower($ctag->GetName())==strtolower($fname)) break; | |||||
| } | |||||
| //字段类型信息 | |||||
| $ds = file(DEDEADMIN."/inc/fieldtype.txt"); | |||||
| foreach($ds as $d) | |||||
| { | |||||
| $dds = explode(',',trim($d)); | |||||
| $fieldtypes[$dds[0]] = $dds[1]; | |||||
| } | |||||
| //保存更改 | |||||
| /*-------------------- | |||||
| function _SAVE() | |||||
| ----------------------*/ | |||||
| if($action=='save') | |||||
| { | |||||
| if(!isset($fieldtypes[$dtype])) | |||||
| { | |||||
| ShowMsg("你修改的是系统专用类型的数据,禁止操作!","-1"); | |||||
| exit(); | |||||
| } | |||||
| //检测数据库是否存在附加表,不存在则新建一个 | |||||
| $tabsql = "CREATE TABLE IF NOT EXISTS `$trueTable`( | |||||
| `mid` int(10) unsigned NOT NULL auto_increment, | |||||
| "; | |||||
| if($mysql_version < 4.1) | |||||
| { | |||||
| $tabsql .= " PRIMARY KEY (`mid`)\r\n) TYPE=MyISAM; "; | |||||
| } | |||||
| else | |||||
| { | |||||
| $tabsql .= " PRIMARY KEY (`mid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; | |||||
| } | |||||
| //检测表里含有的字段 | |||||
| $fields = array(); | |||||
| $rs = $dsql->SetQuery("SHOW fields FROM `$trueTable`"); | |||||
| $dsql->Execute('a'); | |||||
| while($nrow = $dsql->GetArray('a',MYSQL_ASSOC)) | |||||
| { | |||||
| $fields[ strtolower($nrow['Field']) ] = $nrow['Type']; | |||||
| } | |||||
| //修改字段配置信息 | |||||
| $dfvalue = $vdefault; | |||||
| $isnull = "true"; | |||||
| $mxlen = $maxlength; | |||||
| $fieldname = strtolower($fname); | |||||
| //检测被修改的字段类型,并更新数据表 | |||||
| $fieldinfos = GetFieldMake($dtype, $fieldname, $dfvalue, $mxlen); | |||||
| $ntabsql = $fieldinfos[0]; | |||||
| $buideType = $fieldinfos[1]; | |||||
| $tabsql = ''; | |||||
| //检测旧数据类型,并替换为新配置 | |||||
| foreach($dtp->CTags as $tagid=>$ctag) | |||||
| { | |||||
| if(trim($fieldname)==trim(strtolower($ctag->GetName()))) | |||||
| { | |||||
| if(isset($fields[$fieldname]) && $fields[$fieldname]!=$buideType) | |||||
| { | |||||
| $tabsql = "ALTER TABLE `$trueTable` CHANGE `$fieldname` ".$ntabsql; | |||||
| $dsql->ExecuteNoneQuery($tabsql); | |||||
| } | |||||
| else if(!isset($fields[$fieldname])) | |||||
| { | |||||
| $tabsql = "ALTER TABLE `$trueTable` ADD ".$ntabsql; | |||||
| $dsql->ExecuteNoneQuery($tabsql); | |||||
| } | |||||
| else | |||||
| { | |||||
| $tabsql = ''; | |||||
| } | |||||
| $dtp->Assign($tagid,stripslashes($fieldstring),false); | |||||
| break; | |||||
| } | |||||
| } | |||||
| $oksetting = $dtp->GetResultNP(); | |||||
| $oksetting = addslashes($oksetting); | |||||
| $dsql->ExecuteNoneQuery("UPDATE #@__member_model SET info='$oksetting' WHERE id='$id' "); | |||||
| ShowMsg("成功更改一个字段的配置!","member_model_edit.php?id={$id}"); | |||||
| exit(); | |||||
| } | |||||
| /*---------------- | |||||
| 禁用字段 | |||||
| function __Disabled() | |||||
| -----------------*/ | |||||
| else if($action=="disabled") | |||||
| { | |||||
| foreach($dtp->CTags as $tagid=>$ctag) | |||||
| { | |||||
| if(strtolower($ctag->GetName())==strtolower($fname)) | |||||
| { | |||||
| $statenum = ($ctag->GetAtt('state')==1)? 0 : 1; | |||||
| $fieldstring = "<field:{$ctag->GetName()} itemname=\"{$ctag->GetAtt('itemname')}\" autofield=\"{$ctag->GetAtt('autofield')}\" type=\"{$ctag->GetAtt('type')}\" isnull=\"{$ctag->GetAtt('isnull')}\" default=\"{$ctag->GetAtt('default')}\" maxlength=\"{$ctag->GetAtt('maxlength')}\" issearch=\"{$ctag->GetAtt('issearch')}\" isshow=\"{$ctag->GetAtt('isshow')}\" state=\"{$statenum}\">\r\n"; | |||||
| $fieldstring .= "</field:{$ctag->GetName()}>"; | |||||
| $dtp->Assign($tagid,stripslashes($fieldstring),false); | |||||
| } | |||||
| } | |||||
| $oksetting = addslashes($dtp->GetResultNP()); | |||||
| //echo $oksetting;exit(); | |||||
| $dsql->ExecuteNoneQuery("UPDATE #@__member_model SET info='$oksetting' WHERE id='$id' "); | |||||
| ShowMsg("成功禁用一个字段!","member_model_edit.php?id={$id}"); | |||||
| exit(); | |||||
| } | |||||
| /*------------------ | |||||
| 删除字段 | |||||
| function _DELETE() | |||||
| -------------------*/ | |||||
| else if($action=="delete") | |||||
| { | |||||
| //检测旧数据类型,并替换为新配置 | |||||
| foreach($dtp->CTags as $tagid=>$ctag) | |||||
| { | |||||
| if(strtolower($ctag->GetName())==strtolower($fname)) | |||||
| { | |||||
| $dtp->Assign($tagid,"#@Delete@#"); | |||||
| } | |||||
| } | |||||
| $oksetting = addslashes($dtp->GetResultNP()); | |||||
| $dsql->ExecuteNoneQuery("Update #@__member_model set info='$oksetting' where id='$id' "); | |||||
| $dsql->ExecuteNoneQuery("ALTER TABLE `$trueTable` DROP `$fname` "); | |||||
| ShowMsg("成功删除一个字段!","member_model_edit.php?id={$id}"); | |||||
| exit(); | |||||
| } | |||||
| require_once(DEDEADMIN."/templets/member_model_field_edit.htm"); | |||||
| @@ -1,31 +0,0 @@ | |||||
| <?php | |||||
| /** | |||||
| * 会员模型管理 | |||||
| * | |||||
| * @version $Id: member_model_main.php 1 11:24 2010年7月20日Z tianya $ | |||||
| * @package DedeCMS.Administrator | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('member_Type'); | |||||
| require_once(DEDEINC."/datalistcp.class.php"); | |||||
| require_once(DEDEINC."/common.func.php"); | |||||
| setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); | |||||
| function GetTotalMember($mtable=''){ | |||||
| global $dsql; | |||||
| if($dsql->IsTable($mtable)){ | |||||
| $row =$dsql->GetOne("SELECT COUNT(*) AS nums FROM {$mtable}"); | |||||
| return empty($row['nums'])? "0" : $row['nums']; | |||||
| }else{ | |||||
| return '0'; | |||||
| } | |||||
| } | |||||
| $sql = "SELECT `id`,`name`,`table`,`description`,`state`,`issystem` FROM #@__member_model ORDER BY id ASC"; | |||||
| $dlist = new DataListCP(); | |||||
| $dlist->SetTemplet(DEDEADMIN."/templets/member_model_main.htm"); | |||||
| $dlist->SetSource($sql); | |||||
| $dlist->display(); | |||||
| $dlist->Close(); | |||||
| @@ -1,104 +0,0 @@ | |||||
| <!DOCTYPE html | |||||
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>新增会员模型</title> | |||||
| <script language="javascript" src="../static/js/jquery.js"></script> | |||||
| <script language="javascript" src="js/main.js"></script> | |||||
| <script language="javascript" src="js/diy.js"></script> | |||||
| <script language="javascript"> | |||||
| function CheckSubmit() { | |||||
| if (document.form1.name.value == '') { | |||||
| alert("自定义表单名称不能为空!"); | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| </script> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <style type="text/css"> | |||||
| .STYLE1 { | |||||
| color: #FF0000 | |||||
| } | |||||
| td { | |||||
| padding: 2px; | |||||
| padding-left: 6px; | |||||
| line-height: 150%; | |||||
| } | |||||
| .STYLE2 { | |||||
| color: #666666; | |||||
| display: none; | |||||
| } | |||||
| </style> | |||||
| </head> | |||||
| <body background="images/allbg.gif" leftmargin="8" topmargin="8"> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" | |||||
| style="background:#CFCFCF;"> | |||||
| <form name="form1" action="member_model_add.php?action=add" method="post" onSubmit="return CheckSubmit();"> | |||||
| <tr bgcolor="#CFCFCF"> | |||||
| <td height="28" colspan="2" bgcolor="#EDF9D5" background='images/tbg.gif'><b> <a | |||||
| href="member_model_main.php"><u>会员模型管理</u></a> > 新增会员模型:</b></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td width="35%" height="28" align="left" bgcolor="#FFFFFF"> 模型ID:<br /> | |||||
| <span class="STYLE2" id='help1'> 数字,创建后不可更改,并具有唯一性。推荐使用默认值</span></td> | |||||
| <td width="65%" bgcolor="#FFFFFF"><input name="id" type="text" id="id" size="10" value="<?php echo $newid?>" | |||||
| class='pubinputs' style='width:60px' /> | |||||
| * <img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" | |||||
| onClick="showHide2('help1')" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF"> 会员模型名称:<br /> | |||||
| <span class="STYLE2" id="help3"> 自定义表单的中文名称,在后台管理,前台发布等均使用此名字。</span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="name" type="text" id="name" style="width:180px" | |||||
| value="会员模型<?php echo $newid;?>" class='pubinputs' /> | |||||
| *<img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" | |||||
| onClick="showHide2('help3')" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">数据表:<br /> | |||||
| <span class="STYLE2" id="help5"> 必须由英文、数字、下划线组成,用于保存自定义表单数据,不能和已有表名重复,创建后不可修改表名。</span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="table" type="text" id="table" style="width:180px" | |||||
| value="<?php echo $cfg_dbprefix; ?>member_<?php echo $newid; ?>" class='pubinputs' /> | |||||
| *<img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" | |||||
| onClick="showHide2('help5')" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">模型描述:</td> | |||||
| <td bgcolor="#FFFFFF"><textarea name="description" cols="50" rows="5" class="tbtitle" id="description" | |||||
| onClick="this.value=''">模型描述</textarea></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">字段配置:</td> | |||||
| <td bgcolor="#FFFFFF"><span class="STYLE1">建立自定义表单后在“更改”自定义表单的地方添加字段即可。</span></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">启用状态:</td> | |||||
| <td bgcolor="#FFFFFF"><label> | |||||
| <input name="state" type="radio" class='np' value="1" checked /> | |||||
| 启用 | |||||
| <input name="state" type="radio" value="0" class='np' /> | |||||
| 禁用</label></td> | |||||
| </tr> | |||||
| <tr bgcolor="#F9FCEF"> | |||||
| <td height="28" colspan="2"> | |||||
| <table width="100%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="26%" height="45"> </td> | |||||
| <td width="15%"><input type="submit" name="button" id="button" value="确定" class="np coolbg" /></td> | |||||
| <td width="59%"><input name="按钮" type="button" class="np coolbg" id="button2" | |||||
| onClick="location='mychannel_main.php';" value="返回" /></td> | |||||
| </tr> | |||||
| </table> | |||||
| </td> | |||||
| </tr> | |||||
| </form> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @@ -1,195 +0,0 @@ | |||||
| <!DOCTYPE html | |||||
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>修改会员模型管理</title> | |||||
| <script language="javascript" src="../static/js/jquery.js"></script> | |||||
| <script language="javascript" src="js/main.js"></script> | |||||
| <script language="javascript" src="js/diy.js"></script> | |||||
| <script language="javascript"> | |||||
| function CheckSubmit() { | |||||
| if (document.form1.typename.value == '') { | |||||
| alert("自定义表单名称不能为空!"); | |||||
| return false; | |||||
| } | |||||
| return true; | |||||
| } | |||||
| //删除 | |||||
| function DelNote(gourl) { | |||||
| if (!window.confirm("你确认要删除这条记录么!")) { return false; } | |||||
| location.href = gourl; | |||||
| } | |||||
| </script> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <style type="text/css"> | |||||
| .STYLE1 { | |||||
| color: #FF0000 | |||||
| } | |||||
| td { | |||||
| padding: 2px; | |||||
| padding-left: 6px; | |||||
| line-height: 150%; | |||||
| } | |||||
| .STYLE2 { | |||||
| color: #666666; | |||||
| display: none; | |||||
| } | |||||
| </style> | |||||
| </head> | |||||
| <body background='images/allbg.gif' leftmargin='8' topmargin='8'> | |||||
| <div class="bodytitle"> | |||||
| <div class="bodytitleleft"></div> | |||||
| <div class="bodytitletxt" style="padding-left:10px;">会员模型管理</div> | |||||
| </div> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" | |||||
| style="background:#CFCFCF;"> | |||||
| <form name="form1" action="member_model_edit.php" method="post" onSubmit="return CheckSubmit();"> | |||||
| <input type='hidden' name='id' value='<?php echo $id;?>'> | |||||
| <input type='hidden' name='name' value='<?php echo $row['name'];?>'> | |||||
| <input type='hidden' name='dopost' value='save'> | |||||
| <tr bgcolor="#CFCFCF"> | |||||
| <td height="28" colspan="2" bgcolor="#EDF9D5" background='images/tbg.gif' style="padding-left:10px;"><b><a | |||||
| href="member_model_main.php"><u>会员模型管理</u></a> > 修改<?php echo $row['name']?>会员模型:</b> | |||||
| (修改表名不会创建新表,如果您不懂手工处理这些表,请不要更改) </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td width="35%" height="28" align="left" bgcolor="#FFFFFF">会员模型ID:<br /> | |||||
| <span class="STYLE2" id='help1'> 数字,创建后不可更改,并具有唯一性。</span></td> | |||||
| <td width="65%" bgcolor="#FFFFFF"><?php echo $id;?> * <img src="images/help.gif" alt="帮助" width="16" height="16" | |||||
| border="0" style="cursor:hand" onclick="ShowHide2('help1')" /> | |||||
| <?php if($row['issystem']) echo "<font color='red'>系统模型,我们不建议您去修改基本配置信息!</font>";?></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#F9FCEF">模型名称:<br /> | |||||
| <span class="STYLE2" id="help3"> 会员模型类型统一使用中文,前台后台都保持一致。</span></td> | |||||
| <td bgcolor="#F8FCEF"><input name="name" type="text" id="name" value="<?php echo $row['name']?>" | |||||
| style="width:180px" class='alltxt' <?php if($row['issystem']) echo "disabled='1'";?> /> | |||||
| *<img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" | |||||
| onclick="ShowHide2('help3')" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">数据表:<br /> | |||||
| <span class="STYLE2" id="help5"> 模型表一旦创建不可修改</span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="table" type="text" id="table" style="width:180px" | |||||
| value="<?php echo $row['table']; ?>" class='alltxt' disabled='1' /> | |||||
| *<img src="images/help.gif" alt="帮助" width="16" height="16" border="0" style="cursor:hand" | |||||
| onclick="ShowHide2('help5')" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#F9FCEF">模型字段配置:<br /> | |||||
| 信息索引类字段系统已经加入,<br /> | |||||
| 您只需要增加其它个性化字段即可。</td> | |||||
| <td bgcolor="#F8FCEF"><input name="fset" type="button" id="fset" value="添加新字段" | |||||
| onClick="location.href='member_model_field_add.php?id=<?php echo $id; ?>'" class="np coolbg" | |||||
| style="margin-top:5px" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td colspan='2' bgcolor="#FFFFFF" style="padding:6px"> | |||||
| <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" style="background:#cfcfcf;"> | |||||
| <tr align="center" bgcolor="#FBFCE2" height="24"> | |||||
| <td width="12%">提示文字</td> | |||||
| <td width="12%">数据字段名</td> | |||||
| <td width="12%">数据类型</td> | |||||
| <td width="12%">前台显示</td> | |||||
| <td width="12%">条件搜索</td> | |||||
| <td width="12%">状态</td> | |||||
| <td width="12%">表单类型</td> | |||||
| <td width="16%">维护</td> | |||||
| </tr> | |||||
| <?php | |||||
| $ds = file(DedeInclude('/inc/fieldtype.txt')); | |||||
| foreach($ds as $d){ | |||||
| $dds = explode(',',trim($d)); | |||||
| $fieldtypes[$dds[0]] = $dds[1]; | |||||
| } | |||||
| $fieldset = $row['info']; | |||||
| $dtp = new DedeTagParse(); | |||||
| $dtp->SetNameSpace("field","<",">"); | |||||
| $dtp->LoadSource($fieldset); | |||||
| if(is_array($dtp->CTags)){ | |||||
| foreach($dtp->CTags as $ctag) | |||||
| { | |||||
| ?> | |||||
| <tr align="center" bgcolor="#FFFFFF" height="26" align="center" | |||||
| onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
| <td><?php | |||||
| $itname = $ctag->GetAtt('itemname'); | |||||
| if($itname=='') echo "没指定"; | |||||
| else echo $itname; | |||||
| ?></td> | |||||
| <td><?php echo $ctag->GetTagName()?></td> | |||||
| <td><?php | |||||
| $ft = $ctag->GetAtt('type'); | |||||
| if(isset($fieldtypes[$ft])) echo $fieldtypes[$ft]; | |||||
| else echo "系统专用类型"; | |||||
| ?></td> | |||||
| <td><?php | |||||
| $issearch = $ctag->GetAtt('issearch'); | |||||
| echo ($issearch == '1')? "<font color=green>√</font>" : "<font color=red>×</font>"; | |||||
| ?></td> | |||||
| <td><?php | |||||
| $isshow = $ctag->GetAtt('isshow'); | |||||
| echo ($isshow == '1')? "<font color=green>√</font>" : "<font color=red>×</font>"; | |||||
| ?></td> | |||||
| <td><?php | |||||
| $state = $ctag->GetAtt('state'); | |||||
| echo ($state == 1)? "<font color=green>√</font>" : "<font color=red>×</font>"; | |||||
| ?></td> | |||||
| <td><?php | |||||
| $ft = $ctag->GetAtt('autofield'); | |||||
| if($ft==''||$ft==0) echo "固化表单"; | |||||
| else echo "自动表单"; | |||||
| ?></td> | |||||
| <td><a | |||||
| href="member_model_field_edit.php?id=<?php echo $id;?>&fname=<?php echo $ctag->GetTagName()?>">[修改]</a> | |||||
| <a | |||||
| href="member_model_field_edit.php?id=<?php echo $id;?>&action=disabled&fname=<?php echo $ctag->GetTagName()?>">[<?php echo ($ctag->GetAtt('state')==1)? "禁用" : "启用" ?>]</a> | |||||
| <a | |||||
| href="member_model_field_edit.php?id=<?php echo $id;?>&action=delete&fname=<?php echo $ctag->GetTagName()?>">[删除]</a> | |||||
| </td> | |||||
| </tr> | |||||
| <?php | |||||
| }} | |||||
| ?> | |||||
| </table> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">模型描述:</td> | |||||
| <td bgcolor="#FFFFFF"><label> | |||||
| <textarea name="description" cols="50" rows="5" class="tbtitle" | |||||
| id="description"><?php echo $row['description']; ?></textarea> | |||||
| </label></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" align="left" bgcolor="#FFFFFF">会员模型状态:</td> | |||||
| <td bgcolor="#FFFFFF"><input name="state" type="radio" class='np' value="1" | |||||
| <?php if($row['state']=='1') echo " checked='1' "; ?> /> | |||||
| 启用 | |||||
| <input name="state" type="radio" value="0" class='np' <?php if($row['state']=='0') echo " checked='1' "; ?> /> | |||||
| 禁用</td> | |||||
| </tr> | |||||
| <tr bgcolor="#F9FCEF"> | |||||
| <td height="28" colspan="2"> | |||||
| <table width="100%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="26%" height="45"> </td> | |||||
| <td width="15%"><input type="submit" name="button" id="button" value="确定" class='np coolbg' /></td> | |||||
| <td width="59%"><input name="按钮" type="button" class='np coolbg' id="button2" | |||||
| onclick="location='diy_main.php';" value="返回" /></td> | |||||
| </tr> | |||||
| </table> | |||||
| </td> | |||||
| </tr> | |||||
| </form> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @@ -1,214 +0,0 @@ | |||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>增加字段</title> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <script language="javascript"> | |||||
| var notAllow = " <?php echo $f; ?> "; | |||||
| function GetFields() | |||||
| { | |||||
| var theform = document.form1; | |||||
| var fieldname = theform.fieldname.value; | |||||
| var itemname = theform.itemname.value; | |||||
| var dtype = 'text'; | |||||
| var enums = document.getElementsByName('dtype'); | |||||
| for(i=0;i<enums.length;i++) | |||||
| { | |||||
| if(enums[i].checked) dtype = enums[i].value; | |||||
| } | |||||
| var isnull = theform.isnull.value; | |||||
| var vdefault = theform.vdefault.value; | |||||
| var maxlength = theform.maxlength.value; | |||||
| var vinnertext = theform.vinnertext.value; | |||||
| var issearch = (theform.issearch[0].checked ? theform.issearch[0].value : theform.issearch[1].value); | |||||
| var isshow = (theform.isshow[0].checked ? theform.isshow[0].value : theform.isshow[1].value); | |||||
| var state = (theform.state[0].checked ? theform.state[0].value : theform.state[1].value); | |||||
| var sisnull = (isnull==0 ? "false" : "true"); | |||||
| if(itemname=="") | |||||
| { | |||||
| alert("表单提示名称不能为空!"); | |||||
| theform.itemname.focus(); | |||||
| return false; | |||||
| } | |||||
| if(fieldname=="") | |||||
| { | |||||
| alert("字段名称不能为空!"); | |||||
| theform.fieldname.focus(); | |||||
| return false; | |||||
| } | |||||
| if(notAllow.indexOf(" "+fieldname+" ") >-1 ) | |||||
| { | |||||
| alert("字段名称不合法,如下字段名已经存在,建议在名称后加上数字以区分:\n"+notAllow); | |||||
| return false; | |||||
| } | |||||
| if((dtype=="radio" || dtype=="select" || dtype=="checkbox") && vdefault=="") | |||||
| { | |||||
| alert("你选择的select或radio、checkbox类型,必须默认值设置选择的项目(用逗号[,]分开)!"); | |||||
| return false; | |||||
| } | |||||
| revalue = "<field:"+fieldname+" itemname=\""+itemname+"\" autofield=\"1\" type=\""+dtype+"\" isnull=\""+sisnull+"\""; | |||||
| revalue += " default=\""+vdefault+"\" "; | |||||
| revalue += " maxlength=\""+maxlength+"\" issearch=\""+issearch+"\" isshow=\""+isshow+"\" state=\""+state+"\">\r\n"+vinnertext+"</field:"+fieldname+">\r\n"; | |||||
| document.form1.fieldstring.value = revalue; | |||||
| return true; | |||||
| } | |||||
| </script> | |||||
| <style type="text/css"> | |||||
| <!-- | |||||
| td { | |||||
| padding:2px; | |||||
| padding-left:6px; | |||||
| line-height:150%; | |||||
| } | |||||
| .STYLE1 { | |||||
| color: #FF3300 | |||||
| } | |||||
| .STYLE2 { | |||||
| color: #666666 | |||||
| } | |||||
| .nw { | |||||
| float:left; | |||||
| width:150px; | |||||
| } | |||||
| .cls { | |||||
| clear:both; | |||||
| } | |||||
| --> | |||||
| </style> | |||||
| </head> | |||||
| <body background='images/allbg.gif' leftmargin='8' topmargin='8'> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#CFCFCF;"> | |||||
| <form name="form1" action="member_model_field_add.php" method="post" onSubmit="return GetFields();"> | |||||
| <input type='hidden' name='action' value='save'> | |||||
| <input type='hidden' name='id' value='<?php echo $id?>'> | |||||
| <input type='hidden' name='fieldstring' value=''> | |||||
| <tr> | |||||
| <td height="20" colspan="2" bgcolor="#EDF9D5" background="images/tbg.gif"><table width="98%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="30%"> <b><a href="member_model_main.php">会员模型管理</a> >> 增加新字段:</b></td> | |||||
| <td align="right" style="padding-top:6px;"><input type="button" name="ss1" value="当前会员模型" onClick="location='member_model_edit.php?id=<?php echo $id; ?>&dopost=edit';" class="nbt"/></td> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td colspan="2" bgcolor="#FFFFFF"><span class="STYLE1">所有填写的内容不允许包含双引号[<strong>"</strong>],否则配置将无法写入。</span></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>提示文字:</strong><br> | |||||
| <span class="STYLE2">注册修改时显示的提示文字</span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="itemname" type="text" id="itemname" class="pubinputs" /> | |||||
| *</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td width="28%" bgcolor="#FFFFFF"><strong>字段名称:</strong><br> | |||||
| <span class="STYLE2"> 只能用英文字母或数字,数据表的真实字段名,如果数据类型是联动类型,该项应该填写联动类型的<a href='stepselect_main.php' target='_blank'><u>[组名称]</u></a>。 </span></td> | |||||
| <td width="72%" bgcolor="#FFFFFF"><input name="fieldname" type="text" id="fieldname" class="pubinputs" /> | |||||
| * </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>数据类型:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype1' value="text" checked='1'> | |||||
| 单行文本(varchar)</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype2' value="textchar"> | |||||
| 单行文本(char)</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype3' value="multitext"> | |||||
| 多行文本</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype4' value="htmltext"> | |||||
| HTML文本</div> | |||||
| <br class='cls' /> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype6' value="int"> | |||||
| 整数类型</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype7' value="float"> | |||||
| 小数类型</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype8' value="datetime"> | |||||
| 时间类型</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype13' value="select"> | |||||
| 使用option下拉框</div> | |||||
| <br class='cls' /> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype14' value="radio"> | |||||
| 使用radio选项卡</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype15' value="checkbox"> | |||||
| Checkbox多选框</div> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype9' value="img"> | |||||
| 图片</div> | |||||
| <!--div class='nw'><input type='radio' class='np' name='dtype' id='dtype10' value="imgfile">图片(仅网址)</div--> | |||||
| <!--div class='nw'><input type='radio' class='np' name='dtype' id='dtype11' value="media">多媒体文件</div--> | |||||
| <div class='nw'> | |||||
| <input type='radio' class='np' name='dtype' id='dtype12' value="addon"> | |||||
| 附件类型</div> | |||||
| <!--div class='nw'><input type='radio' class='np' name='dtype' id='dtype16' value="stepselect">联动类型</div--></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>默认值:</strong><br> | |||||
| <span class="STYLE2"> 如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(用“,”分开,如“男,女,人妖”)。 </span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="isnull" type="hidden" value="1" /><textarea name="vdefault" type="text" id="vdefault" style="width:70%;height:60px"></textarea></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>最大长度:</strong><br> | |||||
| <span class="STYLE2"> 文本数据必须填写,大于255为text类型 </span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="maxlength" type="text" id="maxlength" class="pubinputs" value="250" style="width:80px;" /></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>会员模型表单HTML:</strong></td> | |||||
| <td bgcolor="#FFFFFF"> ◆自定义表单HTML模板中用~name~表示提示文字,~form~表示表单元素。 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td align="center" bgcolor="#FFFFFF"></td> | |||||
| <td bgcolor="#FFFFFF"><textarea name="vinnertext" cols="45" rows="5" id="vinnertext" style="width:70%; height:120px;"></textarea></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>作为搜索条件:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="issearch" type="radio" class='np' value="1" /> | |||||
| 是 | |||||
| <input name="issearch" type="radio" class='np' value="0" checked /> | |||||
| 否 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>是否在前台会员相关页面中显示:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="isshow" type="radio" class='np' value="1" /> | |||||
| 是 | |||||
| <input name="isshow" type="radio" class='np' value="0" checked /> | |||||
| 否 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>字段状态:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="state" type="radio" class='np' value="1" checked /> | |||||
| 启用 | |||||
| <input name="state" type="radio" value="0" class='np' /> | |||||
| 禁用 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" colspan="2" bgcolor="#F9FDF0"><table width="100%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="26%" height="45"> </td> | |||||
| <td width="10%"><input type="submit" name="button1" id="button1" value="确定" class="coolbg np" /></td> | |||||
| <td><input type="reset" name="button2" id="button2" value="重置" class="coolbg np" /></td> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| </form> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @@ -1,185 +0,0 @@ | |||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>更改字段</title> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <script language="javascript"> | |||||
| function GetFields() | |||||
| { | |||||
| var theform = document.form1; | |||||
| var itemname = theform.itemname.value; | |||||
| var fieldname = theform.fname.value; | |||||
| var dtype = theform.dtype.value; | |||||
| var vdefault = theform.vdefault.value; | |||||
| var maxlength = theform.maxlength.value; | |||||
| var vinnertext = theform.vinnertext.value; | |||||
| var issearch = (theform.issearch[0].checked ? theform.issearch[0].value : theform.issearch[1].value); | |||||
| var isshow = (theform.isshow[0].checked ? theform.isshow[0].value : theform.isshow[1].value); | |||||
| var state = (theform.state[0].checked ? theform.state[0].value : theform.state[1].value); | |||||
| if(itemname=="") | |||||
| { | |||||
| alert("表单提示名称不能为空!"); | |||||
| theform.itemname.focus(); | |||||
| return false; | |||||
| } | |||||
| if((dtype=="radio"||dtype=="select"||dtype=="checkbox") && vdefault=="") | |||||
| { | |||||
| alert("你选择的select或radio、checkbox类型,必须默认值设置选择的项目(用逗号[,]分开)!"); | |||||
| return false; | |||||
| } | |||||
| revalue = "<field:"+fieldname+" itemname=\""+itemname+"\" autofield=\"1\" type=\""+dtype+"\""; | |||||
| revalue += " default=\""+vdefault+"\" "; | |||||
| revalue += " maxlength=\""+maxlength+"\" issearch=\""+issearch+"\" isshow=\""+isshow+"\" state=\""+state+"\">\r\n"+vinnertext+"</field:"+fieldname+">\r\n"; | |||||
| document.form1.fieldstring.value = revalue; | |||||
| return true; | |||||
| } | |||||
| </script> | |||||
| <style type="text/css"> | |||||
| <!-- | |||||
| td { | |||||
| padding:2px; | |||||
| padding-left:6px; | |||||
| } | |||||
| .STYLE1 { | |||||
| color: #FF3300 | |||||
| } | |||||
| .STYLE2 { | |||||
| color: #666666 | |||||
| } | |||||
| .nw { | |||||
| float:left; | |||||
| width:150px; | |||||
| } | |||||
| .cls { | |||||
| clear:both; | |||||
| } | |||||
| --> | |||||
| </style> | |||||
| </head> | |||||
| <body topmargin=8> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#CFCFCF;"> | |||||
| <form name="form1" action="member_model_field_edit.php" method="post" onSubmit="return GetFields();"> | |||||
| <input type='hidden' name='action' value='save'> | |||||
| <input type='hidden' name='id' value='<?php echo $id?>'> | |||||
| <input type='hidden' name='fname' value='<?php echo $fname?>'> | |||||
| <input type='hidden' name='fieldstring' value=''> | |||||
| <tr> | |||||
| <td height="20" colspan="2" bgcolor="#EDF9D5" background="images/tbg.gif"><table width="98%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="30%"> <b><a href="member_model_main.php">会员模型管理</a> >> 修改字段:</b></td> | |||||
| <td align="right" style="padding-top:6px;"><input type="button" name="ss1" value="当前会员模型" onClick="location='member_model_edit.php?id=<?php echo $id; ?>&dopost=edit';" class="nbt"/></td> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>会员模型管理:</strong><br> | |||||
| <span class="STYLE2">字段提示文字提示文字</span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="itemname" type="text" id="itemname" value="<?php echo $ctag->GetAtt('itemname')?>" class="pubinputs"> | |||||
| *(发布内容时显示的项名字) </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td width="28%" bgcolor="#FFFFFF"><strong>字段名称:</strong><br> | |||||
| <span class="STYLE2">只能用英文字母或数字,数据表的真实字段名</span></td> | |||||
| <td width="72%" bgcolor="#FFFFFF" style="table-layout:fixed;word-break:break-all"><?php echo $fname?></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>数据类型:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><select name="dtype" id="type" style="width:200px"> | |||||
| <?php | |||||
| $dtype = $ctag->GetAtt('type'); | |||||
| if($dtype!='' && isset($fieldtypes[$dtype])) | |||||
| { | |||||
| echo " <option value='{$dtype}'>{$fieldtypes[$dtype]}</option>\r\n"; | |||||
| $canchange = true; | |||||
| } | |||||
| else | |||||
| { | |||||
| echo " <option value='{$dtype}'>系统专用类型</option>\r\n"; | |||||
| $canchange = false; | |||||
| } | |||||
| if($canchange) | |||||
| { | |||||
| ?> | |||||
| <option value="text">单行文本(varchar)</option> | |||||
| <option value="textchar">单行文本(char)</option> | |||||
| <option value="multitext">多行文本</option> | |||||
| <option value="htmltext">HTML文本</option> | |||||
| <option value="int">整数类型</option> | |||||
| <option value="float">小数类型</option> | |||||
| <option value="datetime">时间类型</option> | |||||
| <option value="img">图片</option> | |||||
| <option value="addon">附件类型</option> | |||||
| <option value="select">使用option下拉框</option> | |||||
| <option value="radio">使用radio选项卡</option> | |||||
| <option value="checkbox">Checkbox多选框</option> | |||||
| <?php | |||||
| } | |||||
| ?> | |||||
| </select> | |||||
| <!-- | |||||
| //取消的类型 | |||||
| option value="textdata">文本保存HTML数据</option> | |||||
| <option value="imgfile">图片(仅网址)</option> | |||||
| <option value="media">多媒体文件</option> | |||||
| <option value="stepselect">联动类型</option--></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>默认值:</strong><br> | |||||
| <span class="STYLE2"> 如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(用“,”分开,如“男,女,人妖”),如果为联动选框,这里填写联动选框项目名称。</span></td> | |||||
| <td bgcolor="#FFFFFF"><textarea name="vdefault" type="text" id="vdefault" style="width:70%;height:60px"><?php echo $ctag->GetAtt('default'); ?></textarea></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>最大长度:</strong><br> | |||||
| <span class="STYLE2"> 文本数据必须填写,大于255为text类型 </span></td> | |||||
| <td bgcolor="#FFFFFF"><input name="maxlength" type="text" id="maxlength" value="<?php echo $ctag->GetAtt('maxlength')?>" style="width:80px;height:24px;padding-top:3px;"></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>会员模型表单HTML:</strong></td> | |||||
| <td bgcolor="#FFFFFF"> ◆自定义表单HTML用~name~表示提示文字,~form~表示表单元素<br></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td align="center" bgcolor="#FFFFFF"><br></td> | |||||
| <td bgcolor="#FFFFFF"><textarea name="vinnertext" cols="45" rows="5" id="vinnertext" style="width:70%; height:120px;"><?php echo $ctag->GetInnerText(); ?></textarea></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>作为搜索条件:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="issearch" type="radio" value="1"<?php if($ctag->GetAtt('issearch')=='1') echo " checked='1' "; ?> class='np' /> | |||||
| 是 | |||||
| <input name="issearch" type="radio" value="0"<?php if($ctag->GetAtt('issearch')=='0') echo " checked='1' "; ?> class='np' /> | |||||
| 否 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>是否在前台会员相关页面中显示:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="isshow" type="radio" value="1"<?php if($ctag->GetAtt('isshow')=='1') echo " checked='1' "; ?> class='np' /> | |||||
| 是 | |||||
| <input name="isshow" type="radio" value="0"<?php if($ctag->GetAtt('isshow')=='0') echo " checked='1' "; ?> class='np' /> | |||||
| 否 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td bgcolor="#FFFFFF"><strong>字段状态:</strong></td> | |||||
| <td bgcolor="#FFFFFF"><input name="state" type="radio" value="1"<?php if($ctag->GetAtt('state')=='1') echo " checked='1' "; ?> class='np' /> | |||||
| 启用 | |||||
| <input name="state" type="radio" value="0"<?php if($ctag->GetAtt('state')=='0') echo " checked='1' "; ?> class='np' /> | |||||
| 禁用 </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="28" colspan="2" bgcolor="#F9FDF0"><table width="100%" border="0" cellspacing="0" cellpadding="0"> | |||||
| <tr> | |||||
| <td width="26%" height="45"> </td> | |||||
| <td width="10%"><input type="submit" name="button1" id="button1" value="确定" class="coolbg np" /></td> | |||||
| <td><input type="reset" name="button3" id="button3" value="重置" class="coolbg np" /></td> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| </form> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @@ -1,50 +0,0 @@ | |||||
| {dede:page pagesize="50"/} | |||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | |||||
| <head> | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>会员模型管理</title> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| </head> | |||||
| <body background="images/allbg.gif" leftmargin="8" topmargin="8"> | |||||
| <div class="bodytitle"> | |||||
| <div class="bodytitleleft"></div> | |||||
| <div class="bodytitletxt" style="padding-left:10px;">会员模型管理</div> | |||||
| </div> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="border:1px solid #CFCFCF;border-bottom:none;"> | |||||
| <tr> | |||||
| <td bgcolor="#EDF9D5" class="tbtitletxt" background="images/tbg.gif"><table width='96%' border="0" cellpadding='0' cellspacing='0'> | |||||
| <tr> | |||||
| <td width='30%' class="tbtitletxt" style="padding-left:10px;">[<a href="member_model_add.php"><u>增加会员模型</u></a>]</td> | |||||
| <td align='right'> [图片说明:暂无] </td> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| </table> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class='tbtitle' style='background:#CFCFCF;margin-bottom:5px;'> | |||||
| <tr align="center" bgcolor="#FBFCE2"> | |||||
| <td>ID号</td> | |||||
| <td>模型名称</td> | |||||
| <td>表名</td> | |||||
| <td>会员数</td> | |||||
| <td>启用状态</td> | |||||
| <td>管理</td> | |||||
| </tr> | |||||
| {dede:datalist} | |||||
| <tr align="center" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
| <td>{dede:field.id/}</td> | |||||
| <td><a href="member_main.php?mtype={dede:field.name/}" title="{dede:field.description/}"><u>{dede:field.name/}</u></a>{dede:if field.issystem==1 }<font color=red>[*]</font>{/dede:if}</td> | |||||
| <td>{dede:field.table/}</td> | |||||
| <td>{dede:field.table function='GetTotalMember(@me)'/}</td> | |||||
| <td> {dede:if field.state==0 } <font color=red>[×]Off</font> {else} <font color=green>[√]On</font> {/dede:if} </td> | |||||
| <td><a href='member_model_edit.php?id={dede:field.id/}&dopost=edit'>编辑</a> | <a href='member_model_edit.php?id={dede:field.id/}&dopost=copy'>复制</a> | <a href='member_model_edit.php?id={dede:field.id/}&dopost=disabled'>{dede:if field.state==0 }启用{else}禁用{/dede:if}</a> | <a href='member_model_edit.php?id={dede:field.id/}&dopost=delete'>删除</a></td> | |||||
| </tr> | |||||
| {/dede:datalist} | |||||
| </table> | |||||
| <table width="98%" border="0" cellpadding="5" cellspacing="1" align="center" style=" border:1px solid #CFCFCF;line-height:31px;margin:auto;"> | |||||
| <tr> | |||||
| <td height="35" align="center" style="background:#F9FCEF;padding:7px 6px 6px 10px;" >{dede:pagelist listsize=6/}</td> | |||||
| </tr> | |||||
| </table> | |||||
| </body> | |||||
| </html> | |||||
| @@ -234,14 +234,6 @@ | |||||
| echo "<a href='javascript:AddTypeid2();'>【<u>选择副栏目</u>】</a>"; | echo "<a href='javascript:AddTypeid2();'>【<u>选择副栏目</u>】</a>"; | ||||
| } | } | ||||
| ?> | ?> | ||||
| <?php | |||||
| if($cfg_remote_site=='Y') | |||||
| { | |||||
| ?> | |||||
| <input name="isremote" type="checkbox" id="isremote" value="1" | |||||
| <?php if($cfg_title_site=='Y') echo "checked";?>>是否同步远程发布 <?php GetFtp();?> <?php | |||||
| } | |||||
| ?> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -218,14 +218,6 @@ | |||||
| <img src='images/menusearch.gif' style='cursor:pointer' | <img src='images/menusearch.gif' style='cursor:pointer' | ||||
| onClick="ShowCatMap(event, this, <?php echo $channelid; ?>, 'typeid', '<?php echo $arcRow['typeid']; ?>')" | onClick="ShowCatMap(event, this, <?php echo $channelid; ?>, 'typeid', '<?php echo $arcRow['typeid']; ?>')" | ||||
| alt='快捷选择' title='快捷选择' /> | alt='快捷选择' title='快捷选择' /> | ||||
| <?php | |||||
| if($cfg_remote_site=='Y') | |||||
| { | |||||
| ?> | |||||
| <input name="isremote" type="checkbox" id="isremote" value="1" | |||||
| <?php if($cfg_title_site=='Y') echo "checked";?>>是否同步远程发布 <?php GetFtp();?> <?php | |||||
| } | |||||
| ?> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -209,16 +209,7 @@ function CheckVal(id){ | |||||
| echo "</select>"; | echo "</select>"; | ||||
| ?> | ?> | ||||
| <img src='images/menusearch.gif' style='cursor:pointer;' onClick="ShowCatMap(event, this, 0, 'typeid')" alt='快捷选择' title='快捷选择' /> | <img src='images/menusearch.gif' style='cursor:pointer;' onClick="ShowCatMap(event, this, 0, 'typeid')" alt='快捷选择' title='快捷选择' /> | ||||
| <?php | |||||
| if($cfg_remote_site=='Y') | |||||
| { | |||||
| ?> | |||||
| <input name="isremote" type="checkbox" id="isremote" value="1" <?php if($cfg_title_site=='Y') echo "checked";?>> | |||||
| 是否同步远程发布 | |||||
| <?php GetFtp();?> | |||||
| <?php | |||||
| } | |||||
| ?></td> | |||||
| </td> | |||||
| </tr> | </tr> | ||||
| </table></td> | </table></td> | ||||
| </tr> | </tr> | ||||
| @@ -280,14 +280,7 @@ | |||||
| ?> | ?> | ||||
| <img src='images/menusearch.gif' style='cursor:pointer;' onClick="ShowCatMap(event, this, 0, 'typeid')" | <img src='images/menusearch.gif' style='cursor:pointer;' onClick="ShowCatMap(event, this, 0, 'typeid')" | ||||
| alt='快捷选择' title='快捷选择' /> | alt='快捷选择' title='快捷选择' /> | ||||
| <?php | |||||
| if($cfg_remote_site=='Y') | |||||
| { | |||||
| ?> | |||||
| <input name="isremote" type="checkbox" id="isremote" value="1" | |||||
| <?php if($cfg_title_site=='Y') echo "checked";?>>是否同步远程发布 <?php GetFtp();?> <?php | |||||
| } | |||||
| ?> </td> | |||||
| </td> | |||||
| <td width="100" align="center"> </td> | <td width="100" align="center"> </td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -350,7 +350,7 @@ class Archives | |||||
| */ | */ | ||||
| function MakeHtml($isremote=0) | function MakeHtml($isremote=0) | ||||
| { | { | ||||
| global $cfg_remote_site,$fileFirst,$baidu_seo,$cfg_basehost; | |||||
| global $fileFirst,$baidu_seo,$cfg_basehost; | |||||
| if($this->IsError) | if($this->IsError) | ||||
| { | { | ||||
| @@ -425,18 +425,6 @@ class Archives | |||||
| $seoUrls = array_merge($seoUrls, array($cfg_basehost.$URLFilename)); | $seoUrls = array_merge($seoUrls, array($cfg_basehost.$URLFilename)); | ||||
| $this->ParseDMFields($i,1); | $this->ParseDMFields($i,1); | ||||
| $this->dtp->SaveTo($TRUEfilename); | $this->dtp->SaveTo($TRUEfilename); | ||||
| //如果启用远程发布则需要进行判断 | |||||
| if($cfg_remote_site=='Y' && $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '', $TRUEfilename); | |||||
| $localfile = '..'.$remotefile; | |||||
| //创建远程文件夹 | |||||
| $remotedir = preg_replace("#[^\/]*\.html#", '', $remotefile); | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'ascii'); | |||||
| } | |||||
| } | } | ||||
| if ($baidu_seo == true) { | if ($baidu_seo == true) { | ||||
| @@ -279,7 +279,6 @@ class ListView | |||||
| */ | */ | ||||
| function MakeHtml($startpage=1, $makepagesize=0, $isremote=0) | function MakeHtml($startpage=1, $makepagesize=0, $isremote=0) | ||||
| { | { | ||||
| global $cfg_remote_site; | |||||
| if(empty($startpage)) | if(empty($startpage)) | ||||
| { | { | ||||
| $startpage = 1; | $startpage = 1; | ||||
| @@ -339,17 +338,6 @@ class ListView | |||||
| $makeFile = preg_replace("/\/{1,}/", "/", $makeFile); | $makeFile = preg_replace("/\/{1,}/", "/", $makeFile); | ||||
| $murl = $this->GetTrueUrl($murl); | $murl = $this->GetTrueUrl($murl); | ||||
| $this->dtp->SaveTo($makeFile); | $this->dtp->SaveTo($makeFile); | ||||
| //如果启用远程发布则需要进行判断 | |||||
| if($cfg_remote_site=='Y'&& $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '',$makeFile); | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| } | } | ||||
| if($startpage==1) | if($startpage==1) | ||||
| { | { | ||||
| @@ -361,17 +349,6 @@ class ListView | |||||
| $onlyrule = str_replace("{page}","1",$onlyrule); | $onlyrule = str_replace("{page}","1",$onlyrule); | ||||
| $list_1 = $this->GetTruePath().$onlyrule; | $list_1 = $this->GetTruePath().$onlyrule; | ||||
| $murl = MfTypedir($this->Fields['typedir']).'/'.$this->Fields['defaultname']; | $murl = MfTypedir($this->Fields['typedir']).'/'.$this->Fields['defaultname']; | ||||
| //如果启用远程发布则需要进行判断 | |||||
| if($cfg_remote_site=='Y'&& $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = $murl; | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| $indexname = $this->GetTruePath().$murl; | $indexname = $this->GetTruePath().$murl; | ||||
| copy($list_1,$indexname); | copy($list_1,$indexname); | ||||
| } | } | ||||
| @@ -462,34 +439,12 @@ class ListView | |||||
| if($nmfa==0) | if($nmfa==0) | ||||
| { | { | ||||
| $this->PartView->SaveToHtml($makeFile); | $this->PartView->SaveToHtml($makeFile); | ||||
| //如果启用远程发布则需要进行判断 | |||||
| if($GLOBALS['cfg_remote_site']=='Y'&& $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '',$makeFile); | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if(!file_exists($makeFile)) | if(!file_exists($makeFile)) | ||||
| { | { | ||||
| $this->PartView->SaveToHtml($makeFile); | $this->PartView->SaveToHtml($makeFile); | ||||
| //如果启用远程发布则需要进行判断 | |||||
| if($cfg_remote_site=='Y'&& $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '',$makeFile); | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| return $this->GetTrueUrl($makeUrl); | return $this->GetTrueUrl($makeUrl); | ||||
| @@ -181,18 +181,6 @@ class PartView | |||||
| */ | */ | ||||
| function SaveToHtml($filename,$isremote=0) | function SaveToHtml($filename,$isremote=0) | ||||
| { | { | ||||
| global $cfg_remote_site; | |||||
| //如果启用远程发布则需要进行判断 | |||||
| if($cfg_remote_site=='Y' && $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '', $filename); | |||||
| $localfile = '..'.$remotefile; | |||||
| //创建远程文件夹 | |||||
| $remotedir = preg_replace('/[^\/]*\.js/', '', $remotefile); | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'ascii'); | |||||
| } | |||||
| $this->dtp->SaveTo($filename); | $this->dtp->SaveTo($filename); | ||||
| } | } | ||||
| @@ -97,21 +97,9 @@ class RssView | |||||
| */ | */ | ||||
| function MakeRss($isremote=0) | function MakeRss($isremote=0) | ||||
| { | { | ||||
| global $cfg_remote_site; | |||||
| $murl = $GLOBALS['cfg_cmspath']."/data/rss/".$this->TypeID.".xml"; | $murl = $GLOBALS['cfg_cmspath']."/data/rss/".$this->TypeID.".xml"; | ||||
| $mfile = $GLOBALS['cfg_basedir'].$murl; | $mfile = $GLOBALS['cfg_basedir'].$murl; | ||||
| $this->dtp->SaveTo($mfile); | $this->dtp->SaveTo($mfile); | ||||
| //如果启用远程站点则上传 | |||||
| if($cfg_remote_site=='Y' && $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = $murl; | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.xml/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| return $murl; | return $murl; | ||||
| } | } | ||||
| @@ -221,7 +221,6 @@ class SpecView | |||||
| */ | */ | ||||
| function MakeHtml($isremote=0) | function MakeHtml($isremote=0) | ||||
| { | { | ||||
| global $cfg_remote_site; | |||||
| //初步给固定值的标记赋值 | //初步给固定值的标记赋值 | ||||
| $this->ParseTempletsFirst(); | $this->ParseTempletsFirst(); | ||||
| $totalpage = ceil($this->TotalResult / $this->PageSize); | $totalpage = ceil($this->TotalResult / $this->PageSize); | ||||
| @@ -275,17 +274,6 @@ class SpecView | |||||
| $murl = $makeFile; | $murl = $makeFile; | ||||
| $makeFile = $GLOBALS['cfg_basedir'].$makeFile; | $makeFile = $GLOBALS['cfg_basedir'].$makeFile; | ||||
| $this->dtp->SaveTo($makeFile); | $this->dtp->SaveTo($makeFile); | ||||
| //如果启用远程站点则上传 | |||||
| if($cfg_remote_site=='Y'&& $isremote == 1) | |||||
| { | |||||
| //分析远程文件路径 | |||||
| $remotefile = str_replace(DEDEROOT, '', $makeFile); | |||||
| $localfile = '..'.$remotefile; | |||||
| $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile); | |||||
| //不相等则说明已经切换目录则可以创建镜像 | |||||
| $this->ftp->rmkdir($remotedir); | |||||
| $this->ftp->upload($localfile, $remotefile, 'acii'); | |||||
| } | |||||
| echo "成功创建:$murl<br/>"; | echo "成功创建:$murl<br/>"; | ||||
| } | } | ||||
| copy($GLOBALS['cfg_basedir'].$GLOBALS['cfg_special']."/spec_1".$GLOBALS['art_shortname'],$GLOBALS['cfg_basedir'].$GLOBALS['cfg_special']."/index.html"); | copy($GLOBALS['cfg_basedir'].$GLOBALS['cfg_special']."/spec_1".$GLOBALS['art_shortname'],$GLOBALS['cfg_basedir'].$GLOBALS['cfg_special']."/index.html"); | ||||
| @@ -1,183 +0,0 @@ | |||||
| <?php if (!defined('DEDEINC')) exit('forbidden'); | |||||
| /** | |||||
| * 会员自定义模块 | |||||
| * | |||||
| * @version $Id: oxwindow.class.php 1 15:21 2010年7月5日Z tianya $ | |||||
| * @package DedeCMS.Libraries | |||||
| * @copyright Copyright (c) 2007 - 2020, DesDev, Inc. | |||||
| * @license http://help.dedecms.com/usersguide/license.html | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| require_once DEDEINC . '/dedetag.class.php'; | |||||
| require_once DEDEINC . '/customfields.func.php'; | |||||
| require_once DEDEINC . '/enums.func.php'; | |||||
| /** | |||||
| * 会员自定义模块 | |||||
| * | |||||
| * @package membermodel | |||||
| * @subpackage DedeCMS.Libraries | |||||
| * @link http://www.dedecms.com | |||||
| */ | |||||
| class membermodel | |||||
| { | |||||
| var $modid; | |||||
| var $db; | |||||
| var $info; | |||||
| var $name; | |||||
| var $table; | |||||
| var $public; | |||||
| var $egroups; | |||||
| var $listTemplate; | |||||
| var $viewTemplate; | |||||
| var $postTemplate; | |||||
| //兼容PHP4版本 | |||||
| function membermodel($modtype) | |||||
| { | |||||
| $this->__construct($modtype); | |||||
| } | |||||
| //析构函数 | |||||
| function __construct($modtype) | |||||
| { | |||||
| $this->name = $modtype; | |||||
| $this->db = $GLOBALS['dsql']; | |||||
| $query = "SELECT * FROM #@__member_model WHERE name='{$modtype}'"; | |||||
| $diyinfo = $this->db->getone($query); | |||||
| if (!is_array($diyinfo)) { | |||||
| showMsg('参数不正确,该会员模型不存在', 'javascript:;'); | |||||
| exit(); | |||||
| } | |||||
| $etypes = array(); | |||||
| $egroups = array(); | |||||
| $this->db->Execute('me', 'SELECT * FROM `#@__stepselect` ORDER BY id desc'); | |||||
| while ($arr = $this->db->GetArray()) { | |||||
| $etypes[] = $arr; | |||||
| $egroups[$arr['egroup']] = $arr['itemname']; | |||||
| } | |||||
| $this->egroups = $egroups; | |||||
| $this->modid = $diyinfo['id']; | |||||
| $this->table = $diyinfo['table']; | |||||
| $this->description = $diyinfo['description']; | |||||
| $this->state = $diyinfo['state']; | |||||
| $this->issystem = $diyinfo['issystem']; | |||||
| $this->info = $diyinfo['info']; | |||||
| } //end func __construct() | |||||
| /** | |||||
| * 获取用户数据表单 | |||||
| * | |||||
| * @access public | |||||
| * @param string $type 表单类型 | |||||
| * @param string $value 值 | |||||
| * @param string $admintype 模型类型 | |||||
| * @return string | |||||
| */ | |||||
| function getForm($type = 'post', $value = '', $admintype = 'membermodel2') | |||||
| { | |||||
| global $cfg_cookie_encode; | |||||
| $dtp = new DedeTagParse(); | |||||
| $dtp->SetNameSpace("field", "<", ">"); | |||||
| $dtp->LoadSource($this->info); | |||||
| $formstring = ''; | |||||
| $formfields = ''; | |||||
| $func = $type == 'post' ? 'GetFormItem' : 'GetFormItemValue'; | |||||
| if (is_array($dtp->CTags)) { | |||||
| foreach ($dtp->CTags as $tagid => $tag) { | |||||
| if ($tag->GetAtt('autofield')) { | |||||
| if ($tag->GetAtt('state') == 1) { | |||||
| //如果启用该字段 | |||||
| if ($type == 'post') { | |||||
| //对一些字段进行特殊处理 | |||||
| if ($tag->GetName() == 'onlynet') { | |||||
| $formstring .= '<li><span>联系方式限制:</span><div class="lform"> | |||||
| <input name="onlynet" type="radio" id="onlynet" value="2" checked="checked" /> | |||||
| 不公开所有联系方式 | |||||
| <input name="onlynet" type="radio" id="onlynet" value="1" /> | |||||
| 不公开电话、详细地址 | |||||
| <input name="onlynet" type="radio" id="onlynet" value="0" /> | |||||
| 公开所有联系方式</div></li>'; | |||||
| } else if ($tag->GetName() == 'place' || $tag->GetName() == 'oldplace') { | |||||
| $formtitle = ($tag->GetName() == 'place') ? '目前所在地' : '家乡所在地'; | |||||
| $formstring .= '<li><div class="lform">' . GetEnumsForm( | |||||
| 'nativeplace', | |||||
| 0, | |||||
| $tag->GetName() | |||||
| ) . '</div><span>' . $formtitle . ':</span></li>'; | |||||
| } else if (array_key_exists($tag->GetName(), $this->egroups)) { | |||||
| //对联动模型进行特殊处理 | |||||
| $formstring .= '<li><div class="lform">' . GetEnumsForm( | |||||
| $tag->GetName(), | |||||
| 0, | |||||
| $tag->GetName() | |||||
| ) . '</div><span>' . $this->egroups[$tag->GetName()] . ':</span></li>'; | |||||
| } else if ($tag->GetAtt('type') == 'checkbox') { | |||||
| //对checkbox模型进行特殊处理 | |||||
| $formstring .= $func($tag, $admintype); | |||||
| } else { | |||||
| $formstring .= $func($tag, $admintype); | |||||
| } | |||||
| } else { | |||||
| if ($tag->GetName() == 'onlynet') { | |||||
| $formstring .= '<p style="display:none"><label>联系方式限制:</label> | |||||
| <input name="onlynet" type="radio" id="onlynet" value="2" checked="checked" /> | |||||
| 不公开所有联系方式 | |||||
| <input name="onlynet" type="radio" id="onlynet" value="1" /> | |||||
| 不公开电话、详细地址 | |||||
| <input name="onlynet" type="radio" id="onlynet" value="0" /> | |||||
| 公开所有联系方式</p>'; | |||||
| } else if ($tag->GetName() == 'place' || $tag->GetName() == 'oldplace') { | |||||
| $formtitle = ($tag->GetName() == 'place') ? '目前所在地' : '家乡所在地'; | |||||
| $formstring .= '<div class="form-group row"><label class="col-sm-2 col-form-label">' . $formtitle . ':</label><div class="col-sm-10">' . GetEnumsForm('nativeplace', $value[$tag->GetName()], $tag->GetName()) . '</div></div>'; | |||||
| } else if ($tag->GetName() == 'birthday') { | |||||
| $formstring .= '<div class="form-group row"><label class="col-sm-2 col-form-label">' . $tag->GetAtt('itemname') . ':</label><div class="col-sm-10"><input type="text" class="form-control" style="width: 100px;" id="birthday" value="' . $value[$tag->GetName()] . '" name="birthday"></div></div>'; | |||||
| } else if (array_key_exists($tag->GetName(), $this->egroups)) { | |||||
| //对联动模型进行特殊处理 | |||||
| $formstring .= '<div class="form-group row"><label class="col-sm-2 col-form-label">' . $this->egroups[$tag->GetName()] . ':</label><div class="col-sm-10">' . GetEnumsForm($tag->GetName(), $value[$tag->GetName()], $tag->GetName()) . '</div></div>'; | |||||
| } else if ($tag->GetAtt('type') == 'checkbox') { | |||||
| //对checkbox模型进行特殊处理 | |||||
| $formstring .= $func($tag, dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES), $admintype); | |||||
| } else if ($tag->GetAtt('type') == 'img') { | |||||
| $fieldname = $tag->GetName(); | |||||
| $labelname = $tag->GetAtt('itemname'); | |||||
| $fvalue = dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES); | |||||
| $imgstrng = "<div class='form-group row'><label class='col-sm-2 col-form-label'>{$labelname}:</label><div class='col-sm-10'><input type='text' name='$fieldname' value='$fvalue' id='$fieldname' class='text' /> <input name='" . $fieldname . "_bt' class='inputbut' type='button' value='浏览...' onClick=\"SelectImage('addcontent.$fieldname','big')\" />\r\n</div></div>"; | |||||
| $formstring .= $imgstrng; | |||||
| } else { | |||||
| $formstring .= $func($tag, dede_htmlspecialchars($value[$tag->GetName()], ENT_QUOTES), $admintype); | |||||
| //echo $formstring; | |||||
| } | |||||
| } | |||||
| $formfields .= $formfields == '' ? $tag->GetName() . ',' . $tag->GetAtt('type') : ';' . $tag->GetName() . ',' . $tag->GetAtt('type'); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| $formstring .= "<input type=\"hidden\" name=\"dede_fields\" value=\"" . $formfields . "\" />\n"; | |||||
| $formstring .= "<input type=\"hidden\" name=\"dede_fieldshash\" value=\"" . md5($formfields . $cfg_cookie_encode) . "\" />"; | |||||
| return $formstring; | |||||
| } //end func getForm | |||||
| /** | |||||
| * 获取字段列表 | |||||
| * | |||||
| * @access public | |||||
| * @param string | |||||
| * @return array | |||||
| */ | |||||
| function getFieldList() | |||||
| { | |||||
| $dtp = new DedeTagParse(); | |||||
| $dtp->SetNameSpace("field", "<", ">"); | |||||
| $dtp->LoadSource($this->info); | |||||
| $fields = array(); | |||||
| if (is_array($dtp->CTags)) { | |||||
| foreach ($dtp->CTags as $tagid => $tag) { | |||||
| $fields[$tag->GetName()] = array($tag->GetAtt('itemname'), $tag->GetAtt('type')); | |||||
| } | |||||
| } | |||||
| return $fields; | |||||
| } | |||||
| } | |||||
| @@ -8,7 +8,7 @@ | |||||
| * @link http://www.dedecms.com | * @link http://www.dedecms.com | ||||
| */ | */ | ||||
| require_once(dirname(__FILE__) . "/config.php"); | require_once(dirname(__FILE__) . "/config.php"); | ||||
| require_once DEDEINC . '/membermodel.cls.php'; | |||||
| if ($cfg_mb_allowreg == 'N') { | if ($cfg_mb_allowreg == 'N') { | ||||
| ShowMsg('系统关闭了新用户注册!', 'index.php'); | ShowMsg('系统关闭了新用户注册!', 'index.php'); | ||||
| exit(); | exit(); | ||||
| @@ -162,18 +162,6 @@ if ($step == 1) { | |||||
| //写入其它默认数据 | //写入其它默认数据 | ||||
| $dsql->ExecuteNoneQuery("INSERT INTO `#@__member_flink`(mid,title,url) VALUES('$mid','织梦内容管理系统','http://www.dedecms.com'); "); | $dsql->ExecuteNoneQuery("INSERT INTO `#@__member_flink`(mid,title,url) VALUES('$mid','织梦内容管理系统','http://www.dedecms.com'); "); | ||||
| $membermodel = new membermodel($mtype); | |||||
| $modid = $membermodel->modid; | |||||
| $modid = empty($modid) ? 0 : intval($modid); | |||||
| $modelform = $dsql->getOne("SELECT * FROM `#@__member_model` WHERE id='$modid' "); | |||||
| if (!is_array($modelform)) { | |||||
| showmsg('模型表单不存在', '-1'); | |||||
| exit(); | |||||
| } else { | |||||
| $dsql->ExecuteNoneQuery("INSERT INTO `{$membermodel->table}` (`mid`) VALUES ('{$mid}');"); | |||||
| } | |||||
| //---------------------------------------------- | //---------------------------------------------- | ||||
| //模拟登录 | //模拟登录 | ||||
| //--------------------------- | //--------------------------- | ||||
| @@ -234,8 +222,7 @@ if ($step == 1) { | |||||
| exit; | exit; | ||||
| } | } | ||||
| } | } | ||||
| $membermodel = new membermodel($cfg_ml->M_MbType); | |||||
| $postform = $membermodel->getForm(true); | |||||
| if ($dopost == 'reginfo') { | if ($dopost == 'reginfo') { | ||||
| //这里完成详细内容填写 | //这里完成详细内容填写 | ||||
| $dede_fields = empty($dede_fields) ? '' : trim($dede_fields); | $dede_fields = empty($dede_fields) ? '' : trim($dede_fields); | ||||
| @@ -273,7 +260,6 @@ if ($step == 1) { | |||||
| } | } | ||||
| } | } | ||||
| $query = "UPDATE `{$membermodel->table}` SET `mid`='{$cfg_ml->M_ID}' $inadd_f WHERE `mid`='{$cfg_ml->M_ID}'; "; | |||||
| if ($dsql->executenonequery($query)) { | if ($dsql->executenonequery($query)) { | ||||
| $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `spacesta`='2' WHERE `mid`='{$cfg_ml->M_ID}'"); | $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `spacesta`='2' WHERE `mid`='{$cfg_ml->M_ID}'"); | ||||
| // 清除缓存 | // 清除缓存 | ||||
| @@ -92,7 +92,6 @@ document.write("午夜好,"); | |||||
| <form method="post" action="reg_new.php" id="regUser" name="form1"> | <form method="post" action="reg_new.php" id="regUser" name="form1"> | ||||
| <input type="hidden" value="reginfo" name="dopost"/> | <input type="hidden" value="reginfo" name="dopost"/> | ||||
| <input type="hidden" value="2" name="step"/> | <input type="hidden" value="2" name="step"/> | ||||
| <input type="hidden" value="<?php echo $membermodel->modid;?>" name="modid"/> | |||||
| <p style="text-align: right;" class="mB10"/> | <p style="text-align: right;" class="mB10"/> | ||||
| <?php | <?php | ||||
| echo '<ul>'; | echo '<ul>'; | ||||