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 . "'";
Exemplo n.º 2
1
                        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 
                }
Exemplo n.º 3
1
         </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 -->
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
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">&times;</button><strong>Warning!</strong> Unknown problem with the video, contact the webmaster.</div>';
            break;
    }
}
Exemplo n.º 7
0
        ?>
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 
                }
                ?>
Exemplo n.º 8
0
     }
 }
 // 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'] = "Количество знаков превышает допустимое значение";
Exemplo n.º 9
0
 if (preg_match('/@/', $name)) {
     if ($email == '') {
         $email = $name;
     }
     $name = NULL;
 }
 /*
 	if (preg_match('/@/',$how_to_apply))
 	{
 		if ($email == '')
 			$email = $how_to_apply;
 		$how_to_apply = NULL;
 	}	
 */
 if (isset($homepage)) {
     $homepage = addhttp($homepage);
 }
 ## CLEANING ADDRESS ##
 if ($address != '') {
     $address_array = get_address($address);
 }
 if ($address_array['country_id'] == '') {
     $address_array['country_id'] = $country_id;
 }
 ## INSERTING EMPLOYER AND AVOIDING SOME DUPLICATES ##
 // Conditions for avoiding duplicates must be tested for more jobs to avoid wrong relations. Maybe we should take them off for now ?
 if ($name != '' || $address != '' && $address != ',  ,') {
     $query = "SELECT id FROM employer WHERE name = '{$name}' AND address = '{$address}' AND country_id = '{$address_array['country_id']}'";
     $employer_id = select_id($query);
     if ($employer_id == '') {
         if ($name != '' && $address_array['formatted_address'] != '') {
Exemplo n.º 10
0
function ajax_update_listing()
{
    global $wpdb;
    $location = filter_var($_REQUEST["location"], FILTER_SANITIZE_STRING);
    $section = filter_var($_REQUEST["section"], FILTER_SANITIZE_STRING);
    $categories = $_REQUEST["categories"];
    $keywords = filter_var($_REQUEST["keywords"], FILTER_SANITIZE_STRING);
    $company_name = filter_var($_REQUEST["company_name"], FILTER_SANITIZE_STRING);
    $description = filter_var($_REQUEST["description"], FILTER_SANITIZE_STRING);
    $phone = filter_var($_REQUEST["phone"], FILTER_SANITIZE_STRING);
    $website = addhttp(filter_var($_REQUEST["website"], FILTER_SANITIZE_STRING));
    $email = filter_var($_REQUEST["email"], FILTER_SANITIZE_EMAIL);
    $features = $_REQUEST["features"];
    $logo = $_REQUEST["logo"];
    $banner = $_REQUEST["banner"];
    $gallery = $_REQUEST["gallery"];
    $listing_id = $_REQUEST["id"];
    //update listing
    $sql = "UPDATE " . $wpdb->prefix . "kallababy_listing SET location_id='" . $location . "', section_id='" . $section . "', keywords='" . $keywords . "', company_name='" . $company_name . "', company_logo='" . $logo . "', company_banner='" . $banner . "', description='" . $description . "', phone='" . $phone . "', website='" . $website . "', email='" . $email . "' WHERE id='" . $listing_id . "'";
    $wpdb->query($sql);
    //delete previously set categories from cross table
    $sql = "DELETE FROM " . $wpdb->prefix . "kallababy_cross_categories where listing_id='" . $listing_id . "'";
    $wpdb->query($sql);
    //associate all categories with the new created listing
    for ($i = 0; $i < count($categories); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_categories VALUES('" . $listing_id . "', '" . $categories[$i] . "')";
        $wpdb->query($sql);
    }
    //delete from features cross table
    $sql = "DELETE FROM " . $wpdb->prefix . "kallababy_cross_features where listing_id='" . $listing_id . "'";
    $wpdb->query($sql);
    //associate all features with the new created listing
    for ($i = 0; $i < count($features); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_features VALUES('" . $listing_id . "', '" . $features[$i] . "')";
        $wpdb->query($sql);
    }
    //GALLERY
    //insert new images
    for ($i = 0; $i < count($gallery); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_gallery VALUES( NULL, '" . $gallery[$i] . "', NULL )";
        $wpdb->query($sql);
        $gallery_id = $wpdb->insert_id;
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_gallery VALUES('" . $listing_id . "', '" . $gallery_id . "')";
        $wpdb->query($sql);
    }
    //get email of the list owner
    $sql = "SELECT * FROM " . $wpdb->prefix . "kallababy_listing WHERE id='" . $listing_id . "'";
    $row = $wpdb->get_row($sql, ARRAY_A);
    $ownerEmail = $row["user_id"];
    $res = array('message' => "OK", 'updatedByAdmin' => isAdminLogged(), 'ownerId' => $ownerEmail);
    echo json_encode($res);
    die;
}
Exemplo n.º 11
0
     $prev_type = (int) trim($_POST['v_prev_type']);
     $cost_type = (int) trim($_POST['v_pcosttype']);
     $is_video = 't';
     $video_link = stripslashes(trim($_POST['v_video_link']));
     $make_position = $_POST['v_make_position'];
     $make_position_num = trim($_POST['v_make_position_num']);
 } else {
     // Добавление работы
     // Удаляем повторные пробелы.
     $name = __paramInit('html', null, 'pname', '', 120, true);
     if (!$name) {
         $name = '';
     }
     $img = new CFile($_FILES['img']);
     $sm_img = new CFile($_FILES['sm_img']);
     $link = addhttp(trim(stripslashes(__paramInit('string', NULL, 'link', null, 150))));
     if (!$link) {
         $link = '';
     }
     //            $link = stripslashes(trim($_POST['link']));
     //echo $link;
     // Разбиваем длинные слова.
     //$descr = tidy_repair_string($_POST['descr'], array("show-body-only" => true), 'raw'); // Приводим теги впорядок
     //$descr = substr(change_q_new(trim(stripslashes($_POST['descr']))),0,1500);
     $descr = __paramInit('html_save_ul_li_b_p_i', null, 'descr', '', 1500, true);
     if (!$descr) {
         $descr = '';
     }
     $prof = (int) trim($_POST['prof']);
     $new_prof = (int) trim($_POST['new_prof']);
     $prj_id = (int) trim($_POST['prjid']);
Exemplo n.º 12
0
 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;
 }
Exemplo n.º 13
0
function get_ad($ad_type = '')
{
    if ($ad_type == '') {
        return;
    }
    global $exclude_posts;
    $args = array('posts_per_page' => 1, 'post_type' => 'ad_display', 'tax_query' => array(array('taxonomy' => 'ad_type', 'field' => 'slug', 'terms' => $ad_type)), 'post_status' => 'publish');
    $ad_query = new WP_Query($args);
    while ($ad_query->have_posts()) {
        $ad_query->the_post();
        $id = get_the_ID();
        $ad_hyperlink = get_post_meta($id, 'db_ad_hyperlink', true);
        $ad_hyperlink = addhttp($ad_hyperlink);
        if ($ad_type != 'skin') {
            if ($ad_type == 'sidebar' || $ad_type == 'sidebar-top') {
                echo '<div class="widget">';
            }
            echo '<div class="custom-ad ' . $ad_type . '">';
            echo '<a href="' . $ad_hyperlink . '" target="_blank">';
            if (has_post_thumbnail()) {
                the_post_thumbnail();
            }
            if ($ad_type == 'post-bottom' || $ad_type == 'post-top' || $ad_type == 'post-infeed') {
                echo '<div class="category-tag cat-background">Sponsored</div>';
            }
            echo '</a>';
            echo '</div>';
            if ($ad_type == 'sidebar' || $ad_type == 'sidebar-top') {
                echo '</div>';
            }
        }
        if ($ad_type == 'skin') {
            $thumb_id = get_post_thumbnail_id();
            $thumb_url = wp_get_attachment_image_src($thumb_id, array(1400, 1400), true);
            $thumb_url = $thumb_url[0];
            // responsive image
            if (class_exists('Dynamic_Featured_Image')) {
                global $dynamic_featured_image;
                $featured_images = $dynamic_featured_image->get_featured_images($id);
            }
            if ($featured_images[0]) {
                echo '<a href="' . $ad_hyperlink . '" target="_blank" class="skin-ads-link low-res" style="background-image:url(' . $featured_images[0]['full'] . ');"></a>';
                // normal image
                echo '<a href="' . $ad_hyperlink . '" target="_blank" class="skin-ads-link high-res" style="background-image:url(' . $thumb_url . ');"></a>';
            } else {
                // if there is no econd image, remove the high res class so it stays on LR.
                echo '<a href="' . $ad_hyperlink . '" target="_blank" class="skin-ads-link" style="background-image:url(' . $thumb_url . ');"></a>';
            }
        }
    }
}
Exemplo n.º 14
0
						<div class="week_event_info">
							<?php 
            $e_u = $sd_event->getEventUrl();
            ?>
							<?php 
            if (empty($e_u)) {
                ?>
 
							<?php 
                echo $sd_event->getVenue() . " / " . date('H:i', strtotime($sd_event->getStartTime())) . "-" . date('H:i', strtotime($sd_event->getEndTime())) . " / " . $sd_event->getPrice() . "€";
                ?>
							<?php 
            } else {
                ?>
							<?php 
                echo $sd_event->getVenue() . " / " . date('H:i', strtotime($sd_event->getStartTime())) . "-" . date('H:i', strtotime($sd_event->getEndTime())) . " / " . $sd_event->getPrice() . "€ / " . '<a target="_blank" href="' . addhttp($e_u) . '"><i class="icon-globe icon-white"></i></a>';
                ?>
							<?php 
            }
            ?>
						</div>
						<div class="week_event_description">
							<?php 
            echo $sd_event->getDescription();
            ?>
						</div>
						</div>	
						<div class="separator"></div>
					<?php 
        }
        ?>
Exemplo n.º 15
0
                break;
            case 'sort':
                if (isset($_GET['id']) && $_GET['id']) {
                    $entry = sort_bookmark($_GET['id'], $_GET['sort'], isset($_GET['recursive']) ? $_GET['recursive'] : 0, $bookmark_json);
                    $anchor = $_GET['id'] == '_0' ? '' : $_GET['id'];
                }
                break;
            case 'export':
                header('Content-Type: text/plain');
                readfile($bookmark_json);
                exit;
        }
        header('Location: index.php' . (isset($anchor) && $anchor ? '#entry-' . $anchor : ''));
        exit;
    } elseif (isset($_GET['u'])) {
        $url = addhttp(urldecode(substr($_SERVER['QUERY_STRING'], 2)));
        $entry = add_bookmark($url, '_0', 'url', $sync_json, null, 1);
        echo '<html><body><script>if (window.confirm("URL synced to ' . htmlentities($site_name) . '. Redirect to ' . htmlentities($site_name) . '?")) {window.location="' . $site_url . '";} else {window.location="' . $url . '";}</script></body></html>';
        //header('Location: '.$url);
        exit;
    }
}
?>

