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


PHP RMFunctions::get_num_records方法代码示例

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


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

示例1: elseif

    RMTemplate::get()->add_style('editor_img.css', 'rmcommon');
    if ($type == 'tiny') {
        RMTemplate::get()->add_script(RMCURL . '/api/editors/tinymce/tiny_mce_popup.js');
    } else {
        RMTemplate::get()->add_head('<script type="text/javascript">var exmPopup = window.parent.' . $en . ';</script>');
    }
    RMEvents::get()->run_event('rmcommon.loading_editorimages', '');
    include RMTemplate::get()->get_template('editor_image.php', 'module', 'rmcommon');
} elseif ($action == 'load-images') {
    $db = Database::getInstance();
    if (!$xoopsSecurity->check()) {
        _e('Sorry, unauthorized operation!', 'rmcommon');
        die;
    }
    // Check if some category exists
    $catnum = RMFunctions::get_num_records("rmc_img_cats");
    if ($catnum <= 0) {
        send_message(__('There are not categories yet! Please create one in order to add images.', 'rmcommon'));
        die;
    }
    if ($cat->isNew()) {
        send_message(__('You must select a category before', 'rmcommon'));
        die;
    }
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("rmc_images");
    if (!$cat->isNew()) {
        $sql .= " WHERE cat='" . $cat->id() . "'";
    }
    /**
     * Paginacion de Resultados
     */
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:tiny-images.php

示例2: save_category

/**
* Stores data for new categories
*/
function save_category($edit = 0)
{
    global $xoopsDB, $xoopsModuleConfig, $xoopsModule;
    $q = 'images.php?action=' . ($edit ? 'editcat' : 'newcat');
    foreach ($_POST as $k => $v) {
        if ($k == 'action' || $k == 'XOOPS_TOKEN_REQUEST') {
            continue;
        }
        if (is_array($v)) {
            $q .= '&' . RMFunctions::urlencode_array($v, $k);
        } else {
            $q .= '&' . $k . '=' . urlencode($v);
        }
    }
    extract($_POST);
    if ($edit) {
        if ($id <= 0) {
            redirectMsg('images.php?action=showcats', __('Specify a valid category id', 'rmcommon'), 1);
            die;
        }
        $cat = new RMImageCategory($id);
        if ($cat->isNew()) {
            redirectMsg('images.php?action=showcats', __('Specified category does not exists!', 'rmcommon'), 1);
            die;
        }
    } else {
        $cat = new RMImageCategory();
    }
    if ($name == '') {
        redirectMsg($q, __('Please specify a category name', 'rmcommon'), 1);
        die;
    }
    if (empty($read)) {
        $read = array(0);
    }
    if (empty($write)) {
        $write = array(0);
    }
    // Check if resize data is correct
    $schecked = array();
    foreach ($sizes as $size) {
        if (trim($size['name']) == '') {
            continue;
        }
        if ($size['type'] != 'none' && $size['width'] <= 0 && $size['height'] <= 0) {
            continue;
        }
        $schecked[] = $size;
    }
    if (empty($schecked)) {
        redirectMsg($q, __('You must create one size for this category at least!', 'rmcommon'), 1);
        die;
    }
    // Check if there are a category with same name
    $num = RMFunctions::get_num_records('rmc_img_cats', "name='{$name}'" . ($edit ? " AND id_cat<>'" . $cat->id() . "'" : ''));
    if ($num > 0) {
        redirectMsg($q, __('There is already a category with the same name!', 'rmcommon'), 1);
        die;
    }
    $cat->setVar('name', $name);
    $cat->setVar('status', $status);
    $cat->setVar('groups', array('write' => $write, 'read' => $read));
    $cat->setVar('sizes', $schecked);
    $cat->setVar('filesize', $filesize <= 0 ? '50' : $filesize);
    $cat->setVar('sizeunit', $sizeunit <= 0 ? '1024' : $sizeunit);
    if ($cat->save()) {
        redirectMsg('images.php?action=showcats', __($edit ? 'Category updated successfully!' : 'Category saved successfully!', 'rmcommon'), 0);
    } else {
        redirectMsg($q, __('There were some erros while trying to save this category.', 'rmcommon') . '<br />' . $cat->errors(), 1);
    }
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:74,代码来源:images.php

示例3: elseif

    if ($type == 'tiny' && $target != 'container') {
        RMTemplate::get()->add_script(RMCURL . '/api/editors/tinymce/tiny_mce_popup.js');
    } elseif ($target != 'container' && $type != 'external') {
        RMTemplate::get()->add_head_script('var exmPopup = window.parent.exmCode' . ucfirst($container) . ';');
    }
    RMEvents::get()->run_event('rmcommon.loading.editorimages', '');
    include RMTemplate::get()->get_template('rmc-editor-image.php', 'module', 'rmcommon');
} elseif ($action == 'load-images') {
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    if (!$xoopsSecurity->check()) {
        _e('Sorry, unauthorized operation!', 'rmcommon');
        echo '<script type="text/javascript">window.location.href="tiny-images.php";</script>';
        die;
    }
    // Check if some category exists
    $catnum = RMFunctions::get_num_records("mod_rmcommon_images_categories");
    if ($catnum <= 0) {
        send_message(__('There are not categories yet! Please create one in order to add images.', 'rmcommon'));
        die;
    }
    if ($cat->isNew()) {
        send_message(__('You must select a category before', 'rmcommon'));
        die;
    }
    $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_rmcommon_images");
    if (!$cat->isNew()) {
        $sql .= " WHERE cat='" . $cat->id() . "'";
    }
    /**
     * Paginacion de Resultados
     */
开发者ID:JustineBABY,项目名称:rmcommon,代码行数:31,代码来源:tiny-images.php


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