本文整理汇总了PHP中prep_url函数的典型用法代码示例。如果您正苦于以下问题:PHP prep_url函数的具体用法?PHP prep_url怎么用?PHP prep_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prep_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showProvider
function showProvider($clsRpt, $provider, $lProviderID)
{
//--------------------------------------------------
// provider section
//--------------------------------------------------
openBlock('Funding Provider', strLinkEdit_GrantProvider($lProviderID, 'Edit Provider Record', true) . ' ' . strLinkRem_Provider($lProviderID, 'Remove Provider', true, true));
echoT($clsRpt->openReport() . $clsRpt->openRow() . $clsRpt->writeLabel('Funder/Provider ID:') . $clsRpt->writeCell(str_pad($lProviderID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Name:') . $clsRpt->writeCell(htmlspecialchars($provider->strGrantOrg)) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:') . $clsRpt->writeCell($provider->strAddress) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Phone:') . $clsRpt->writeCell(htmlspecialchars($provider->strPhone)) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Cell:') . $clsRpt->writeCell(htmlspecialchars($provider->strCell)) . $clsRpt->closeRow());
if ($provider->strEmail == '') {
$strOut = ' ';
} else {
$strOut = mailto($provider->strEmail, htmlspecialchars($provider->strEmail));
}
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Email:') . $clsRpt->writeCell($strOut) . $clsRpt->closeRow());
if ($provider->strWebSite == '') {
$strOut = ' ';
} else {
if (!strtoupper(substr($provider->strWebSite, 0, 4)) == 'HTTP') {
$provider->strWebSite = 'http://' . $provider->strWebSite;
}
$strOut = '<a target="_blank" href="' . prep_url($provider->strWebSite) . '">' . htmlspecialchars($provider->strWebSite) . '</a>';
}
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Web:') . $clsRpt->writeCell($strOut) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Notes:') . $clsRpt->writeCell(nl2br(htmlspecialchars($provider->strNotes))) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Attributed to:') . $clsRpt->writeCell(htmlspecialchars($provider->strAttributedTo)) . $clsRpt->closeRow());
echoT($clsRpt->closeReport());
closeBlock();
}
示例2: qry
function qry($mb_id)
{
if (!IS_MEMBER) {
alert_close("회원만 이용하실 수 있습니다.");
}
$member = unserialize(MEMBER);
if (!$member['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
alert_close("자신의 정보를 공개하지 않으면 다른분의 정보를 조회할 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.");
}
$mb = $this->Basic_model->get_member($mb_id, "mb_id, mb_level, mb_point, mb_homepage, mb_open, mb_nick, mb_datetime, mb_today_login, mb_profile");
if (!isset($mb['mb_id'])) {
alert_close("회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.");
}
if (!$mb['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
alert_close("정보공개를 하지 않았습니다.");
}
$name = $this->config->item('cf_use_nick') && $mb['mb_nick'] ? $mb['mb_nick'] : $mb['mb_name'];
$name = get_sideview($mb['mb_id'], $name);
// 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻
$query = $this->db->query("select (TO_DAYS('" . TIME_YMDHIS . "') - TO_DAYS('" . $mb['mb_datetime'] . "') + 1) as days");
$row = $query->row_array();
$mb_reg_after = $row['days'];
$mb_homepage = prep_url($mb['mb_homepage']);
$mb_profile = $mb['mb_profile'] ? conv_content($mb['mb_profile'], FALSE) : "소개 내용이 없습니다.";
$mb_join_date = $member['mb_level'] >= $mb['mb_level'] ? substr($mb['mb_datetime'], 0, 10) . " (" . $mb_reg_after . " 일)" : "알 수 없음";
$mb_last_login = $member['mb_level'] >= $mb['mb_level'] ? $mb['mb_today_login'] : "알 수 없음";
$head = array('title' => $mb['mb_nick'] . "님의 자기소개");
$data = array('name' => $name, 'profile' => $mb_profile, 'homepage' => $mb_homepage, 'point' => number_format($mb['mb_point']), 'join_date' => $mb_join_date, 'last_login' => $mb_last_login);
widget::run('head', $head);
$this->load->view('member/profile', $data);
widget::run('tail');
}
示例3: updateRecord
function updateRecord($slideshowimage)
{
$data = array();
$data['alt'] = $this->input->post('alt', TRUE);
$data['link'] = prep_url($this->input->post('link', TRUE));
$data['image_active'] = 1;
$data['new_window'] = $this->input->post('new_window', TRUE);
//Upload Image
$config = array();
$config['upload_path'] = $this->config->item('SLIDESHOW_IMAGE_PATH');
$config['allowed_types'] = '*';
$config['overwrite'] = FALSE;
$this->load->library('upload', $config);
if (count($_FILES) > 0) {
//Check For Vaild Image Upload
if ($_FILES['image']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['image']['tmp_name'])) {
if (!$this->upload->do_upload('image')) {
show_error($this->upload->display_errors('<p class="err">', '</p>'));
return FALSE;
} else {
//$data = array();
$upload_data = $this->upload->data();
$data['slideshow_image'] = $upload_data['file_name'];
//delete the image
$path = $this->config->item('SLIDESHOW_IMAGE_PATH');
$filename = $path . $slideshowimage['slideshow_image'];
if (file_exists($filename)) {
@unlink($filename);
}
}
}
}
$this->db->where('slideshow_image_id', $slideshowimage['slideshow_image_id']);
$this->db->update('slideshow_image', $data);
}
示例4: ajaxDashboard
public function ajaxDashboard()
{
$all_websites = $this->model_front->get_all_websites();
$count_websites = $this->model_front->count_all_websites();
$data = array();
$no = $_POST['start'];
foreach ($all_websites->result() as $row) {
/*$domain = new Whois($row->w_url_rw);
$date_register = $domain->info();*/
$no++;
$list = array();
$list[] = $row->w_id;
$list[] = $row->w_title;
$list[] = '<a href="' . prep_url($row->w_url_rw) . '" target="_blank">' . $row->w_url_rw . '</a>';
$list[] = $this->input->valid_ip(gethostbyname($row->w_url_rw)) ? gethostbyname($row->w_url_rw) : "ADRESSE IP NON VALIDE";
$list[] = $row->c_title;
$list[] = $row->l_title;
$list[] = isset($date_register[0]) ? $date_register[0] : "";
$list[] = isset($date_register[1]) ? $date_register[1] : "";
$list[] = '<a class="access-ftp" href="#view-ftp" data-toggle="modal" data-target="#view-ftp" data-id="' . $row->w_id . '">Access FTP</a>';
$list[] = '<a class="access-sql" href="#view-database" data-toggle="modal" data-target="#view-database" data-id="' . $row->w_id . '">Access SQL</a>';
$list[] = '<a class="access-back-office" href="#view-backoffice" data-toggle="modal" data-target="#view-backoffice" data-id="' . $row->w_id . '">Access Back office</a>';
$list[] = '<a class="email" href="#email" data-toggle="modal" data-target="#email">Email</a>';
$list[] = '<a id="edit-dashboard" href="' . site_url('dashboard/edit-website/' . $row->w_id) . '">Edit</a>';
$list[] = '<a id="delete-dashboard" href="' . site_url('dashboard/delete-website/' . $row->w_id) . '">Delete</a>';
$data[] = $list;
}
$output = array("draw" => $_POST['draw'], "recordsTotal" => $all_websites->num_rows(), "recordsFiltered" => $count_websites->num_rows(), "data" => $data);
echo json_encode($output);
}
示例5: banner
/**
* banner url 이동 관련 함수입니다
*/
public function banner($ban_id = 0)
{
// 이벤트 라이브러리를 로딩합니다
$eventname = 'event_gotourl_banner';
$this->load->event($eventname);
// 이벤트가 존재하면 실행합니다
Events::trigger('before', $eventname);
$ban_id = (int) $ban_id;
if (empty($ban_id) or $ban_id < 1) {
show_404();
}
$this->load->model(array('Banner_model'));
$banner = $this->Banner_model->get_one($ban_id);
if (!element('ban_id', $banner)) {
show_404();
}
if (!element('ban_activated', $banner)) {
show_404();
}
if (!element('ban_url', $banner)) {
show_404();
}
if (!$this->session->userdata('banner_click_' . $ban_id)) {
$this->session->set_userdata('banner_click_' . $ban_id, '1');
$this->Banner_model->update_plus($ban_id, 'ban_hit', 1);
}
// 이벤트가 존재하면 실행합니다
Events::trigger('after', $eventname);
redirect(prep_url(element('ban_url', $banner)));
}
示例6: get_url
function get_url()
{
if (!empty($this->link)) {
return prep_url($this->link);
}
return site_url('news/' . $this->slug);
}
示例7: smarty_function_url
/**
* Smarty {url} function plugin
*
* Type: function
* Name: url
* @author: Trimo
* @mail: trimo.1992[at]gmail[dot]com
*/
function smarty_function_url($params, &$smarty)
{
if (!function_exists('current_url')) {
if (!function_exists('get_instance')) {
$smarty->trigger_error("url: Cannot load CodeIgniter");
return;
}
$CI =& get_instance();
$CI->load->helper('url');
}
if ($params['type'] == 'string') {
return uri_string();
} elseif ($params['type'] == 'anchor' && isset($params['url'])) {
return anchor($params['url'], $params['text'], $params['attr']);
} elseif ($params['type'] == 'safemail' && isset($params['url'])) {
return safe_mailto($params['url'], $params['text'], $params['attr']);
} elseif ($params['type'] == 'mail' && isset($params['url'])) {
return mailto($params['url'], $params['text'], $params['attr']);
} elseif ($params['type'] == 'autolink' && isset($params['url'])) {
return auto_link($params['url'], isset($params['mode']) ? $params['mode'] : 'both', $params['new'] == 1 ? TRUE : FALSE);
} elseif ($params['type'] == 'urltitle' && isset($params['title'])) {
return url_title($params['title'], isset($params['mode']) ? $params['mode'] : 'dash', $params['lower'] == 1 ? TRUE : FALSE);
} elseif ($params['type'] == 'prep' && isset($params['url'])) {
return prep_url($params['url']);
} elseif ($params['type'] == 'current') {
return current_url();
} elseif ($params['type'] == 'site') {
return site_url($params['url']);
} else {
return base_url();
}
}
示例8: post
public function post($year = NULL, $month = NULL, $day = NULL, $url_title = NULL)
{
$this->load->module_model('blog', 'comments_model', 'comments');
$this->load->module_model('blog', 'users_model', 'users');
if ($data['post'] = $this->blog->get_post_by_url($year, $month, $day, $url_title)) {
$data['post']['url'] = post_url($data['post']['url_title'], $data['post']['date_posted']);
$data['post']['display_name'] = $this->users->get_user_display_name($data['post']['author']);
if ($data['post']['allow_comments'] == 1) {
$this->comment($data['post']['id'], $data['post']['url']);
}
$data['comments'] = $this->comments->get_comments($data['post']['id']);
if ($data['comments'] != "") {
foreach ($data['comments'] as $key => $comment) {
$data['comments'][$key]['content'] = parse_bbcode(nl2br(parse_smileys($comment['content'], base_url() . 'application/views/admin/static/javascript/tiny_mce/plugins/emotions/img/')));
if ($comment['user_id'] != "") {
$website = $this->users->get_user_website($comment['user_id']);
$display_name = $this->users->get_user_display_name($comment['user_id']);
$data['comments'][$key]['author'] = '<a href="' . prep_url($website) . '" target="_blank">' . $display_name . '</a>';
} else {
if ($comment['author_website'] != "") {
$data['comments'][$key]['author'] = '<a href="' . prep_url($comment['author_website']) . '" target="_blank">' . $comment['author'] . '</a>';
}
}
}
}
$this->_template['page'] = 'blog/single_post';
} else {
$this->_template['page'] = 'errors/404';
}
$this->system_library->load($this->_template['page'], $data);
}
示例9: link_to_long
function link_to_long($str, $message = 'Click here', $len = 15)
{
$class = '';
if (strlen($str) > $len) {
$class = ' class="link_to_long" title="' . $str . '"';
}
return "<a href='" . prep_url($str) . "' target='_blank'" . $class . ">" . (strlen($str) > $len ? $message : $str) . "</a>";
}
示例10: __construct
/**
* Constructor
*/
public function __construct()
{
$this->EE =& get_instance();
$this->EE->load->helper('url');
$url = $this->EE->TMPL->fetch_param('url');
$type = $this->EE->TMPL->fetch_param('type') ? intval($this->EE->TMPL->fetch_param('type')) : 301;
redirect(prep_url($url), 'location', $type);
}
示例11: update
function update()
{
$data['url'] = prep_url($this->input->post('url'));
$data['title'] = 'Add Bookmark';
$data['main_view'] = 'bookmark/add_bookmark';
$data['user'] = $_SESSION['logged_in_user'];
$this->load->vars($data);
$this->load->view('template');
}
示例12: redirect_external
function redirect_external($uri = '', $method = 'location', $http_response_code = 302)
{
switch ($method) {
case 'refresh':
header("Refresh:0;url=" . prep_url($uri));
break;
default:
header("Location: " . prep_url($uri), TRUE, $http_response_code);
break;
}
exit;
}
开发者ID:khaledaSabina,项目名称:php-codeigniter-tips-tricks,代码行数:12,代码来源:codeigniter_function_about_url.php
示例13: lookup
/**
* Perform lookup
*
* @access public
* @return mixed
**/
public function lookup($domain)
{
$domain = prep_url($domain);
$domain = parse_url($domain);
$domain = preg_replace('/^www\\./', '', $domain['host']);
// --------------------------------------------------------------------------
$_ch = curl_init();
curl_setopt($_ch, CURLOPT_URL, 'http://www.freedomainwhois.com/src/webservice.php');
curl_setopt($_ch, CURLOPT_POST, TRUE);
curl_setopt($_ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($_ch, CURLOPT_POSTFIELDS, array('action' => 'whois', 'f_domainname' => $domain));
$result = curl_exec($_ch);
curl_close($_ch);
return json_decode($result);
}
示例14: go
public function go($banner_id = null)
{
$banner_id = (is_numeric($banner_id) and $banner_id > 0) ? intval($banner_id) : 0;
if (!$banner_id or !($banner_obj = $this->Banners_model->get($banner_id))) {
show_404();
}
// add info to statistic
$this->load->model('banners/models/Banners_stat_model');
$this->Banners_stat_model->add_hit($banner_id);
$stat = $this->Banners_model->get_banner_overall_stat($banner_id);
$this->Banners_model->save_banner_clicks($banner_id, $stat["stat_clicks"] + 1);
$url = isset($banner_obj['link']) ? prep_url($banner_obj['link']) : '';
if ($url) {
redirect($url);
}
}
示例15: get_valtype
function get_valtype($val, $type, $mode = 'grid')
{
$ci =& get_instance();
switch ($type) {
case "yes_no":
return !$val ? img('public/img/icons/decline_inline.gif') : img('public/img/icons/accept_inline.gif');
break;
case "email":
return $val ? safe_mailto($val) : '';
break;
case "url":
return $val ? anchor(prep_url($val), lang('GO_LINK'), 'target="_blank"') : '';
break;
default:
return $val;
}
}