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


PHP RMFunctions::load_images_categories方法代码示例

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


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

示例1: edit_image

/**
* Function to edit images
*/
function edit_image()
{
    global $xoopsUser, $xoopsSecurity;
    $id = rmc_server_var($_GET, 'id', 0);
    $page = rmc_server_var($_GET, 'page', '');
    if ($id <= 0) {
        redirectMsg('images.php', __('Invalid image ID', 'rmcommon'), 1);
        die;
    }
    $image = new RMImage($id);
    if ($image->isNew()) {
        redirectMsg('images.php', __('Image not found!', 'rmcommon'), 1);
        die;
    }
    $cat = new RMImageCategory($image->getVar('cat'));
    $sizes = $cat->getVar('sizes');
    $current_size = array();
    $fd = pathinfo($image->getVar('file'));
    $updir = '/' . date('Y', $image->getVar('date')) . '/' . date('m', time());
    foreach ($sizes as $size) {
        if ($size['width'] <= 0) {
            continue;
        }
        if (empty($current_size)) {
            $current_size = $size;
        } else {
            if ($current_size['width'] >= $size['width'] && $size['width'] > 0) {
                $current_size = $size;
            }
        }
        $image_data['sizes'][] = array('file' => XOOPS_UPLOAD_URL . $updir . '/sizes/' . $fd['filename'] . '_' . $size['width'] . 'x' . $size['height'] . '.' . $fd['extension'], 'name' => $size['name']);
    }
    $image_data['thumbnail'] = XOOPS_UPLOAD_URL . $updir . '/sizes/' . $fd['filename'] . '_' . $current_size['width'] . 'x' . $current_size['height'] . '.' . $fd['extension'];
    $mimes = (include XOOPS_ROOT_PATH . '/include/mimetypes.inc.php');
    $image_data['mime'] = isset($mimes[$fd['extension']]) ? $mimes[$fd['extension']] : 'application/octet-stream';
    $image_data['file'] = $image->getVar('file');
    $image_data['date'] = $image->getVar('date');
    $image_data['title'] = $image->getVar('title');
    $image_data['desc'] = $image->getVar('desc', 'e');
    $image_data['url'] = XOOPS_UPLOAD_URL . $updir . '/' . $image->getVar('file');
    $categories = RMFunctions::load_images_categories("WHERE status='open' ORDER BY id_cat DESC");
    xoops_cp_header();
    RMFunctions::create_toolbar();
    RMTemplate::get()->add_script('include/js/images.js');
    RMTemplate::get()->add_script('include/js/jquery.validate.min.js');
    RMTemplate::get()->add_style('imgmgr.css', 'rmcommon');
    include RMTemplate::get()->get_template('images_edit.php', 'module', 'rmcommon');
    xoops_cp_footer();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:52,代码来源:images.php

示例2: RMFlashUploader

        $uploader = new RMFlashUploader('files-container', 'upload.php');
        $uploader->add_setting('scriptData', array('action' => 'upload', 'category' => $cat->id(), 'rmsecurity' => TextCleaner::getInstance()->encrypt($xoopsUser->uid() . '|' . RMCURL . '/images.php' . '|' . $xoopsSecurity->createToken(), true)));
        $uploader->add_setting('multi', true);
        $uploader->add_setting('fileExt', '*.jpg;*.png;*.gif');
        $uploader->add_setting('fileDesc', __('All Images (*.jpg, *.png, *.gif)', 'rmcommon'));
        $uploader->add_setting('sizeLimit', $cat->getVar('filesize') * $cat->getVar('sizeunit'));
        $uploader->add_setting('buttonText', __('Browse Images...', 'rmcommon'));
        $uploader->add_setting('queueSizeLimit', 100);
        $uploader->add_setting('auto', true);
        $uploader->add_setting('onSelect', "function(event, qid, file){\n        \tif (queuefiles[qid]) return false;\n        \tqueuefiles[qid] = true;\n        \treturn true;\n        }");
        $uploader->add_setting('onComplete', "function(event, id, file, resp, data){\n            eval('ret = '+resp);\n            if (ret.error){\n                \$('#upload-errors').append('<span class=\"failed\"><strong>'+file.name+'</strong>: '+ret.message+'</span>');\n            } else {\n                total++;\n                ids[total-1] = ret.id;\n                \$('#upload-errors').append('<span class=\"done\"><strong>'+file.name+'</strong>: " . __('Uploaded successfully!', 'rmcommon') . "</span>');\n            }\n            return true;\n        }");
        $uploader->add_setting('onAllComplete', "function(event, data){\n            if(total<=0) return;\n                \$('.categories_selector').hide('slow');\n                \$('#upload-errors').hide('slow');\n                \$('#upload-errors').html('');\n                \$('#upload-controls').hide('slow');\n                \$('#resizer-bar').show('slow');\n                \$('#resizer-bar').effect('highlight',{},1000);\n                \$('#gen-thumbnails').show();\n                    \n                var increments = 1/total*100;\n                url = '" . RMCURL . "/images.php';\n                    \n                params = '" . TextCleaner::getInstance()->encrypt($xoopsUser->uid() . '|' . RMCURL . '/images.php' . '|' . $xoopsSecurity->createToken(), true) . "';\n                resize_image(params);\n                    \n        }");
        $uploader->add_setting('onSelectOnce', "function(event, data){\n            \$('#upload-errors').html('');\n        }");
        RMTemplate::get()->add_head($uploader->render());
    }
    $categories = RMFunctions::load_images_categories("WHERE status='open' ORDER BY id_cat DESC", true);
    RMTemplate::get()->add_style('imgmgr.css', 'rmcommon');
    RMTemplate::get()->add_style('pagenav.css', 'rmcommon');
    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;
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:tiny-images.php


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