info1.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php
  2. //信息查看权限提示函数
  3. function eCheckLevelInfo_ViewInfoMsg($ckuser,$r,$ecms){
  4. global $empire,$dbtbpre,$public_r,$check_path,$level_r,$class_r,$public_diyr;
  5. $ViewLevel=eCheckLevelInfo_ReturnViewLevelSay($r);
  6. $msg=eCheckLevelInfo_ReturnMsgStr($ckuser,$ecms);
  7. $r['title']=stripSlashes($r['title']);
  8. $showsmalltext=eCheckLevelInfo_ReturnIntroField($r);
  9. $public_diyr['pagetitle']=$r['title'];
  10. $url="<a href='".$public_r['newsurl']."'>首页</a>&nbsp;>&nbsp;<a href='".$public_r['newsurl']."e/member/cp/'>会员中心</a>&nbsp;>&nbsp;查看信息:".$r['title'];
  11. @include(ECMS_PATH."e/data/template/cp_1.php");
  12. ?>
  13. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  14. <tr class="header">
  15. <td height="25">提示信息</td>
  16. </tr>
  17. <tr bgcolor="#FFFFFF">
  18. <td height="25"><?=$msg?></td>
  19. </tr>
  20. </table>
  21. <br>
  22. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  23. <tr class="header">
  24. <td height="25" colspan="2">标题:
  25. <?=$r['title']?>
  26. </td>
  27. </tr>
  28. <tr bgcolor="#FFFFFF">
  29. <td height="25">查看权限:</td>
  30. <td height="25">
  31. <?=$ViewLevel?>
  32. </td>
  33. </tr>
  34. <tr bgcolor="#FFFFFF">
  35. <td width="17%" height="25">发布时间:</td>
  36. <td width="83%" height="25">
  37. <?=date("Y-m-d H:i:s",$r['newstime'])?>
  38. </td>
  39. </tr>
  40. <tr bgcolor="#FFFFFF">
  41. <td height="25">信息简介:</td>
  42. <td height="25">
  43. <?=$showsmalltext?>
  44. </td>
  45. </tr>
  46. </table>
  47. <?php
  48. @include(ECMS_PATH."e/data/template/cp_2.php");
  49. exit();
  50. }
  51. //返回提示信息内容
  52. function eCheckLevelInfo_ReturnMsgStr($ckuser,$ecms){
  53. global $check_path,$level_r,$empire,$gotourl,$toreturnurl,$public_r,$dbtbpre,$class_r,$checkinfor;
  54. $msgstr='';
  55. if($ecms=='NotLogin')//未登录
  56. {
  57. $msgstr="您还未登陆,<a href='$gotourl'><u>点击这里</u></a>进行登陆操作;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  58. }
  59. elseif($ecms=='SingleLogin')//只能一人在线
  60. {
  61. $msgstr="同一帐号只能一人在线,<a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  62. }
  63. elseif($ecms=='NotCheckUser')//未审核
  64. {
  65. $msgstr="您的帐号还未审核通过,<a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  66. }
  67. elseif($ecms=='NotLevelClass')//权限不足(栏目设置)
  68. {
  69. $msgstr="您没有足够权限查看此信息! <a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  70. }
  71. elseif($ecms=='NotLevelGroup')//权限不足(会员组)
  72. {
  73. $msgstr="您的会员级别不足(您的当前级别:".$level_r[$ckuser['groupid']]['groupname']."),没有查看此信息的权限! <a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  74. }
  75. elseif($ecms=='NotLevelViewGroup')//权限不足(访问组)
  76. {
  77. $msgstr="您的会员级别不足,没有查看此信息的权限! <a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  78. }
  79. elseif($ecms=='NotUserfen')//点数不够
  80. {
  81. $msgstr="您的点数不足(您当前拥有的点数 ".$ckuser['userfen']." 点),没有查看此信息的权限! <a href='$gotourl'><u>点击这里</u></a>重新登陆;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  82. }
  83. else
  84. {
  85. $msgstr="您还未登陆,<a href='$gotourl'><u>点击这里</u></a>进行登陆操作;注册请<a href='".$public_r['newsurl']."e/member/register/'><u>点击这里</u></a>。";
  86. }
  87. return $msgstr;
  88. }
  89. //返回需要的查看权限提示
  90. function eCheckLevelInfo_ReturnViewLevelSay($infor){
  91. global $check_path,$level_r,$empire,$gotourl,$toreturnurl,$public_r,$dbtbpre,$class_r,$checkinfor;
  92. if(empty($infor['userfen']))//不需要扣点
  93. {
  94. if($class_r[$infor['classid']]['cgtoinfo'])//栏目设置
  95. {
  96. $ViewLevel="需要 [".eCheckLevelInfo_ViewInfoLevels($infor['eclass_cgroupid'])."] 级别才能查看。";
  97. }
  98. else
  99. {
  100. if($infor['groupid']>0)
  101. {
  102. $ViewLevel="需要 [".$level_r[$infor['groupid']]['groupname']."] 级别以上才能查看。";
  103. }
  104. else
  105. {
  106. $ViewLevel="需要 [特定访问组] 级别才能查看。";
  107. }
  108. }
  109. }
  110. else//需要扣点
  111. {
  112. if($class_r[$infor['classid']]['cgtoinfo'])//栏目设置
  113. {
  114. $ViewLevel="需要 [".eCheckLevelInfo_ViewInfoLevels($infor['eclass_cgroupid'])."] 级别与扣除 ".$infor['userfen']." 点才能查看。";
  115. }
  116. else
  117. {
  118. if($infor['groupid']>0)
  119. {
  120. $ViewLevel="需要 [".$level_r[$infor['groupid']]['groupname']."] 级别以上与扣除 ".$infor['userfen']." 点才能查看。";
  121. }
  122. else
  123. {
  124. $ViewLevel="需要 [特定访问组] 级别与扣除 ".$infor['userfen']." 点才能查看。";
  125. }
  126. }
  127. }
  128. return $ViewLevel;
  129. }
  130. //返回权限列表
  131. function eCheckLevelInfo_ViewInfoLevels($groupid){
  132. global $level_r;
  133. if(empty($groupid))
  134. {
  135. return '至少会员';
  136. }
  137. $r=explode(',',$groupid);
  138. $count=count($r)-1;
  139. $groups='';
  140. $dh='';
  141. for($i=1;$i<$count;$i++)
  142. {
  143. $groups.=$dh.$level_r[$r[$i]][groupname];
  144. $dh=',';
  145. }
  146. return $groups;
  147. }
  148. //返回简介字段
  149. function eCheckLevelInfo_ReturnIntroField($r){
  150. global $public_r,$class_r,$emod_r,$check_tbname;
  151. $sublen=120;//截取120个字
  152. $mid=$class_r[$r[classid]]['modid'];
  153. $smalltextf=$emod_r[$mid]['smalltextf'];
  154. $stf=$emod_r[$mid]['savetxtf'];
  155. //简介
  156. $value='';
  157. $showf='';
  158. if($smalltextf&&$smalltextf<>',')
  159. {
  160. $smr=explode(',',$smalltextf);
  161. $smcount=count($smr)-1;
  162. for($i=1;$i<$smcount;$i++)
  163. {
  164. $smf=$smr[$i];
  165. if($r[$smf])
  166. {
  167. $value=$r[$smf];
  168. $showf=$smf;
  169. break;
  170. }
  171. }
  172. }
  173. if(empty($showf))
  174. {
  175. $value=strip_tags($r['newstext']);
  176. $value=esub($value,$sublen);
  177. $showf='newstext';
  178. }
  179. //存文本
  180. if($stf==$showf)
  181. {
  182. $value='';
  183. }
  184. return stripSlashes($value);
  185. }
  186. ?>