AvocadoAmber/AvocadoEdition_Light/bbs/memo.php

74 lines
2 KiB
PHP
Raw Normal View History

2022-09-17 20:50:50 +09:00
<?php
2024-09-23 11:07:19 +09:00
include_once "./_common.php";
2022-09-17 20:50:50 +09:00
if ($is_guest)
2024-09-19 20:57:39 +09:00
alert_close('회원만 이용하실 수 있습니다.');
2022-09-17 20:50:50 +09:00
$g5['title'] = '내 쪽지함';
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/head.sub.php');
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if (!$kind)
$kind = 'recv';
2022-09-17 20:50:50 +09:00
if ($kind == 'recv')
2024-09-19 20:57:39 +09:00
$unkind = 'send';
2022-09-17 20:50:50 +09:00
else if ($kind == 'send')
2024-09-19 20:57:39 +09:00
$unkind = 'recv';
2024-09-19 20:57:55 +09:00
else {
// xss patch - gnuboard 2e81619ea8
$kind = clean_xss_tags(trim($kind));
2024-09-19 20:57:39 +09:00
alert('' . $kind . '값을 넘겨주세요.');
2024-09-19 20:57:55 +09:00
}
2022-09-17 20:50:50 +09:00
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
$total_count = number_format($row['cnt']);
2024-09-19 20:57:39 +09:00
if ($kind == 'recv') {
$kind_title = '받은';
$recv_img = 'on';
$send_img = 'off';
} else {
$kind_title = '보낸';
$recv_img = 'off';
$send_img = 'on';
2022-09-17 20:50:50 +09:00
}
2024-09-23 09:37:13 +09:00
$list = [];
2022-09-17 20:50:50 +09:00
$sql = " select a.*, b.mb_id, b.mb_nick, b.mb_email, b.mb_homepage
from {$g5['memo_table']} a
left join {$g5['member_table']} b on (a.me_{$unkind}_mb_id = b.mb_id)
where a.me_{$kind}_mb_id = '{$member['mb_id']}'
order by a.me_id desc ";
$result = sql_query($sql);
2024-09-19 20:57:39 +09:00
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$list[$i] = $row;
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$mb_id = $row["me_{$unkind}_mb_id"];
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if ($row['mb_nick'])
$mb_nick = $row['mb_nick'];
else
$mb_nick = '정보없음';
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$name = get_sideview($row['mb_id'], $row['mb_nick'], $row['mb_email'], $row['mb_homepage']);
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
if (substr($row['me_read_datetime'], 0, 1) == 0)
$read_datetime = '아직 읽지 않음';
else
$read_datetime = substr($row['me_read_datetime'], 2, 14);
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$send_datetime = substr($row['me_send_datetime'], 2, 14);
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
$list[$i]['name'] = $name;
$list[$i]['send_datetime'] = $send_datetime;
$list[$i]['read_datetime'] = $read_datetime;
$list[$i]['view_href'] = './memo_view.php?me_id=' . $row['me_id'] . '&amp;kind=' . $kind;
$list[$i]['del_href'] = './memo_delete.php?me_id=' . $row['me_id'] . '&amp;kind=' . $kind;
2022-09-17 20:50:50 +09:00
}
2024-09-19 20:57:39 +09:00
include_once($member_skin_path . '/memo.skin.php');
2022-09-17 20:50:50 +09:00
2024-09-19 20:57:39 +09:00
include_once(G5_PATH . '/tail.sub.php');