<?php 
// Head
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
Exemplo n.º 16
0
 public function analyticsmonth()
 {
     set_time_limit(0);
     $runby = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'CLI';
     $cdt = array('runat' => date('Y-m-d H:i:s', time()), 'path' => 'mycron/analyticsmonth', 'runby' => $runby);
     $this->common_model->insert($cdt, 'croncheck');
     //$lang = $this->config->item('langshort');
     $this->load->library('My_Webmaster');
     $webmaster = new My_Webmaster();
     $month_initial = strtotime(date('Y-m-01 00:00:00'));
     $cond_user = array('where' => array('user_type' => 2), 'result' => 1);
     $users = $this->common_model->get_rows($cond_user, 'users');
     foreach ($users as $user) {
         $qry = "SELECT ca_website.* FROM ca_website " . "WHERE ca_website.id IN (SELECT MAX(`cw`.`id`) from `ca_website` as `cw` WHERE `cw`.`user_id` = ? GROUP BY cw.md5domain, cw.lang) " . "ORDER BY ca_website.modified desc";
         $websites = $this->db->query($qry, array($user['id']))->result_array();
         foreach ($websites as $website) {
             // Add condition - Done
             $last_modified = strtotime($website['modified']);
             //if(1)
             if ($last_modified < $month_initial) {
                 $domain = addhttp($website['domain']);
                 $ip = gethostbyname($website['domain']);
                 $lang = $website['lang'];
                 $inserted_data = $webmaster->insert($domain, $ip, $lang, $user['id']);
                 //echo "<pre>"; print_r($inserted_data); echo "</pre>";
                 $this->domain = $website['domain'];
                 $this->website = $inserted_data['inserted_data']['ca_website'];
                 $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');
             }
         }
     }
 }
