当前位置: 首页>>代码示例>>PHP>>正文


PHP fix_url函数代码示例

本文整理汇总了PHP中fix_url函数的典型用法代码示例。如果您正苦于以下问题:PHP fix_url函数的具体用法?PHP fix_url怎么用?PHP fix_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fix_url函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ManageSettings


//.........这里部分代码省略.........
         $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('BrandDefaultImage'), GetConfig('BrandDefaultImage'));
     } else {
         $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), GetConfig('ShopPath') . '/templates/' . GetConfig('template') . '/images/BrandDefault.gif', 'templates/' . GetConfig('template') . '/images/BrandDefault.gif');
     }
     $GLOBALS['HideCurrentDefaultProductImage'] = 'display: none';
     switch (GetConfig('DefaultProductImage')) {
         case 'template':
             $GLOBALS['DefaultProductImageTemplateChecked'] = 'checked="checked"';
             break;
         case '':
             $GLOBALS['DefaultProductImageNoneChecked'] = 'checked="checked"';
             break;
         default:
             $GLOBALS['DefaultProductImageCustomChecked'] = 'checked="checked"';
             $GLOBALS['HideCurrentDefaultProductImage'] = '';
             $GLOBALS['DefaultProductImage'] = GetConfig('DefaultProductImage');
     }
     if (GetConfig('CategoryListingMode') == 'children') {
         $GLOBALS['CategoryListModeChildren'] = "checked=\"checked\"";
     } else {
         if (GetConfig('CategoryListingMode') == 'emptychildren') {
             $GLOBALS['CategoryListModeEmptyChildren'] = "checked=\"checked\"";
         } else {
             $GLOBALS['CategoryListModeSingle'] = "checked=\"checked\"";
         }
     }
     // Get a list of the customer groups
     $query = 'SELECT * FROM [|PREFIX|]customer_groups ORDER BY groupname ASC';
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     $GLOBALS['CustomerGroupOptions'] = '';
     while ($group = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         if (GetConfig('GuestCustomerGroup') == $group['customergroupid']) {
             $sel = 'selected="selected"';
         } else {
             $sel = '';
         }
         $GLOBALS['CustomerGroupOptions'] .= "<option value=\"" . $group['customergroupid'] . "\" " . $sel . ">" . isc_html_escape($group['groupname']) . "</option>";
     }
     // Workout the HTTPS URL
     $GLOBALS['CompleteStorePath'] = fix_url($_SERVER['PHP_SELF']);
     $GLOBALS['HTTPSUrl'] = str_replace("http://", "https://", isc_strtolower($GLOBALS['ShopPath']));
     $GLOBALS['HideVendorSettings'] = 'display: none';
     if (gzte11(ISC_HUGEPRINT)) {
         $GLOBALS['HideVendorSettings'] = '';
     }
     if (GetConfig('VendorLogoSize')) {
         $logoDimensions = explode('x', GetConfig('VendorLogoSize'));
         $GLOBALS['VendorLogoSizeW'] = (int) $logoDimensions[0];
         $GLOBALS['VendorLogoSizeH'] = (int) $logoDimensions[1];
         $GLOBALS['HideVendorLogoUploading'] = '';
         $GLOBALS['VendorLogoUploadingChecked'] = 'checked="checked"';
     } else {
         $GLOBALS['HideVendorLogoUploading'] = 'display: none';
     }
     if (GetConfig('VendorPhotoSize')) {
         $photoDimensions = explode('x', GetConfig('VendorPhotoSize'));
         $GLOBALS['VendorPhotoSizeW'] = (int) $photoDimensions[0];
         $GLOBALS['VendorPhotoSizeH'] = (int) $photoDimensions[1];
         $GLOBALS['HideVendorPhotoUploading'] = '';
         $GLOBALS['VendorPhotoUploadingChecked'] = 'checked="checked"';
     } else {
         $GLOBALS['HideVendorPhotoUploading'] = 'display: none';
     }
     foreach ($this->all_vars as $var) {
         if (is_string(GetConfig($var)) || is_numeric(GetConfig($var))) {
             $GLOBALS[$var] = isc_html_escape(GetConfig($var));
         }
     }
     if (GetConfig('DisableDatabaseDetailFields')) {
         $GLOBALS['dbType'] = '';
         $GLOBALS['dbServer'] = '';
         $GLOBALS['dbUser'] = '';
         $GLOBALS['dbPass'] = '';
         $GLOBALS['dbDatabase'] = '';
         $GLOBALS['tablePrefix'] = '';
         $GLOBALS['HideDatabaseDetails'] = 'display: none';
     }
     if (GetConfig('DisableLicenseKeyField')) {
         $GLOBALS['serverStamp'] = 'N/A';
         $GLOBALS['HideLicenseKey'] = 'display: none';
     }
     if (GetConfig('DisablePathFields')) {
         $GLOBALS['HidePathFields'] = 'display: none';
     }
     if (GetConfig('DisableStoreUrlField')) {
         $GLOBALS['HideStoreUrlField'] = 'display: none';
     }
     if (GetConfig('DisableLoggingSettingsTab')) {
         $GLOBALS['HideLoggingSettingsTab'] = 'display: none';
     }
     if (GetConfig('DisableProxyFields')) {
         $GLOBALS['HideProxyFields'] = 'display: none';
     }
     if (GetConfig('DisableBackupSettings')) {
         $GLOBALS['HideBackupSettings'] = 'none';
     }
     $GLOBALS['ShopPath'] = GetConfig('ShopPathNormal');
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("settings.manage");
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:class.settings_nov25.php

