本文整理汇总了PHP中forum::processLock方法的典型用法代码示例。如果您正苦于以下问题:PHP forum::processLock方法的具体用法?PHP forum::processLock怎么用?PHP forum::processLock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forum
的用法示例。
在下文中一共展示了forum::processLock方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Install
$installer = new Install();
if (isset($_POST['op']) && $_POST['op'] == 'process') {
switch ($_POST['type']) {
case 'activate':
$query = "UPDATE `" . $roster->db->table('topics', $addon['basename']) . "` SET `active` = '1' WHERE `topic_id` = '" . $_POST['id'] . "';";
$roster->db->query($query);
break;
case 'deactivate':
$query = "UPDATE `" . $roster->db->table('topics', $addon['basename']) . "` SET `active` = '0' WHERE `topic_id` = '" . $_POST['id'] . "';";
$roster->db->query($query);
break;
case 'delete':
processTopic();
break;
case 'lock':
$functions->processLock($_POST['id'], 1);
break;
case 'unlock':
$functions->processLock($_POST['id'], 0);
break;
default:
break;
}
}
$queryb = "SELECT `topics`.*, `posts`.`poster_id`, `posts`.`post_subject` as t_title," . "COUNT(`posts`.`post_id`) as topic_count " . "FROM `" . $roster->db->table('topics', $addon['basename']) . "` topics " . "LEFT JOIN `" . $roster->db->table('posts', $addon['basename']) . "` posts USING (`topic_id`) " . "GROUP BY `topics`.`topic_id` " . "ORDER BY `topics`.`topic_id` DESC; ";
$resultsb = $roster->db->query($queryb);
$num = 1;
$total = $roster->db->num_rows($resultsb);
while ($rowb = $roster->db->fetch($resultsb)) {
$roster->tpl->assign_block_vars('topic', array('ROW_CLASS' => $roster->switch_row_class(), 'T_NAME' => $rowb['title'], 'T_POSTER' => $rowb['author'], 'L_ACTIVEU' => $rowb['locked'] == 1 ? 'locked' : 'unlocked', 'L_ACTIVET' => $rowb['locked'] == 1 ? $roster->locale->act['lock'] : $roster->locale->act['unlock'], 'L_ACTIVEOP' => $rowb['locked'] == 1 ? 'unlock' : 'lock', 'B_ACTIVEI' => $rowb['active'] == 1 ? 'green' : 'red', 'B_ACTIVET' => $rowb['active'] == 1 ? 'Active' : 'Inactive', 'B_ACTIVEOP' => $rowb['active'] == 1 ? 'deactivate' : 'activate', 'FORUM_ID' => $rowb['topic_id'], 'T_POSTS' => $rowb['topic_count']));
}