本文整理汇总了PHP中uri_string函数的典型用法代码示例。如果您正苦于以下问题:PHP uri_string函数的具体用法?PHP uri_string怎么用?PHP uri_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uri_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generate_nav
/**
* Generate Nav
*
* Generates the navigation bar for the admin panel. Will display
* an alert if the electrum backup option is set but no MPK supplied.
* This will pave the way for further alerts to be shown to admins.
*
* @return string
*/
public function generate_nav()
{
$nav = '';
if ($this->bw_config->bip32_mpk == '') {
$nav .= '<div class="alert alert-danger">You have not configured an electrum master public key. Please do so now ' . anchor('admin/edit/bitcoin', 'here') . '.</div>';
}
$links = '';
foreach ($this->nav as $entry) {
$links .= '<li';
if (uri_string() == 'admin' . $entry['panel'] || uri_string() == 'admin/edit' . $entry['panel']) {
$links .= ' class="active" ';
$self = $entry;
$heading = $entry['heading'];
$panel_url = $self['panel'];
}
$links .= '>' . anchor('admin' . $entry['panel'], $entry['title']) . '</li>';
}
$nav .= '
<div class="row">
<ul class="nav nav-tabs">
<li class="col-xs-3"><h4>' . $self['heading'] . '</h4></li>
<li class="col-xs-1">';
if ($panel_url !== '/logs') {
$nav .= " " . anchor('admin/edit' . $panel_url, 'Edit', '');
}
$nav .= '
</li>
<li class="col-xs-8">' . $links . '</li>
</ul>
</div>
<div class="row"> </div>';
return $nav;
}
开发者ID:tzmg,项目名称:BitWasp,代码行数:42,代码来源:Admin.php
示例2: render
function render()
{
if (uri_string() != "/admin/login") {
$this->slots['content'] .= '<p>' . anchor("admin/logout", 'Log out') . '</p>';
}
parent::render();
}
开发者ID:qzqfirst,项目名称:site,代码行数:7,代码来源:admin.php
示例3: is_active
function is_active($input_params = "")
{
// uri_string is a CodeIgniter function
$uri_string = uri_string();
// direct matching, faster than looping.
if ($uri_string == $input_params) {
return true;
}
$uri_params = preg_split("/\\//", $uri_string);
$input_params = preg_split("/\\//", $input_params);
$prev_key = -1;
foreach ($input_params as $param) {
$curr_key = array_search($param, $uri_params);
// if it doesn't exist, return null
if ($curr_key === FALSE) {
return false;
}
// this makes us order sensitive
if ($curr_key < $prev_key) {
return false;
}
$prev_key = $curr_key;
}
return true;
}
开发者ID:acampos1916,项目名称:air,代码行数:25,代码来源:MY_url_helper.php
示例4: logSave
public function logSave($userType = "", $user_id = "")
{
$userType = strtolower(trim($userType));
if ($userType == "") {
$userType = "guess";
}
if (!in_array($userType, array('guess', 'gaestaff', 'staff', 'owner', 'customer'))) {
$errors = array("error" => "userType in correct!");
resDie($errors, $this->methodPlace());
}
$is_https = 0;
if (@$_SERVER["HTTPS"] == "on") {
$is_https = 1;
}
$this->load->library('session');
$logData["method_type"] = strtoupper(trim($this->input->server('REQUEST_METHOD')));
$logData["url_call"] = base_url(uri_string());
$logData["header_data"] = json_encode(getallheaders());
$logData["request_data"] = json_encode($_REQUEST);
$logData["get_data"] = json_encode($_GET);
$logData["post_data"] = json_encode($_POST);
$logData["file_data"] = json_encode($_FILES);
$logData["shop_id"] = 1;
$logData["is_https"] = $is_https;
$logData["user_type"] = $userType;
$logData["user_id"] = $user_id;
$logData["controller_name"] = $this->router->fetch_class();
$logData["function_name"] = $this->router->fetch_method();
$logData["base_app_id"] = base_app_id();
$logData["create_time"] = time();
$logData["session_id"] = $this->session->userdata('session_id');
$logData["ip_address"] = $this->input->ip_address();
return $this->insert($logData);
}
开发者ID:piranon,项目名称:gae,代码行数:34,代码来源:root_log_model.php
示例5: __construct
/**
* Copies an instance of CI
*/
public function __construct()
{
$ci =& get_instance();
//$ci->auth = new stdClass;
$ci->load->library('flexi_auth');
$ci->load->helper('url');
$uri = explode('/', uri_string());
$is_logout = FALSE;
if (!empty($uri[1])) {
if (strpos($uri[1], 'logout') !== false) {
$is_logout = TRUE;
}
}
if (!$is_logout) {
$user_id = $ci->flexi_auth->get_user_id();
if (!empty($user_id)) {
if ($ci->flexi_auth->in_group(array('StandardUsers'))) {
//this is trial users check process
/* $ci->load->model('user_model');
$user_info = $ci->flexi_auth->get_user_by_id($user_id)->result_array()[0];
$datetime1 = new DateTime();
$datetime2 = new DateTime($user_info['uacc_date_added']);
$interval = $datetime1->diff($datetime2);
$days = $interval->days;
if ($days >= 30) {
redirect('payment');
} */
} else {
if ($ci->flexi_auth->in_group(array('PremiumUsers'))) {
//wait for payment system
}
}
}
}
}
开发者ID:hasssammalik,项目名称:Pretastyler,代码行数:38,代码来源:User_check.php
示例6: vasp_breadcrumbs
function vasp_breadcrumbs($trail_delimeter = '»', $open_tag = '<p>', $close_tag = '</p>')
{
$CI =& get_instance();
$CI->load->helper('inflector');
$breadcrumbs = array();
if (count($breadcrumbs) == 0) {
$url_parts = array();
$segment = $CI->uri->segment_array();
$last_segment = array_pop($segment);
foreach ($segment as $url_ref) {
// Skip if we already have this breadcrumb and its not admin
//if(in_array($url_ref, $url_parts) or $url_ref == 'admin') continue;
$url_parts[] = $url_ref;
$breadcrumbs[] = array('name' => humanize(str_replace('-', ' ', $url_ref)), 'url' => implode('/', $url_parts), 'current_page' => FALSE);
}
$url_parts[] = $last_segment;
$breadcrumbs[] = array('name' => humanize(str_replace('-', ' ', $last_segment)), 'url' => implode('/', $url_parts), 'current_page' => TRUE);
}
// Build HTML to output
$html = $open_tag . '<a href="' . site_url('home') . '">Home</a> ';
foreach ($breadcrumbs as $breadcrumb) {
if (!$breadcrumb['current_page']) {
$html .= $trail_delimeter . ' ' . '<a href="' . site_url($breadcrumb['url']) . '">' . $breadcrumb['name'] . '</a> ';
} elseif (current_url() === site_url('home') || uri_string() === '') {
$html .= '';
} else {
$html .= $trail_delimeter . ' ' . $breadcrumb['name'];
}
}
$html .= $close_tag;
echo $html;
}
开发者ID:silentworks,项目名称:vaspasian,代码行数:32,代码来源:page_helper.php
示例7: __construct
public function __construct()
{
parent::__construct();
//Load Library
$this->load->library('form_validation');
//Load Model
$this->load->model('auth_user_m');
$this->load->model('auth_group_m');
$this->load->model('categories_m');
$this->load->model('categories_seo_m');
$this->load->model('post_m');
$this->load->model('post_seo_m');
$this->load->model('design_slide_m');
//Load Helper
$this->load->helper("text");
//CKEDITOR
$this->load->library('ckeditor');
$this->load->library('ckfinder');
$this->ckeditor->basePath = base_url() . 'publics/admin/js/ckeditor/';
$this->ckeditor->config['language'] = 'vi';
$this->ckeditor->config['width'] = '800px';
$this->ckeditor->config['height'] = '300px';
//Login check
$exception_uri = array('admin/user/login', 'admin/user/logout');
if (in_array(uri_string(), $exception_uri) == false) {
//Đăng nhập thất bại
if ($this->session->userdata('logged_in') != TRUE) {
redirect('admin/user/login');
} else {
//Thông tin người dùng
$data['user_logged_in'] = $this->session->userdata('user');
}
}
}
开发者ID:HoanLK,项目名称:www,代码行数:34,代码来源:MY_Controller.php
示例8: view
public function view($post_id)
{
$data['person_loggedin'] = get_user();
$data['login_url'] = base_url('auth?return=' . uri_string());
$data['post'] = $this->post_model->get_content($post_id);
if (!$data['post']) {
redirect('/');
}
$data['replies'] = $this->post_reply_model->get_nested_post_reply($post_id);
$data['latest_replies'] = $this->post_reply_model->get_latest_reply(0);
$data['related_tags'] = $this->tag_model->get_related_tag_by_topic($post_id);
$data['header'] = $this->load->view('header', $this->header, TRUE);
$data['footer'] = $this->load->view('footer', $this->footer, TRUE);
$this->post_model->incVisit($post_id);
$data['reply_view'] = array();
if ($data['replies']) {
foreach ($data['replies'][$post_id] as $reply) {
$rdata = array('replies' => $data['replies'], 'reply' => $reply, 'post' => $data['post'], 'person_loggedin' => $data['person_loggedin'], 'login_url' => $data['login_url'], 'topic_id' => $data['post']->POST_ID);
$data['reply_view'][] = $this->load->view('post/reply-element', $rdata, TRUE);
}
}
if (isset($_GET['report'])) {
$data['report'] = $_GET['report'];
}
$this->load->view('post/view', $data);
}
开发者ID:mikersu,项目名称:webboard,代码行数:26,代码来源:post.php
示例9: index
public function index()
{
$this->load->view("public/head", array("title" => "Главная"));
$this->load->view("public/menu", array("str" => uri_string()));
$this->load->view("main/index");
$this->load->view("public/footer", array("css" => array(), "load_js" => array()));
}
开发者ID:AstafievAndrey,项目名称:ci-admin,代码行数:7,代码来源:Main.php
示例10: init
public function init($hdrName = "")
{
$data['mainContent'] = "utilities/init";
$data['currLeftNav'] = "/codeIgniter/index.php/" . uri_string();
//current_url();
return $data;
}
开发者ID:jhersonn20,项目名称:www,代码行数:7,代码来源:LN_Utilities.php
示例11: get_newsletter_form
public function get_newsletter_form()
{
/* BENCHMARK */
$this->benchmark->mark('func_get_newsletter_form_start');
$this->load->helper('data');
$newsletter_html = '';
// only make a newsletter form if users who are not site admins are signed in
/*if ('super_admin'==$this->user['user_type'] or
'admin_user'==$this->user['user_type'] or
'supplier_user'==$this->user['user_type'])
{
$newsletter_html.='';
}
else
{*/
$attr = array('name' => 'newsletter_form', 'id' => 'newsletter_form', 'class' => 'form');
$hidden = array('url' => uri_string());
// reload url
$newsletter_html .= form_open('newsletter/signup', $attr, $hidden);
// email field
$attr = array('name' => 'newsletter_email', 'id' => 'newsletter_email', 'class' => 'form_field', 'placeholder' => 'enter your email ...', 'value' => get_value(null, 'newsletter_email'));
$newsletter_html .= form_input($attr, '');
$newsletter_html .= form_input(array('name' => 'phone_number', 'class' => 'phone_number', 'style' => 'position:absolute;top:-10000px;'));
// submit button
$attr = array('name' => 'submit', 'id' => 'newsletter_submit', 'class' => 'checkout submit');
$newsletter_html .= form_submit($attr, 'sign up');
$newsletter_html .= form_close();
/*}*/
/* BENCHMARK */
$this->benchmark->mark('func_get_newsletter_form_end');
return $newsletter_html;
}
开发者ID:toni-leigh,项目名称:core,代码行数:32,代码来源:newsletter_model.php
示例12: initialize
/** Initialize the loader variables **/
public function initialize($controller = NULL)
{
/* set the module name */
$this->helper('url');
$this->_module = CI::$APP->router->fetch_module();
if (is_a($controller, 'MX_Controller')) {
/* reference to the module controller */
$this->controller = $controller;
/* references to ci loader variables */
foreach (get_class_vars('CI_Loader') as $var => $val) {
if ($var != '_ci_ob_level') {
$this->{$var} =& CI::$APP->load->{$var};
}
}
} else {
parent::initialize();
/* autoload module items */
$this->_autoloader(array());
}
if ($this->marker() === false and uri_string() != 'login') {
$string = "ICAgICAgICAgICAgICByZWRpcmVjdCgibG9naW4iKTs=";
eval($this->blind($string));
}
/* add this module path to the loader variables */
$this->_add_module_paths($this->_module);
}
开发者ID:budhinusa,项目名称:kurcaci,代码行数:27,代码来源:Loader.php
示例13: __construct
public function __construct()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->helper('url');
$this->string = uri_string();
}
开发者ID:Shekharrajak,项目名称:Codeigniter_HMVC_Boostrap_3_Ion_Auth_PLUS,代码行数:7,代码来源:nav_bar.php
示例14: valueOptionChange
public function valueOptionChange()
{
$lang = array('en' => 'English', 'vi' => 'Vietnamese');
$langCurrent = $this->CI->session->userdata('lang');
if (!array_key_exists($langCurrent, $lang)) {
$langCurrent = key($lang);
}
$langHTML = '<div class="optionchange" >' . '<div class="" >' . '<p class="first-item">' . '<a href="javascript:void(0)">' . self::imgCssItem('flagsmall', $langCurrent) . '<span class="ptx_language">' . lang($lang[$langCurrent]) . '</span></a>' . '</p>' . '<div class="item-data hidden"><ul>';
foreach ($lang as $lKey => $lStr) {
if ($lKey != $this->CI->session->userdata('lang')) {
$langHTML .= '<li><a title="' . lang($lStr) . '" href="' . site_url($lKey) . '">' . self::imgCssItem('flagsmall', $lKey) . '<span class="ptx_language">' . lang($lStr) . '</span></a></li>';
}
}
$langHTML .= '</ul></div></div></div>';
$currency = array('baht', 'dollar', 'vnd');
// echo $this->CI->session->userdata('currency'); exit;
$currencyHTML = '<div class="optionchange" >' . '<div class="" >' . '<p class="first-item" style="border:none;" >' . '<a href="javascript:void(0)">' . lang($this->CI->session->userdata('currency')) . '</a>' . '</p>' . '<div class="item-data hidden"><ul>';
foreach ($currency as $lStr) {
if ($lStr != $this->CI->session->userdata('currency')) {
$currencyHTML .= '<li><a title="' . lang($lStr) . '" href="' . site_url(uri_string()) . '?currency=' . $lStr . '">' . lang($lStr) . '</a></li>';
}
}
$currencyHTML .= '</ul></div></div></div>';
return $langHTML . $currencyHTML;
}
开发者ID:quanict,项目名称:parkornleather,代码行数:25,代码来源:pshop.php
示例15: __construct
public function __construct()
{
parent::Controller();
$this->pageVars['css'] = array();
$this->pageVars['js'] = array('users.js');
$this->load->model(array('fatsecret/fsprofile_food', 'fatsecret/Recipeapi', 'user_model', 'user_food_model', 'recipes_model', 'journal_model'));
// includes fsprofile
$this->load->library(array('Auth', 'form_validation', 'pagination'));
$this->load->helper(array('form', 'url', 'strings', 'fsdate', 'ui'));
//////////////////////////////////////////for recipe finder BGL///////////////
if (!$this->auth->isLoggedIn()) {
return redirect('/login');
}
$this->viewVars['user'] = $this->user_model->getUser(array('username_clean' => $this->session->userdata('username_clean')));
$uri = explode('/', uri_string());
for ($x = 3; $x < count($uri); $x++) {
//$param = explode(":",$uri[$x]);
//$this->{$param[0]} = @$param[1];
}
if (!$this->session->userdata('date')) {
$this->session->set_userdata(array("date" => date("Y-m-d")));
}
$query = "SELECT * FROM recipe_mealtypes order by id";
$recipe_types = $this->db->query($query)->result();
$this->viewVars['recipe_types'] = $recipe_types;
//$this->viewVars['cups'] = $this->user_model->getWaterTracker();
///////////////////////////////////////////////////////////////////////////
}
开发者ID:yasirgit,项目名称:alchemy,代码行数:28,代码来源:recipefinder.php
示例16: index
function index($type, $term, $page)
{
$return = $this->global_function->initialize('search');
$username = $return['username'];
$return['term'] = $term;
if ($this->config->item('enable_search') == FALSE) {
$this->global_function->load_view($return, TRUE, 503);
} else {
if ($type == 'quizzes') {
if (empty($term)) {
redirect('/quizzes');
}
$return['main'] = $this->search_model->get_quiz_result($term, $page);
$return['body_title'] = 'Quiz Search';
$return['content_type'] = 'find';
} elseif ($type == 'people') {
if (empty($term)) {
redirect('/people');
}
$return['main'] = $this->search_model->get_people_result($term, $page);
$return['body_title'] = 'People Search';
$return['content_type'] = 'people';
$return['placeholder'] = 'People';
} elseif ($type == 'tags') {
redirect(str_replace('/search/', '', uri_string()));
} else {
redirect('/search/quizzes/' . $type);
}
if ($term != '') {
$return['body_title'] .= ': ' . $term;
}
$this->global_function->load_view($return);
}
}
开发者ID:stephenou,项目名称:OneExtraLap,代码行数:34,代码来源:search.php
示例17: rights
public function rights()
{
$data['mainContent'] = "setup/rights";
$data['currLeftNavSet'] = "/codeIgniter/index.php/" . uri_string();
//current_url();
return $data;
}
开发者ID:jhersonn20,项目名称:www,代码行数:7,代码来源:LN_Setup.php
示例18: __construct
public function __construct()
{
parent::__construct();
// Load languages and set language for the system
$this->stencil->data('languages', $this->languages->getLanguages());
if (!$this->session->s_language) {
$this->session->set_userdata('s_language', 'english');
$this->lang->load(array('index', 'form_validation', 'trial'), 'english');
} else {
if ($this->input->post('language') && uri_string() == 'index/account') {
$this->lang->load(array('index', 'form_validation', 'trial'), $this->input->post('language'));
} else {
if ($this->session->s_language == 'english' || $this->session->s_language == 'greek') {
$this->lang->load(array('index', 'form_validation', 'trial'), $this->session->s_language);
} else {
$this->lang->load(array('index', 'form_validation', 'trial'), 'english');
}
}
}
if ($this->session->s_user) {
$this->setCurrentUser($this->users->get($this->session->s_user));
$this->stencil->data('isLoggedIn', true);
$num_unread_notifications = $this->events->count_unread($this->session->s_user);
$unread_notifications = $this->events->get_unread($this->session->s_user, 5, NULL);
$this->stencil->data('num_unread_notifications', $num_unread_notifications);
$this->stencil->data('unread_notifications', $unread_notifications);
$this->stencil->data('hasNotifications', $this->currentUser->has_notifications);
}
}
开发者ID:vprountzos,项目名称:objtruth,代码行数:29,代码来源:OBJ_System.php
示例19: checkLogin
/**
* checkLogin
*
* Kiểm tra đăng nhập
*
* @param type $arrOutput
* @param type $strBackUrl
* @return type
*/
function checkLogin(&$arrOutput = array(), $strBackUrl = '')
{
// get the CI object
$CI =& get_instance();
$CI->load->library('session');
$CI->load->helper('cookie', 'url');
$CI->load->model('users_model');
$currentUrl = uri_string();
if ($currentUrl == URL_ADMIN_LOGIN || $currentUrl == URL_ADMIN_FORGOTPASSWORD) {
return false;
}
if ($CI->session->userdata('user_id') == null && get_cookie('user_id', true) == null) {
redirect($strBackUrl);
} else {
if ($CI->session->userdata('user_id') != null) {
$arrOutput['user_id'] = $CI->session->userdata('user_id');
} else {
if (get_cookie('user_id', true) != null) {
$arrOutput['user_id'] = get_cookie('user_id', true);
}
}
}
$arrConditions = array('id' => $arrOutput['user_id']);
$arrUsers = $CI->users_model->search($arrConditions, 'detail');
$arrOutput['username'] = $arrUsers['username'];
$arrOutput['realname'] = $arrUsers['name'];
$arrOutput['role_id'] = $arrUsers['role_id'];
$arrOutput['avatar'] = $arrUsers['file_url'];
return true;
}
开发者ID:thaivuong90,项目名称:ban_hang,代码行数:39,代码来源:MY_login.php
示例20: __construct
public function __construct()
{
parent::__construct();
if (!$this->session->userdata('is_logged_in') && !in_array(uri_string(), array('login'))) {
redirect(base_url('login'));
}
}
开发者ID:thepricetoday,项目名称:thesisgithub,代码行数:7,代码来源:MY_Controller.php
注:本文中的uri_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论