-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.php
148 lines (117 loc) · 5.44 KB
/
list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
# $Id: list.php,v 1.5 2009-11-16 21:52:45 oops Exp $
# 페이지 로딩 시간 시작
$p_time[] = microtime();
include "include/header.php";
$page = !$page ? 1 : $page;
$nolenth = 0;
if(!session_is_registered("$jsboard") && preg_match("/^(2|3|5|7)$/",$board['mode']))
print_error($_('login_err'));
$board['headpath'] = @file_exists("data/$table/html_head.php") ? "data/$table/html_head.php" : "html/nofile.php";
$board['tailpath'] = @file_exists("data/$table/html_tail.php") ? "data/$table/html_tail.php" : "html/nofile.php";
if($board['super'] == 1 || $board['adm']) {
if ( @file_exists ("./theme/{$print['theme']}/img/admin.gif") )
$print['adpath'] = "<img src=\"./theme/{$print['theme']}/img/admin.gif\" border=0 alt='" . $_('ln_titl') . "'>";
else $print['adpath'] = ">> admin ";
$print['admin'] = "<a href=\"javascript:new_windows('./admin/user_admin/uadmin.php?table=$table','admin','yes','yes',650,600);\" title='" . $_('ln_titl') . "'>".
"<span class=\"admintext\">{$print['adpath']}</span></a>";
}
# SQL 시작 시간 체크
$a_time[] = microtime();
$c = sql_connect($db['server'], $db['user'], $db['pass'], $db['name']);
# 게시판의 전체, 보통, 답장, 오늘 올라온 글 수 등을 가져옴
$count = get_board_info($table);
# 전체 페이지와 현재 페이지에 관련된 정보를 가져옴
$pages = get_page_info($count, $page);
# SQL 종료 시간 체크
$a_time[] = microtime();
$sqltime1= get_microtime($a_time[0], $a_time[1]);
if($count['all']) {
if ($o['at'] == 's') $count['search'] = "searched";
else $count['search'] = "registered";
$count['today'] = !$count['today'] ? "" : "[ In 12H : {$count['today']} ] ";
$print['count'] = "<font id=\"num\" class=\"listkey\"></font> ".
"Total {$count['all']} articles / {$pages['all']} Pages {$count['search']} {$count['today']}";
} else {
$print['count'] = "<font id=\"num\" class=\"listkey\"></font> ".
"no article ..";
}
# RSS 출력 루틴
if ( $rss['use'] ) {
$rss['title'] = $_SERVER['SERVER_NAME'] . " {$board['title']}";
$rss['link'] = "<link rel=\"Alternate\" type=\"application/rss+xml\" " .
"title=\"{$rss['title']}\" href=\"{$board['path']}rss.php?table={$table}\">\n";
$rss['color'] = trim($rss['color']) ? " color: {$rss['color']};" : "";
if ( $rss['align'] ) {
$print['count'] .= " [<a href=\"{$board['path']}rss.php?table={$table}\">" .
"<span class=\"rss\">RSS</span></a>]";
} else {
$print['count'] = "[<a href=\"{$board['path']}rss.php?table={$table}\">" .
"<span class=\"rss\">RSS</span></a>] {$print['count']}";
}
}
# SQL 시작 시간 체크
$b_time[] = microtime();
# 글 리스트
$colspan_no = $upload['yesno'] ? "6" : "5";
if(trim($notice['subject'])) {
$notice_filno = $colspan_no - 1;
if($notice['contents']) {
$notice['subject'] = "<a href=\"read.php?table={$table}&alert=1\">".
"<span class=\"notice\">{$notice['subject']}</span></a>";
} else {
$notice['subject'] = "<span class=\"notice\">{$notice['subject']}</span>";
}
$print['lists'] = "<tr class=\"noticebg\">\n".
"<td align=\"right\"><img src=\"./theme/{$print['theme']}/img/notice.gif\" border=0 alt=\"\">".
"<img src=\"./images/blank.gif\" width=5 height=\"{$lines['height']}\" border=0 align=\"middle\" alt=''></td>\n".
"<td colspan=\"$notice_filno\">{$notice['subject']}</td>\n</tr>\n\n";
# 글 리스트들 사이에 디자인을 넣기 위한 코드
if($lines['design']) {
$lines['design'] = preg_replace("/=[\"']?AA[\"']?/","=\"$colspan_no\"",$lines['design']);
$print['lists'] .= "<tr>\n{$lines['design']}\n</tr>\n";
}
}
$print['lists'] .= get_list($table, $pages);
# 게시판 앞뒤 페이지 링크
$print['p_list'] = page_list($table, $pages, $count, $board['plist']);
# SQL 종료 시간 체크
$b_time[] = microtime();
$sqltime2 = get_microtime($b_time[0], $b_time[1]);
# SQL 시간
$print['sqltime'] = $sqltime1 + $sqltime2;
$print['sqltime'] = "SQL Time [ {$print['sqltime']} Sec ]";
# 상세 검색 테이블
if($o['at'] == "d" || $o['at'] == "dp")
$print['dsearch'] = detail_searchform();
else {
$page = $page ? $page : "1";
$print['dserlink'] = "<a href=\"{$_SERVER['PHP_SELF']}?table=$table&page=$page&o[at]=dp\">" .
"[ " . $_('detable_search_link') . " ]</a>";
}
# 검색폼, 페이지폼 관련 변수
$sform = search_form($o);
$pform = page_form($pages,$o);
# 관련글 리스트 출력시 preview 기능 사용할때 필요한 JavaScript 출력
#if ($enable['pre']) $print['preview_script'] = print_preview_src();
if ($enable['pre'])
$print['preview_script'] = '<script type="text/javascript" src="./theme/common/preview.js"></script>';
# 글등록지 표시 여부
if($enable['dhost']) {
$list['dhost'] = get_hostname($enable['dlook']);
if($enable['dwho'])
$list['dhost'] = "<a href=\"javascript:new_windows('./whois.php?table=$table&host={$list['dhost']}',0,1,0,600,480)\">".
"<span class=\"sqltime\">{$list['dhost']}</span></a>";
$print['times'] = "Access [ {$list['dhost']} ] {$print['sqltime']}";
} else $print['times'] = "{$print['pagetime']} {$print['sqltime']}";
# 페이지 로딩 끝 시간
$p_time[] = microtime();
$print['pagetime'] = get_microtime($p_time[0], $p_time[1]);
$print['pagetime'] = "Page Loading [ {$print['pagetime']} Sec ]";
sql_close($c);
$sform['ss'] = preg_replace("/\\\\+/i","\\",$sform['ss']);
# PAGE DISPLAY
meta_char_check($print['theme'], 1, 1);
$bodyType = 'list';
include "./theme/{$print['theme']}/index.template";
?>