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


PHP get_root_url函数代码示例

本文整理汇总了PHP中get_root_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_root_url函数的具体用法?PHP get_root_url怎么用?PHP get_root_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: on_index_thumbnails

 static function on_index_thumbnails($thumbs)
 {
     global $page, $template;
     $total = count($page['items']);
     if (count($thumbs) >= $total) {
         add_event_handler('loc_end_index', array('RVTS', 'on_end_index'));
         return $thumbs;
     }
     $url_model = str_replace('123456789', '%start%', duplicate_index_url(array('start' => 123456789)));
     $ajax_url_model = add_url_params($url_model, array('rvts' => '%per%'));
     $url_model = str_replace('&', '&', $url_model);
     $ajax_url_model = str_replace('&', '&', $ajax_url_model);
     $my_base_name = basename(dirname(__FILE__));
     $ajax_loader_image = get_root_url() . "plugins/{$my_base_name}/ajax-loader.gif";
     $template->func_combine_script(array('id' => 'jquery', 'load' => 'footer', 'path' => 'themes/default/js/jquery.min.js'));
     $template->func_combine_script(array('id' => $my_base_name, 'load' => 'async', 'path' => 'plugins/' . $my_base_name . '/rv_tscroller.min.js', 'require' => 'jquery', 'version' => RVTS_VERSION));
     $start = (int) $page['start'];
     $per_page = $page['nb_image_page'];
     $moreMsg = 'See the remaining %d photos';
     if ('en' != $GLOBALS['lang_info']['code']) {
         load_language('lang', dirname(__FILE__) . '/');
         $moreMsg = l10n($moreMsg);
     }
     // the String.fromCharCode comes from google bot which somehow manage to get these urls
     $template->block_footer_script(null, "var RVTS = {\najaxUrlModel: String.fromCharCode(" . ord($ajax_url_model[0]) . ")+'" . substr($ajax_url_model, 1) . "',\nstart: {$start},\nperPage: {$per_page},\nnext: " . ($start + $per_page) . ",\ntotal: {$total},\nurlModel: String.fromCharCode(" . ord($url_model[0]) . ")+'" . substr($url_model, 1) . "',\nmoreMsg: '{$moreMsg}',\nprevMsg: '" . l10n("Previous") . "',\najaxLoaderImage: '{$ajax_loader_image}'\n};\njQuery('.navigationBar').hide();");
     return $thumbs;
 }
开发者ID:kappuccino,项目名称:piwigo-tscroller,代码行数:27,代码来源:main.inc.php

示例2: osm_photo_add_tab

function osm_photo_add_tab($sheets, $id)
{
    if ($id == 'photo') {
        $sheets['openstreetmap'] = array('caption' => '<span class="osm-globe"></span>OpenStreetMap', 'url' => get_root_url() . 'admin.php?page=plugin&amp;section=piwigo-openstreetmap/admin/admin_photo.php&amp;image_id=' . $_GET['image_id']);
    }
    return $sheets;
}
开发者ID:lcorbasson,项目名称:piwigo-openstreetmap,代码行数:7,代码来源:admin_boot.php

示例3: setUp

 protected function setUp()
 {
     $this->install_type = get_install_type();
     $this->page_root = get_root_url();
     $this->setBrowser("*firefox");
     $this->setBrowserUrl($this->page_root . '/');
 }
开发者ID:vinod-co,项目名称:centa,代码行数:7,代码来源:003-RunAsStudentMRQTest.php

示例4: PP_Init

/**
 * Triggered on loc_begin_index
 * 
 * Perform user logout after registration if account locked and redirection to profile page is password renewal is set
 */
function PP_Init()
{
    global $conf, $user;
    include_once PHPWG_ROOT_PATH . 'admin/include/functions.php';
    $conf_PP = unserialize($conf['PasswordPolicy']);
    // Perfoming redirection for locked accounts
    // -----------------------------------------
    if (!is_a_guest() and $user['username'] != "16" and $user['username'] != "18") {
        // Perform user logout if user account is locked
        if (isset($conf_PP['LOGFAILBLOCK']) and $conf_PP['LOGFAILBLOCK'] == 'true' and PP_UsrBlock_Verif($user['username']) and !is_admin() and !is_webmaster()) {
            invalidate_user_cache();
            logout_user();
            if ($conf['guest_access']) {
                redirect(make_index_url() . '?PP_msg=locked', 0);
            } else {
                redirect(get_root_url() . 'identification.php?PP_msg=locked', 0);
            }
        }
    }
    // Performing redirection to profile page for password reset
    // ---------------------------------------------------------
    if (isset($conf_PP['PWDRESET']) and $conf_PP['PWDRESET'] == 'true') {
        $query = '
SELECT user_id, status
FROM ' . USER_INFOS_TABLE . '
WHERE user_id = ' . $user['id'] . '
;';
        $data = pwg_db_fetch_assoc(pwg_query($query));
        if ($data['status'] != "webmaster" and $data['status'] != "generic") {
            if (PP_check_pwdreset($user['id'])) {
                redirect(PHPWG_ROOT_PATH . 'profile.php');
            }
        }
    }
}
开发者ID:Eric-Piwigo,项目名称:Password_Policy,代码行数:40,代码来源:functions.inc.php

