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


PHP order::move_up方法代码示例

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


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

示例1: order

$settings_fetch = $query_settings->fetchRow();
$sort_topics = $settings_fetch['sort_topics'];
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order($table, 'position', $id_field, 'section_id');
$back_url = ADMIN_URL . '/pages/modify.php?page_id=' . $page_id . '&hl=' . $id . '#tpid' . $id;
if ($fredit == 1) {
    $back_url = WB_URL . '/modules/' . $mod_dir . '/modify_fe.php?page_id=' . $page_id . '&section_id=' . $section_id . '&fredit=1&hl=' . $id . '#tpid' . $id;
}
if ($sort_topics == 0) {
    if ($_GET['move'] == 'up') {
        $ok = $order->move_down($id);
    }
    if ($_GET['move'] == 'down') {
        $ok = $order->move_up($id);
    }
}
if ($sort_topics == -1) {
    if ($_GET['move'] == 'down') {
        $ok = $order->move_down($id);
    }
    if ($_GET['move'] == 'up') {
        $ok = $order->move_up($id);
    }
}
if ($ok) {
    $admin->print_success($TEXT['SUCCESS'], $back_url);
} else {
    $admin->print_error($TEXT['ERROR'], $back_url);
}
开发者ID:wyg3958,项目名称:WebsiteBaker_CommunityEdition,代码行数:31,代码来源:move.php

示例2: header

        $common_field = 'page_id';
        $table = TABLE_PREFIX . 'sections';
    } else {
        $id = $_GET['page_id'];
        $id_field = 'page_id';
        $common_field = 'parent';
        $table = TABLE_PREFIX . 'pages';
    }
} else {
    header("Location: index.php");
    exit(0);
}
// Create new admin object and print admin header
$admin = new admin('Pages', 'pages_settings');
// Create new order object an reorder
$order = new order($table, 'position', $id_field, $common_field);
if ($id_field == 'page_id') {
    if ($order->move_up($id)) {
        $admin->print_success($MESSAGE['PAGES_REORDERED']);
    } else {
        $admin->print_error($MESSAGE['PAGES_CANNOT_REORDER']);
    }
} else {
    if ($order->move_up($id)) {
        $admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
    } else {
        $admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
    }
}
// Print admin footer
$admin->print_footer();
开发者ID:WBCE,项目名称:WebsiteBaker_CommunityEdition,代码行数:31,代码来源:move_up.php

示例3: order

 * @author          WebsiteBaker Project
 * @copyright       2004-2009, Ryan Djurovich
 * @copyright       2009-2011, Website Baker Org. e.V.
 * @link            http://www.websitebaker2.org/
 * @license         http://www.gnu.org/licenses/gpl.html
 * @platform        WebsiteBaker 2.8.x
 * @requirements    PHP 5.2.2 and higher
 * @version         $Id: move_up.php 1457 2011-06-25 17:18:50Z Luisehahne $
 * @filesource        $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/modules/form/move_up.php $
 * @lastmodified    $Date: 2011-06-25 19:18:50 +0200 (Sa, 25. Jun 2011) $
 * @description     
 */
require '../../config.php';
// Include WB admin wrapper script
require WB_PATH . '/modules/admin.php';
// Get id
$field_id = $admin->checkIDKEY('field_id', false, 'GET');
if (!$field_id) {
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order(TABLE_PREFIX . 'mod_form_fields', 'position', 'field_id', 'section_id');
if ($order->move_up($field_id)) {
    $admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
} else {
    $admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
// Print admin footer
$admin->print_footer();
开发者ID:WebsiteBaker-modules,项目名称:WB-Portable,代码行数:31,代码来源:move_up.php


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