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


PHP RMFunctions::current_url方法代码示例

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


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

示例1: eventRmcommonXoopsCommonEnd

 public function eventRmcommonXoopsCommonEnd()
 {
     global $xoopsConfig;
     // Get preloaders from current theme
     RMEvents::get()->load_extra_preloads(XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'], ucfirst($xoopsConfig['theme_set'] . 'Theme'));
     $url = RMFunctions::current_url();
     $p = parse_url($url);
     if (substr($p['path'], -11) == 'backend.php') {
         include_once RMCPATH . '/rss.php';
         die;
     }
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:12,代码来源:rmcommon.php

示例2: eventCoreIncludeCommonLanguage

 /**
  * To prevent errors when upload images with closed site 
  */
 public function eventCoreIncludeCommonLanguage()
 {
     global $xoopsConfig;
     if (RMFunctions::current_url() == RMCURL . '/include/upload.php' && $xoopsConfig['closesite']) {
         $security = rmc_server_var($_POST, 'rmsecurity', 0);
         $data = TextCleaner::getInstance()->decrypt($security, true);
         $data = explode("|", $data);
         // [0] = referer, [1] = session_id(), [2] = user, [3] = token
         $xoopsUser = new XoopsUser($data[0]);
         if ($xoopsUser->isAdmin()) {
             $xoopsConfig['closesite'] = 0;
         }
     }
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:17,代码来源:core.php

示例3: formPublish

/**
* @desc Formulario para la creación de una nueva publicación
**/
function formPublish()
{
    global $xoopsModuleConfig, $xoopsUser, $xoopsTpl, $xoopsConfig;
    include 'header.php';
    //Verificamos si existen permisos para crear un nuevo recurso
    if (!$xoopsModuleConfig['createres']) {
        redirect_header(RDFunctions::url(), 1, __('The creation of new Documents has been disabled by administrator.', 'docs'));
        die;
    }
    //Verificamos si usuario tiene permisos de crear nuevo recurso
    $res = new RDResource();
    if (!RDFunctions::new_resource_allowed($xoopsUser ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS))) {
        redirect_header(RDFunctions::url(), 1, __('You can not create Documents.', 'docs'));
        die;
    }
    $xoopsTpl->assign('xoops_pagetitle', __('Create Document', 'docs'));
    $form = new RMForm(__('Create Document', 'docs'), 'frmres', RMFunctions::current_url());
    $form->setExtra("enctype='multipart/form-data'");
    $form->addElement(new RMFormText(__('Document title', 'docs'), 'title', 50, 150), true);
    $form->addElement(new RMFormTextArea(__('Description', 'docs'), 'desc', 5, 50), true);
    //editores de la publicación
    $form->addElement(new RMFormUser(__('Editors', 'docs'), 'editors', 1, $xoopsUser ? array($xoopsUser->uid()) : array(), 30));
    //Grupos con permiso de acceso
    $form->addElement(new RMFormGroups(__('Groups that can read Document', 'docs'), 'groups', 1, 1, 1, array(1, 2)), true);
    $form->addElement(new RMFormYesno(__('Quick index', 'docs'), 'quick'));
    $form->addElement(new RMFormYesno(__('Show index to restricted users', 'docs'), 'showindex'));
    $form->addElement(new RMFormYesno(__('Show content in a single page', 'docs'), 'single'));
    $form->addElement(new RMFormLabel(__('Approved', 'docs'), $xoopsModuleConfig['approved'] ? __('Inmediatly', 'docs') : __('Wait for approval', 'docs')));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', __('Publish Document'), 'submit');
    $buttons->addButton('cancel', _CANCEL, 'button', 'onclick="history.go(-1);"');
    $form->addElement($buttons);
    $form->addElement(new RMFormHidden('action', 'save'));
    $form->display();
    RMTemplate::get()->add_style('forms.css', 'docs');
    include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:40,代码来源:publish.php

示例4: comments_form

 /**
  * Create the comments form
  * You need to include the template 'rmc_comments_form.html' where
  * you wish to show this form
  * @param string Object name (eg. mywords, qpages, etc.)
  * @param string Params to be included in form
  * @param string Object type (eg. module, plugin, etc.)
  * @param string File path to get the methods to update comments
  */
 public function comments_form($obj, $params, $type = 'module', $file = array())
 {
     global $xoopsTpl, $xoopsRequestUri, $xoopsUser;
     $config = self::configs();
     if (!$config['enable_comments']) {
         return;
     }
     if (!$xoopsUser && !$config['anonymous_comments']) {
         return;
     }
     if (!defined('COMMENTS_INCLUDED')) {
         define('COMMENTS_INCLUDED', 1);
     }
     $xoopsTpl->assign('enable_comments_form', 1);
     $form = array('show_name' => !$xoopsUser, 'lang_name' => __('Name', 'rmcommon'), 'show_email' => !$xoopsUser, 'lang_email' => __('Email address', 'rmcommon'), 'show_url' => !$xoopsUser, 'lang_url' => __('Web site', 'rmcommon'), 'lang_text' => __('Your comment', 'rmcommon'), 'lang_submit' => __('Submit Comment', 'rmcommon'), 'lang_title' => __('Submit a comment', 'rmcommon'), 'uri' => urlencode(RMFunctions::current_url()), 'actionurl' => RMCURL . '/post_comment.php', 'params' => urlencode($params), 'update' => urlencode(str_replace(XOOPS_ROOT_PATH, '', $file)), 'type' => $type, 'object' => $obj, 'action' => 'save');
     // You can include new content into Comments form
     // eg. Captcha checker, etc
     $form = RMEvents::get()->run_event('rmcommon.comments.form', $form, $obj, $params, $type);
     RMTemplate::get()->add_jquery();
     RMTemplate::get()->add_script(RMCURL . '/include/js/jquery.validate.min.js');
     RMTemplate::get()->add_head('<script type="text/javascript">
     $(document).ready(function(){
     	$("#rmc-comment-form").validate({
     		messages: {
     			comment_name: "' . __('Please specify your name', 'rmcommon') . '",
     			comment_email: "' . __('Please specify a valid email', 'rmcommon') . '",
     			comment_text: "' . __('Please write a message', 'rmcommon') . '",
     			comment_url: "' . __('Please enter a valid URL', 'rmcommon') . '"
     		}
     	});
     });</script>');
     $xoopsTpl->assign('cf', $form);
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:42,代码来源:functions.php

示例5: header

    if (FALSE !== strpos($url, XOOPS_URL . '/modules/docs')) {
        header('location: ' . RDFunctions::url());
        die;
    }
    // If friendly urls are activated
    $path = str_replace(XOOPS_URL, '', RMFunctions::current_url());
    $path = str_replace($xoopsModuleConfig['htpath'], '', $path);
    $path = trim($path, '/');
    if ($xoopsModuleConfig['subdomain'] != '') {
        $path = str_replace(rtrim($xoopsModuleConfig['subdomain'], '/'), '', $path);
        $path = trim($path, '/');
    }
    $params = explode("/", $path);
} else {
    // If friendly urls are disabled
    $path = parse_url(RMFunctions::current_url());
    if (isset($path['query'])) {
        parse_str($path['query']);
    }
    if (!isset($page) || $page == '') {
        require 'mainpage.php';
        die;
    }
    $file = $page . '.php';
    if (!file_exists(XOOPS_ROOT_PATH . '/modules/docs/' . $file)) {
        RDfunctions::error_404();
    }
    if (!$xoopsModuleConfig['standalone'] && isset($standalone)) {
        unset($standalone);
    }
    include $file;
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:index.php

示例6: showImageDetails

/**
* @desc Mostramos los detalles de una imágen
*/
function showImageDetails()
{
    global $usr, $set, $img, $db, $xoopsModule, $mc, $xoopsModuleConfig, $xoopsConfig, $xoopsUser, $xoopsOption, $tpl;
    $user = new GSUser($usr);
    if ($user->isNew()) {
        redirect_header(GSFunctions::get_url(), 0, __('Specified user does not exists!', 'galleries'));
        die;
    }
    $image = new GSImage($img);
    if ($image->isNew()) {
        redirect_header(GSFunctions::get_url(), 0, __('Specified image does not exists!', 'galleries'));
        die;
    }
    $user = new GSUser($image->owner(), 1);
    //Verificamos la privacidad de la imagen
    if (!$image->isPublic()) {
        //Privada, Verificamos si el usuario es el dueño de la imagen
        if (!$xoopsUser || $xoopsUser->uid() != $image->owner()) {
            redirect_header(GSFunctions::get_url(), 1, __('You can not view this image!', 'galleries'));
            die;
        }
    } else {
        if ($image->isPublic() == 1) {
            //Privada y amigos
            if (!$xoopsUser || $xoopsUser->uid() != $image->owner()) {
                //Verificamos si es un amigo
                if (!$xoopsUser || !$user->isFriend($xoopsUser->uid())) {
                    redirect_header(GSFunctions::get_url(), 1, __('You are not authorized to view this image!', 'galleries'));
                    die;
                }
            }
        }
    }
    //Incrementamos las vistas de la imagen
    $image->addViews();
    if (isset($set)) {
        $set = new GSSet($set);
        if ($set->isNew()) {
            redirect_header(GSFunctions::get_url(), 0, __('Specified album does not exists!', 'galleries'));
            die;
        }
    }
    if ($image->desc() != '') {
        global $xoTheme;
        $xoTheme->addMeta('meta', 'description', $image->desc());
    }
    $xoopsOption['template_main'] = 'gs_imgdetails.html';
    $xoopsOption['module_subpage'] = 'picsdetails';
    include 'header.php';
    GSFunctions::makeHeader();
    $tpl->assign('user', array('id' => $user->id(), 'uname' => $user->uname(), 'link' => $user->userURL(), 'avatar' => $user->userVar('user_avatar') != '' ? XOOPS_URL . '/uploads/avatars/' . $user->userVar('user_avatar') : GS_URL . '/images/avatar.png'));
    $tpl->assign('user_link', $user->userURL());
    $tpl->assign('lang_alsobelong', __('Also belongs to:', 'galleries'));
    $tpl->assign('lang_postcards', __('Send postcard', 'galleries'));
    $tpl->assign('lang_bookmark', __('+ Bookmark', 'galleries'));
    $tpl->assign('lang_photos', __('Pictures', 'galleries'));
    $tpl->assign('lang_toset', __('+ to Album', 'galleries'));
    $tpl->assign('lang_lastpic', __('This is the last picture', 'galleries'));
    $tpl->assign('lang_firstpic', __('This is the first picture', 'galleries'));
    $tpl->assign('toset_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/toset/ids/' . $image->id() . '/referer/' . base64_encode(RMFunctions::current_url()) . '/' : '?cp=toset&amp;ids=' . $image->id() . '&amp;referer=' . base64_encode(RMFunctions::current_url())));
    $tpl->assign('edit_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/edit/id/' . $image->id() . '/referer/' . base64_encode(RMFunctions::current_url()) . '/' : '?cp=edit&amp;id=' . $image->id() . '&amp;referer=' . base64_encode(RMFunctions::current_url())));
    $tpl->assign('bookmark_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/bookmarks/add/' . $image->id() . '/referer/' . base64_encode($_SERVER['REQUEST_URI']) : '?cpanel=bookmarks&amp;add=' . $image->id() . '&amp;referer=' . base64_encode($_SERVER['REQUEST_URI'])));
    $tpl->assign('postcard_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'postcard/new/img/' . $image->id() . '/' : '?postcard=new&amp;img=' . $image->id()));
    $tpl->assign('delete_link', GSFunctions::get_url() . ($mc['urlmode'] ? 'cp/delete/referer/' . base64_encode(RMFunctions::current_url()) . '/ids/' : '?cpanel=delete&amp;referer=' . base64_encode(RMFunctions::current_url()) . '&amp;ids='));
    $tpl->assign('lang_confirmdel', sprintf(__('Dow you really want to delete this picture?\\n(%s)', 'galleries'), $image->title()));
    if ($xoopsUser && $xoopsUser->uid() == $image->owner()) {
        $tpl->assign('lang_edit', __('Edit', 'galleries'));
        $tpl->assign('lang_delete', __('Delete', 'galleries'));
        $tpl->assign('isowner', 1);
    }
    $tpl->assign('postcards', $mc['postcards']);
    $data = getimagesize($user->filesURL() . '/' . $image->image());
    $tpl->assign('image', array('title' => $image->title(), 'id' => $image->id(), 'file' => $user->filesURL() . '/' . $image->image(), 'desc' => $image->desc(), 'width' => $data[0] + 2, 'height' => $data[1] + 2));
    unset($data);
    //Verificamos si el usuario es dueño o amigo
    if ($xoopsUser && $xoopsUser->uid() == $user->uid()) {
        $public = '';
    } else {
        if ($xoopsUser && $user->isFriend($xoopsUser->uid())) {
            $public = " AND public<>'0'";
        } else {
            $public = " AND public='2'";
        }
    }
    // Imágenes anterior y siguiente
    if (!isset($set)) {
        // Navigation as images
        if ($xoopsModuleConfig['navimages']) {
            $limit_n = $xoopsModuleConfig['navimages_num'];
            $limit_p = $xoopsModuleConfig['navimages_num'];
            // Count images
            $sql = "SELECT * FROM " . $db->prefix("gs_images") . " WHERE id_image>'" . $image->id() . "' AND owner='" . $user->uid() . "' {$public} ORDER BY id_image ASC LIMIT 0," . $xoopsModuleConfig['navimages_num'];
            $resultn = $db->query($sql);
            if ($db->getRowsNum($resultn) < $xoopsModuleConfig['navimages_num']) {
                $limit_p = $limit_p + ($xoopsModuleConfig['navimages_num'] - $db->getRowsNum($resultn));
            }
            $sql = "SELECT * FROM " . $db->prefix("gs_images") . " WHERE id_image<'" . $image->id() . "' AND owner='" . $user->uid() . "' {$public} ORDER BY id_image DESC, created DESC LIMIT 0," . $limit_p;
//.........这里部分代码省略.........
开发者ID:laiello,项目名称:bitcero-modules,代码行数:101,代码来源:user.php

示例7: str_replace

<?php

// $Id$
// --------------------------------------------------------------
// MyGalleries
// Module for advanced image galleries management
// Author: Eduardo Cortés <i.bitcero@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
if ($xoopsModuleConfig['urlmode']) {
    // Get parameters directly from URL when mod_rewrite is enabled
    $params = str_replace(XOOPS_URL, '', RMFunctions::current_url());
    $params = str_replace($xoopsModuleConfig['urlbase'], '', $params);
    $params = trim($params, '/');
    $params = explode("/", $params);
    foreach ($params as $i => $p) {
        switch ($p) {
            case 'cp':
                // Control Panel
                $cp = isset($params[$i + 1]) ? $params[$i + 1] : 'images';
                break;
            case 'pag':
                // Page number
                $page = $params[$i + 1];
                break;
            case 'usr':
                // User
                $usr = $params[$i + 1];
                break;
            case 'explore':
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:parse.php

示例8: _e

<?php

include RMTemplate::get()->get_template('rd_header.php', 'module', 'docs');
?>

<h1><?php 
$edit ? _e('Edit Page', 'docs') : _e('New Page', 'docs');
?>
</h1>

<div class="form_container">
<form name="frmPage" id="frm-page" method="post" action="<?php 
echo RMFunctions::current_url();
?>
">
<label><?php 
_e('Document', 'docs');
?>
</label>
<span><?php 
echo $res->getVar('title');
?>
</span>
<label for="sec-title"><?php 
_e('Title', 'docs');
?>
</label>
<input type="text" name="title" id="sec-title" value="<?php 
echo $edit ? $section->getVar('title') : '';
?>
" />
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:rd_sec.php

示例9: eventRmcommonEndFlush

 /**
  * This event save the current page if is neccesary
  */
 public function eventRmcommonEndFlush($output)
 {
     global $xoopsUser, $xoopsConfig;
     $plugin = RMFunctions::load_plugin('booster');
     if (!$plugin->get_config('enabled')) {
         return $output;
     }
     if (defined('BOOSTER_NOTSAVE')) {
         return $output;
     }
     $url = RMFunctions::current_url();
     $path = parse_url($url);
     if ($plugin->is_excluded($url)) {
         return $output;
     }
     if ($xoopsUser) {
         $file = XOOPS_CACHE_PATH . '/booster/files/' . md5($url . session_id() . '|' . $xoopsConfig['language']);
         setcookie('booster_session', session_id() . '|' . $xoopsConfig['language'], 0, '/');
     } else {
         $file = XOOPS_CACHE_PATH . '/booster/files/' . md5($url . $xoopsConfig['language']);
     }
     $data = array('uri' => $url, 'created' => time(), 'language' => $xoopsConfig['language']);
     $pos = strpos($output, '<div id="xo-logger-output">');
     if ($pos !== FALSE) {
         file_put_contents($file . '.html', substr($output, 0, $pos) . '<!-- Cached by Booster -->');
     } else {
         file_put_contents($file . '.html', $output . '<!-- Cached by Booster -->');
     }
     file_put_contents($file . '.meta', json_encode($data));
     $plugin->delete_expired();
     return $output;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:rmcommon.php

示例10: str_replace

<?php

// $Id$
// --------------------------------------------------------------
// MyWords
// Complete Blogging System
// Author: BitC3R0 <bitc3r0@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
include "../../mainfile.php";
$request = str_replace(XOOPS_URL, '', RMFunctions::current_url());
$request = str_replace("/modules/mywords/", '', $request);
if ($xoopsModuleConfig['permalinks'] > 1 && $xoopsModuleConfig['basepath'] != '/') {
    $request = str_replace(rtrim($xoopsModuleConfig['basepath'], '/') . '/', '', rtrim($request, '/') . '/');
}
$yesquery = false;
if (substr($request, 0, 1) == '?') {
    $request = substr($request, 1);
    $yesquery = true;
}
if ($request == '' || $request == 'index.php') {
    require 'home.php';
    die;
}
$params = explode("/", $request);
if ($params[0] == 'page') {
    require 'home.php';
    die;
}
$vars = array();
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:index.php

示例11: redirect_header

        die;
    }
    redirect_header(ShopFunctions::get_url(), 1, __('Your message has been sent successfully!', 'shop'));
} else {
    $xoopsOption['template_main'] = 'shop_contact.html';
    include 'header.php';
    $tf = new RMTimeFormatter(0, '%d%/%M%/%Y%');
    // Product data
    $xoopsTpl->assign('product', array('name' => $product->getVar('name'), 'description' => $product->getVar('description'), 'price' => sprintf(__('Price: <strong>%s</strong>', 'shop'), sprintf($xoopsModuleConfig['format'], number_format($product->getVar('price'), 2))), 'type' => $product->getVar('type'), 'stock' => $product->getVar('available'), 'image' => $product->getVar('image'), 'created' => sprintf(__('Since: <strong>%s</strong>', 'shop'), $tf->format($product->getVar('created'))), 'updated' => $product->getVar('modified') > 0 ? sprintf(__("Updated: <strong>%s</strong>", 'shop'), $tf->format($product->getVar('modified'))) : '', 'link' => $product->permalink(), 'metas' => $product->get_meta(), 'images' => $product->get_images()));
    $categories = array();
    ShopFunctions::categos_list($categories);
    array_walk($categories, 'shop_dashed');
    $xoopsTpl->assign('categories_list', $categories);
    $xoopsTpl->assign('lang_selcat', __('Select category...', 'shop'));
    $xoopsTpl->assign('xoops_pagetitle', sprintf(__('Requesting information about %s', 'shop'), $product->getVar('name')) . ' &raquo; ' . $xoopsModuleConfig['modtitle']);
    $xoopsTpl->assign('lang_requesting_info', sprintf(__('Request Information for %s', 'shop'), $product->getVar('name')));
    $xoopsTpl->assign('lang_yname', __('Your Name:', 'shop'));
    $xoopsTpl->assign('lang_ymail', __('Your Email:', 'shop'));
    $xoopsTpl->assign('lang_prod', __('Product:', 'shop'));
    $xoopsTpl->assign('lang_message', __('Message:', 'shop'));
    $xoopsTpl->assign('lang_send', __('Send Message', 'shop'));
    $xoopsTpl->assign('form_action', RMFunctions::current_url());
    if ($xoopsUser) {
        $xoopsTpl->assign('shop_name', $xoopsUser->name());
        $xoopsTpl->assign('shop_email', $xoopsUser->email());
    }
    $captcha = RMEvents::get()->run_event('rmcommon.recaptcha.field');
    $xoopsTpl->assign('captcha', $captcha);
    RMTemplate::get()->add_style('main.css', 'shop');
    include 'footer.php';
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:contact.php

示例12: url_params

 /**
  * Get parameters from url
  */
 public function url_params()
 {
     $mc = RMUtilities::module_config('shop');
     $category = '';
     $page = 1;
     $id = '';
     $contact = '';
     if ($mc['urlmode']) {
         $params = str_replace(XOOPS_URL, '', RMFunctions::current_url());
         $params = str_replace($mc['htbase'], '', $params);
         $params = trim($params, '/');
         $params = explode("/", $params);
         $fc = false;
         // Switch to category path
         foreach ($params as $i => $k) {
             switch ($k) {
                 case 'category':
                     $category = $params[$i + 1];
                     $fc = true;
                     break;
                 case 'page':
                     $page = $params[$i + 1];
                     $fc = false;
                     break;
                 case 'contact':
                     $contact = $params[$i + 1];
                     $fc = false;
                     break;
                 default:
                     if ($category != '' && $category != $k && $fc) {
                         $category .= '/' . $k;
                     }
                     $id = $category == '' && $page <= 1 && $contact == '' ? $params[0] : '';
                     break;
             }
         }
     } else {
         $category = rmc_server_var($_GET, 'cat', 0);
         $id = rmc_server_var($_GET, 'id', 0);
         $page = rmc_server_var($_GET, 'page', 0);
         $contact = rmc_server_var($_GET, 'contact', 0);
     }
     $ret['category'] = $category;
     $ret['page'] = $page;
     $ret['id'] = $id;
     $ret['contact'] = $contact;
     return $ret;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:51,代码来源:shopfunctions.php


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