本文整理汇总了PHP中site_url函数的典型用法代码示例。如果您正苦于以下问题:PHP site_url函数的具体用法?PHP site_url怎么用?PHP site_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了site_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forgot
function forgot()
{
// Create an instance of the client model
$this->load->model('client');
// Grab the email from form post
$email = $this->input->post('email');
if ($email && $this->client->email_exists($email)) {
// send the reset email and then redirect to password_sent page
$slug = md5($this->client->id . $this->client->email . date('Ymd') . 'yeoman');
$this->load->library('email');
ini_set('SMTP', 'smtp.menara.ma.');
$this->email->from('noreply@reputation.com', 'Reputation App');
$this->email->to($email);
$this->email->subject('Please reset your password');
$this->email->message('To reset your password please click the link below and follow the instructions:
' . '<a href="' . site_url('Login/reset/' . $this->client->id . '/' . $slug) . '">link</a>' . '
If you did not request to reset your password then please just ignore this email and no changes will occur.
Note: This reset code will expire after ' . date('j M Y') . '.');
$b = $this->email->send();
echo 'sent: ' . $b . ', link: ' . '<a href="' . site_url('Login/reset/' . $this->client->id . '/' . $slug) . '">link</a>';
//redirect('Login/password_sent');
} else {
$this->show_forgot(true);
}
}
示例2: getNextBanner
/**
* this one is the magic one... (pentru asta am facut aceasta clasa...)
* scoatem urmatorul banner pentru un grup si incrementam view-ul...
*/
function getNextBanner($group)
{
$CI =& get_instance();
$output = "";
$CI->db->where("banner_group", $group);
$CI->db->where("order", "1");
$query = $CI->db->get('banners');
if ($query->num_rows() > 0) {
$prev_banner = $query->row_array();
$prev_id = $prev_banner["id"];
} else {
$prev_id = 0;
}
$CI->db->where("banner_group", $group);
$CI->db->select_max('id', 'last_id');
$query = $CI->db->get('banners');
$last_banner = $query->row_array();
$last_id = $last_banner["last_id"];
$banner_id_where = "AND `b`.`id` > (SELECT `id` FROM `banners` WHERE `order` = '1')";
if ($prev_id == 0 || $prev_id == $last_id) {
$banner_id_where = "";
}
$query = $CI->db->query("SELECT \r\n\t\t\t\t\t\t\t\t\t`b`.*,\r\n\t\t\t\t\t\t\t\t\t`bl`.`name`,\r\n\t\t\t\t\t\t\t\t\t`bl`.`description`\r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t`banners` as `b`\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN `banners_lang` as `bl`\r\n\t\t\t\t\t\t\t\t\t\tON (`bl`.`banner_id` = `b`.`id`)\r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t`b`.`banner_group` = '{$group}'\r\n\t\t\t\t\t\t\t\t\tAND `bl`.`lang_id` = '" . $CI->lang_id . "'\r\n\t\t\t\t\t\t\t\t\t{$banner_id_where}\r\n\t\t\t\t\t\t\t\tLIMIT 1\r\n\t\t\t\t\t\t\t\t");
if ($query->num_rows() > 0) {
$banner = $query->row_array();
// setam toate la 0 si asta curent la 1
$CI->db->query("UPDATE `banners` SET `order` = '0' WHERE `banner_group` = '{$group}' ");
$CI->db->query("UPDATE `banners` SET `order` = '1', `views` = `views`+1 WHERE `id` = '" . $banner["id"] . "' ");
$output .= '<a href="' . site_url("banners/navigate/" . $banner["id"]) . '" target="_blank" title="' . $banner["name"] . ' - ' . $banner["description"] . '">
<img src="' . base_url() . 'uploads/banners/' . $banner["file_name"] . '" alt="' . $banner["name"] . ' - ' . $banner["description"] . '"/></a>';
}
return $output;
}
示例3: load
public function load($parent)
{
$this->parent = $parent;
//delete_option('redux-framework-tracking');
$this->options = get_option('redux-framework-tracking');
$this->options['dev_mode'] = $parent->args['dev_mode'];
if (!isset($this->options['hash']) || !$this->options['hash'] || empty($this->options['hash'])) {
$this->options['hash'] = md5(site_url() . '-' . $_SERVER['REMOTE_ADDR']);
update_option('redux-framework-tracking', $this->options);
}
if (isset($_GET['redux_framework_disable_tracking']) && !empty($_GET['redux_framework_disable_tracking'])) {
$this->options['allow_tracking'] = false;
update_option('redux-framework-tracking', $this->options);
}
if (isset($_GET['redux_framework_enable_tracking']) && !empty($_GET['redux_framework_enable_tracking'])) {
$this->options['allow_tracking'] = true;
update_option('redux-framework-tracking', $this->options);
}
if (isset($_GET['page']) && $_GET['page'] == $this->parent->args['page_slug']) {
if (!isset($this->options['allow_tracking'])) {
add_action('admin_enqueue_scripts', array($this, '_enqueue_tracking'));
} else {
if (!isset($this->options['tour']) && ($this->parent->args['dev_mode'] == "true" || $this->parent->args['page_slug'] == "redux_demo")) {
add_action('admin_enqueue_scripts', array($this, '_enqueue_newsletter'));
}
}
}
if (isset($this->options['allow_tracking']) && $this->options['allow_tracking'] == true) {
// The tracking checks daily, but only sends new data every 7 days.
if (!wp_next_scheduled('redux_tracking')) {
wp_schedule_event(time(), 'daily', 'redux_tracking');
}
add_action('redux_tracking', array($this, 'tracking'));
}
}
示例4: cpm_shortcode
/**
* Shortcode hook to display output HTML from CubePM
*
* @todo Add support for blogs without permalink enabled
*
* @param array $atts An associative array of attributes
* @return string HTML output of CubePM
*/
function cpm_shortcode($atts)
{
$html = '<div class="cubepm">';
if (is_user_logged_in()) {
$html .= cpm_header();
$cpm_action = $_GET['cpm_action'];
switch ($cpm_action) {
default:
case 'inbox':
$html .= cpm_page_inbox();
break;
case 'new':
$html .= cpm_page_new();
break;
case 'read':
$html .= cpm_page_read();
break;
case 'admin-inbox':
if (current_user_can('administrator')) {
$html .= cpm_page_admin_inbox();
} else {
$html .= cpm_page_inbox();
}
}
} else {
$html .= '<p>' . __('You have to be logged in to use Private Messaging.', 'cubepm') . '<br /><a href="' . wp_login_url(site_url($_SERVER["REQUEST_URI"])) . '">' . __('Click here to login', 'cubepm') . ' »</a></p>';
}
$html .= '</div>';
return $html;
}
示例5: view
public function view($id)
{
$get_thread = $this->model_thread->get_thread($id);
foreach ($get_thread as $t) {
$data = array('idCategory' => $t->category, 'category' => $t->category_name, 'topic' => $t->topicName, 'user' => $t->author, 'tanggal' => $t->created_at, 'title' => $t->title, 'status' => $t->status, 'message' => BBCodeParser($t->message));
}
$user = sentinel()->getUser();
if ($this->checkTA() == TRUE) {
$data['tenagaAhli'] = $user->id;
$data['draftSide'] = $this->model_thread->get_all_drafts($user->id);
}
$data['author'] = user($user->id)->full_name;
$data['home'] = site_url('author/');
$data['categoriesSide'] = $this->model_thread->get_categories();
$data['threadSide'] = $this->model_thread->get_thread_from_author($user->id);
$data['closeThreads'] = $this->model_thread->get_close_threads($user->id);
$data['threadSide'] = $this->model_thread->get_thread_from_author($user->id);
$data['closeThreads'] = $this->model_thread->get_close_threads($user->id);
$data['authorSide'] = $this->model_thread->get_thread_from_author($user->id);
$data['reply'] = $this->model_thread->get_reply($id);
$data['countReply'] = count($data['reply']);
$data['id'] = $id;
if ($this->session->flashdata('success')) {
$data['success'] = $this->session->flashdata('success');
} elseif ($this->session->flashdata('failed')) {
$data['failed'] = $this->session->flashdata('failed');
}
$this->load->view('thread/single', $data);
}
示例6: import_ajax_handler
function import_ajax_handler()
{
global $data;
$data = array();
$data['count'] = 0;
$data['existing_count'] = 0;
$data['site_url'] = site_url();
$data['objects'] = array();
// global $email;
// Handle the ajax request
check_ajax_referer('import_drs');
$collection_pid = $_POST['pid'];
$collection_pid = explode("/", $collection_pid);
$collection_pid = end($collection_pid);
$url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=1";
$drs_data = get_response($url);
$json = json_decode($drs_data);
// $email = '';
if ($json->pagination->table->total_count > 0) {
$email .= $json->pagination->table->total_count;
for ($x = 1; $x <= $json->pagination->table->num_pages; $x++) {
$url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=" . $x;
$drs_data = get_response($url);
$json = json_decode($drs_data);
drstk_get_image_data($json);
}
} else {
$data = json_decode($drs_data);
}
wp_send_json(json_encode($data));
}
示例7: viewAll
/**
* Shows all users in a particular category
*
* This function shows config('items_per_page') users, starting from $page_offset-th page.
*
* @param int $category_id The category ID, or 0 to select all categories.
* @param int $page_offset The page number to show.
*/
public function viewAll($category_id = 0, $page_offset = 1)
{
if ($this->input->post(NULL)) {
$category_id = $this->input->post('category_id');
redirect('admin/user/viewAll/' . $category_id . '/' . $page_offset);
}
$this->ui['header']['page'] = 'user';
$this->ui['header']['title'] = $this->lang->line('users');
$items_per_page = $this->setting->get('items_per_page');
$criteria = array();
if ($category_id > 0) {
$criteria['user.category_id'] = $category_id;
}
$conditions['limit'] = $items_per_page;
$conditions['offset'] = ($page_offset - 1) * $items_per_page;
$conditions['order_by'] = array('category_id' => 'ASC', 'id' => 'ASC');
$users = $this->user_manager->get_rows($criteria, $conditions);
$categories = $this->category_manager->get_rows();
$this->ui['content']['users'] = $users;
$this->ui['content']['categories'] = $categories;
$this->ui['content']['total_users'] = $this->user_manager->count_rows($criteria);
$this->ui['content']['items_per_page'] = $items_per_page;
$this->ui['content']['page_offset'] = $page_offset;
$config['base_url'] = site_url('admin/user/viewAll/' . $category_id);
$config['uri_segment'] = 5;
$config['total_rows'] = $this->ui['content']['total_users'];
$this->pagination->initialize($config);
$this->ui['content']['pager'] = $this->pagination->create_links();
$this->ui['content']['category_id'] = $category_id;
$this->load->view('admin/header', $this->ui['header']);
$this->load->view('admin/user/viewAll', $this->ui['content']);
$this->load->view('footer', $this->ui['footer']);
}
示例8: redirect_to_registration
function redirect_to_registration()
{
if (isset($_GET['action']) && $_GET['action'] == 'validatepage1') {
wp_redirect(site_url('/registration-complete/'));
exit;
}
}
示例9: Auth
function Auth()
{
$this->table = 'your_table';
//The fields below should be columns in the table above, which are used to
//authenticate the user's credentials.
$this->userNameField = 'username';
$this->passField = 'password';
//The numeric column which stores the permissions/level of each user:
$this->lvlField = 'lvl';
//The following are general columns in the database which are
//stored in the Session, for easily displaying some information
//about the user:
$this->miscFields = 'id,first,email,lvl,verified,credits';
/* If there is a no lastLoggedIn field in the table which is updated
to the current DATETIME whenever the user logs in, set the next
variable to blank to disable this feature. */
$this->lastLoggedInField = 'last_login';
$this->homePageUrl = site_url();
$this->loginPageUrl = site_url('accounts/login');
$this->membersAreaUrl = site_url();
//This is a CodeIgniter specific variable used to refer to the base
//CodeIgniter Object:
$this->obj =& get_instance();
//This is my custom database library:
$this->db = $this->obj->db;
//All data passed on from a form to this class must be
// already escaped to prevent SQL injection.
//However, all data stored in sessions is escaped by the class.
if ($this->isLoggedIn()) {
$this->refreshInfo();
}
}
示例10: process_submission
function process_submission()
{
if (!current_user_can('pp_manage_settings')) {
wp_die(__ppw('Cheatin’ uh?'));
}
if (!empty($_REQUEST['pp_refresh_updates'])) {
delete_site_transient('update_plugins');
pp_get_version_info(true, false, true);
wp_update_plugins();
wp_redirect(admin_url('admin.php?page=pp-settings&pp_refresh_done=1'));
exit;
}
if (!empty($_REQUEST['pp_renewal'])) {
$opt_val = get_option('pp_support_key');
$renewal_token = !is_array($opt_val) || count($opt_val) < 2 ? '' : substr($opt_val[1], 0, 16);
$url = site_url('');
$arr_url = parse_url($url);
$site = urlencode(str_replace($arr_url['scheme'] . '://', '', $url));
wp_redirect('http://presspermit.com/renewal/?pkg=press-permit-pro&site=' . $site . '&rt=' . $renewal_token);
exit;
}
if (!empty($_REQUEST['pp_upload_config']) || !empty($_REQUEST['pp_support_forum'])) {
require_once dirname(__FILE__) . '/admin/support_pp.php';
$args = array();
if (isset($_REQUEST['post_id'])) {
$args['post_id'] = (int) $_REQUEST['post_id'];
}
if (isset($_REQUEST['term_taxonomy_id'])) {
$args['term_taxonomy_id'] = (int) $_REQUEST['term_taxonomy_id'];
}
if (!empty($_REQUEST['pp_support_forum'])) {
//$forum = ( ! empty( $_REQUEST['pp_forum'] ) ) ? sanitize_url($_REQUEST['pp_forum']) : 'pp2-technical-issues';
$url = "http://presspermit.com/forums/";
if (!empty($_REQUEST['pp_topic'])) {
$url = add_query_arg('pp_topic', $_REQUEST['pp_topic'], $url);
}
wp_redirect($url);
}
$success = _pp_support_upload($args);
if (empty($_REQUEST['pp_support_forum'])) {
if (-1 === $success) {
$flag = 'pp_config_no_change';
} elseif ($success) {
$flag = 'pp_config_uploaded';
} else {
$flag = 'pp_config_failed';
}
wp_redirect(admin_url("admin.php?page=pp-settings&{$flag}=1"));
}
exit;
}
if (isset($_POST['pp_submit'])) {
$this->handle_submission('update');
} elseif (isset($_POST['pp_defaults'])) {
$this->handle_submission('default');
} elseif (isset($_POST['pp_role_usage_defaults'])) {
delete_option('pp_role_usage');
pp_refresh_options();
}
}
示例11: index
public function index()
{
$filtro_usuario = $this->input->post('usuario');
$filtros_usuario = $this->paginador_model->filtro($filtro_usuario, 'usuario_filtro');
/**
* configuracion de paginacion
*/
$data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario);
$total_rows = $data['usuarios'] == false ? 0 : $data['usuarios']->num_rows();
$base_url = site_url('maestro/usuario/index');
$config = $this->paginador_model->paginar($total_rows, $base_url);
$perpage = $this->paginador_model->get_perpage();
$this->pagination->initialize($config);
/**
* fin paginacion.
*/
$data['per_page'] = $perpage;
$data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario, $perpage, $this->uri->segment(4));
$data0['roles'] = $this->usuario_model->buscar('roles');
$data0['bodegas'] = $this->usuario_model->buscar('bodegas', array('bode_estado' => 'A'));
$data['vista_nuevo_usuario'] = $this->load->view('nuevo_usuario_view', $data0, true);
$data['vista_editar_usuario'] = $this->load->view('editar_usuario_view', $data0, true);
$data['vista_buscar_usuario'] = $this->load->view('buscar_usuario_view', $data0, true);
$menu = array(array('callback' => 'nuevo_usuario();return false;', 'val' => '<img class="qtip" alt="Nuevo Usuario" src="' . base_url() . 'assets/images/add-files.png" />'), array('callback' => 'buscar_usuario();return false;', 'val' => '<img class="qtip" alt="Buscar Usuario" src="' . base_url() . 'assets/images/search.png" />'), array('val' => '<img class="qtip" alt="Mostrar Todos" src="' . base_url() . 'assets/images/all.png" />', 'href' => site_url('maestro/usuario/todos')));
$this->run('usuarios_view', $data, 'Listado de usuarios', $menu, null, null, 'usuario.js');
}
示例12: commentList
public function commentList()
{
//后台设置后缀为空,否则分页出错
$this->config->set_item('url_suffix', '');
//载入分页类
$this->load->library('pagination');
//每页显示数量
$perPage = 10;
//配置项设置
$config['base_url'] = site_url('view/comment/commentList');
$config['total_rows'] = $this->db->count_all_results('comment');
$config['per_page'] = $perPage;
$config['uri_segment'] = 4;
$config['first_link'] = '首页';
$config['prev_link'] = '上一页';
$config['next_link'] = '下一页';
$config['last_link'] = '尾页';
$this->pagination->initialize($config);
$data['links'] = $this->pagination->create_links();
$offset = $this->uri->segment(4);
$this->db->limit($perPage, $offset);
$comment = $this->comment->commentList();
$data['comment'] = $comment;
$this->load->view('view/comment/commentList', $data);
}
示例13: setPaginationVb
function setPaginationVb($site, $total_rows, $perpage, $urisegment = 3)
{
$CI =& get_instance();
$CI->load->library('pagination');
$config['base_url'] = site_url($site);
// What will CI use for the page links?
$config['total_rows'] = $total_rows;
$config['per_page'] = $perpage;
// How many items per page?
$config['num_links'] = 2;
$config['full_tag_open'] = '<div class="news-pagination" style="padding-top:10px;">';
$config['full_tag_close'] = "</div>";
$config['first_link'] = 'Đầu';
$config['first_tag_open'] = '';
$config['first_tag_close'] = '';
$config['last_link'] = 'Cuối';
$config['last_tag_open'] = '';
$config['last_tag_close'] = '';
$config['next_link'] = 'Sau ';
$config['next_tag_open'] = '';
$config['next_tag_close'] = '';
$config['prev_link'] = ' Trước';
$config['prev_tag_open'] = '';
$config['prev_tag_close'] = '';
$config['num_tag_open'] = '';
$config['num_tag_close'] = '';
$config['cur_tag_open'] = '<span class="active">';
$config['cur_tag_close'] = '</span>';
$config['uri_segment'] = $urisegment;
$CI->pagination->initialize($config);
// config pagination
}
示例14: save
public function save($driverID = null)
{
//$this->_set_fields();
if ($driverID > 0) {
$data['title'] = "Edit Driver";
} else {
$data['title'] = "New Driver";
}
$data['action'] = site_url('driver/save/' . $driverID);
$this->_set_rules();
$driver_info = array('driverID' => $this->input->post('driverID'), 'firstName' => $this->input->post('firstName'), 'lastName' => $this->input->post('lastName'), 'email' => $this->input->post('email'), 'phone' => $this->input->post('phone'), 'isActive' => $this->input->post('isActive'), 'Address' => $this->input->post('Address'), 'City' => $this->input->post('City'), 'State' => $this->input->post('State'), 'zipCode' => $this->input->post('zipCode'), 'socialSecurity' => $this->input->post('socialSecurity'), 'license' => $this->input->post('license'), 'bankName' => $this->input->post('bankName'), 'bankAccount' => $this->input->post('bankAccount'));
$data['Driver'] = $driver_info;
//$blnSuccess=$this->form_validation->run();
$blnSuccess = true;
$data['blnSuccess'] = $blnSuccess;
if ($blnSuccess) {
if ($driverID > 0) {
$this->driver_model->update_driver($driver_info);
} else {
$this->driver_model->insert_driver($driver_info);
}
}
if ($blnSuccess) {
redirect('driver/index/' . $driverID);
} else {
$this->layout->view('driver/formDriver', $data);
}
}
示例15: admin_preload
function admin_preload()
{
$this->CI->admin_navigation->child_link('members', 10, 'Manage Members', site_url('admincp/users'));
$this->CI->admin_navigation->child_link('members', 20, 'Add Member/Administrator', site_url('admincp/users/add'));
$this->CI->admin_navigation->child_link('members', 30, 'Login Records', site_url('admincp/users/logins'));
$this->CI->admin_navigation->child_link('members', 40, 'Member Groups', site_url('admincp/users/groups'));
}