本文整理汇总了PHP中addhttp函数的典型用法代码示例。如果您正苦于以下问题:PHP addhttp函数的具体用法?PHP addhttp怎么用?PHP addhttp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addhttp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
echo "<BR><B>GOOGLEPLUS CRON ENDED @</B> : " . date('Y-m-d H:i:s A') . "<br><br>";
}
if (WORDPRESSCRONSTART == '1') {
echo "<BR><B>WORDPRESS CRON START @</B> : " . date('Y-m-d H:i:s A') . "<br><br>";
$sql = "SELECT * FROM wp_blog_url";
$result = mysql_query($sql) or die(mysql_error());
$date = date("Y-m-d H:i:s", time());
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$blogurl = $row['blogurl'];
$sql1 = "SELECT * FROM wp_blog_feed where wp_blog_url_id = '" . $id . "'";
$result1 = mysql_query($sql1) or die(mysql_error());
$count1 = mysql_num_rows($result1);
$Rss = new Rss();
// create object
$blogurl1 = addhttp($blogurl);
$siteArr = parse_url($blogurl1);
$host = $siteArr['host'];
$siteexploArr = explode('.', $host);
if ($count1 >= "10") {
//update code
if (!empty($host)) {
$sFeedURL = $host . "/feed";
$sValidator = 'http://feedvalidator.org/check.cgi?url=';
if ($sValidationResponse = @file_get_contents($sValidator . urlencode($sFeedURL))) {
if (stristr($sValidationResponse, 'This is a valid RSS feed') !== false) {
$feed = $Rss->getFeed('http://' . $host . '/feed/', Rss::TXT);
if (empty($feed)) {
$feed = $Rss->getFeed('http://feeds2.feedburner.com/' . $siteexploArr['1'] . '/', Rss::TXT);
if (!empty($feed)) {
$sql44 = "delete from wp_blog_feed where wp_blog_url_id='" . $id . "'";
示例2: mysql_query
</div>
-->
<?php
if($pagina != home) { ?>
<div class="widget">
<hr class="vertical-space4">
<h4 class="subtitle">Destacados</h4>
<div class="postslider">
<div class="flexslider">
<ul class="slides">
<?php
$cSql = "SELECT * FROM SliderHome WHERE SliVisible='Si' ORDER BY SliOrden ASC LIMIT 0,3";
$aResultado = mysql_query($cSql) or die($error_consulta);
while($aRegistro = mysql_fetch_array($aResultado)){
$enlace = addhttp($aRegistro["SliLink"]);
?>
<li>
<a href="<?php echo $enlace ?>" target="_blank">
<img src="./Upload/Directos/SliderHome/<?php echo $aRegistro["SliImagen"] ?>" alt="<?php echo $aRegistro["SliAlt"] ?>" class="thumbnail" />
<p><?php echo $aRegistro["SliTitulo"] ?></p>
</a>
</li>
<? } ?>
</ul>
</div>
<div class="clear"></div>
</div>
</div> <!-- end widget -->
示例3: ON
<?php
$field = " w.id,w.link,c.name ";
$table = " user_website as w LEFT JOIN partner_category as c ON(w.cat_id=c.id) ";
$condition = " ";
$wb_details = getDetail($field, $table, $condition);
if (count($wb_details > 0)) {
foreach ($wb_details as $wb_detail) {
?>
<div>
<div class="col-xs-4" ><?php
echo $wb_detail['name'];
?>
</div>
<div class="col-xs-7" ><a href="<?php
echo addhttp($wb_detail['link']);
?>
" target="_blank"><?php
echo $wb_detail['link'];
?>
</a></div>
<div class="col-xs-1" ><a href="jaavscript:void(0);" title="Click to delete" class="delete_website" alt="<?php
echo $wb_detail['id'];
?>
">X</a></div>
</div>
<?php
}
}
?>
<form id="partner_html">
示例4: get_the_ID
echo 'my_html[' . get_the_ID() . '] += \'<h1 class="name">' . esc_html($my_fields["name"]) . '</h1> \';' . "\n";
if ($my_fields["contact"]) {
echo 'my_html[' . get_the_ID() . '] += \'<b>Contact: </b><span class="contact">' . esc_html($my_fields["contact"]) . '</span> \';' . "\n";
}
echo 'my_html[' . get_the_ID() . '] += \'<br><span class="street">' . esc_html($my_fields["street"]) . '</span>, <span class="county">' . esc_html($my_fields["county"]) . '</span>, <span class="stateprovince">' . esc_html($my_fields["stateprovince"]) . '</span>, <span class="country">' . esc_html($my_fields["country"]) . '</span> <span class="postalcode">' . esc_html($my_fields["postalcode"]) . '</span> \';' . "\n";
if ($my_fields["areas"]) {
echo 'my_html[' . get_the_ID() . '] += \'<br><b>Practice areas: </b><span class="areas">' . esc_html($my_fields["areas"]) . '</span> \';' . "\n";
}
if ($my_fields["phone"]) {
echo 'my_html[' . get_the_ID() . '] += \'<br><b>Phone: </b><span class="phone">' . esc_html($my_fields["phone"]) . '</span> \';' . "\n";
}
if ($my_fields["fax"]) {
echo 'my_html[' . get_the_ID() . '] += \'<br><b>Fax: </b><span class="fax">' . esc_html($my_fields["fax"]) . '</span> \';' . "\n";
}
if ($my_fields["url"]) {
echo 'my_html[' . get_the_ID() . '] += \'<br><b>Web: </b><a target="_blank" href="' . addhttp(esc_html($my_fields["url"])) . '" target="_blank"><span class="url">' . esc_html($my_fields["url"]) . '</span></a> \';' . "\n";
}
if ($my_fields["email"]) {
echo 'my_html[' . get_the_ID() . '] += \'<br><b>Email: </b><a href="mailto:' . esc_html($my_fields["email"]) . '"><span class="email">' . esc_html($my_fields["email"]) . '</span></a> \';' . "\n";
}
?>
</script>
<!-- ////////////////////////////////////////////////////////// -->
<?php
}
?>
<?php
}
示例5: webinfo
public function webinfo()
{
set_time_limit(0);
$this->load->library('My_Webmaster');
$return_data = array('status' => 0);
if ($this->form_validation->run('website_info') == TRUE) {
$url = strtolower(rtrim($this->secure_data($this->input->post('domain')), '/'));
$langArr = $this->config->item('langArr');
$lang = $this->secure_data($this->input->post('lang'));
if (!array_key_exists($lang, $langArr)) {
$lang = 'en';
}
$domain = addhttp($url);
/*$parse = parse_url($domain);
$host = preg_replace('#^www\.(.+\.)#i', '$1', $parse['host']);
$ip = gethostbyname($host);
$domain_access = $parse['scheme'].'://'.$host;
echo $domain_access; exit;*/
$ip = gethostbyname($url);
$webmaster = new My_Webmaster();
$return_data = $webmaster->insert($domain, $ip, $lang);
$return_data['url'] = base_url() . 'web/index/' . md5($return_data['wid']);
} else {
$return_data['message'] = validation_errors();
}
echo json_encode($return_data);
exit;
}
示例6: create
public function create()
{
$data = parent::create();
// add http to links
$this->url = addhttp($this->url);
// detect video types and fill in swffile
if ($this->type == 'video') {
$this->swffile = $this->getFlashImage($this->url);
}
return $data;
}
示例7: webinfo
public function webinfo()
{
set_time_limit(0);
$this->load->library('My_Webmaster');
$return_data = array('status' => 0);
$validation_obj = 'website_lead_info';
$leadprocess = $this->secure_data($this->input->post('leadprocess'));
if ($leadprocess == 1) {
$validation_obj = 'website_lead_process';
}
if ($this->form_validation->run($validation_obj) == TRUE) {
$mid = $this->secure_data($this->input->post('uid'));
$user_data = getDbData('users', array('md5(id)' => $mid));
if ($user_data) {
$url = strtolower(rtrim($this->secure_data($this->input->post('domain')), '/'));
$langArr = $this->config->item('langArr');
$lang = $this->secure_data($this->input->post('lang'));
if (!array_key_exists($lang, $langArr)) {
$lang = 'en';
}
$domain = addhttp($url);
$ip = gethostbyname($url);
$name = $this->secure_data($this->input->post('name'));
$email = $this->secure_data($this->input->post('email'));
$webmaster = new My_Webmaster();
$webmaster->leadActive($name, $email);
$inserted_data = $webmaster->insert($domain, $ip, $lang, $user_data['id']);
//$return_data['url'] = base_url().'web/index/'.md5($return_data['wid']);
// Insert in lead table
if ($leadprocess != 1) {
$speed = '';
$pagespeed_data = json_decode($inserted_data['inserted_data']['ca_pagespeed']['data'], 1);
if (array_key_exists('mobile', $pagespeed_data)) {
$speed .= $pagespeed_data['mobile']['ruleGroups']['SPEED']['score'];
$speed .= '|' . $pagespeed_data['mobile']['ruleGroups']['USABILITY']['score'];
}
if (array_key_exists('desktop', $pagespeed_data)) {
$speed .= $speed !== '' ? '|' : '';
$speed .= $pagespeed_data['desktop']['ruleGroups']['SPEED']['score'];
}
$db_lead = array('agent_id' => $user_data['id'], 'web_id' => $inserted_data['wid'], 'name' => $name, 'email' => $email, 'domain' => $inserted_data['inserted_data']['ca_website']['domain'], 'language' => $lang, 'seo_score' => round($inserted_data['inserted_data']['ca_website']['score']), 'speed' => $speed, 'date' => date('Y-m-d H:i:s', time()));
$this->common_model->insert($db_lead, "leads");
}
$this->website = $inserted_data['inserted_data']['ca_website'];
$this->domain = $this->website['domain'];
$this->wid = $inserted_data['wid'];
$this->thumbnail = WebsiteThumbnail::getUrl(array('{{Url}}' => $this->domain, '{{Size}}' => 'l'));
$this->cloud = $inserted_data['inserted_data']['ca_cloud'];
$this->content = $inserted_data['inserted_data']['ca_content'];
$this->document = $inserted_data['inserted_data']['ca_document'];
$this->isseter = $inserted_data['inserted_data']['ca_issetobject'];
$this->links = $inserted_data['inserted_data']['ca_links'];
$this->meta = $inserted_data['inserted_data']['ca_metatags'];
$this->w3c = $inserted_data['inserted_data']['ca_w3c'];
$this->misc = $inserted_data['inserted_data']['ca_misc'];
$this->pageSpeed = $inserted_data['inserted_data']['ca_pagespeed'];
$this->grader = $inserted_data['inserted_data']['sg_info'];
$this->content['headings'] = @(array) json_decode($this->content['headings'], true);
$this->links['links'] = @(array) json_decode($this->links['links'], true);
$this->cloud['words'] = Utils::shuffle_assoc(@(array) json_decode($this->cloud['words'], true));
$this->cloud['matrix'] = @(array) json_decode($this->cloud['matrix'], true);
$this->meta['ogproperties'] = @(array) json_decode($this->meta['ogproperties'], true);
$this->content['deprecated'] = @(array) json_decode($this->content['deprecated'], true);
if ($this->misc) {
$this->misc['sitemap'] = @(array) json_decode($this->misc['sitemap'], true);
$this->misc['analytics'] = @(array) json_decode($this->misc['analytics'], true);
}
if ($this->pageSpeed) {
$pagespeed = $this->pageSpeed['data'];
$this->pageSpeed = @json_decode($pagespeed, true);
}
$this->strtime = strtotime($this->website['modified']);
$this->generated['A'] = date("A", $this->strtime);
$this->generated['Y'] = date("Y", $this->strtime);
$this->generated['M'] = date("M", $this->strtime);
$this->generated['d'] = date("d", $this->strtime);
$this->generated['H'] = date("H", $this->strtime);
$this->generated['i'] = date("i", $this->strtime);
$this->diff = time() - $this->strtime;
$pdf_path = FCPATH . '/assets/uploads/pdf/';
$pdf_name = $this->cronoutputpdf($pdf_path, 'web/pdf', array('F'));
$this->common_model->update_table(array('saved' => 1, 'pdf' => $pdf_name), array('id' => $this->wid), 'ca_website');
// Send email with attachment
$attachment = $pdf_path . $pdf_name;
$this->email_send('lead-user', array('to' => $email, 'subject' => 'Audit for ' . $this->domain, 'name' => $name, 'domain' => $this->domain, 'attachments' => array($attachment)));
// TODO: Show summary - Done
$html = $this->load->view('leads/summary', array('website' => $this->website, "pageSpeed" => $this->pageSpeed, "grader" => $this->grader, "wid" => $this->wid), TRUE);
$return_data['html'] = $html;
$return_data['thumbnail'] = $this->thumbnail;
$return_data['id'] = $this->wid;
$return_data['status'] = 1;
$return_data['message'] = "we will send the results to you on email";
} else {
$return_data['message'] = 'This agent is not exists.';
}
} else {
$return_data['message'] = validation_errors();
}
echo json_encode($return_data);
exit;
//.........这里部分代码省略.........
示例8: b_promo_validate
/**
* Проверка заполнености полей
* @param banner_promo &$bannerData - объект класса с информацией о баннере
* @param $id - идентификатор редактируемой записи
* */
function b_promo_validate(&$bannerData, $recId = 0)
{
$error = 0;
$errObject = new StdClass();
$text = __paramInit("string", null, "text");
$type = __paramInit("string", null, "ban_type");
$code_txt = __paramInit("string", null, "code_txt");
$bannerData->files = $file = $bannerData->saveImg($err);
if ($type == 'image' && trim($text) == "" && trim($file->name) == "") {
$errObject->entityError = "Нужно ввести текст ссылки или загрузить изображение.";
if ($err) {
$errObject->entityError .= "<br/>{$err}";
}
$error = 1;
}
if ($type == 'code' && trim($code_txt) == "") {
$errObject->entityError = "Нужно ввести текст кода.";
if ($err) {
$errObject->entityError .= "<br/>{$err}";
}
$error = 1;
}
if ($err) {
$errObject->entityError = "{$err}";
}
$from = __paramInit("string", null, "from_date");
$to = __paramInit("string", null, "to_date");
if ($from == '') {
$from = date('Y-m-d');
}
if ($to == '') {
$to = date('Y-m-d');
}
$a = explode("-", $from);
$a = array_reverse($a);
$bannerData->from = $from = join("-", $a);
$a = explode("-", $to);
$a = array_reverse($a);
$bannerData->to = $to = join("-", $a);
$pattern = "#[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}#";
if (!preg_match($pattern, $from, $m) || !preg_match($pattern, $to, $m)) {
$errObject->dateError = "Ошибка при вводе даты";
$error = 1;
}
$data = explode("-", $from);
$fromT = mktime(0, 0, 0, $data[1], $data[2], $data[0]);
$data = explode("-", $to);
$toT = mktime(0, 0, 0, $data[1], $data[2], $data[0]);
if ($toT <= $fromT) {
$errObject->dateError = "Дата начала не должна быть позже даты окончания";
$error = 1;
}
$adv = __paramInit("bool", null, "advertising");
$page_target = __paramInit("string", null, 'page_target');
if ($adv && !$errObject->dateError) {
$query = "SELECT count(id) FROM ban_promo_types WHERE \n ('{$from}' < to_date AND '{$to}' > from_date) \n AND advertising = 't' AND deleted = 'f'\n AND (page_target = ? OR page_target = '0|0')\n ";
if ((int) $recId > 0) {
$query .= " AND id != {$recId}";
}
global $DB;
$n = $DB->val($query, $page_target);
if ($n) {
$errObject->dateError = "В указанный период времени уже размещена рекламная ссылка";
$error = 1;
}
}
$link = __paramInit("string", null, "banner_link");
if (!trim($link)) {
$error = 1;
$errObject->linkError = "Поле обязательно для заполнения";
}
if ($errObject->linkError == '') {
$link = addhttp($link);
$_POST['banner_link'] = $link;
//if ((strpos($link, HTTP_PREFIX) !== 0) && (strpos($link, "/")) !== 0) $link = HTTP_PREFIX."$link";
}
$bannerData->link = $link;
$name = __paramInit("string", null, "name");
if (!trim($name)) {
$error = 1;
$errObject->nameError = "Поле обязательно для заполнения";
}
if (!$error) {
$errObject = $error;
}
return $errObject;
}
示例9: addhttp
<ul class="cleanList flatList flex flex-start">
<li><h5 class="on-open-profile"><a href="<?php
echo $company->url();
?>
"><span class="fa fa-users"></span> Profil</a></h5></li>
<li><h5><a href="mailto:<?php
echo $company->mail();
?>
">E-Mail <span class="fa fa-envelope-o"></span></a></h5></li>
<?php
if (!function_exists("addhttp")) {
function addhttp($url)
{
if (!preg_match("~^(?:f|ht)tps?://~i", $url)) {
$url = "http://" . $url;
}
return $url;
}
}
?>
<li><h5><a href="<?php
echo addhttp($company->website());
?>
">Webseite <span class="fa fa-external-link"></span></a></h5></li>
<li ng-click="toggleBookmarkState()"><h5 class=""><a href="#" onclick="event.preventDefault()"><span class="bookmark fa {{visibleBookmarkClass}}"></span> Merken</a></h5></li>
</ul>
示例10: foreach
?>
comments</div>
</div>
<?php
if ($totaldcom > 0) {
foreach ($composts as $compost) {
$comcontent = nl2br($compost->comment);
?>
<div class="bypostauthor">
<?php
if ($compost->url != '') {
?>
<a href="<?php
echo addhttp($compost->url);
?>
" target="_blank" class="fn"><span><?php
echo $compost->name;
?>
</span></a>
<?php
} else {
?>
<a href="#" class="fn"><span><?php
echo $compost->name;
?>
</span></a>
<?php
}
?>
示例11: video_player
function video_player($video_local, $width = '', $height = '')
{
$url = addhttp($video_local->url);
$url_original = $url;
$url = parse_url($url);
switch ($url['host']) {
case 'www.youtube.com':
parse_str($url['query'], $data);
$video = $data['v'];
$r = "<iframe width='" . ($width ? $width : 560) . "' height='" . ($height ? $height : 360) . "' src='//www.youtube.com/embed/{$video}?autoplay=1&autohide=1' frameborder='0' allowfullscreen ></iframe>";
return $r;
break;
case 'youtu.be':
$video = $url['path'];
$r = "<iframe id='ytplayer' type='text/html' width='" . ($width ? $width : 560) . "' height='" . ($height ? $height : 360) . "' src='//www.youtube.com/embed/{$video}?autoplay=1&rel=0&autohide=1' frameborder='0' allowfullscreen ></iframe>";
return $r;
break;
case 'www.dailymotion.com':
$path = explode('/', $url['path']);
$video = $path[2];
$r = "<iframe src='http://www.dailymotion.com/embed/video/{$video}?logo=0' width='" . ($width ? $width : 560) . "' height='" . ($height ? $height : 360) . "' frameborder='0'></iframe>";
return $r;
break;
case 'vimeo.com':
$path = explode('/', $url['path']);
$video = end($path);
$r = "<iframe src='http://player.vimeo.com/video/{$video}' width=''" . ($width ? $width : 560) . "' height='" . ($height ? $height : 360) . "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>";
return $r;
break;
case 'www.mmpro.de':
$CI =& get_instance();
$CI->load->library('simple_html_dom');
$html = file_get_html($url_original);
foreach ($html->find('link[rel=canonical]') as $element) {
$canonical_url = $element->href;
}
$canonical_url = addhttp($canonical_url);
$canonical_url = parse_url($canonical_url);
parse_str($canonical_url['query'], $data);
$video_id = $data['videoId'];
$json_url = "http://www.mmpro.de/cache/videolist.json";
$json = file_get_contents($json_url, 0, null, null);
$json_output = json_decode($json, true);
foreach ($json_output as $object) {
foreach ($object as $video) {
$video_to_display = $video;
foreach ($video["video"] as $video_data) {
$video_uri = $video_data['uri'];
if ($video_data['uri'] == $video_id) {
break 3;
}
}
}
}
if (isset($video_to_display['mcf'])) {
$playlist = urlencode('[[JSON]][{"file":"media/archive/' . $video_uri . '_h264midlow.mp4","image":"' . site_url('uploads/header/' . $video_local->thumbnail) . '?' . now() . '","streamer":"rtmp://streaming.mcfootage.com/ondemand/2800026086","provider":"rtmp"}]');
} else {
$json_url = "http://www.admiralcloud.com/player/json/" . $video_uri;
$json = file_get_contents($json_url, 0, null, null);
$json_output = json_decode($json, false);
//LECTURE
foreach ($json_output->movies[0]->mp4levels as $level) {
$levels[] = array("file" => $level->src, "bitrate" => $level->bitrate, "width" => $level->width);
}
foreach ($json_output->movies[0]->captions as $caption) {
$captions[] = $caption->lang;
$captions_src[] = $caption->src;
}
if (isset($captions)) {
$captions = implode(",", $captions);
$captions_src = implode(",", $captions_src);
} else {
$captions = "";
$captions_src = "";
}
$new_json = array("caption.labels" => $captions, "captions.files" => $captions_src, "title" => "Kapitel", "description" => "Beschreibung", "levels" => $levels, "image" => site_url('uploads/header/' . $video_local->thumbnail) . '?' . now(), "provider" => "rtmp", "streamer" => "rtmp://s3a2tcgtacgbig.cloudfront.net/cfx/st/");
$playlist = urlencode('[[JSON]][' . json_encode($new_json) . ']');
}
$video_url = urlencode($url_original);
$xml = urlencode('http://www.admiralcloud.com/skins/glow/glow.xml');
$flashVar = $video_url . '&preload=metadata&id=videoplayer&backcolor=#000000&frontcolor=#ffffff&highcolor=#999999&screencolor=#000000&skin=' . $xml . '&playlist=' . $playlist . '&controlbar.position=over';
$r = "<object type='application/x-shockwave-flash' data='http://www.admiralcloud.com/skins/player510.swf' width='100%' height='100%' bgcolor='#000000' tabindex='0'>";
$r .= "<param name='allowfullscreen' value='true'>\n <param name='allowscriptaccess' value='always'>\n <param name='seamlesstabbing' value='true'>\n <param name='wmode' value='opaque'>\n <param name='flashvars' value='netstreambasepath={$flashVar}'></object>";
return $r;
break;
case 'www.tvbvideo.de':
$CI =& get_instance();
$CI->load->library('simple_html_dom');
$html = file_get_html($url_original);
$r = html_entity_decode($html->find('#export_website_code', 0)->innertext());
$r_html = str_get_html($r);
$r = $r_html->find('.containerEpix', 0)->innertext();
return $r;
break;
default:
return '<div class="alert"><button type="button" class="close" data-dismiss="alert">×</button><strong>Warning!</strong> Unknown problem with the video, contact the webmaster.</div>';
break;
}
}
示例12: video_post
function video_post($blogID = 1, $args = array())
{
min_switch_to_blog($blogID);
$id = get_the_ID();
exclude_this_post($blogID, $id);
$defaults = array('beatmersive' => false);
// merge arguments with defaults && set keys as variables
$args = array_merge($defaults, $args);
foreach ($args as $key => $val) {
${$key} = $val;
}
$hyperlink = get_permalink();
if ($beatmersive) {
$hyperlink = addhttp(get_post_meta($id, 'db_beatmersive_hyperlink', true));
}
$external = '';
if ($blogID > 1 || $beatmersive) {
$external = 'external-link';
}
?>
<article class="video-post">
<a href="<?php
echo $hyperlink;
?>
">
<div class="featured-image" data-src="<?php
echo get_thumb_url(700, 700);
?>
">
<div class="play-overlay">
<span class="fa-stack">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-play-circle fa-stack-1x"></i>
</span>
</div>
</div>
</a>
<div class="caption">
<?php
if (!$beatmersive) {
?>
<h6 class="post-meta">
<span class="timestamp"><?php
the_timestamp();
?>
</span> - <span class="author"><?php
the_author_posts_link();
?>
</span>
<?php
if ($blogID > 1) {
?>
via <?php
echo blog_svg($blogID, 0);
}
?>
</h6>
<?php
}
?>
<a href="<?php
echo $hyperlink;
?>
"><h2 class="<?php
echo $external;
?>
"><?php
the_title();
?>
</h2></a>
</div>
</article>
<?php
}
示例13: substr
}
}
// more site
if ($frl->site_1 = change_q(substr(addhttp(trim($_POST['site_1'])), 0, 96), true)) {
if (!url_validate($frl->site_1, true)) {
$error_flag = 1;
$alert[41] = "Поле заполнено некорректно";
}
}
if ($frl->site_2 = change_q(substr(addhttp(trim($_POST['site_2'])), 0, 96), true)) {
if (!url_validate($frl->site_2, true)) {
$error_flag = 1;
$alert[42] = "Поле заполнено некорректно";
}
}
if ($frl->site_3 = change_q(substr(addhttp(trim($_POST['site_3'])), 0, 96), true)) {
if (!url_validate($frl->site_3, true)) {
$error_flag = 1;
$alert[43] = "Поле заполнено некорректно";
}
}
// more site
$frl->icq = substr(strip_tags(trim($_POST['icq'])), 0, 96);
if (strlen($frl->jabber = __paramInit('string', NULL, 'jabber', '')) > 3071) {
$error_flag = 1;
$alert['jabber'] = "Количество знаков превышает допустимое значение";
}
// more jabber
if (strlen($frl->jabber_1 = __paramInit('string', NULL, 'jabber_1', '')) > 3071) {
$error_flag = 1;
$alert['51'] = "Количество знаков превышает допустимое значение";
示例14: ob_start
<?php
ob_start();
$id = intval(trim($_GET['id']));
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/banners.php';
$banners = new banners();
$link = $banners->ClickBanner($id);
header('Location: ' . (is_string($link) && $link != '' ? iconv('CP1251', 'UTF-8', addhttp($link)) : HTTP_PFX . 'free-lance.ru'));
exit;
示例15: completeData
//.........这里部分代码省略.........
$country_value = __paramInit('string', null, 'country', false);
if ($city == 0 && strlen($city_value) != 0) {
$error['city'] = 'Поле заполнено некорректно';
}
if ($country == 0 && strlen($country_value) != 0) {
$error['country'] = 'Поле заполнено некорректно';
}
$user->country = $country;
$user->city = $city;
$company = __paramInit('string', null, 'company') ? substr(__paramInit('string', null, 'company'), 0, 64) : '';
$about_company = __paramInit('string', null, 'about_company');
$user->compname = $company;
if (strlen($about_company) > 500) {
$error['company'] = "Количество знаков в тексте о компании превышает допустимое значение";
} else {
$user->company = $about_company;
}
$logo_id = __paramInit('int', null, 'logo_company');
$logo_name = __paramInit('string', null, 'logo_name');
if ($logo_name) {
$user->logo = $logo_name;
$user->Update(wizard::getUserIDReg(), $res);
}
$info['site'] = $this->initMultiVal('site');
$info['email'] = $this->initMultiVal('email');
$info['phone'] = $this->initMultiVal('phone');
$info['icq'] = $this->initMultiVal('icq');
$info['skype'] = $this->initMultiVal('skype');
$info['jabber'] = $this->initMultiVal('jabber');
$info['lj'] = $this->initMultiVal('lj');
if (!empty($info['site'])) {
foreach ($info['site'] as $i => $value) {
$name = 'site' . ($i != 0 ? "_{$i}" : "");
if (!url_validate(addhttp($value), true) && trimhttp($value) != '') {
$error[$name] = "Поле заполнено некорректно";
} else {
$user->{$name} = addhttp($value);
}
}
}
if (!empty($info['email'])) {
foreach ($info['email'] as $i => $value) {
if ($i == 0) {
$name_save = "second_email";
} else {
$name_save = "email_{$i}";
}
$name = 'email' . ($i != 0 ? "_{$i}" : "");
if (!is_email($value) && $value != '') {
$error[$name] = "Поле заполнено некорректно";
} else {
$user->{$name_save} = $value;
}
}
}
if (!empty($info['phone'])) {
foreach ($info['phone'] as $i => $value) {
$name = 'phone' . ($i != 0 ? "_{$i}" : "");
if (!preg_match("/^[-+0-9)( #]*\$/", $value)) {
$error[$name] = "Поле заполнено некорректно";
} else {
$user->{$name} = $value;
}
}
}
if (!empty($info['icq'])) {