示例5: PH_admin_menu

/**
 * Plugin administration menu
 */
function PH_admin_menu($menu)
{
    // Retreive plugin name
    $plugin = PHInfos(PH_PATH);
    $name = $plugin['name'];
    array_push($menu, array('NAME' => $name, 'URL' => get_root_url() . 'admin.php?page=plugin-' . basename(PH_PATH)));
    return $menu;
}
开发者ID:Eric-Piwigo,项目名称:Prune_History,代码行数:11,代码来源:functions.inc.php

示例6: NBMS_admin_menu

function NBMS_admin_menu($menu)
{
    // +-----------------------------------------------------------------------+
    // |                      Getting plugin name                              |
    // +-----------------------------------------------------------------------+
    $plugin = NBMSInfos(NBMS_PATH);
    $name = $plugin['name'];
    array_push($menu, array('NAME' => $name, 'URL' => get_root_url() . 'admin.php?page=plugin-' . basename(NBMS_PATH)));
    return $menu;
}
开发者ID:Eric-Piwigo,项目名称:NBM_Subscriber,代码行数:10,代码来源:main.inc.php

示例7: tg_groups_display

function tg_groups_display()
{
    global $conf, $template, $user, $tags, $page;
    load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    load_language('lang', PHPWG_ROOT_PATH . PWG_LOCAL_DIR, array('no_fallback' => true, 'local' => true));
    $template->set_prefilter('tags', 'tg_add_display_link_prefilter');
    $template->assign('U_TAG_GROUPS', get_root_url() . 'tags.php?display_mode=groups');
    if ($page['tg_display']) {
        // echo __FILE__.'::'.__LINE__.' display_mode=groups<br>';
        $template->set_prefilter('tags', 'tg_groups_display_prefilter');
        $template->assign('display_mode', 'groups');
        // we want tags diplayed in alphabetic order
        usort($tags, 'tag_alpha_compare');
        $current_tag_group = null;
        $nb_tags = count($tags);
        $current_column = 1;
        $current_tag_idx = 0;
        $tag_group = array('tags' => array());
        foreach ($tags as $tag) {
            // if the tag belongs to no group, we don't show it on the "tag by
            // group" display mode
            if (strpos($tag['name'], ':') === false) {
                continue;
            } else {
                list($tag['group'], $tag['name']) = explode(':', $tag['name'], 2);
                $tag['group'] = preg_replace('/^[^=]*=/', '', $tag['group']);
            }
            if ($current_tag_idx == 0) {
                $current_tag_group = $tag['group'];
                $tag_group['TITLE'] = $tag['group'];
            }
            // new group?
            if ($tag['group'] !== $current_tag_group) {
                if ($current_column < $conf['tag_letters_column_number'] and $current_tag_idx > $current_column * $nb_tags / $conf['tag_letters_column_number']) {
                    $tag_group['CHANGE_COLUMN'] = true;
                    $current_column++;
                }
                $tag_group['TITLE'] = $current_tag_group;
                $template->append('tag_groups', $tag_group);
                $current_tag_group = $tag['group'];
                $tag_group = array('tags' => array());
            }
            array_push($tag_group['tags'], array_merge($tag, array('URL' => make_index_url(array('tags' => array($tag))))));
            $current_tag_idx++;
        }
        // flush last group
        if (count($tag_group['tags']) > 0) {
            unset($tag_group['CHANGE_COLUMN']);
            $tag_group['TITLE'] = $current_tag_group;
            $template->append('tag_groups', $tag_group);
        }
    }
}
开发者ID:lcorbasson,项目名称:piwigo-tag_groups,代码行数:53,代码来源:main.inc.php

示例8: vjs_add_tab

