|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+<?php
|
|
|
2
|
+
|
|
|
3
|
+define('IN_SMT', true);
|
|
|
4
|
+define('CURSCRIPT', 'about');
|
|
|
5
|
+define('IN_MYMPS', true);
|
|
|
6
|
+require_once dirname(__FILE__) . '/include/global.php';
|
|
|
7
|
+require_once dirname(__FILE__) . '/data/config.php';
|
|
|
8
|
+require_once MYMPS_DATA . '/config.db.php';
|
|
|
9
|
+require_once MYMPS_INC . '/db.class.php';
|
|
|
10
|
+ifsiteopen();
|
|
|
11
|
+(!$part || !in_array($part, array('aboutus', 'friendlink', 'faq', 'announce', 'sitemap', 'googlemap'))) && ($part = 'aboutus');
|
|
|
12
|
+$id = isset($id) ? intval($id) : '';
|
|
|
13
|
+$page = isset($page) ? intval($page) : '';
|
|
|
14
|
+$action = isset($action) ? trim($action) : '';
|
|
|
15
|
+
|
|
|
16
|
+if ($action == 'dopost') {
|
|
|
17
|
+ if (!($randcode = mymps_chk_randcode($checkcode))) {
|
|
|
18
|
+ write_msg('验证码输入错误,请返回重新输入');
|
|
|
19
|
+ }
|
|
|
20
|
+
|
|
|
21
|
+ $url = $url ? trim(mhtmlspecialchars($url)) : '';
|
|
|
22
|
+ $webname = $webname ? trim(mhtmlspecialchars($webname)) : '';
|
|
|
23
|
+ $weblogo = $weblogo ? trim(mhtmlspecialchars($weblogo)) : '';
|
|
|
24
|
+ $msg = $msg ? textarea_post_change($msg) : '';
|
|
|
25
|
+ $email = $email ? trim(mhtmlspecialchars($email)) : '';
|
|
|
26
|
+ $typeid = $typeid ? intval($typeid) : '';
|
|
|
27
|
+ if (empty($webname) || empty($url)) {
|
|
|
28
|
+ write_msg('网站名称和网址不能为空!');
|
|
|
29
|
+ }
|
|
|
30
|
+
|
|
|
31
|
+ if ($email && !is_email($email)) {
|
|
|
32
|
+ write_msg('您的email输入不正确!');
|
|
|
33
|
+ }
|
|
|
34
|
+
|
|
|
35
|
+ $sql = 'INSERT INTO `' . $db_mymps . 'flink`(url,webname,weblogo,msg,email,typeid,createtime,ischeck)
|
|
|
36
|
+ VALUES(\'' . $url . '\',\'' . $webname . '\',\'' . $weblogo . '\',\'' . $msg . '\',\'' . $email . '\',\'' . $typeid . '\',\'' . $timestamp . '\',\'1\'); ';
|
|
|
37
|
+ $res = $db->query($sql);
|
|
|
38
|
+ write_msg('链接申请提交成功,管理员审核通过后显示', Rewrite('about', array('part' => 'friendlink')));
|
|
|
39
|
+ exit();
|
|
|
40
|
+}
|
|
|
41
|
+
|
|
|
42
|
+$cache = get_cache_config();
|
|
|
43
|
+require_once MYMPS_INC . '/cachepages.class.php';
|
|
|
44
|
+
|
|
|
45
|
+if ($part == 'aboutus') {
|
|
|
46
|
+ $seo = $seo ? $seo : get_seoset();
|
|
|
47
|
+ $rewrite = $seo['seo_force_category'];
|
|
|
48
|
+
|
|
|
49
|
+ if ($rewrite != 'active') {
|
|
|
50
|
+ $mayimobile = get_mobile_settings();
|
|
|
51
|
+ $mayimobile['mobiledomain'] = $mayimobile['mobiledomain'] ? $mayimobile['mobiledomain'] : $mymps_global['SiteUrl'] . '/m';
|
|
|
52
|
+ $mayimobile['mobileuri'] = $mayimobile['mobiledomain'] . ($_SERVER['HTTP_X_ORIGINAL_URL'] ? $_SERVER['HTTP_X_ORIGINAL_URL'] : $_SERVER['REQUEST_URI']);
|
|
|
53
|
+
|
|
|
54
|
+ if ($ifmobile) {
|
|
|
55
|
+ write_msg('', $mayimobile['mobileuri']);
|
|
|
56
|
+ exit();
|
|
|
57
|
+ }
|
|
|
58
|
+ }
|
|
|
59
|
+
|
|
|
60
|
+ !$id && ($id = $db->getOne('SELECT MIN(id) FROM `' . $db_mymps . 'about`'));
|
|
|
61
|
+ $cachepages = new cachepages($cache['aboutus']['time'], 'aboutus_' . $id);
|
|
|
62
|
+ $cachetime = 0 < $cache['aboutus']['time'] ? true : false;
|
|
|
63
|
+ $cachepages->cacheCheck();
|
|
|
64
|
+ $aboutus_all = get_aboutus(0);
|
|
|
65
|
+ $aboutus = get_aboutus($id);
|
|
|
66
|
+ $loc = get_location('aboutus', '', $aboutus['typename']);
|
|
|
67
|
+ $page_title = $loc['page_title'];
|
|
|
68
|
+ $location = $loc['location'];
|
|
|
69
|
+}
|
|
|
70
|
+else if ($part == 'announce') {
|
|
|
71
|
+ $cachepages = new cachepages($cache['announce']['time'], 'announce');
|
|
|
72
|
+ $cachetime = 0 < $cache['announce']['time'] ? true : false;
|
|
|
73
|
+ $cachepages->cacheCheck();
|
|
|
74
|
+ $loc = get_location('aboutus', '', '网站公告');
|
|
|
75
|
+ $query = $db->query('SELECT * FROM `' . $db_mymps . 'announce` WHERE begintime<=\'' . $timestamp . '\' AND (endtime=\'0\' OR endtime>\'' . $timestamp . '\') ORDER BY id DESC');
|
|
|
76
|
+
|
|
|
77
|
+ while ($row = $db->fetchRow($query)) {
|
|
|
78
|
+ $arr['id'] = $row['id'];
|
|
|
79
|
+ $arr['title'] = $row['title'];
|
|
|
80
|
+ $arr['begintime'] = $row['begintime'] == 0 ? $row['pubdate'] : $row['begintime'];
|
|
|
81
|
+ $arr['endtime'] = $row['endtime'];
|
|
|
82
|
+ $arr['author'] = $row['author'];
|
|
|
83
|
+ $arr['content'] = $row['redirecturl'] ? '<a href=' . $row[redirecturl] . ' target=_blank>' . $row[redirecturl] . '</a>' : $row['content'];
|
|
|
84
|
+ $arr['uri'] = $row['redirecturl'] ? $row['redirecturl'] : Rewrite('about', array('part' => 'aboutus#' . $row['id']));
|
|
|
85
|
+ $announce[] = $arr;
|
|
|
86
|
+ }
|
|
|
87
|
+}
|
|
|
88
|
+else if ($part == 'faq') {
|
|
|
89
|
+ !$id && ($id = $db->getOne('SELECT MIN(id) FROM `' . $db_mymps . 'faq`'));
|
|
|
90
|
+ $cachepages = new cachepages($cache['faq']['time'], 'faq_' . $id);
|
|
|
91
|
+ $cachetime = 0 < $cache['faq']['time'] ? true : false;
|
|
|
92
|
+ $cachepages->cacheCheck();
|
|
|
93
|
+ $faq_type = get_faq();
|
|
|
94
|
+
|
|
|
95
|
+ if (!($faq = get_faq($id))) {
|
|
|
96
|
+ write_msg('您指定的帮助主题不存在!');
|
|
|
97
|
+ }
|
|
|
98
|
+
|
|
|
99
|
+ $loc = get_location('faq', '', $faq['title']);
|
|
|
100
|
+}
|
|
|
101
|
+else if ($part == 'friendlink') {
|
|
|
102
|
+ require MYMPS_INC . '/flink.fun.php';
|
|
|
103
|
+ $cachepages = new cachepages($cache['friendlink']['time'], 'friendlink');
|
|
|
104
|
+ $cachetime = 0 < $cache['friendlink']['time'] ? true : false;
|
|
|
105
|
+ $cachepages->cacheCheck();
|
|
|
106
|
+ $loc = get_location('friendlink', '', '友情链接');
|
|
|
107
|
+ $flink = get_flink();
|
|
|
108
|
+}
|
|
|
109
|
+else if ($part == 'sitemap') {
|
|
|
110
|
+ $loc = get_location('', '', '网站地图');
|
|
|
111
|
+ $cachepages = new cachepages($cache['sitemap']['time'], 'sitemap');
|
|
|
112
|
+ $cachetime = 0 < $cache['sitemap']['time'] ? true : false;
|
|
|
113
|
+ $cachepages->cacheCheck();
|
|
|
114
|
+ $categories = get_categories_tree(0, 'category');
|
|
|
115
|
+}
|
|
|
116
|
+
|
|
|
117
|
+$page_title = $loc['page_title'];
|
|
|
118
|
+$location = $loc['location'];
|
|
|
119
|
+$about = array();
|
|
|
120
|
+$about['aboutus_uri'] = Rewrite('about', array('part' => 'aboutus'));
|
|
|
121
|
+$about['news_uri'] = Rewrite('news', array('part' => 'index'));
|
|
|
122
|
+$about['faq_uri'] = Rewrite('about', array('part' => 'faq'));
|
|
|
123
|
+$about['yp_uri'] = Rewrite('corp', array('part' => 'index'));
|
|
|
124
|
+$about['friendlink_uri'] = Rewrite('about', array('part' => 'friendlink'));
|
|
|
125
|
+$about['announce_uri'] = Rewrite('about', array('part' => 'announce'));
|
|
|
126
|
+$about['sitemap_uri'] = Rewrite('about', array('part' => 'sitemap'));
|
|
|
127
|
+include mymps_tpl($part);
|
|
|
128
|
+$cachetime && $cachepages->caching();
|
|
|
129
|
+is_object($db) && $db->Close();
|
|
|
130
|
+
|
|
|
131
|
+?>
|