function.php 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. if (!defined('IN_ROOT')) {
  3. exit('Access denied');
  4. }
  5. function mainjump()
  6. {
  7. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . IN_CHARSET . "\" /><style type=\"text/css\">body{background:#F2F9FD;}</style>";
  8. }
  9. function ShowMessage($in_msg, $in_url, $in_style, $in_time, $in_type)
  10. {
  11. if ($in_type == 1) {
  12. echo "<div class=\"container\"><h3>提示</h3><div class=\"infobox\"><h4 class=\"" . $in_style . "\">" . $in_msg . "</h4><script type=\"text/javascript\">setTimeout(\"location.href='" . $in_url . "';\"," . $in_time . ");</script><p class=\"marginbot\"><a href=\"" . $in_url . "\" class=\"lightlink\">如果您的浏览器没有自动跳转,请点击这里</a></p></div></div>";
  13. } elseif ($in_type == 2) {
  14. echo "<div class=\"container\"><h3>提示</h3><div class=\"infobox\"><h4 class=\"" . $in_style . "\">" . $in_msg . "</h4><script type=\"text/javascript\">setTimeout(\"" . $in_url . "\"," . $in_time . ");</script><p class=\"marginbot\"><a href=\"javascript:history.go(-1);\" class=\"lightlink\">如果您的浏览器没有自动跳转,请点击这里</a></p></div></div>";
  15. } else {
  16. echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
  17. echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
  18. echo "<head>";
  19. echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . IN_CHARSET . "\" />";
  20. echo "<meta http-equiv=\"x-ua-compatible\" content=\"ie=7\" />";
  21. echo "<title>提示信息</title>";
  22. echo "<link href=\"" . IN_PATH . "static/admincp/css/main.css\" rel=\"stylesheet\" type=\"text/css\" />";
  23. echo "</head>";
  24. echo "<body>";
  25. echo "<div class=\"container\"><h3>提示</h3><div class=\"infobox\"><h4 class=\"" . $in_style . "\">" . $in_msg . "</h4><script type=\"text/javascript\">setTimeout(\"location.href='" . $in_url . "';\"," . $in_time . ");</script><p class=\"marginbot\"><a href=\"" . $in_url . "\" class=\"lightlink\">如果您的浏览器没有自动跳转,请点击这里</a></p></div></div>";
  26. }
  27. echo "</body>";
  28. echo "</html>";
  29. exit();
  30. }
  31. function Administrator($value)
  32. {
  33. if (!isAdminLogin()) {
  34. ShowMessage("未登录或登录已过期,请重新登录管理中心!", $_SERVER['PHP_SELF'], "infotitle3", 3000, 0);
  35. }
  36. setcookie("in_adminexpire", $_COOKIE['in_adminexpire'], time() + 36000);
  37. $array = explode(",", $_COOKIE['in_permission']);
  38. $adminlogined = false;
  39. for ($i = 0; $i < count($array); $i++) {
  40. if ($array[$i] == $value) {
  41. $adminlogined = true;
  42. }
  43. }
  44. if (!$adminlogined) {
  45. ShowMessage("权限不够,无法进入此页面!", "?c=body", "infotitle3", 3000, 0);
  46. }
  47. }
  48. function Menu_App()
  49. {
  50. global $develop_auth;
  51. $app = "<li><a href=\"" . (is_ssl() ? str_replace('http://', 'https://', $develop_auth) : $develop_auth) . "\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>应用中心</a></li>";
  52. $module = "<li><a href=\"?c=module\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>所有应用</a></li>";
  53. $li = "";
  54. $query = db('plugin')->where('in_type>0')->order('in_addtime desc')->select();
  55. foreach ($query as $row) {
  56. $li = $li . "<li><a href=\"plugin.php/" . $row['in_dir'] . "/" . $row['in_file'] . "/\" hidefocus=\"true\" target=\"main\"><em onclick=\"menuNewwin(this)\" title=\"新窗口打开\"></em>" . $row['in_name'] . "</a></li>";
  57. }
  58. return $app . $module . $li;
  59. }