当前位置: 首页>>代码示例>>PHP>>正文


PHP Board::RegeneratePages方法代码示例

本文整理汇总了PHP中Board::RegeneratePages方法的典型用法代码示例。如果您正苦于以下问题:PHP Board::RegeneratePages方法的具体用法?PHP Board::RegeneratePages怎么用?PHP Board::RegeneratePages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Board的用法示例。


在下文中一共展示了Board::RegeneratePages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: time

                $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "posts` SET `bumped` = '" . time() . "' WHERE `boardid` = " . $board_class->board['id'] . " AND `id` = '" . $thread_replyto . "'");
            }
        }
        // If the user replied to a thread he is watching, update it so it doesn't count his reply as unread
        if (KU_WATCHTHREADS && $thread_replyto != '0') {
            $viewing_thread_is_watched = $tc_db->GetOne("SELECT COUNT(*) FROM `" . KU_DBPREFIX . "watchedthreads` WHERE `ip` = '" . $_SERVER['REMOTE_ADDR'] . "' AND `board` = '" . $board_class->board['name'] . "' AND `threadid` = '" . $thread_replyto . "'");
            if ($viewing_thread_is_watched > 0) {
                $newestreplyid = $tc_db->GetOne('SELECT `id` FROM `' . KU_DBPREFIX . 'posts` WHERE `boardid` = ' . $board_class->board['id'] . ' AND `IS_DELETED` = 0 AND `parentid` = ' . $thread_replyto . ' ORDER BY `id` DESC LIMIT 1');
                $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "watchedthreads` SET `lastsawreplyid` = " . $newestreplyid . " WHERE `ip` = '" . $_SERVER['REMOTE_ADDR'] . "' AND `board` = '" . $board_class->board['name'] . "' AND `threadid` = '" . $thread_replyto . "'");
            }
        }
        $tc_db->Execute("COMMIT");
        // Trim any threads which have been pushed past the limit, or exceed the maximum age limit
        TrimToPageLimit($board_class->board);
        // Regenerate board pages
        $board_class->RegeneratePages();
        if ($thread_replyto == '0') {
            // Regenerate the thread
            $board_class->RegenerateThreads($post_id);
        } else {
            // Regenerate the thread
            $board_class->RegenerateThreads($thread_replyto);
        }
    } else {
        exitWithErrorPage(_gettext('Sorry, this board is locked and can not be posted in.'));
    }
} elseif ((isset($_POST['deletepost']) || isset($_POST['reportpost']) || isset($_POST['moddelete']) || isset($_POST['edit'])) && isset($_POST['post'])) {
    $ismod = false;
    // Initialize the post class
    foreach ($_POST['post'] as $val) {
        $post_class = new Post($val, $board_class->board['name'], $board_class->board['id']);
开发者ID:stormeus,项目名称:Kusaba-Z,代码行数:31,代码来源:board.php

示例2: bans


//.........这里部分代码省略.........
                    if ($ban_appealat > 0) {
                        $ban_appealat += time();
                    }
                }
                if (isset($_POST['multiban'])) {
                    $ban_ips = unserialize($_POST['multiban']);
                } else {
                    $ban_ips = array($ban_ip);
                }
                foreach ($ban_ips as $ban_ip) {
                    $whitelist = $tc_db->GetAll("SELECT `ipmd5` FROM `" . KU_DBPREFIX . "banlist` WHERE `type` = 2");
                    if (in_array(md5($ban_ip), $whitelist)) {
                        exitWithErrorPage(_gettext('That IP is on the whitelist'));
                    }
                    if ($bans_class->BanUser($ban_ip, $_SESSION['manageusername'], $ban_globalban, $ban_duration, $ban_boards, $ban_reason, $ban_note, $ban_appealat, $ban_type, $ban_allowread)) {
                        if ((KU_BANMSG != '' || $_POST['banmsg'] != '') && isset($_POST['addbanmsg']) && (isset($_POST['quickbanpostid']) || isset($_POST['quickmultibanpostid'])) || $instantban) {
                            $ban_msg = KU_BANMSG == $_POST['banmsg'] || empty($_POST['banmsg']) ? KU_BANMSG : $_POST['banmsg'];
                            if (isset($ban_post_id)) {
                                $postids = array($ban_post_id);
                            } else {
                                $postids = unserialize($_POST['quickmultibanpostid']);
                            }
                            foreach ($postids as $ban_post_id) {
                                $results = $tc_db->GetAll("SELECT HIGH_PRIORITY `parentid`, `message` FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = " . $tc_db->qstr($ban_post_id) . " LIMIT 1");
                                foreach ($results as $line) {
                                    $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "posts` SET `message` = " . $tc_db->qstr($line['message'] . $ban_msg) . " WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = " . $tc_db->qstr($ban_post_id));
                                    clearPostCache($ban_post_id, $ban_board_id);
                                    $board_class = new Board($ban_board);
                                    if ($line['parentid'] == 0) {
                                        $board_class->RegenerateThreads($ban_post_id);
                                    } else {
                                        $board_class->RegenerateThreads($line['parentid']);
                                    }
                                    $board_class->RegeneratePages();
                                    unset($board_class);
                                }
                            }
                        }
                        $tpl_page .= _gettext('Ban successfully placed.') . "<br />";
                    } else {
                        exitWithErrorPage(_gettext('Sorry, a generic error has occurred.'));
                    }
                    $logentry = _gettext('Banned') . ' ' . $ban_ip;
                    $logentry .= $ban_duration == 0 ? ' ' . _gettext('without expiration') : ' ' . _gettext('until') . ' ' . date('F j, Y, g:i a', time() + $ban_duration);
                    $logentry .= ' - ' . _gettext('Reason') . ': ' . $ban_reason . ($ban_note ? " (" . $ban_note . ")" : "") . ' - ' . _gettext('Banned from') . ': ';
                    $logentry .= $ban_globalban == 1 ? _gettext('All boards') . ' ' : '/' . implode('/, /', explode('|', $ban_boards)) . '/ ';
                    management_addlogentry($logentry, 8);
                    $ban_ip = '';
                }
                if (isset($_POST['deleteposts'])) {
                    $tpl_page .= '<br />';
                    $this->deletepostsbyip(true);
                }
                if (isset($_GET['instant']) && !isset($_GET['cp'])) {
                    die("success");
                }
                if (isset($_POST['banhashtime']) && $_POST['banhashtime'] !== '' && ($_POST['hash'] !== '' || isset($_POST['multibanhashes'])) && $_POST['banhashtime'] >= 0) {
                    if (isset($_POST['multibanhashes'])) {
                        $banhashes = unserialize($_POST['multibanhashes']);
                    } else {
                        $banhashes = array($_POST['hash']);
                    }
                    foreach ($banhashes as $banhash) {
                        $results = $tc_db->GetOne("SELECT HIGH_PRIORITY COUNT(*) FROM `" . KU_DBPREFIX . "bannedhashes` WHERE `md5` = " . $tc_db->qstr($banhash) . " LIMIT 1");
                        if ($results == 0) {
                            $tc_db->Execute("INSERT INTO `" . KU_DBPREFIX . "bannedhashes` ( `md5` , `bantime` , `description` ) VALUES ( " . $tc_db->qstr($banhash) . " , " . $tc_db->qstr($_POST['banhashtime']) . " , " . $tc_db->qstr($_POST['banhashdesc']) . " )");
开发者ID:stormeus,项目名称:Kusaba-Z,代码行数:67,代码来源:manage.class.php


注:本文中的Board::RegeneratePages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。