本文整理汇总了PHP中Net_URL::addQueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_URL::addQueryString方法的具体用法?PHP Net_URL::addQueryString怎么用?PHP Net_URL::addQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Net_URL
的用法示例。
在下文中一共展示了Net_URL::addQueryString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: page_a
function page_a($url, $page, $text)
{
$url_obj = new Net_URL($url);
$url_obj->addQueryString('page', $page);
$newurl = $url_obj->getURL();
return "<a href='{$newurl}'>{$text}</a>";
}
示例2: lfGetNews
/**
* 新着情報を取得する.
*
* @return array $arrNewsList 新着情報の配列を返す
*/
function lfGetNews(&$objQuery)
{
if (DB_TYPE != 'sqlsrv') {
return parent::lfGetNews($objQuery);
} else {
$objQuery->setOrder('rank DESC ');
$arrNewsList = $objQuery->select("* ,convert(varchar(4), YEAR(news_date)) + '-' + convert(varchar(2), MONTH(news_date)) + '-' + convert(varchar(10), DAY(news_date)) as news_date_disp", 'dtb_news', 'del_flg = 0');
// モバイルサイトのセッション保持 (#797)
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
foreach (array_keys($arrNewsList) as $key) {
$arrRow =& $arrNewsList[$key];
if (SC_Utils_Ex::isAppInnerUrl($arrRow['news_url'])) {
$netUrl = new Net_URL($arrRow['news_url']);
$netUrl->addQueryString(session_name(), session_id());
$arrRow['news_url'] = $netUrl->getURL();
}
}
}
return $arrNewsList;
}
}
示例3: doLogin
function doLogin($mode, SC_Customer $objCustomer, SC_Query $objQuery)
{
$each = false;
switch ($mode) {
case "pay_cert_for_authory_sold":
$each = true;
break;
default:
$each = false;
break;
}
$consumer = $this->getConsumer($objQuery);
$netUrl = new Net_URL($_SERVER["SCRIPT_NAME"]);
$netUrl->addQueryString("mode", $this->getMode());
$responce = $consumer->complete($netUrl->getURL());
$status = Auth_OpenID_FAILURE;
if ($responce) {
$status = $responce->status;
} else {
$responce = "null";
}
GC_Utils_Ex::gfPrintLog(print_r(compact("consumer", "responce", "status"), true), DEBUG_LOG_REALFILE);
switch ($status) {
case Auth_OpenID_CANCEL:
SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "処理を中断しました。");
break;
default:
case Auth_OpenID_FAILURE:
$this->doLoginAuone($this->getMode());
$this->sendResponse();
SC_Response_Ex::actionExit();
break;
case Auth_OpenID_SUCCESS:
$openid = $responce->getDisplayIdentifier();
$customer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId(null, 'au_open_id=? AND status = 2 AND del_flg = 0', array($openid));
GC_Utils_Ex::gfPrintLog(print_r($customer, true), DEBUG_LOG_REALFILE);
if (is_array($customer) && isset($customer["email"])) {
$objCustomer->setLogin($customer["email"]);
} else {
GC_Utils_Ex::gfPrintLog(print_r(compact("responce", "status"), true), DEBUG_LOG_REALFILE);
if ($each) {
// 都度課金時 (ログインルートへ乗せる)
SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。<br/><a href='./login.php'>ログイン・会員登録<a>ボタンより会員登録をしてください。");
// ログインへとばすなら
// SC_Response_Ex::sendRedirect ( "login.php" );
// SC_Response_Ex::actionExit ();
} else {
// 都度課金時以外
SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, "", true, "未登録または退会済みの会員です。");
}
}
break;
}
}
示例4: lfGetNews
/**
* 新着情報を取得する.
*
* @return array $arrNewsList 新着情報の配列を返す
*/
public function lfGetNews($dispNumber, $pageNo, SC_Helper_News_Ex $objNews)
{
$arrNewsList = $objNews->getList($dispNumber, $pageNo);
// モバイルサイトのセッション保持 (#797)
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) {
foreach ($arrNewsList as $key => $value) {
$arrRow =& $arrNewsList[$key];
if (SC_Utils_Ex::isAppInnerUrl($arrRow['news_url'])) {
$netUrl = new Net_URL($arrRow['news_url']);
$netUrl->addQueryString(session_name(), session_id());
$arrRow['news_url'] = $netUrl->getURL();
}
}
}
return $arrNewsList;
}
示例5: gfFinishKaraMail
/**
* 空メール管理テーブルからトークンが一致する行を削除し、
* 次に遷移させるページのURLを返す。
*
* メールアドレスは $_SESSION['mobile']['kara_mail_from'] に登録される。
*
* @param string $token トークン
* @return string|false URLを返す。エラーが発生した場合はfalseを返す。
*/
function gfFinishKaraMail($token)
{
$objQuery =& SC_Query_Ex::getSingletonInstance();
$arrRow = $objQuery->getRow('session_id, next_url, email', 'dtb_mobile_kara_mail', 'token = ? AND email IS NOT NULL AND receive_date >= ?', array($token, date('Y-m-d H:i:s', time() - MOBILE_SESSION_LIFETIME)), DB_FETCHMODE_ORDERED);
if (!isset($arrRow)) {
return false;
}
$objQuery->delete('dtb_mobile_kara_mail', 'token = ?', array($token));
list($session_id, $next_url, $email) = $arrRow;
$objURL = new Net_URL(HTTP_URL . $next_url);
$objURL->addQueryString(session_name(), $session_id);
$url = $objURL->getURL();
session_id($session_id);
session_start();
$_SESSION['mobile']['kara_mail_from'] = $email;
session_write_close();
return $url;
}
示例6: Context
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../lib');
require_once 'init.php';
require_once 'data.php';
$C = new Context(DB_DSN, GUARDIAN_API_KEY, FLICKR_API_KEY, $_COOKIE['visitor']);
$C->setCookie();
list($response_format, $response_mime_type) = parse_format($_GET['format'], 'html');
$woe_id = is_numeric($_GET['woe']) ? intval($_GET['woe']) : null;
$woe_ids = isset($_GET['woes']) ? intvals($_GET['woes']) : null;
$article_id = is_numeric($_GET['article']) ? intval($_GET['article']) : null;
$article_ids = isset($_GET['articles']) ? intvals($_GET['articles']) : null;
$count = is_numeric($_GET['count']) ? intval($_GET['count']) : null;
$offset = is_numeric($_GET['offset']) ? intval($_GET['offset']) : 0;
$js_callback = $response_mime_type == 'text/javascript' && $_GET['callback'] ? sanitize_js_callback($_GET['callback']) : null;
if ($woe_id && $article_id) {
$url = new Net_URL('http://' . get_domain_name() . get_base_dir() . '/point.php');
$url->addQueryString('article', $article_id);
$url->addQueryString('woe', $woe_id);
$url->addQueryString('format', $response_format);
header('Location: ' . $url->getURL());
exit;
} elseif (($article_ids || $woe_ids) && ($article_id || $woe_id)) {
header('Content-Type: text/plain');
die_with_code(400, "It's not possible to specify both singular and plural article/WOE ID's.\n");
} else {
$points = get_points($C, compact('article_id', 'woe_id', 'article_ids', 'woe_ids', 'count', 'offset'));
$total = get_points_total($C, compact('article_id', 'woe_id', 'article_ids', 'woe_ids'));
$count = count($points);
}
$C->close();
header("Content-Type: {$response_mime_type}; charset=UTF-8");
switch ($response_format) {
示例7: addQueryString
/**
* Adds a querystring parameter
*
* @param string Querystring parameter name
* @param string Querystring parameter value
* @param bool Whether the value is already urlencoded or not, default = not
* @access public
*/
function addQueryString($name, $value = '', $preencoded = false)
{
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->addQueryString($k, $v, $preencoded);
}
return;
}
$this->_url->addQueryString($name, $value, $preencoded);
}
示例8: addQueryString
/**
* Adds a querystring parameter
*
* @param string Querystring parameter name
* @param string Querystring parameter value
* @param bool Whether the value is already urlencoded or not, default = not
* @access public
*/
function addQueryString($name, $value, $preencoded = false)
{
$this->_url->addQueryString($name, $value, $preencoded);
}
示例9: wyswietlOstatniKomentarz
/**
*
* @static
*/
function wyswietlOstatniKomentarz() {
$ostatniKomentarz = ZarzadcaKomentarzy::pobierzOstatniKomentarz();
$galeriaZdjec = ZarzadcaGaleriiZdjec::pobierzGalerie($ostatniKomentarz->katalog);
$tytulGalerii = "";
if ($galeriaZdjec != null) {
$tytulGalerii = $galeriaZdjec->tytulGalerii;
}
$podpis = $ostatniKomentarz->podpis;
$tresc = $ostatniKomentarz->tresc;
$ustawieniaGaleriiZdjec = new UstawieniaGaleriiZdjec();
$url = new Net_URL($ustawieniaGaleriiZdjec->linkDoGaleriiZdjec, false);
$url->addQueryString("katalog", $ostatniKomentarz->katalog);
$url->anchor = $ostatniKomentarz->nazwaPlikuZdjecia;
if ($tresc != null && $tresc != "") {
echo "<span class=\"ostatniKomentarz\"><a href=\"" . $url->getURL() . "\" title=\"$tytulGalerii\"><b>[$podpis]</b> $tresc</a></span>";
}
}
示例10: sendRedirect
/**
* アプリケーション内でリダイレクトする
*
* 内部で生成する URL の searchpart は、下記の順で上書きしていく。(後勝ち)
* 1. 引数 $inheritQueryString が true の場合、$_SERVER['QUERY_STRING']
* 2. $location に含まれる searchpart
* 3. 引数 $arrQueryString
*
* @param string $location
* 「url-path」「現在のURLからのパス」「URL」のいずれか。「../」の解釈は行なわない。
* @param array $arrQueryString
* URL に付加する searchpart
* @param bool $inheritQueryString
* 現在のリクエストの searchpart を継承するか
* @param bool|null $useSsl
* true:HTTPSを強制, false:HTTPを強制, null:継承
* @return void
* @static
*
*/
public function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null)
{
// ローカルフックポイント処理
$objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg);
if (is_object($objPlugin)) {
$arrBacktrace = debug_backtrace();
if (is_object($arrBacktrace[0]['object'])) {
$pattern = '/^[a-zA-Z0-9_]+$/';
if (isset($_REQUEST['mode']) && preg_match($pattern, $_REQUEST['mode'])) {
$mode = $_REQUEST['mode'];
}
$parent_class_name = get_parent_class($arrBacktrace[0]['object']);
$class_name = get_class($arrBacktrace[0]['object']);
}
$objPlugin->doAction($parent_class_name . '_action_' . $mode, array($arrBacktrace[0]['object']));
if ($class_name != $parent_class_name) {
$objPlugin->doAction($class_name . '_action_' . $mode, array($this));
}
}
// url-path → URL 変換
if ($location[0] === '/') {
$netUrl = new Net_URL($location);
$url = $netUrl->getUrl();
} elseif (strpos($location, HTTPS_URL) === 0 || strpos($location, HTTP_URL) === 0) {
$url = $location;
} else {
$netUrl = new Net_URL(HTTP_URL);
$netUrl->path = dirname($_SERVER['SCRIPT_NAME']) . '/' . $location;
$url = $netUrl->getUrl();
}
if (!is_bool($useSsl)) {
$useSsl = SC_Utils_Ex::sfIsHTTPS();
}
if ($useSsl) {
$url = str_replace(HTTP_URL, HTTPS_URL, $url);
} else {
$url = str_replace(HTTPS_URL, HTTP_URL, $url);
}
// アプリケーション外へのリダイレクトは扱わない
if (!SC_Utils_Ex::isAppInnerUrl($url)) {
trigger_error('URL IS APP NOT INNER URL', E_USER_ERROR);
}
$netUrl = new Net_URL($url);
if ($inheritQueryString && !empty($_SERVER['QUERY_STRING'])) {
$arrQueryStringBackup = $netUrl->querystring;
// XXX メソッド名は add で始まるが、実際には置換を行う
$netUrl->addRawQueryString($_SERVER['QUERY_STRING']);
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryStringBackup);
}
$netUrl->querystring = array_merge($netUrl->querystring, $arrQueryString);
$session = SC_SessionFactory_Ex::getInstance();
if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE || $session->useCookie() == false) {
$netUrl->addQueryString(session_name(), session_id());
}
if (GC_Utils_Ex::isAdminFunction()) {
// 管理画面またはmode指定時は付与
$netUrl->addQueryString(TRANSACTION_ID_NAME, SC_Helper_Session_Ex::getToken());
}
$url = $netUrl->getURL();
header("Location: {$url}");
exit;
}
示例11: doCheckBuyAndDownloadOk
function doCheckBuyAndDownloadOk($config, $re_download = false)
{
$objCustomer = new SC_Customer_Ex();
$objQuery = SC_Query_Ex::getSingletonInstance();
if (empty($_REQUEST["product_ktc_vid"])) {
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
}
$vid = $_REQUEST["product_ktc_vid"];
$curl = $this->curl_init(KISEKAE_TOUCH_API02);
$post = $this->getPost($config, array("contentid" => $this->arrProduct["product_code_min"], "vid" => $vid));
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$status = SC_XML::xpath($result, "//status/@value");
switch ($status) {
default:
SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
break;
case "000":
case "010":
break;
}
if ($status == "000") {
// FIXME 課金処理
// API03
$curl = $this->curl_init(KISEKAE_TOUCH_API03);
if ($objCustomer->getValue("buy_to_nopoint") == "1") {
$price = $this->arrProduct["price02_min"];
$settlementtype = "998";
$redownloaddate = date("Ymd");
} elseif ($re_download) {
$price = 0;
$settlementtype = "900";
$redownloaddate = date("Ymd");
} else {
$price = $this->arrProduct["price02_min"];
$settlementtype = "001";
$redownloaddate = date("Ymd", strtotime($this->downloadable_days2));
}
$contentid = $this->arrProduct["product_code_min"];
$post = compact("contentid", "price", "redownloaddate", "vid", "settlementtype");
$post = $this->getPost($config, $post);
$this->getDs($post, $config);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
$result = curl_exec($curl);
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
$objFormParam = new SC_FormParam();
$this->setOrderParam($objFormParam, $vid, $authentication_id);
$objFormParam->convParam();
$message = '';
$arrValBef = array();
$objPurchase = new SC_Helper_Purchase_Ex();
$objPurchase->saveShippingTemp(array());
$order_id = $this->doRegister("", $objPurchase, $objFormParam, $message, $arrValBef);
$customer_id = $objCustomer->getValue("customer_id");
$this->addPointHistory($order_id, $customer_id, $objFormParam, $objQuery);
} else {
$authentication_id = SC_XML::xpath($result, "//authentication/@id");
}
$netUrl = new Net_URL(KISEKAE_TOUCH_CST02);
$netUrl->addQueryString("aid", $authentication_id);
$netUrl->addQueryString("cpid", $post["cpid"]);
$netUrl->addQueryString("siteid", $post["siteid"]);
$netUrl->addQueryString("contentid", $post["contentid"]);
$netUrl->addQueryString("ts", $post["ts"]);
$post2 = $netUrl->querystring;
$this->getDs($post2, $config);
$netUrl->addRawQueryString(http_build_query($post2));
header("Location: " . $netUrl->getURL());
}
示例12: lfGetNews
/**
* 新着情報を取得する.
*
* @return array $arrNewsList 新着情報の配列を返す
*/
public function lfGetNews($dispNumber, $pageNo, NewsHelper $objNews)
{
$arrNewsList = $objNews->getList($dispNumber, $pageNo);
// モバイルサイトのセッション保持 (#797)
if (Application::alias('eccube.display')->detectDevice() == DEVICE_TYPE_MOBILE) {
foreach ($arrNewsList as $key => $value) {
$arrRow =& $arrNewsList[$key];
if (Utils::isAppInnerUrl($arrRow['news_url'])) {
$netUrl = new \Net_URL($arrRow['news_url']);
$netUrl->addQueryString(session_name(), session_id());
$arrRow['news_url'] = $netUrl->getURL();
}
}
}
return $arrNewsList;
}
示例13: date
$redirect = preg_match('#^http://#', $_POST['redirect']) ? $_POST['redirect'] : null;
$expiration = $_POST['expiration'] ? $_POST['expiration'] : null;
$file = is_array($_FILES['file']) ? $_FILES['file'] : null;
if (strtotime($expiration) < time()) {
die_with_code(401, "Sorry, expiration date {$expiration} has come and gone - " . date('r', strtotime($expiration)));
}
if ($file['error'] > 0) {
die_with_code(400, "Sorry, encountered error #{$file['error']} (see http://us.php.net/manual/en/features.file-upload.errors.php)");
}
$posted_signature = $_POST['signature'] ? $_POST['signature'] : null;
$expected_signature = sign_post_details($dirname, $expiration, API_PASSWORD);
if ($posted_signature != $expected_signature) {
die_with_code(401, 'Sorry, bad signature');
}
if (is_array($file) && is_uploaded_file($file['tmp_name'])) {
$object_id = rtrim($dirname, '/') . '/' . ltrim($file['name'], '/');
$content_bytes = file_get_contents($file['tmp_name']);
$url = post_file_local($object_id, $content_bytes);
}
if ($redirect) {
$redirect = new Net_URL($redirect);
$redirect->addQueryString('url', $url);
$redirect = $redirect->getURL();
}
if ($redirect) {
header("Location: {$redirect}");
}
header('Content-Type: text/plain');
echo "Thanks, I think I handled your file, so thanks.\n";
echo "That's: {$file['name']}\n";
echo "Or? {$file['error']}\n";
示例14: reload
/**
* ページをリロードする.
*
* 引数 $queryString に, $_SERVER['QUERY_STRING'] の値を使用してはならない.
* この関数は, 内部で LC_Page::sendRedirect() を使用するため,
* $_SERVER['QUERY_STRING'] の値は自動的に付与される.
*
* @param array $queryString QueryString の配列
* @param bool $removeQueryString 付与されていた QueryString を削除する場合 true
* @return void
* @see Net_URL
*/
function reload($queryString = array(), $removeQueryString = false)
{
// 現在の URL を取得
$netURL = new Net_URL();
if ($removeQueryString) {
$netURL->querystring = array();
$_SERVER['QUERY_STRING'] = '';
}
// QueryString を付与
if (!empty($queryString)) {
foreach ($queryString as $key => $val) {
$netURL->addQueryString($key, $val);
}
}
$this->sendRedirect($netURL->getURL());
}
示例15:
echo "<th>Opis</th>";
}
if ($ustawieniaGaleriiZdjec->obslugaPolaGaleriaZdjecNowa) {
echo "<th>Nowa</th>";
}
if ($ustawieniaGaleriiZdjec->obslugaPolaGaleriaZdjecPrawieNowa) {
echo "<th>Prawie nowa</th>";
}
echo "<th>Akcja</th>";
echo "<tr>\n";
$edytujUrl = new Net_URL($_SERVER['REQUEST_URI'], false);
$usunUrl = new Net_URL($_SERVER['REQUEST_URI'], false);
$dodajUrl = new Net_URL($_SERVER['REQUEST_URI'], false);
$dodajUrl->addQueryString("dodaj", "1");
$dodajLink = $dodajUrl->getURL();
foreach ($galerie as $galeriaZdjec) {
$edytujUrl->addQueryString("edytuj", $galeriaZdjec->katalog);
$edytujLink = $edytujUrl->getURL();
$usunUrl->addQueryString("usun", $galeriaZdjec->katalog);
$usunLink = $usunUrl->getURL();
echo "<tr>";
echo "<td>" . $galeriaZdjec->katalog . "</td>";
echo "<td>" . $galeriaZdjec->data . "</td>";
echo "<td>" . $galeriaZdjec->tytulGalerii . "</td>";
if ($ustawieniaGaleriiZdjec->obslugaPolaGaleriaZdjecOpis) {
echo "<td>" . $galeriaZdjec->opisGalerii . "</td>";