本文整理汇总了PHP中cdn_url函数的典型用法代码示例。如果您正苦于以下问题:PHP cdn_url函数的具体用法?PHP cdn_url怎么用?PHP cdn_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cdn_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
public function download($id = false)
{
$this->load->model('product_model');
$product = $this->product_model->getNotValidateProduct($id);
//I know, it's a little bit ugly coded, but important for pending download
//17-08-2013 and it's important for the unique system
if (!$product) {
die("Invalid product");
}
if ($product['price'] == 0) {
$this->product_model->addDownload($id);
}
if ($this->user->hasProduct($id) || $product['price'] == 0 || $this->user->getRank() >= 2) {
//$basedir = $_SERVER['DOCUMENT_ROOT']."/files";
//$filename = sprintf("%s/%s", $basedir, $product['download']);
//header("Content-Type: application/zip");
//$save_as_name = basename($product['name']).".zip";
//header("Content-Length: ".filesize("/".$filename));
//header("Content-Disposition: attachment; filename=\"$save_as_name\"");
//readfile("/".$filename);
header("Location: " . cdn_url() . $product['download']);
// let's use this for the moment untill we fix that way
} else {
die("You don't own this product");
}
}
示例2: cdn_asset
/**
* Generate a URL to an asset on a CDN.
*
* @param string $name
* @param string $folder
* @return string
*/
function cdn_asset($filename, $folder = null, $whichCdn = null)
{
$url = '';
if ($folder) {
$url .= $folder;
}
$url .= urlencode($filename);
return cdn_url($url, $whichCdn);
}
示例3: raw_view
public function raw_view($view, $data = array(), $return = FALSE)
{
is_array($data) or $data = (array) $data;
$this->_data = array_merge($this->_data, $data);
if (isset($this->ci->cfg->default_theme)) {
$this->_data['default_theme'] = $this->_default_theme = $this->ci->cfg->default_theme;
}
$this->_data['asset_url'] = cdn_url() . 'assets/' . $this->_default_theme . '/';
$this->_data['mobile_asset_url'] = cdn_url() . 'assets/mobile/';
$this->_data['cdn_url'] = cdn_url() . '/';
$this->_data['ctrl_id'] = now();
$this->_data['plugins'] = array_merge($this->_data['plugins'], array('sparkline'));
$mobile_override = isset($data['mobile_override']) ? $data['mobile_override'] : FALSE;
if ($this->_is_mobile && ($view != 'auth/login' || $view != 'login') && $mobile_override == FALSE) {
$view = "mobile/" . $view;
if ($return == TRUE) {
return $this->ci->load->view($view, $this->_data, TRUE);
} else {
$this->ci->load->view($view, $this->_data);
}
} else {
$page = VIEWPATH . "tablets/{$this->_default_theme}/{$view}.php";
if ($this->_is_tablet && ($view != 'auth/login' || $view != 'login') && file_exists($page)) {
if ($return == TRUE) {
return $this->ci->load->view("tablets/{$this->_default_theme}/{$view}", $this->_data, TRUE);
} else {
$this->ci->load->view("tablets/{$this->_default_theme}/{$view}", $this->_data);
}
} else {
if ($return == TRUE) {
return $this->ci->load->view("web/{$this->_default_theme}/{$view}", $this->_data, TRUE);
} else {
$this->ci->load->view("web/{$this->_default_theme}/{$view}", $this->_data);
}
}
}
}
示例4: cdn_url
</div>
<div class="footer"></div>
<script type="text/javascript" src="<?php
echo cdn_url('/assets/js/tribble.min.js');
?>
"></script>
<!--
<script type="text/javascript" src="<?php
echo cdn_url('/assets/js/jquery.1.4.1-min.js');
?>
"></script>
<script type="text/javascript" src="<?php
echo cdn_url('/assets/js/jquery.tagsinput.min.js ');
?>
"></script>
<script type="text/javascript" src="<?php
echo cdn_url('/assets/js/smartupdater.4.0.js');
?>
"></script>
<script type="text/javascript" src="<?php
echo cdn_url('/assets/js/tribble.js');
?>
"></script>
-->
<?php
if (isset($js)) {
echo $js;
}
?>
</body>
</html>
示例5: base_url
<?php
if ($product['validated'] == 1) {
?>
<a href="<?php
echo base_url();
?>
publisher/edit/<?php
echo $product['id'];
?>
" style="font-size:14px;">Modify product</a><?php
}
?>
</div>
<img src="<?php
echo cdn_url() . $product['thumbnail'];
?>
" width="94" height="94">
<h1><a href="<?php
echo base_url() . $this->product_model->getUrl($product);
?>
"><?php
echo character_limiter($product['name'], 10);
?>
</a></h1>
<h2><?php
if ($product['validated'] == 1) {
echo '<span style="color:green;">Approved</span>';
} elseif ($product['validated'] == 2) {
echo '<span style="color:red;">Denied</span>';
} else {
示例6: view
/**
* Post::view()
*
* @param mixed $postId
* @return
*/
public function view($postId)
{
if (!strpos($postId, '-')) {
$slug = strlen($postId);
} else {
$slug = strpos($postId, '-');
}
$post_id = substr($postId, 0, $slug);
$session = $this->alternatesession->session_exists();
if ($session) {
$data['user'] = $session;
$LIKE_Data = $this->rest->get('likes/exists/post/' . $postId . '/user/' . $session->user_id);
if ($LIKE_Data->request_status) {
$data['like_status'] = $LIKE_Data->like;
}
}
if (isset($session->user_id)) {
$request = 'posts/single/' . $post_id . '/' . $session->user_id;
} else {
$request = 'posts/single/' . $post_id;
}
//Pull in an array of tweets
$REST_Data = $this->rest->get($request);
//Pull in an array of tweets
$likers = $this->rest->get('posts/likes/' . $post_id);
if ($REST_Data->request_status == false) {
show_404('The post you requested does not exist!');
}
$tag_data = $this->rest->get('meta/tags');
$color_data = $this->rest->get('meta/colors');
$users_data = $this->rest->get('meta/users');
$data['tags'] = $tag_data->tags;
$data['colors'] = $color_data->colors;
$data['users'] = $users_data->users;
$parent_id = $REST_Data->post[0]->post_parent_id;
if ($parent_id != 0) {
$parent_data = $this->rest->get('posts/single/' . $parent_id);
$data['parent'] = $parent_data->post[0];
}
$data['post'] = $REST_Data->post[0];
$data['palette'] = $REST_Data->palette;
$data['replies'] = $REST_Data->post_replies->replies;
$data['replies_count'] = $REST_Data->post_replies->count;
if ($likers->request_status == true) {
$data['likers'] = $likers->likes;
}
$data['title'] = $this->config->item('site_name') . ' - ' . $data['post']->post_title;
$data['meta_description'] = $this->config->item('site_description') . ' - ' . $data['post']->post_text;
$data['meta_keywords'] = $this->config->item('site_keywords') . $data['post']->post_tags;
$data['css'] = '<link rel="stylesheet" href="' . cdn_url('assets/css/jquery.fancybox.css') . '" type="text/css" media="screen" />';
$data['js'] = '<script type="text/javascript" src="' . cdn_url('assets/js/jquery.fancybox.pack.js') . '"></script>';
$this->load->view('common/page_top.php', $data);
$this->load->view('post/view.php', $data);
$this->load->view('widgets/widgets.php', $data);
$this->load->view('common/page_end.php', $data);
}
示例7: cdn_url
<?php
if ($form_question->question_type == 'upload') {
?>
<a href="<?php
echo cdn_url() . 'documents/' . $form_question->answer;
?>
" rel="prettyPhoto[pp_gal_<?php
echo $form_question->question_id;
?>
]" title="">
<?php
if (isset($form_question->answer)) {
$file = cdn_url() . 'documents/' . $form_question->answer;
$file_headers = @get_headers($file);
if (isset($form_question->answer) && !empty($form_question->answer) && !strpos($file_headers[0], '404 Not Found') && !strpos($file_headers[0], '403 Forbidden')) {
echo '<img src="' . cdn_url() . 'documents/' . $form_question->answer . '" alt="" class="img-responsive" style="margin-left:auto;margin-right:auto;width:100px;" />';
} else {
/*echo '<img src="' . $asset_url . 'images/' . 'images/photos/missing_file.png" alt="" class="img-responsive" />';*/
}
}
?>
</a>
<?php
} else {
?>
<?php
echo $form_question->answer;
?>
<?php
}
示例8: cdn_url
if ($theme['downloads'] != -1) {
echo $theme['downloads'];
?>
<?php
if ($theme['price']) {
?>
sales<?php
} else {
?>
downloads<?php
}
}
?>
</div>
<img src="<?php
echo cdn_url() . $theme['thumbnail'];
?>
">
<h1><a href="<?php
echo base_url();
?>
view/<?php
echo $theme['id'];
?>
"><?php
echo $theme['name'];
?>
</a></h1>
<h2><?php
echo "Validated: " . ($theme['validated'] ? "True" : "False");
?>
示例9: base_url
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<script src="<?php
echo base_url();
?>
include/js/ie8_fix_maxwidth.js?v=<?php
echo app_version();
?>
"></script>
<![endif]-->
<script>
var base_url = "<?php
echo base_url();
?>
";
var cdn_url = "<?php
echo cdn_url();
?>
";
var builder = {};
</script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
Mantenimiento
<script src="<?php
echo base_url();
?>
示例10: array
<br><br><div class="clear"></div>
<section class="full">
<aside class="right" id="quotes">
<?php
echo '<span style="font-size:20px;font-weight:bold;float:left;margin-top:-15px;text-shadow: 1px 1px 3px purple;">Latest Submissions</span></br>';
$query = $this->db->query("SELECT * FROM products WHERE validated!=0 ORDER BY id DESC LIMIT 4", array());
$latestproducts = $query->result_array();
if ($query->num_rows() > 0) {
foreach ($latestproducts as $product) {
echo '<a href="' . base_url() . 'Product/' . url_title($product['name']) . '-' . $product['id'] . '">
<span style="color:purple;font-weight:bold;top:-5px;">' . $product['name'] . '</span></a>
</br><blockquote>
<a href="' . base_url() . 'Product/' . url_title($product['name']) . '-' . $product['id'] . '"><img src="' . cdn_url() . $product['thumbnail'] . '"/></a>
</span></blockquote>';
}
} else {
echo '<span style="font-weight:bold;color:#FF0000;";>no submissions..</span>';
}
?>
</aside>
<div div="ad_banner"><a href="contact"><img src="static/images/banner_default.png"></a></div>
<section id="gallery">
<div id="gallery_wrapper">
<img src="<?php
echo base_url();
?>
static/images/slides/1.jpg">
<img src="<?php
echo base_url();
?>
static/images/slides/2.jpg">
示例11: local_time
echo $por_row->requested_by_name;
?>
</small><br />
<strong><small>Requested On : </small></strong><small><?php
echo local_time($por_row->requested_on, 'M d, Y @ h:ia');
?>
</small><br />
</span>
</span>
<span class="pull-right" style="line-height:normal;">
<?php
foreach ($por_row->files as $attachment) {
?>
<?php
$cdn_file = cdn_url() . DOCUMENT_FOLDER . $attachment->document_name;
$file_headers = @get_headers($cdn_file, 1);
$is_document_exist = strpos($file_headers[0], '404 Not Found') === FALSE && strpos($file_headers[0], '403 Forbidden') === FALSE ? TRUE : FALSE;
if ($is_document_exist) {
?>
<a href="<?php
echo $cdn_file;
?>
" title="<?php
echo $attachment->original_name;
?>
"><i class="fa fa-link"></i></a>
<?php
}
}
?>
示例12: cdn_url
if ($module['downloads'] != -1) {
echo $module['downloads'];
?>
<?php
if ($module['price']) {
?>
sales<?php
} else {
?>
downloads<?php
}
}
?>
</div>
<img src="<?php
echo cdn_url() . $module['thumbnail'];
?>
">
<h1><a href="<?php
echo base_url();
?>
view/<?php
echo $module['id'];
?>
"><?php
echo $module['name'];
?>
</a></h1>
<h2><?php
echo "Validated: " . ($module['validated'] ? "True" : "False");
?>
示例13: elseif
?>
</textarea></div><?php
} elseif ($form_question->question_type == 'upload') {
?>
<div class="ui-field-contain" style="border-width:0;">
<label for="answer"><?php
echo $form_question->question_desc;
?>
</label>
<input type="file" name="answer" id="answer"><div class="clearfix" style="margin-top:10px;">
<?php
if (isset($form_question->answer)) {
$file = cdn_url() . 'documents/' . $form_question->answer;
$file_headers = @get_headers($file);
if (isset($form_question->answer) && !empty($form_question->answer) && !strpos($file_headers[0], '404 Not Found') && !strpos($file_headers[0], '403 Forbidden')) {
echo '<img src="' . cdn_url() . 'documents/' . $form_question->answer . '" alt="" class="image" style="margin-top:10px;" />';
} else {
echo '<img src="' . $asset_url . 'images/' . DEFAULT_IMAGE . '" alt="" class="image" style="margin-top:10px;" />';
}
}
?>
</div></div><div class="ui-field-contain" style="border-width:0;"><textarea name="notes" id="notes" data-role="none" rows="5" style="height:150px;" class="ui-input-text ui-shadow-inset ui-body-inherit ui-corner-all ui-mini ui-textinput-autogrow"><?php
echo $form_question->notes;
?>
</textarea></div><p><?php
echo $form_question->help_text;
?>
</p><?php
} elseif ($form_question->question_type == 'select') {
?>
<div class="ui-field-contain" style="border-width:0;">
示例14: get_gravatar
</p>
</li>
<hr />
<?php
} else {
?>
<li class="rebound">
<h4><a href="/"><?php
echo get_gravatar($reply->reply_post_user_email, 42);
?>
</a> </h4>
<div class="rebound-image"><a href="<?php
echo site_url('view/' . $reply->reply_post_id . '-' . url_title($reply->reply_post_title));
?>
"><img src="<?php
echo cdn_url($reply->post_image_path);
?>
" width="74" height="49" class="box"/></a></div>
<div class="rebound-title">
<h2><?php
echo $reply->reply_post_title;
?>
</h2>
<h4><a href="/user/<?php
echo $reply->reply_post_user_id;
?>
"><?php
echo $reply->reply_post_user_name;
?>
</a></h4>
</div>
示例15: cdn_url
<head>
<!-- <link rel="stylesheet" href="http://f.fontdeck.com/s/css/jrnfacj2+/6qJZMV0RqKKjVd0Pc/10.134.132.97/15877.css" type="text/css" /> -->
<!-- <link type="text/css" rel="stylesheet" href="<?php
echo cdn_url('/assets/css/tribble.min.css');
?>
" /> -->
<link type="text/css" rel="stylesheet" href="<?php
echo cdn_url('/assets/css/addictive.css');
?>
" />
<link type="text/css" rel="stylesheet" href="<?php
echo cdn_url('/assets/css/tribble.css');
?>
" />
<link type="text/css" rel="stylesheet" href="<?php
echo cdn_url('/assets/css/tagsinput.css');
?>
" />
<title><?php
echo $title;
?>
</title>
<meta charset="utf-8">
<meta name="description" content="<?php
echo $meta_description;
?>
" />
<meta name="keywords" content="<?php
echo $meta_keywords;
?>
" />