本文整理汇总了PHP中get_full_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_full_url函数的具体用法?PHP get_full_url怎么用?PHP get_full_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_full_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_tab
function display_tab()
{
if (is_admin()) {
// return without running if we are in the admin
return;
}
// set the value for the tab display to true
// this can only be changed by the 'plugin_display_tab' filter)
$display_tab = true;
// apply filter for the display of the tab so it can be turned on and off conditionally
$display_tab = apply_filters('plugin_display_tab', $display_tab);
// do not display the tab if the value has been turned off
if ($display_tab == false) {
return;
}
// get the current page url
$current_page_url = get_full_url();
// get the tab url from the plugin option variable array
$plugin_option_array = get_option('options');
$tab_url = $plugin_option_array['tab_url'];
// compare the page url and the option tab - don't render the tab if the values are the same
if ($tab_url != $current_page_url) {
// hook to get option values and dynamically render css to support the tab classes
add_action('wp_head', 'custom_css_hook');
// hook to get option values and write the div for the Simple Side Tab to display
add_action('wp_footer', 'body_tag_html');
}
}
示例2: kaixin_sync
function kaixin_sync($data)
{
$sys_config = kaixin_init();
if (!$sys_config) {
return 'kaixin_init is invalid';
}
$tid = is_numeric($data['tid']) ? $data['tid'] : 0;
if ($tid < 1) {
return 'tid is invalid';
}
$uid = is_numeric($data['uid']) ? $data['uid'] : 0;
if ($uid < 1) {
return 'uid is invalid';
}
$totid = is_numeric($data['totid']) ? $data['totid'] : 0;
$content = $data['content'];
if (false !== strpos($content, '[')) {
$content = preg_replace('~\\[([^\\]]{1,6}?)\\]~', '(#\\1)', $content);
}
$content = array_iconv($sys_config['charset'], 'UTF-8', trim(strip_tags($content)));
if (!$content) {
return 'content is invalid';
}
$content .= " " . get_full_url($sys_config['site_url'], 'index.php?mod=topic&code=' . $tid);
$kaixin_bind_info = kaixin_bind_info($uid);
if (!$kaixin_bind_info) {
return 'bind_info is empty';
}
if (!kaixin_has_bind($uid)) {
return 'bind_info is invalid';
}
$kaixin_bind_topic = DB::fetch_first("select * from " . DB::table('kaixin_bind_topic') . " where `tid`='{$tid}'");
if ($kaixin_bind_topic) {
return 'bind_topic is invalid';
} else {
DB::query("insert into " . DB::table('kaixin_bind_topic') . " (`tid`) values ('{$tid}')");
}
$ret = array();
if ($totid < 1) {
$p = array();
$p['access_token'] = $kaixin_bind_info['token'];
$p['content'] = $content;
$imageid = (int) $data['imageid'];
if ($imageid > 0 && $sys_config['kaixin']['is_sync_image']) {
$topic_image = topic_image($imageid, 'original');
if (is_image(ROOT_PATH . $topic_image)) {
$p['picurl'] = $sys_config['site_url'] . '/' . $topic_image;
$p['save_to_album'] = 1;
}
}
$ret = kaixin_api('records/add', $p);
}
$kaixin_id = is_numeric($ret['rid']) ? $ret['rid'] : 0;
if ($kaixin_id > 0) {
DB::query("UPDATE " . DB::table('kaixin_bind_topic') . " SET `kaixin_id`='{$kaixin_id}' WHERE `tid`='{$tid}'");
}
return $ret;
}
示例3: getAccesstokenUrl
/**
* 组装获取code授权URL
*/
function getAccesstokenUrl($appid)
{
$nowUrl = get_full_url();
//获取当前访问的url地址
$redirectUrl = urlencode($nowUrl);
//url 编码
$accessTokenUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . $appid . '&redirect_uri=' . $redirectUrl . '&response_type=code&scope=snsapi_base&state=123#wechat_redirect';
return $accessTokenUrl;
}
示例4: check_signature
public static function check_signature($client_sig)
{
$user = Loader::get_user();
if (!$client_sig) {
return FALSE;
}
if (!$user->get_module(User::M_SECRET_KEY)->check_secret_key()) {
$user->get_module(User::M_SECRET_KEY)->unset_secret_key();
Session::destroy(Session::get_sid(), Session::ST_INCORRECT);
return FALSE;
}
//Создаём серверную сигнатуру
//1. получаем все параметры и удаляем параметр с сигнатурой
$all_params = Buffer::get_post();
unset($all_params['sig']);
$elements_sig = array();
//2. извлекаем значения из пришедших параметров в обязательный список параметров на серврере
$params = config('web', 'sig_params');
foreach ($params as $param) {
//некоторые параметрый дублируем в ручную, по тем правилам, по которомы они дложны были создаваться на клиенте
switch ($param) {
case Session::COOKIE_ID:
$elements_sig[$param] = Session::get_sid();
break;
case 'location':
$elements_sig[$param] = get_full_url();
$elements_sig[$param] = str_replace('/www.', '/', $elements_sig[$param]);
break;
default:
$elements_sig[$param] = isset($all_params[$param]) ? $all_params[$param] : '';
}
if (isset($all_params[$param])) {
unset($all_params[$param]);
}
}
//Если в запросе остались какие-то параметры то добавляем их в конец массива
if (!empty($all_params)) {
$elements_sig = array_merge($elements_sig, $all_params);
}
//3. получаем секретный ключ текущего пользователя
$elements_sig[self::NAME_SECRET_KEY] = $user->get_secret_key();
//4. Сортируем и собираем в строку элементы запроса
$server_sig = array();
ksort($elements_sig);
foreach ($elements_sig as $key => $value) {
$server_sig[] = $key . '=' . $value;
}
//5. Формируем сигнатуру сервера
$server_sig = md5(implode('&', $server_sig));
//6. Сравниваем результаты
if ($server_sig == $client_sig) {
return TRUE;
}
return FALSE;
}
示例5: route
public static function route($rule, $call)
{
/* CHECK IF THE ROUTE IS GOOD */
$params = self::check($rule, true);
if ($params !== false) {
// check routed
self::$routed = true;
$to_replace = array();
$with = array();
for ($i = 1; $i < count($params); $i++) {
$to_replace[] = '$' . $i;
$with[] = $params[$i];
}
if (is_callable($call)) {
call_user_func_array($call, $with);
} else {
$call_params = substr(strstr($call, '?'), 1);
foreach (explode("&", $call_params) as $chuck) {
$param = explode("=", $chuck);
$param[1] = urldecode(str_replace($to_replace, $with, $param[1]));
if ($param[1] != '') {
$_GET[$param[0]] = $param[1];
}
}
// CHECK WHAT FILE TO ROUTE
$call_file = strstr($call, "?", 1);
$call_path = FOLDER_BASE . $call_file;
if ($call_file != "index.php" && file_exists($call_path)) {
// INCLUDE FILE
include $call_path;
// REMOVE ALL PARAMS
foreach (explode("&", $call_params) as $chuck) {
$param = explode("=", $chuck);
unset($_GET[$param[0]]);
}
}
}
} else {
self::$url_request = self::$url_request . "/";
if (self::check($rule) !== false) {
redirect(get_full_url() . "/");
} else {
self::$url_request = substr(self::$url_request, 0, -1);
}
}
}
示例6: loadTags
function loadTags($ids, $lang, $isurl = FALSE)
{
$langstr = $lang == $this->CI->Cache_model->defaultLang ? '' : '?lang=' . $lang;
if (!$ids) {
return FALSE;
}
$idarr = explode(',', $ids);
$data = $this->CI->Data_model->getData(array('id' => $idarr, 'lang' => $lang), 'listorder', 0, 0, 'tags');
if (!$data) {
return FALSE;
}
$dataarr = array();
foreach ($data as $item) {
$dataarr[] = $isurl ? '<a href="' . get_full_url('tags/' . $item['url'] . $langstr) . '">' . $item['title'] . '</a>' : $item['title'];
}
$datastr = implode(',', $dataarr);
return $datastr;
}
示例7: get_full_url
function get_full_url()
{
$https = !empty($_SERVER['HTTPS']) && strcasecmp($_SERVER['HTTPS'], 'on') === 0 || !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;
return ($https ? 'https://' : 'http://') . (!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] . '@' : '') . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'] . ($https && $_SERVER['SERVER_PORT'] === 443 || $_SERVER['SERVER_PORT'] === 80 ? '' : ':' . $_SERVER['SERVER_PORT'])) . substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
}
$base_id = $_GET['base_id'];
$id = $_GET['id'];
try {
if (!$base_id || !$id) {
throw new Exception('Wrong Parameter');
}
$highResFile = dirname(__FILE__) . '/files/' . $base_id . '/boxed/' . $id;
$thumbFile = dirname(__FILE__) . '/files/' . $base_id . '/boxed/thumbnail/' . $id;
$highResUrl = get_full_url() . '/files/' . $base_id . '/boxed/' . $id;
$thumbUrl = get_full_url() . '/files/' . $base_id . '/boxed/thumbnail/' . $id;
$downLink = get_full_url() . '/download.php?base_id=' . urlencode($base_id) . '&id=' . urlencode($id);
$shareLink = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
if (!is_file($highResFile) || !is_file($thumbFile)) {
throw new Exception('File Not Found');
}
} catch (Exception $e) {
header('Location: 404.html');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
示例8: update_page_links_by_full_url
function update_page_links_by_full_url($buffer, $allLinksFromDB, $hostname)
{
$regexp = "<a\\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\\/a>";
$regexp1 = "href=(\"??)([^\" >]*?\\1)";
preg_match_all("/{$regexp}/siU", $buffer, $matches);
$pieces = preg_split("/{$regexp}/siU", $buffer);
$ret = null;
foreach ($matches[0] as $k => $link) {
$l = preg_split("/{$regexp1}/siU", $link);
$new = $l[0] . "href=\"" . get_full_url($matches[2][$k], $hostname) . "\"" . $l[1];
$ret .= $pieces[$k] . $new;
/*
$l=preg_split("/$regexp1/siU",$link);
$found=0;
foreach($allLinksFromDB as $key=>$value)
{
if($value[0]===$matches[2][$k])
{
$new=$l[0]."href=\"".get_full_url($value[0],$hostname)."\"".$l[1];
$ret.=$pieces[$k].$new;
$found=1;
break;
}
}
if($found==0)
{
$ret.=$pieces[$k].$matches[0][$k];
$found=0;
}
*/
}
$ret .= $pieces[sizeof($pieces) - 1];
return $ret;
}
示例9: get_timthumb_url
/**
* Build Timthumb URL
*
* @param string $path_img
* @param BEA_Images|null $image_size
*
* @return string
*/
function get_timthumb_url($path_img, $image_size = null)
{
if (!empty($image_size)) {
return get_full_url($_SERVER, true) . 'functions/vendor/timthumb.php?src=' . $path_img . '&h=' . $image_size->height . '&w=' . $image_size->width . '&zc=' . (int) $image_size->crop;
} else {
return get_full_url($_SERVER, true) . 'functions/vendor/timthumb.php?src=' . $path_img;
}
}
示例10: save_previous
function save_previous($suffix = "")
{
$_SESSION['previous' . $suffix] = get_full_url();
}
示例11: publishShare
function publishShare()
{
$id = (int) $this->Get['id'];
$name = DB::result_first("select title from " . TABLE_PREFIX . "event where id = '{$id}'");
$value = '我觉得活动【' . $name . '】不错,推荐给大家,地址:' . get_full_url($this->Config['site_url'], "index.php?mod=event&code=detail&id={$id}");
$item_id = $id;
include template('vote/vote_toweibo');
exit;
}
示例12: header
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/_/inc/init.php';
if (!isConnected()) {
header('Location: index.php?redirect_uri=' . get_full_url() . $_SERVER['REQUEST_URI']);
exit;
}
require '_/inc/UploadHandler.php';
$upload_handler = new UploadHandler();
示例13: eventDetail
function eventDetail()
{
$id = intval($this->Get['id']);
load::logic('event');
$EventLogic = new EventLogic();
$param = array('where' => " a.id = '{$id}' ");
$return = $EventLogic->getEventInfo($param);
$rs = $return['event_list'][$id];
if (!$rs) {
$this->Messager("活动不存在或已删除", -1);
}
if (!$rs['verify'] || $rs['verify'] == 0) {
if ($rs['postman'] != MEMBER_ID) {
$this->Messager("活动还在审核中", -1);
}
}
$from = array();
if ($rs['item'] == 'qun' && $rs['item_id'] > 0) {
load::logic('qun');
$qun_logic = new QunLogic();
$qunInfo = $qun_logic->get_qun_info($rs['item_id']);
$rs['qunname'] = $qunInfo['name'];
$from['name'] = $this->Config[changeword][weiqun] . '--' . $rs['qunname'];
$from['url'] = get_full_url('', 'index.php?mod=qun&qid=' . $rs['item_id']);
} else {
#if NEDU
if (defined('NEDU_MOYO')) {
if ($rs['item'] && $rs['item_id']) {
$app = nlogic('com.object')->get_info($rs['item'], $rs['item_id']);
if ($app) {
$from = array('name' => $app['object_name'], 'url' => $app['object_url']);
}
}
}
#endif
}
$app_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.app = 1 and a.play = 0 ", 'order' => " order by a.app_time ", 'limit' => " limit 6 "), 'app');
$app_count = $app_member_arr['count'];
$app_member = $app_member_arr['member'];
$play_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.play = 1 ", 'order' => " order by a.play_time ", 'limit' => " limit 6 "), 'play');
$play_count = $play_member_arr['count'];
$play_member = $play_member_arr['member'];
$member = $this->Member;
if ($member['medal_id']) {
$medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
}
jfunc('app');
$gets = array('mod' => 'event', 'code' => "detail", 'id' => $id);
$page_url = 'index.php?' . url_implode($gets);
$options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url);
$topic_info = app_get_topic_list('event', $id, $options);
$topic_list = array();
if (!empty($topic_info)) {
$topic_list = $topic_info['list'];
$page_arr['html'] = $topic_info['page']['html'];
$no_from = true;
}
$this->item = 'event';
$this->item_id = $id;
$set_qun_closed = 1;
$set_event_closed = 1;
$set_fenlei_closed = 1;
$this->Title = $rs['title'];
include template('event/event_dateil');
}
示例14: isset
$searchname = isset($_GET['s']) ? $_GET['s'] : "";
$searchfid = isset($_GET['fid']) ? $_GET['fid'] : "";
$start = is_numeric($_GET['start']) ? $_GET['start'] : 0;
$end = is_numeric($_GET['end']) ? $_GET['end'] : 50;
$filenb = $fdao->countFiles();
if ($searchfid != "") {
$filesList = array($fdao->getByFid($searchfid));
} else {
if ($searchname != "") {
$filesList = $fdao->searchByName($searchname);
} else {
$filesList = $fdao->getLastFiles($start, $end);
}
}
$filesTotalSize = $fdao->filesTotalSize() / 1000000;
$fullurl = get_full_url() . '/';
$sdao = new SessionsDao();
$sessionscount = $sdao->countSessions();
$usercount = $sdao->countUsers();
$sessionstoday = $sdao->getSessionToday();
$action = isset($_GET['dis']) ? $_GET['dis'] : 1;
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie ie6 lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie ie7 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie ie8 lt-ie9"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie ie9 lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<title><?php
echo $Hoster_name;
示例15: _setlist
function _setlist($data, $ismultiple = true)
{
$newdata = $ismultiple ? $data : ($newdata[0] = $data);
if ($ismultiple) {
$newdata = $data;
} else {
$newdata = array(0 => $data);
}
$newstr = '';
foreach ($newdata as $key => $item) {
$item['func'] = '';
if ($this->Purview_model->checkPurviewFunc($this->tablefunc, 'edit')) {
$item['func'] .= $this->Purview_model->getSingleFunc(site_aurl($this->tablefunc . '/edit/' . $item['id']), 'edit');
}
if ($this->Purview_model->checkPurviewFunc($this->tablefunc, 'edit')) {
$item['func'] .= $this->Purview_model->getSingleFunc(site_aurl($this->tablefunc . '/order'), 'order');
}
if ($this->Purview_model->checkPurviewFunc($this->tablefunc, 'del')) {
$item['func'] .= $this->Purview_model->getSingleFunc(site_aurl($this->tablefunc . '/del/' . $item['id']), 'sdel', $item['id']);
}
$typestr = isset($this->typearr[$item['type']]) ? '[<font color="green">' . $this->typearr[$item['type']]['title'] . '</font>]' : '';
$newstr .= '<tr id="tid_' . $item['id'] . '">
<td width=30><input type=checkbox name="optid[]" value=' . $item['id'] . '></td>
<td width=50><input type="hidden" name="ids[]" value="' . $item['id'] . '"><input type="text" name="listorder[]" class="input-order" size="3" value="' . $item['listorder'] . '"></td>
<td width=40>' . $item['id'] . '</td>
<td width=150>' . $typestr . '<a href="' . get_full_url($item['url']) . '" target="_blank">' . $item['title'] . '</a></td>
<td width=250 style="word-break:break-all;"><a href="' . get_full_url($item['url']) . '" target="_blank">' . get_full_url($item['url']) . '</a></td>
<td>' . $item['remark'] . '</td>
<td width=50 >' . lang('status' . $item['status']) . '</td>
<td width=50>' . $item['func'] . '</td></tr>';
}
return $newstr;
}