示例2: subscribe_to_feed

/**
 * @return array (code => Status code, message => error message if available)
 *
 *                 0 - OK, Feed already exists
 *                 1 - OK, Feed added
 *                 2 - Invalid URL
 *                 3 - URL content is HTML, no feeds available
 *                 4 - URL content is HTML which contains multiple feeds.
 *                     Here you should call extractfeedurls in rpc-backend
 *                     to get all possible feeds.
 *                 5 - Couldn't download the URL content.
 *                 6 - Content is an invalid XML.
 */
function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '')
{
    global $fetch_last_error;
    require_once "include/rssfuncs.php";
    $url = fix_url($url);
    if (!$url || !validate_feed_url($url)) {
        return array("code" => 2);
    }
    $contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
    if (!$contents) {
        return array("code" => 5, "message" => $fetch_last_error);
    }
    foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
        $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
    }
    if (is_html($contents)) {
        $feedUrls = get_feeds_from_html($url, $contents);
        if (count($feedUrls) == 0) {
            return array("code" => 3);
        } else {
            if (count($feedUrls) > 1) {
                return array("code" => 4, "feeds" => $feedUrls);
            }
        }
        //use feed url as new URL
        $url = key($feedUrls);
    }
    if ($cat_id == "0" || !$cat_id) {
        $cat_qpart = "NULL";
    } else {
        $cat_qpart = "'{$cat_id}'";
    }
    $result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]);
    if (strlen(FEED_CRYPT_KEY) > 0) {
        require_once "crypt.php";
        $auth_pass = substr(encrypt_string($auth_pass), 0, 250);
        $auth_pass_encrypted = 'true';
    } else {
        $auth_pass_encrypted = 'false';
    }
    $auth_pass = db_escape_string($auth_pass);
    if (db_num_rows($result) == 0) {
        $result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})");
        $result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
        $feed_id = db_fetch_result($result, 0, "id");
        if ($feed_id) {
            set_basic_feed_info($feed_id);
        }
        return array("code" => 1);
    } else {
        return array("code" => 0);
    }
}
开发者ID:nota-ja,项目名称:tt-rss,代码行数:66,代码来源:functions.php

示例3: get_set_by_id

include $_SERVER['DOCUMENT_ROOT'] . '/library/modules/nav.php';
?>

<main role="main">
    <h1>Card Details</h1>
    <table>
        <tr>
            <td class="leftcolumn">
                <img src="<?php 
$set = get_set_by_id($card['set_id']);
$url = '/pictures/' . $set['official_code'] . '/' . $card['card_name'];
if ($card['variation_number'] != NULL) {
    $url = $url . $card['variation_number'];
}
$url = $url . '.jpg';
$url = fix_url($url);
echo $url;
?>
" alt="Card Image Goes Here"><br>
                Fair Trade Price:<br>
                <div id="price_area">...Loading...<script>
                    $(document).ready(function () {
                        get_price()
                    });
                    </script></div>
                <div id="price_area_foil">...Loading...<script>

                    </script></div>
                Variations<br>
                <?php 
