本文整理汇总了PHP中uri_string函数的典型用法代码示例。如果您正苦于以下问题:PHP uri_string函数的具体用法?PHP uri_string怎么用?PHP uri_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uri_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: render
function render()
{
if (uri_string() != "/admin/login") {
$this->slots['content'] .= '<p>' . anchor("admin/logout", 'Log out') . '</p>';
}
parent::render();
}
示例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;
}
示例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);
}
示例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
}
}
}
}
}
示例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;
}
示例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');
}
}
}
示例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);
}
示例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()));
}
示例10: init
public function init($hdrName = "")
{
$data['mainContent'] = "utilities/init";
$data['currLeftNav'] = "/codeIgniter/index.php/" . uri_string();
//current_url();
return $data;
}
示例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;
}
示例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);
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->load->library('form_validation');
$this->load->helper('url');
$this->string = uri_string();
}
示例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;
}
示例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();
///////////////////////////////////////////////////////////////////////////
}