function vjs_add_tab($sheets, $id)
{
    if ($id == 'photo') {
        $query = "SELECT id FROM " . IMAGES_TABLE . " WHERE " . SQL_VIDEOS . " AND id = " . $_GET['image_id'] . ";";
        $result = pwg_query($query);
        if (!pwg_db_num_rows($result)) {
            return $sheets;
        }
        $sheets['videojs'] = array('caption' => 'VideoJS', 'url' => get_root_url() . 'admin.php?page=plugin&amp;section=piwigo-videojs/admin/admin_photo.php&amp;image_id=' . $_GET['image_id']);
        unset($sheets['coi'], $sheets['update']);
        unset($sheets['rotate'], $sheets['update']);
        /* Replace the RotateImage by a our own */
        $sheets['rotate'] = array('caption' => 'Rotate', 'url' => get_root_url() . 'admin.php?page=plugin&amp;section=piwigo-videojs/admin/admin_rotate.php&amp;image_id=' . $_GET['image_id']);
    }
    return $sheets;
}
开发者ID:naryoss,项目名称:piwigo-videojs,代码行数:16,代码来源:admin_boot.php

示例9: get_admin_plugin_menu_link

/**
 * Retrieves an url for a plugin page.
 * @param string file - php script full name
 */
function get_admin_plugin_menu_link($file)
{
    global $page;
    $real_file = realpath($file);
    $url = get_root_url() . 'admin.php?page=plugin';
    if (false !== $real_file) {
        $real_plugin_path = rtrim(realpath(PHPWG_PLUGINS_PATH), '\\/');
        $file = substr($real_file, strlen($real_plugin_path) + 1);
        $file = str_replace('\\', '/', $file);
        //Windows
        $url .= '&amp;section=' . urlencode($file);
    } else {
        if (isset($page['errors'])) {
            $page['errors'][] = 'PLUGIN ERROR: "' . $file . '" is not a valid file';
        }
    }
    return $url;
}
开发者ID:donseba,项目名称:Piwigo,代码行数:22,代码来源:functions_plugins.inc.php

示例10: oauth_assign_template_vars

function oauth_assign_template_vars($u_redirect = null)
{
    global $template, $conf, $hybridauth_conf, $user;
    $conf['oauth']['include_common_template'] = true;
    if ($template->get_template_vars('OAUTH') == null) {
        if (!empty($user['oauth_id'])) {
            list($provider, $identifier) = explode('---', $user['oauth_id'], 2);
            if ($provider == 'Persona') {
                $persona_email = $identifier;
            }
        }
        $template->assign('OAUTH', array('conf' => $conf['oauth'], 'u_login' => get_root_url() . OAUTH_PATH . 'auth.php?provider=', 'providers' => $hybridauth_conf['providers'], 'persona_email' => @$persona_email, 'key' => get_ephemeral_key(0)));
        $template->assign(array('OAUTH_PATH' => OAUTH_PATH, 'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/', 'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/'));
    }
    if (isset($u_redirect)) {
        $template->append('OAUTH', compact('u_redirect'), true);
    }
}
开发者ID:lcorbasson,项目名称:Piwigo-Social-Connect,代码行数:18,代码来源:functions.inc.php

示例11: oauth_try_log_user

/**
 * interrupt normal login if corresponding to an oauth user
 */
function oauth_try_log_user($success, $username)
{
    global $conf, $redirect_to;
    $query = '
SELECT oauth_id
  FROM ' . USER_INFOS_TABLE . ' AS i
    INNER JOIN ' . USERS_TABLE . ' AS u
    ON i.user_id = u.' . $conf['user_fields']['id'] . '
  WHERE ' . $conf['user_fields']['username'] . ' = "' . pwg_db_real_escape_string($username) . '"
  AND oauth_id != ""
;';
    $result = pwg_query($query);
    if (pwg_db_num_rows($result)) {
        list($oauth_id) = pwg_db_fetch_row($result);
        list($provider) = explode('---', $oauth_id, 2);
        $_SESSION['page_errors'][] = l10n('You registered with a %s account, please sign in with the same account.', $provider);
        $redirect_to = get_root_url() . 'identification.php';
        // variable used by identification.php
        return true;
    }
    return false;
}
开发者ID:lcorbasson,项目名称:Piwigo-Social-Connect,代码行数:25,代码来源:public_events.inc.php

示例12: pfemail_admin_menu