$variations = get_variations($card['card_name'], $set['set_id']);
开发者ID:Dorely,项目名称:WebDevelopment,代码行数:31,代码来源:cardDetails.php

示例4: get_feeds_from_html

function get_feeds_from_html($url, $content)
{
    $url = fix_url($url);
    $baseUrl = substr($url, 0, strrpos($url, '/') + 1);
    libxml_use_internal_errors(true);
    $doc = new DOMDocument();
    $doc->loadHTML($content);
    $xpath = new DOMXPath($doc);
    $entries = $xpath->query('/html/head/link[@rel="alternate"]');
    $feedUrls = array();
    foreach ($entries as $entry) {
        if ($entry->hasAttribute('href')) {
            $title = $entry->getAttribute('title');
            if ($title == '') {
                $title = $entry->getAttribute('type');
            }
            $feedUrl = rewrite_relative_url($baseUrl, $entry->getAttribute('href'));
            $feedUrls[$feedUrl] = $title;
        }
    }
    return $feedUrls;
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:22,代码来源:functions.php

示例5: fix_url_price

function fix_url_price($card_name, $set_name)
{
    //echo $card_name.'<br>';
    //echo $set_name.'<br>';
    $card_name = html_entity_decode($card_name);
    $card_name = str_replace(' ', '_', $card_name);
    $card_name = str_replace(':', '', $card_name);
    $card_name = str_replace('/', '', $card_name);
    $card_name = str_replace('"', '', $card_name);
    $card_name = str_replace('Æ', 'AE', $card_name);
    $card_name = trim($card_name);
    $card_name = fix_url($card_name);
    //echo $card_name.'<br>';
    //$card_name = urlencode($card_name);
    //echo $card_name.'<br>';
    $set_name = str_replace('.', '', $set_name);
    $set_name = str_replace(':', '', $set_name);
    $set_name = str_replace('"', '', $set_name);
    $set_name = str_replace("'", '', $set_name);
    $set_name = str_replace('(', '', $set_name);
    $set_name = str_replace(')', '', $set_name);
    //echo $set_name.'1<br>';
    $set_name = str_replace('Magic The Gathering-', '', $set_name);
    //echo $set_name.'2<br>';
    $set_name = str_replace('Limited', '', $set_name);
    $set_name = str_replace('City of Guilds', '', $set_name);
    $set_name = str_replace('Magic 20', 'M', $set_name);
    //echo $set_name.'3<br>';
    $set_name = str_replace('Magic', '', $set_name);
    //echo $set_name.'4<br>';
    $set_name = str_replace('into', 'Into', $set_name);
    $set_name = str_replace('Origins', 'Magic Origins', $set_name);
    $set_name = str_replace('Core Set', '', $set_name);
    $set_name = str_replace('Edition', '', $set_name);
    $set_name = str_replace('Tenth', '10th Edition', $set_name);
    $set_name = str_replace('Fifth', '5th Edition', $set_name);
    $set_name = str_replace('Seventh', '7th Edition', $set_name);
    $set_name = str_replace('Eighth', '8th Edition', $set_name);
    $set_name = str_replace('Ninth', '9th Edition', $set_name);
    $set_name = str_replace('Classic Sixth', '6th Edition', $set_name);
    $set_name = str_replace('Fourth', '4th Edition', $set_name);
    $set_name = str_replace('Deckmasters', 'Deckmasters Box Set', $set_name);
    //echo $set_name.'5<br>';
    $set_name = trim(preg_replace('/\\s+/', ' ', $set_name));
    $set_name = str_replace(' ', '_', $set_name);
    //echo $set_name.'6<br>';
    //echo $card_name.'<br>';
    //echo $set_name.'<br>';
    $link = 'http://www.mtgprice.com/sets/' . $set_name . '/' . $card_name;
    //$link = urlencode($link);
    //echo $link.'<br>';
    //echo fix_url($link).'<br>';
    return $link;
}
开发者ID:Dorely,项目名称:WebDevelopment,代码行数:54,代码来源:cards.php

示例6: ManageSettings


//.........这里部分代码省略.........

			if (GetConfig('CategoryListingMode') == 'children') {
				$GLOBALS['CategoryListModeChildren'] = "checked=\"checked\"";
			}
			else if (GetConfig('CategoryListingMode') == 'emptychildren') {
				$GLOBALS['CategoryListModeEmptyChildren'] = "checked=\"checked\"";
			}
			else {
				$GLOBALS['CategoryListModeSingle'] = "checked=\"checked\"";
			}

			// check if the images need to be resized automatically
			$GLOBALS['RunImageResize'] = '0';
			if(isset($_SESSION['RunImageResize']) && $_SESSION['RunImageResize'] == 'yes') {
				$GLOBALS['RunImageResize'] = '1';
				unset($_SESSION['RunImageResize']);
			}

			// Get a list of the customer groups
			$query = 'SELECT * FROM [|PREFIX|]customer_groups ORDER BY groupname ASC';
			$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
			$GLOBALS['CustomerGroupOptions'] = '';
			while($group = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
				if(GetConfig('GuestCustomerGroup') == $group['customergroupid']) {
					$sel = 'selected="selected"';
				}
				else {
					$sel = '';
				}
				$GLOBALS['CustomerGroupOptions'] .= "<option value=\"".$group['customergroupid']."\" ".$sel.">".isc_html_escape($group['groupname'])."</option>";
			}

			// Workout the HTTPS URL
			$GLOBALS['CompleteStorePath'] = fix_url($_SERVER['PHP_SELF']);
			$GLOBALS['HTTPSUrl'] = str_replace("http://", "https://", isc_strtolower($GLOBALS['ShopPath']));

			$GLOBALS['HideVendorSettings'] = 'display: none';
			if(gzte11(ISC_HUGEPRINT)) {
				$GLOBALS['HideVendorSettings'] = '';
			}

			if(GetConfig('VendorLogoSize')) {
				$logoDimensions = explode('x', GetConfig('VendorLogoSize'));
				$GLOBALS['VendorLogoSizeW'] = (int)$logoDimensions[0];
				$GLOBALS['VendorLogoSizeH'] = (int)$logoDimensions[1];
				$GLOBALS['HideVendorLogoUploading'] = '';
				$GLOBALS['VendorLogoUploadingChecked'] = 'checked="checked"';
			}
			else {
				$GLOBALS['HideVendorLogoUploading'] = 'display: none';
			}

			if(GetConfig('VendorPhotoSize')) {
				$photoDimensions = explode('x', GetConfig('VendorPhotoSize'));
				$GLOBALS['VendorPhotoSizeW'] = (int)$photoDimensions[0];
				$GLOBALS['VendorPhotoSizeH'] = (int)$photoDimensions[1];
				$GLOBALS['HideVendorPhotoUploading'] = '';
				$GLOBALS['VendorPhotoUploadingChecked'] = 'checked="checked"';
			}
			else {
				$GLOBALS['HideVendorPhotoUploading'] = 'display: none';
			}

			foreach ($this->all_vars as $var) {
				if (is_string(GetConfig($var)) || is_numeric(GetConfig($var))) {
					$GLOBALS[$var] = isc_html_escape(GetConfig($var));
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:class.settings.php

示例7: the_title

    <div class="inner-text">
        <h2>
            <?php 
the_title();
?>
        </h2>
        <?php 
the_content();
?>

        <?php 
if (get_field('company_website')) {
    ?>
            <br>
            <a href="<?php 
    echo fix_url(get_field('company_website'));
    ?>
">
                Read more here
            </a>
        <?php 
}
?>

        <br>
        <button class="button place-left" href="<?php 
echo esc_url(home_url('/'));
?>
?page_id=234" data-toggle="modal" data-target="#myModal">
            Contact us here
        </button>
开发者ID:johnleesw,项目名称:mustardseedwp,代码行数:31,代码来源:single-venture.php

示例8: testFixUrlWithPaths

 /**
  * Test fix_url with domain + paths
  */
 public function testFixUrlWithPaths()
 {
     $this->assertEquals('http://tt-rss.org/foo', fix_url('tt-rss.org/foo'));
     $this->assertEquals('http://tt-rss.org/foo/bar/baz', fix_url('tt-rss.org/foo/bar/baz'));
     $this->assertEquals('http://tt-rss.org/foo/bar/baz/', fix_url('tt-rss.org/foo/bar/baz/'));
 }
开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:9,代码来源:FunctionsTest.php

示例9: mysql_real_escape_string

 include_once 'wall_includes/security.php';
 include_once 'wall_includes/smileys.php';
 $clientids = mysql_real_escape_string($_POST['clientids']);
 $message = clean(mysql_real_escape_string($_POST['message']));
 $top_id = mysql_real_escape_string($_POST['top_id']);
 $message = special_chars($message);
 $time = time();
 //getting image link
 if (!empty($_POST['pic_url'])) {
     $image = strip_tags($_POST['pic_url']);
 } else {
     $image = '';
 }
 //getting video link
 if (!empty($_POST['y_link'])) {
     $video = fix_url(strip_tags($_POST['y_link']));
 } else {
     $video = '';
 }
 //insert into wall table
 $query = mysql_query("INSERT INTO `posts` (`desc`, `image_url`, `vid_url`,`users_id`,`client_id`, `tid`, `date`) VALUES ('{$message}', '{$image}', '{$video}','{$user_id}', '{$clientids}', '', '{$time}')") or die(mysql_error());
 $ins_id = mysql_insert_id();
 if ($top_id != "") {
     $topquery = mysql_query("UPDATE `posts` SET `tid` = '{$top_id}' WHERE `pid` = '{$ins_id}'") or die(mysql_error());
 }
 $sql_usernames = "SELECT * FROM crm_users WHERE users_id = '{$user_id}'";
 $res_usernames = mysql_query($sql_usernames);
 $rows = @mysql_num_rows($res_usernames);
 $fnames = stripslashes(@mysql_result($res_usernames, 0, 'first_name'));
 $lnames = stripslashes(@mysql_result($res_usernames, 0, 'last_name'));
 $fulln = ucfirst($fnames) . " " . ucfirst($lnames);
开发者ID:Entellus,项目名称:System,代码行数:31,代码来源:post_updates.php

示例10: redirect

function redirect($url, $message = '', $title = '', $wait = 3, $usephp = false, $withbaseurl = true)
{
    global $SITENAME, $BASEURL;
    if (empty($message)) {
        $message = "You will now be redirected...";
    }
    if (empty($title)) {
        $title = $SITENAME;
    }
    $url = fix_url($url);
    if ($withbaseurl) {
        $url = $BASEURL . (substr($url, 0, 1) == '/' ? '' : '/') . $url;
    }
    if ($usephp) {
        @header('Location: ' . $url);
        exit;
    }
    ob_start();
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT...tional.dtd">
<html lang="en">
<head>
<title><?php 
    echo $title;
    ?>
</title>
<meta http-equiv="refresh" content="<?php 
    echo $wait;
    ?>
;URL=<?php 
    echo $url;
    ?>
">
<link rel="stylesheet" href="<?php 
    echo $BASEURL;
    ?>
/themes/green/green.css" type="text/css" media="screen">
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div  align="center">
<table width="755" border="2" cellspacing="1" cellpadding="4" >
<tr>
<td bgcolor="#660000"><strong><a href="<?php 
    echo $BASEURL;
    ?>
"><center><?php 
    echo $title;
    ?>
</a></center></strong></td>
</tr>
<tr>
<td align="center"><p><font color="#white"><?php 
    echo $message;
    ?>
</font></p></td>
</tr>
<tr>
<td bgcolor="#660000" ><a href="<?php 
    echo $url;
    ?>
">
<span class="smalltext">Click here if you don't want to wait any longer.</span></a></td>
</tr>
</table>
</div>
</body>
</html>
<?php 
    ob_end_flush();
    exit;
}
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:87,代码来源:takelogin.php

示例11: _fix_url_callback2

function _fix_url_callback2($m, $init = false)
{
    static $base_url;
    if ($init) {
        $base_url = $m;
        return;
    }
    return '[[' . fix_url($base_url, $m) . trim($m[2]) . ']]';
}
开发者ID:ahastudio,项目名称:moniwiki,代码行数:9,代码来源:ImportUrl.php


注:本文中的fix_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。