Exemplo n.º 17
0
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 
}
Exemplo n.º 18
0
        }
        ?>
                    
                    <?php 
        if (!empty($evPrice)) {
            ?>
						<div class="form-group">
						  <div class="price text-left col-xs-10 col-sm-10 col-md-10 col-lg-12 control-label">Стоимость: <span class="event-price">
								<?php 
            echo "от \$" . $evPrice . "</span>";
            ?>
								<?php 
            if (!empty($link)) {
                ?>
									<a href="<?php 
                echo addhttp($link);
                ?>
"><button class='btn btn-primary buy-ticket-event pull-right'>Kупить билеты</button></a>
								<?php 
            }
            ?>
						   </div>
						</div>
                    <?php 
        }
        ?>
                    
                    <!--<div class="event-buy-btn-out">
                      <div class="text-center form-group"> <a href="#"><button type="submit" class="btn btn-primary">Отправить сообщение</button></a></div>
                    </div>-->
					
Exemplo n.º 19
0
/**
 * Проверка заполнености полей
 * @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;
}
Exemplo n.º 20
0
<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>
Exemplo n.º 21
0
 $rResultTotal = mysqli_query($gaSql['link'], $sQuery) or die(mysqli__connect_error());
 $aResultTotal = mysqli_fetch_array($rResultTotal);
 $iTotal = $aResultTotal[0];
 $output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iFilteredTotal, "aaData" => array());
 $no = 1;
 while ($aRow = mysqli_fetch_array($rResult)) {
     $row = array();
     $tableroleaccess = new PoTable('user_role');
     $currentRoleAccess = $tableroleaccess->findByAnd(id_level, $_SESSION['leveluser'], module, 'comment');
     $currentRoleAccess = $currentRoleAccess->current();
     for ($i = 1; $i < count($aColumns); $i++) {
         $valid = $aRow['id_post'];
         $tablepost = new PoTable('post');
         $currentPost = $tablepost->findBy(id_post, $valid);
         $currentPost = $currentPost->current();
         $urlcar = addhttp($aRow['url']);
         if ($aRow['status'] == "Y") {
             $readdata = "<a class='btn btn-xs btn-success'><i class='fa fa-circle-o'></i></a>";
         } else {
             $readdata = "<a class='btn btn-xs btn-success readdata' id='{$aRow['id_comment']}'><i class='fa fa-circle' id='read{$aRow['id_comment']}'></i></a>";
         }
         if ($currentRoleAccess->delete_access == "Y") {
             $tbldelete = "<a class='btn btn-xs btn-danger alertdel' id='{$aRow['id_comment']}'><i class='fa fa-times'></i></a>";
         }
         $checkdata = "<div class='text-center'><input type='checkbox' id='titleCheckdel' /><input type='hidden' class='deldata' name='item[{$no}][deldata]' value='{$aRow['id_comment']}' disabled></div>";
         $row[] = $checkdata;
         $row[] = $aRow['id_comment'];
         $row[] = "<a href='../detailpost/{$currentPost->seotitle}' target='_blank'>{$currentPost->title}</a>";
         $row[] = $aRow['name'];
         $row[] = $aRow['email'];
         $row[] = "<a href='{$urlcar}' target='_blank'>Website</a>";
Exemplo n.º 22
0
function linktohtml($url, $referalize = TRUE, $trunc = FALSE)
{
    if (is_array($url)) {
        $url = $url[0];
    }
    $href = addhttp($url);
    $url = preg_replace("{http://}", "", $url);
    $trunc ? $displayUrl = truncate($url, $trunc) : ($displayUrl = $url);
    if ($referalize) {
        return '<a href="http://jsindustries.net/?y=2012&x=' . $href . '" target="_blank">' . $displayUrl . '</a>';
    } else {
        return '<a href="' . $href . '" target="_blank">' . $displayUrl . '</a>';
    }
}
Exemplo n.º 23
0
									</table>
								<?php 
}
?>

								<table width="489" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:arial, helvetica, sans-serif; color:#514a4a; font-size:14px;">
									<tbody>
										<tr>
											<td width="10" height="30">&nbsp;</td>
											<td width="479" height="30">&nbsp;</td>
										</tr>
										<?php 
for ($i = 1; $i <= $qtd; $i++) {
    echo '<tr>
														<td width="10" height="5" valign="top"></td>
														<td rowspan="2"><span style="font-style:italic; font-weight:600;">' . $_POST['veiculoMateria' . $i] . '</span> <a href="' . addhttp($_POST['linkMateria' . $i]) . '" target="_blank" style="color:#514A4A">' . $_POST['tituloMateria' . $i] . '</a></td>
													</tr>
													<tr>
														<td width="10" valign="top">&nbsp;</td>
													</tr>
													<tr>
														<td width="10">&nbsp;</td>
														<td>&nbsp;</td>
													</tr>';
}
?>
									</tbody>
								</table>
								<table width="489" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:arial, helvetica, sans-serif; color:#514a4a;">
									<tbody>
										<tr>
Exemplo n.º 24
0
<?php

echo 'urls' . "\n";
foreach ($links as $link) {
    if ($link['Type'] === 'internal') {
        $url1 = preg_replace('/#.*/', '', $link['Link']);
        $url = rtrim(preg_replace('/\\?.*/', '', $url1), "/");
        echo addhttp($url) . "\n";
    }
}
Exemplo n.º 25
0
<?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;
Exemplo n.º 26
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Social Media', 'vh') : $instance['title'], $instance, $this->id_base);
        $networks['RSS'] = $instance['rss'];
        $networks['Twitter'] = $instance['twitter'];
        $networks['Facebook'] = $instance['facebook'];
        $networks['Flickr'] = $instance['flickr'];
        $networks['YouTube'] = $instance['youtube'];
        $networks['LinkedIn'] = $instance['linkedin'];
        $networks['FourSquare'] = $instance['foursquare'];
        $networks['Delicious'] = $instance['delicious'];
        $networks['Digg'] = $instance['digg'];
        $networks['Skype'] = $instance['skype'];
        $networks['Tumblr'] = $instance['tumblr'];
        $networks['Vimeo'] = $instance['vimeo'];
        $networks['Instagram'] = $instance['instagram'];
        $networks['Pintrest'] = $instance['pintrest'];
        $networks['Google'] = $instance['google'];
        $display = $instance['display'];
        echo $before_widget;
        // Show title
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        ?>

		<ul class="social_links">
			<?php 
        if (empty($networks['RSS'])) {
            ?>
				<li><a href="<?php 
            bloginfo('rss2_url');
            ?>
" onclick="window.open(this.href); return false;" class="rss">RSS</a></li>
			<?php 
        } else {
            ?>
				<li><a href="<?php 
            echo $networks['RSS'];
            ?>
" onclick="window.open(this.href); return false;" class="rss">RSS</a></li>
			<?php 
        }
        foreach (array("Twitter", "Facebook", "Flickr", "YouTube", "LinkedIn", "FourSquare", "Delicious", "Digg", "Skype", "Tumblr", "Vimeo", "Instagram", "Pintrest", "Google") as $network) {
            if (!empty($networks[$network])) {
                ?>
					<li><a href="<?php 
                echo addhttp($networks[$network]);
                ?>
" class="<?php 
                echo strtolower($network);
                ?>
" onclick="window.open(this.href); return false;"><?php 
                echo $network;
                ?>
</a></li>
				<?php 
            }
        }
        ?>
		</ul>
		<div class="clearfix"></div>

		<?php 
        echo $after_widget;
    }