function pfemail_admin_menu($menu)
{
    global $page;
    $query = '
SELECT
    COUNT(*)
  FROM ' . PFEMAIL_PENDINGS_TABLE . '
    JOIN ' . IMAGES_TABLE . ' ON image_id = id
  WHERE state = \'moderation_pending\'
;';
    $result = pwg_query($query);
    list($page['pfemail_nb_pendings']) = pwg_db_fetch_row($result);
    $name = 'Photo from Email';
    if ($page['pfemail_nb_pendings'] > 0) {
        $style = 'background-color:#666;';
        $style .= 'color:white;';
        $style .= 'padding:1px 5px;';
        $style .= 'border-radius:10px;';
        $style .= 'margin-left:5px;';
        $name .= '<span style="' . $style . '">' . $page['pfemail_nb_pendings'] . '</span>';
    }
    array_push($menu, array('NAME' => $name, 'URL' => get_root_url() . 'admin.php?page=plugin-photo_from_email'));
    return $menu;
}
开发者ID:plegall,项目名称:Piwigo-photo_from_email,代码行数:24,代码来源:main.inc.php

示例13: die

// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH")) {
    die("Hacking attempt!");
}
include_once PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php';
$my_base_url = get_root_url() . 'admin.php?page=languages';
if (isset($_GET['tab'])) {
    $page['tab'] = $_GET['tab'];
} else {
    $page['tab'] = 'installed';
}
$tabsheet = new tabsheet();
$tabsheet->set_id('languages');
$tabsheet->select($page['tab']);
$tabsheet->assign();
if ($page['tab'] == 'update') {
    include PHPWG_ROOT_PATH . 'admin/updates_ext.php';
} else {
    include PHPWG_ROOT_PATH . 'admin/languages_' . $page['tab'] . '.php';
}
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:languages.php

示例14: pwg_query

if ('sizes' == $page['section'] and isset($_GET['action']) and 'restore_settings' == $_GET['action']) {
    ImageStdParams::set_and_save(ImageStdParams::get_default_sizes());
    pwg_query('DELETE FROM ' . CONFIG_TABLE . ' WHERE param = \'disabled_derivatives\'');
    clear_derivative_cache();
    $page['infos'][] = l10n('Your configuration settings are saved');
}
//----------------------------------------------------- template initialization
$template->set_filename('config', 'configuration_' . $page['section'] . '.tpl');
// TabSheet
$tabsheet = new tabsheet();
$tabsheet->set_id('configuration');
$tabsheet->select($page['section']);
$tabsheet->assign();
$action = get_root_url() . 'admin.php?page=configuration';
$action .= '&amp;section=' . $page['section'];
$template->assign(array('U_HELP' => get_root_url() . 'admin/popuphelp.php?page=configuration', 'F_ACTION' => $action));
switch ($page['section']) {
    case 'main':
        function order_by_is_local()
        {
            @(include PHPWG_ROOT_PATH . 'local/config/config.inc.php');
            if (isset($conf['local_dir_site'])) {
                @(include PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'config/config.inc.php');
            }
            return isset($conf['order_by']) or isset($conf['order_by_inside_category']);
        }
        if (order_by_is_local()) {
            $page['warnings'][] = l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !');
        }
        if (isset($conf['order_by_custom']) or isset($conf['order_by_inside_category_custom'])) {
            $order_by = array('');
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:configuration.php

示例15: add_permission_on_category

        }
        //
        // add permissions to users
        //
        $grant_users = $_POST['users'];
        if (count($grant_users) > 0) {
            add_permission_on_category($page['cat'], $grant_users);
        }
    }
    $page['infos'][] = l10n('Album updated successfully');
}
// +-----------------------------------------------------------------------+
// |                       template initialization                         |
// +-----------------------------------------------------------------------+
$template->set_filename('cat_perm', 'cat_perm.tpl');
$template->assign(array('CATEGORIES_NAV' => get_cat_display_name_from_id($page['cat'], 'admin.php?page=album-'), 'U_HELP' => get_root_url() . 'admin/popuphelp.php?page=cat_perm', 'F_ACTION' => $admin_album_base_url . '-permissions', 'private' => 'private' == $category['status']));
// +-----------------------------------------------------------------------+
// |                          form construction                            |
// +-----------------------------------------------------------------------+
// groups denied are the groups not granted. So we need to find all groups
// minus groups granted to find groups denied.
$groups = array();
$query = '
SELECT id, name
  FROM ' . GROUPS_TABLE . '
  ORDER BY name ASC
;';
$groups = simple_hash_from_query($query, 'id', 'name');
$template->assign('groups', $groups);
// groups granted to access the category
$query = '
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:cat_perm.php


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