if ($adminid != 1) {
    showmessage("您无此权限,请用管理员帐号登陆。");
}
if ($operation) {
    ##给用户发短信息,通知其爱墙号被删
    $query = $db->query("SELECT `uid`, `id` FROM `" . $tablepre . "lovewall` WHERE `id` IN ('" . implode('\',\'', $moderate) . "')");
    while ($delrow = $db->fetch_array($query)) {
        $duid = $delrow['uid'];
        $subject = "被删除祝福的号码";
        $message = "您好,您在爱墙发布的祝福因为违规已经被删除。\r\n被删除的祝福号码:" . $delrow['id'];
        $fromid = $lovepmid ? $lovepmid : 0;
        $from = $lovepmname ? $lovepmname : $bbname;
        sendpm($duid, $subject, $message, $fromid, $from);
    }
    $db->query("DELETE FROM `" . $tablepre . "lovewall` WHERE `id` IN ('" . implode('\',\'', $moderate) . "')");
    loveidcache();
    for ($i = 1; $i < $lovek; $i++) {
        @unlink(DISCUZ_ROOT . "./extend/lovewall/cache_lovewall_{$i}.php");
    }
}
$tpp = 25;
$page = empty($page) || !intval($page) ? 1 : $page;
$start_limit = ($page - 1) * $tpp;
$query = $db->query("select COUNT(*) from `" . $tablepre . "lovewall`");
$qcount = $db->result($query, 0);
$multipage = multi($qcount, $tpp, $page, "lovewall.php?index=listmsg", $threadmaxpages);
$query = $db->query("select * FROM `" . $tablepre . "lovewall` ORDER BY `id` desc limit {$start_limit},{$tpp}");
while ($rowlove = $db->fetch_array($query)) {
    $rowlove['lovetime'] = gmdate("{$dateformat} {$timeformat}", $rowlove['lovetime'] + 3600 * $timeoffset);
    $rowlove['lovesay'] = dhtmlspecialchars($rowlove['lovesay']);
    $rowlove['lovesay'] = nl2br(str_replace(array("\t", '   ', '  ', "\r\n"), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;', '<br>'), $rowlove['lovesay']));
    if ($lovepmswitch) {
        sendpm($discuz_uid, $subject, $message, $fromid, $from);
    }
    if ($lovemailswitch) {
        $mailsend = 1;
        $mailfrom = $lovemail ? $lovemail : $adminemail;
        $query = $db->query("select email from `" . $tablepre . "members` where `uid`='{$discuz_uid}'");
        $rowu = $db->fetch_array($query);
        sendmail($rowu[email], $subject, $message, $mailfrom);
    }
    $lovetime = gmdate("{$dateformat} {$timeformat}", $timestamp + 3600 * $timeoffset);
    $massages = dhtmlspecialchars($massages);
    $massages = nl2br(str_replace(array("\t", '   ', '  ', "\r\n"), array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;', '<br>'), $massages));
    if (!$smileyoff && !empty($GLOBALS['_DCACHE']['smilies']) && is_array($GLOBALS['_DCACHE']['smilies'])) {
        $massages = preg_replace($GLOBALS['_DCACHE']['smilies']['searcharray'], $GLOBALS['_DCACHE']['smilies']['replacearray'], $massages, $maxsmilies);
    }
    $massages = str_replace(array('\\&quot;', "\\'"), array('&quot;', "'"), $massages);
    //生成LOVEID缓存
    $loveid_cache = loveidcache();
    if ($lovecache == 1) {
        $page = $lovek;
        lovecache();
    }
    $tipsa = '您在爱墙发布的祝福号码已经发到您的收件箱,请注意查收';
    $tipsb = $loveokmsg ? $loveokmsg : "您在爱墙发布信息成功";
    $lovesay_send_succeed = $lovepmswitch ? $tipsa : $tipsb;
    showmessage("{$lovesay_send_succeed}", 'lovewall.php');
} else {
    require_once DISCUZ_ROOT . './forumdata/cache/cache_post.php';
}
$navigation .= " &raquo; <a href=\"lovewall.php\">{$lovetitle}</a> &raquo; 新的留言";