Exemplo n.º 27
0
     $subcat = __paramInit('int', 'subcategory', null, 0);
     $tmpPrj->setProjectField('category', $cat);
     $tmpPrj->setProjectField('subcategory', $subcat);
 }
 if ($PDA && (!$project['city'] || $action == "change_country" || $action == "change_country2")) {
     $tmpPrj->setProjectField('country', __paramInit('int', 'country', 0));
     $tmpPrj->setProjectField('city', __paramInit('int', 'city', 0));
 }
 if ($action == "change_country2" && $PDA) {
     header("Location: /public/?step={$step}&kind={$project['kind']}&category={$project['category']}&subcategory={$project['subcategory']}{$pprm}");
     exit;
 }
 if ($_POST['link'] == 'Адрес сайта по желанию') {
     $_POST['link'] = '';
 } else {
     $_POST['link'] = addhttp($_POST['link']);
 }
 $tmpPrj->setProjectField('kind', $kind ? $kind : $project['kind']);
 // Может быть получен с нулевого шага.
 $project = $tmpPrj->getProject();
 if ($project['kind'] && !in_array($project['kind'], array(0, 1, 2, 4, 7, 9))) {
     $error['kind'] = 'Закладка не выбрана';
 }
 if ($_POST['logo_del'] == "1") {
     $_POST['logo_ok'] = 0;
     $_POST['logo_file_id'] = "";
 }
 if ($action == 'save' || $action == "change" || $action == "change_country") {
     $use_draft = $project['user_id'] == get_uid(false);
     if (isset($_POST['contacts'])) {
         $error = users::validateContacts($_POST['contacts'], $contacts);
Exemplo n.º 28
0
/**
 * Сохранение работы в портфолио
 * 
 * @param object $objResponse xajaxResponse
 * @param string $rec_id идентификатор записи
 * @param string $rec_type тип записи
 * @param array $aForm массив данных
 * @param string $sDrawFunc имя функции для выполнения после сохранения
 */
function _admEditPortfolioSaveForm(&$objResponse, $rec_id = '', $rec_type = '', $aForm = array(), $sDrawFunc = '')
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/user_content.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/portfolio.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
    $max_time_value = 100;
    //стоимость работы из портфолио
    $max_portf_cost[0] = 100000;
    // usd
    $max_portf_cost[1] = 100000;
    // euro
    $max_portf_cost[2] = 5000000;
    // rur
    $max_portf_cost[3] = 100000;
    // fm
    $user = new users();
    $user->GetUserByUID($aForm['user_id']);
    // инициализация
    $aPortf = portfolio::GetPortfById($rec_id);
    $alert = array();
    $maxlen = $aForm['is_video'] ? 80 : 120;
    $name = substr($aForm['pname'], 0, $maxlen);
    $name = change_q_x($name, false, true, '', false, false);
    $name = $name ? $name : '';
    $descr = substr(change_q_new(trim(stripslashes($aForm['descr']))), 0, 1500);
    $prof = intval($aForm['prof']);
    $new_prof = intval($aForm['new_prof']);
    $prj_id = $rec_id;
    $cost = intval(str_replace(' ', '', $aForm['pcost']) * 100) / 100;
    $cost_type = intval($aForm['pcosttype']);
    $time_value = intval(trim($aForm['ptime']));
    $time_type = intval($aForm['ptimeei']);
    $is_video = $aForm['is_video'] ? 't' : 'f';
    $video_link = $aForm['is_video'] ? stripslashes(trim($aForm['v_video_link'])) : '';
    $link = $aForm['is_video'] ? '' : addhttp(trim(substr(change_q_x($aForm['link'], true), 0, 150)));
    $link = $link ? $link : '';
    $make_position = $aForm['make_position'];
    $make_position_num = trim($aForm['make_position_num']);
    $update_prev = intval($aForm['upd_prev']);
    $prev_type = intval($aForm['prev_type']);
    $del_prev = intval($aForm['del_prev']);
    $new_position = NULL;
    $pict = substr(change_q_new(trim(stripslashes($aForm['pict']))), 0, 1500);
    $prev_pict = substr(change_q_new(trim(stripslashes($aForm['prev_pict']))), 0, 1500);
    if ($new_prof != $prof) {
        $new_position = 0;
    }
    if (isset($make_position)) {
        switch ($make_position) {
            case 'first':
                $new_position = 1;
                break;
            case 'last':
                $new_position = 0;
                break;
            case 'num':
            default:
                $new_position = intval($make_position_num);
                $new_position = $new_position <= 0 ? 1 : $new_position;
                break;
        }
    }
    // валидация (нумерация алертов как в первоначальном варианте радактирования и новый нулевой)
    if (!$name || strlen(trim(stripslashes($aForm['pname']))) > 80) {
        $alert[1] = 'Поле заполнено некорректно';
    }
    if ($link != '' && !url_validate($link, true)) {
        $alert[6] = 'Поле заполнено некорректно';
    }
    if ($is_video == 't') {
        $v_video_link = video_validate($video_link);
        if (!$v_video_link) {
            $alert[206] = "Поле заполнено некорректно";
        } else {
            $video_link = preg_replace("/^http:\\/\\//", '', $v_video_link);
        }
    }
    if ($cost < 0 || $cost > $max_portf_cost[$cost_type]) {
        $alert[4] = 'Стоимость должна быть в пределе от 0 ' . view_range_cost2(0, $max_portf_cost[$cost_type], '', '', false, $cost_type) . ($cost_type != 2 ? '.' : '');
    }
    if ($time_value < 0 || $time_value > $max_time_value) {
        $alert[5] = 'Временные затраты должны быть в пределе от 0 до ' . $max_time_value . '.';
    }
    if ($new_prof != $prof && ($new_prof == professions::CLIENTS_PROF_ID || $new_prof == professions::BEST_PROF_ID) && portfolio::CountAll($aForm['user_id'], $new_prof, true) >= portfolio::MAX_BEST_WORKS) {
        $alert[0] = 'Превышено количество работ в этом разделе';
    }
    // сохраняем
    if (!$alert) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
        $sReason = _parseReason($aForm['user_id'], $aForm['adm_edit_text']);
        $portf = new portfolio();
        $portf->EditPortf($aForm['user_id'], $name, $img, $sm_img, $link, $descr, $new_prof, $cost, $cost_type, $time_type, $time_value, $prev_type, $prj_id, $file_error, $preview_error, $new_position, 0, $video_link, $update_prev, $_SESSION['uid'], $pict, $prev_pict, $user->login, $sReason);
        if ($del_prev) {
            $portf->DelPict($user->login, $prj_id, 0);
        }
        messages::portfolioModifiedNotification($aPortf, $user, $sReason);
        $content_id = user_content::MODER_PORTFOLIO;
        _admEditAfterAll($objResponse, $content_id, $rec_id, $rec_type, $sDrawFunc, $aForm);
    } else {
        _setErrors($objResponse, $alert, array(0 => 'prof', 1 => 'pname', 2 => 'descr', 4 => 'pcost', 5 => 'ptime', 6 => 'link', 206 => 'video_link'), $sDrawFunc);
    }
}
 public function completeData($type_role = 1)
 {
     if ($this->isDisable()) {
         header("Location: /wizard/registration/?step=1");
         exit;
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/employer.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/city.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/country.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/blogs.php";
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/commune.php";
     $themes_blogs = blogs::getRandomThemes(5);
     $themes_commune = commune::getRandomCommunes(3);
     $month = array('1' => 'января', '2' => 'февраля', '3' => 'марта', '4' => 'апреля', '5' => 'мая', '6' => 'июня', '7' => 'июля', '8' => 'августа', '9' => 'сентября', '10' => 'октября', '11' => 'ноября', '12' => 'декабря');
     if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) {
         $user = new employer();
         $checkPRO = $this->checkWizardPRO(array(step_employer::OP_CODE_PRO));
         $pro_emp = $checkPRO['id'] > 0 ? 1 : 0;
         if ($pro_emp) {
             $week_pro = round($checkPRO['ammount'] / 10);
         }
     } else {
         $user = new freelancer();
         $checkPRO = $this->checkWizardPRO(step_freelancer::getOperationCodePRO());
         $pro_frl = $checkPRO['id'] > 0 ? 1 : 0;
         if ($pro_frl) {
             $op_code = $checkPRO['op_code'];
         }
     }
     $user->GetUserByUID(wizard::getUserIDReg());
     $info_for_reg = unserialize($user->info_for_reg);
     $uname = $user->uname;
     $usurname = $user->usurname;
     $sex = $user->sex == 't' ? 1 : ($user->sex == 'f' ? 0 : -1);
     $birthday = strtotime($user->birthday);
     if ($birthday) {
         $bday = date('d', $birthday);
         $bmonth = (int) date('m', $birthday);
         $bmonth_value = $month[$bmonth];
         $byear = date('Y', $birthday);
     } else {
         $bday = '';
         $bmonth = (int) date('m', $birthday);
         $bmonth_value = $month[$bmonth];
         $byear = '';
     }
     $city = $user->city;
     if ($city) {
         $city_value = city::GetCityName($city);
     }
     $country = $user->country;
     if ($country) {
         $country_value = country::GetCountryName($country);
     }
     if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) {
         $company = $user->compname;
         $about_company = $user->company;
         $logo_name = $user->logo;
         $dir = "users/" . substr($user->login, 0, 2) . "/" . $user->login . "/logo/";
         $logo_path = WDCPREFIX . "/" . $dir . $user->logo;
     }
     $info['site'] = $this->loadMultiVal('site', 'site', $user);
     $info['email'] = $this->loadMultiVal('second_email', 'email', $user);
     $info['phone'] = $this->loadMultiVal('phone', 'phone', $user);
     $info['icq'] = $this->loadMultiVal('icq', 'icq', $user);
     $info['skype'] = $this->loadMultiVal('skype', 'skype', $user);
     $info['jabber'] = $this->loadMultiVal('jabber', 'jabber', $user);
     $info['lj'] = $this->loadMultiVal('ljuser', 'lj', $user);
     $action = __paramInit('string', null, 'action');
     if ($action == 'upd_info') {
         $info_for_reg = $_POST['info_for_reg'];
         if ($info_for_reg['email_0'] !== null) {
             $info_for_reg['second_email'] = $info_for_reg['email_0'];
             unset($info_for_reg['email_0']);
         }
         if ($info_for_reg['phone_0'] !== null) {
             $info_for_reg['phone'] = $info_for_reg['phone_0'];
             unset($info_for_reg['phone_0']);
         }
         if ($info_for_reg['site_0'] !== null) {
             $info_for_reg['site'] = $info_for_reg['site_0'];
             unset($info_for_reg['site_0']);
         }
         if ($info_for_reg['lj_0'] !== null) {
             $info_for_reg['ljuser'] = $info_for_reg['lj_0'];
             unset($info_for_reg['lj_0']);
         }
         if ($info_for_reg['jabber_0'] !== null) {
             $info_for_reg['jabber'] = $info_for_reg['jabber_0'];
             unset($info_for_reg['jabber_0']);
         }
         if ($info_for_reg['skype_0'] !== null) {
             $info_for_reg['skype'] = $info_for_reg['skype_0'];
             unset($info_for_reg['skype_0']);
         }
         if ($info_for_reg['icq_0'] !== null) {
             $info_for_reg['icq'] = $info_for_reg['icq_0'];
             unset($info_for_reg['icq_0']);
         }
         if ($info_for_reg['compname'] !== null) {
             $info_for_reg['company'] = $info_for_reg['compname'];
             unset($info_for_reg['compname']);
         }
         $info_for_reg = array_map('intval', $info_for_reg);
         $user->info_for_reg = serialize($info_for_reg);
         $uname = __paramInit('string', null, 'uname', null, 21);
         $usurname = __paramInit('string', null, 'usurname', null, 21);
         if ($uname == '') {
             $error['uname'] = "Поле заполнено некорректно";
         }
         if ($usurname == '') {
             $error['usurname'] = "Поле заполнено некорректно";
         }
         if (!preg_match("/^[-a-zA-Zа-яёА-ЯЁ]+\$/", $uname)) {
             $error['uname'] = "Поле заполнено некорректно";
         } else {
             $user->uname = $uname;
         }
         if (!preg_match("/^[-a-zA-Zа-яёА-ЯЁ]+\$/", $usurname)) {
             $error['usurname'] = "Поле заполнено некорректно";
         } else {
             $user->usurname = $usurname;
         }
         $sex = __paramInit('int', null, 'sex', 1);
         // по умолчанию мужской пол
         $user->sex = $sex == 1 ? 't' : 'f';
         $bday = __paramInit('int', null, 'bday', null);
         $bmonth = __paramInit('int', null, 'bmonth_db_id', 1);
         $bmonth_value = __paramInit('string', null, 'bmonth');
         $byear = __paramInit('int', null, 'byear', null);
         if ($bday != null && $byear != null) {
             if (!is_numeric($bday) || !is_numeric($byear) || !checkdate($bmonth, $bday, $byear) || $byear < 1945 || $byear > date('Y')) {
                 $error['birthday'] = "Поле заполнено некорректно";
             } else {
                 $user->birthday = dateFormat("Y-m-d", $byear . "-" . $bmonth . "-" . $bday);
             }
         } else {
             $user->birthday = "1910-01-01";
         }
         if (!$error['birthday'] && $user->birthday && date("Y", strtotime($user->birthday)) >= date("Y")) {
             $error['birthday'] = "Поле заполнено некорректно";
         }
         $city = __paramInit('int', null, 'city_db_id', 0);
         $city_value = __paramInit('string', null, 'city', false);
         $country = __paramInit('int', null, 'country_db_id', 0);
         $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'])) {
             foreach ($info['icq'] as $i => $value) {
                 $name = 'icq' . ($i != 0 ? "_{$i}" : "");
                 if (!preg_match("/^[-0-9\\s]*\$/", $value) && !is_email($value)) {
                     $error[$name] = "Поле заполнено некорректно";
                 } else {
                     $user->{$name} = $value;
                 }
             }
         }
         if (!empty($info['skype'])) {
             foreach ($info['skype'] as $i => $value) {
                 $name = 'skype' . ($i != 0 ? "_{$i}" : "");
                 $user->{$name} = $value;
             }
         }
         if (!empty($info['jabber'])) {
             foreach ($info['jabber'] as $i => $value) {
                 $name = 'jabber' . ($i != 0 ? "_{$i}" : "");
                 if (strlen($value) > 255) {
                     $error[$name] = "Количество знаков превышает допустимое значение";
                 } else {
                     $user->{$name} = $value;
                 }
             }
         }
         if (!empty($info['lj'])) {
             foreach ($info['lj'] as $i => $value) {
                 if ($i == 0) {
                     $name_save = "ljuser";
                 } else {
                     $name_save = "lj_{$i}";
                 }
                 $name = 'lj' . ($i != 0 ? "_{$i}" : "");
                 if (!preg_match("/^[a-zA-Z0-9_-]*\$/", $value)) {
                     $error[$name] = "Поле заполнено некорректно";
                 } else {
                     $user->{$name_save} = $value;
                 }
             }
         }
         if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) {
             $pro_emp = __paramInit('int', null, 'pro-emp', false);
             if ($pro_emp) {
                 $week_pro = round(__paramInit('int', null, 'week_pro', 0));
             }
         } else {
             $ammount = 0;
             $pro_frl = __paramInit('int', null, 'pro-frl', false);
             if ($pro_frl) {
                 $pro = __paramInit('string', null, 'pro', -1);
                 switch ($pro) {
                     case "1week":
                         $op_code = 76;
                         $ammount = 7;
                         break;
                     case "1":
                         $op_code = 48;
                         $ammount = 19;
                         break;
                     case "3":
                         $op_code = 49;
                         $ammount = 54;
                         break;
                     case "6":
                         $op_code = 50;
                         $ammount = 102;
                         break;
                     case "12":
                         $op_code = 51;
                         $ammount = 180;
                         break;
                     case "-1":
                     default:
                         $ammount = 0;
                         break;
                 }
             }
         }
         if (!$error && wizard::getUserIDReg()) {
             $error['save'] = $user->Update(wizard::getUserIDReg(), $res);
             if (!$error['save']) {
                 if ($type_role == step_wizard_registration::TYPE_WIZARD_EMP) {
                     $ammount = $week_pro * 10;
                     if ($ammount > 0) {
                         $checkPRO = $this->checkWizardPRO(step_employer::OP_CODE_PRO);
                         if ($checkPRO['id'] > 0) {
                             $update = array("ammount" => $ammount);
                             wizard_billing::editPaidOption($update, $checkPRO['id']);
                         } else {
                             $insert = array("wiz_uid" => step_wizard::getWizardUserID(), "op_code" => step_employer::OP_CODE_PRO, "type" => 3, "ammount" => $ammount, "parent" => wizard::getUserIDReg());
                             wizard_billing::addPaidOption($insert);
                         }
                     } else {
                         $sql = "DELETE FROM wizard_billing WHERE wiz_uid = ? AND op_code = ?";
                         $this->_db->query($sql, step_wizard::getWizardUserID(), step_employer::OP_CODE_PRO);
                     }
                 } else {
                     // Чистим
                     $sql = "DELETE FROM wizard_billing WHERE wiz_uid = ? AND op_code IN (?l)";
                     $this->_db->query($sql, step_wizard::getWizardUserID(), step_freelancer::getOperationCodePRO());
                     if ($ammount > 0) {
                         $insert = array("wiz_uid" => step_wizard::getWizardUserID(), "op_code" => $op_code, "type" => 4, "ammount" => $ammount, "parent" => wizard::getUserIDReg());
                         wizard_billing::addPaidOption($insert);
                     }
                 }
                 $this->parent->setCompliteStep(true);
                 $this->parent->setNextStep($this->parent->getPosition() + 1);
                 header("Location: /wizard/registration/");
                 exit;
             }
         }
         if ($logo_id > 0) {
             $file = new CFile($logo_id);
             $logo_path = WDCPREFIX . "/" . $file->path . $file->name;
         }
     }
     include $_SERVER['DOCUMENT_ROOT'] . "/wizard/registration/steps/tpl.step.info.php";
 }
Exemplo n.º 30
-2
								
								<?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">