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"); } }
/** * 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); }
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); } } } }
</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>
<?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 {
/** * 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); }
<?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 }
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"); ?>
<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(); ?>
<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">
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 } } ?>
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"); ?>
?> </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;">
</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>
<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; ?> " />
<div class="form-group"> <label class="col-sm-5 text-right" for="phone">Phone:</label> <div class="col-sm-6"><?php echo $phone; ?> </div> </div> <div class="form-group"> <label class="col-sm-5 text-right" for="address">Profile Image:</label> <div class="col-sm-6"> <?php if (isset($avatar)) { $file = cdn_url() . 'documents/profile/' . $avatar; $file_headers = @get_headers($file); if (isset($avatar) && !empty($avatar) && !strpos($file_headers[0], '404 Not Found') && !strpos($file_headers[0], '403 Forbidden')) { echo '<img src="' . cdn_url() . 'documents/profile/' . $avatar . '" 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> </div> </div> <div class="tab-pane mb30" id="tab_efn_2">
<label class="col-sm-3 text-right" for="address">Agency Address:</label> <div class="col-sm-8"><?php echo $address; ?> </div> </div> <div class="form-group"> <label class="col-sm-3 text-right" for="standard_hourly_rate">Agency Logo:</label> <div class="col-sm-8"> <?php if (isset($logo)) { $file = cdn_url() . 'documents/companylogo/' . $logo; $file_headers = @get_headers($file); if (isset($logo) && !empty($logo) && !strpos($file_headers[0], '404 Not Found') && !strpos($file_headers[0], '403 Forbidden')) { echo '<img src="' . cdn_url() . 'documents/companylogo/' . $logo . '" 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="form-group"> <label class="col-sm-3 text-right" for="gmt_offset">Timezone:</label> <div class="col-sm-8"><?php echo _date_lang_shorttag($gmt_offset); ?> </div> </div>
<div class="g75 box"> <h2>Edit your post</h2> <hr> <img src="<?php echo cdn_url($post->post_image_path); ?> " /> <hr> <?php if (isset($errors)) { ?> <div class="alert-msg error"> <?php foreach ($errors as $key => $message) { ?> <?php echo $message; ?> <?php } ?> </div> <?php } if (isset($success)) { ?> <div class="alert-msg success"> <p><?php echo $success; ?> </p>
" class="post-hover"> <span class="title"><?php echo character_limiter($post->post_title, 12); ?> </span> <span class="desc"><?php echo word_limiter($post->post_text, 20); ?> </span> <em><?php echo strftime('%B %d, %Y', mysql_to_unix($post->post_date)); ?> </em> </a> <img src="<?php echo cdn_url(getThumb($post->post_image_path)); ?> " alt="<?php echo $post->post_title; ?> " /> </div> <div class="post-tools"> <p class="ico"><a href="" class="comments"><?php echo $post->post_reply_count; ?> </a>Comments</p> <p class="ico"><a href="" class="likes"><?php echo $post->post_like_count; ?> </a>likes</p>
function load_css($css_file = NULL, $tag = true) { $ci =& get_instance(); $_is_mobile = isset($ci->agent) && $ci->agent->is_mobile() ? TRUE : FALSE; $_is_ipad = isset($ci->agent) && $ci->agent->is_ipad() ? TRUE : FALSE; $_is_tablet = isset($ci->agent) && $ci->agent->is_tablet() ? TRUE : FALSE; if (is_null($css_file) || empty($css_file)) { return; } if ($_is_mobile && !$_is_tablet) { if (file_exists("./assets/mobile/css/{$css_file}")) { if ($tag) { return "<link type=\"text/css\" rel=\"stylesheet\" href=\"" . cdn_url() . "assets/mobile/css/{$css_file}\" />"; } else { $data = file_get_contents(base_url() . "assets/mobile/css/{$css_file}"); return '<style type=\\"text/css\\">' . $data . '</style>'; } } } else { if ($_is_tablet && file_exists("./assets/{$default_theme}/css/t/{$css_file}")) { if ($tag) { return "<link type=\"text/css\" rel=\"stylesheet\" href=\"" . cdn_url() . "assets/{$default_theme}/css/t/{$css_file}\" />"; } else { $data = file_get_contents(cdn_url() . "assets/{$default_theme}/css/t/{$css_file}"); return '<style type=\\"text/css\\">' . $data . '</style>'; } } elseif (file_exists("./assets/{$default_theme}/css/{$css_file}")) { if ($tag) { return "<link type=\"text/css\" rel=\"stylesheet\" href=\"" . cdn_url() . "assets/{$default_theme}/css/{$css_file}\" />"; } else { $data = file_get_contents(cdn_url() . "assets/{$default_theme}/css/{$css_file}"); return '<style type=\\"text/css\\">' . $data . '</style>'; } } } }