kaban1

Рейтинг
100
Регистрация
21.02.2011
vozzy:
во вкладке безопасность - есть "защитить директории паролем" - доступ к сайту будет только с парольной защитой, но проще через .htaccess

А как, кстати, закрыть через .htaccess ?

Не хочу парковать, менять DNS

Желательно чтобы как-то был закрыт сайт - не видно ни одного элемента сайта

Через .htaccess можно как-то или CP ?

------

ПС. Закрыта тема.

Паролем закрыл

Нужен плагин, превращающий легко запись в страницу и наоборот =) :)

Существует такой или нет ? =)

Психиатр:
А что, там своих цветов нет? Вы отсюда хотите?

Из Москвы туда, да =))

ПС

Вернее, мне не важно откуда (Из Москвы или из немецкого магаза), главное, чтобы букет был доставлен по адресу определённому в Германии

Сам я в Москве

NP04

Filan

Спасибо за советы =)) :)

iren K:
ясно, сpanel рулит))
удалите старую(прежнюю) папку,затем добавьте домен через панель - была подобная ситуация..

1. Спасибо большое!:), что помогаете =))) :):):)

2. :)

Не могу удалять папку - там сайт=) Переименовать только временно в иную.

Переименовал папку в другую, добавил домен снова в CP. Папки соответсвующей снова не появилось - не видно её. Вот..=)

+ когда добавлял, там же ещё добавляется к доп домену "Пользователь" с паролем - выскакивала ошибка при добавлении домена снова - Такой пользователь существует

Тогда вводил иного пользователя, но папки всё равно не появилось

kaban1 добавил 17.09.2011 в 09:06

Всё. Решил

Сильно притупил.

Я же держал папку для доп. домена в самом корне

А когда вторично добавлял - она сюда добавлялась в public_html автоматом

Это проглядел, притупил

Всё теперь нормально добавил

Ничего не пришлось удалять

Просто ступил в одним полем при добавлении вторичном

Спасибо за помощь, отклик:):)

Всё работает уже

Сайт снова на доп. домене арбайтает =))

:)

iren K:
если Вы про субдомен,то пропишите в
RewriteEngine On

RewriteRule ^папка_субдомена/ - [last]
RewriteCond %{HTTP_HOST} (www.)?субдомен.site.ru [nocase]
RewriteRule (.*) папка_субдомена/$1 [last]

- если есть доступ к .htaccess..
(если я прально поняла))
и если не используете .pl скрипты,то папку cgi-bin закройте (444)..

Я не о субдомене, а о дополнительном домене

Второй нормальный обычный домен второго уровня со вторым сайтом на одном хостинге в одной CP-панели =)

weblad:
Возможно ли? Да, возможно. Нужно в css стилях указать другой цвет, это самое точное что можно сказать по скриншоту.

А где именно в CSS и как прописать правильно, например для стандартного шаблона Twenty Ten ?

weblad:
Предлагаете по цвету фона определить как им управлять или по девочкам?

Возможно ли где-то дополнительно дописать-указать иной/другой фон области расположения картинок, чтобы он отличался от общего фона записи/страницы?

То есть, чтобы можно было регулировать фоном всей области, которая на скрине вырезана

---

(ПС

На скрине вокруг самих картинок это не фон - это бордер широкий просто такой)

И ещё один вопрос (мне важный)

Хотелось бы иметь возможность управлять фоном области размещения картинок в записях/страницах

:)

Где это можно подрегулировать/(дописать) дополнительно ?

Не знаю, в какой области WP это заложено - описание области с картинками.

Скрин:

вот хотелось бы иметь возможность в такой области фоном дополнительно управлять

jpg 1111yuiuiiit111.jpg

Ещё вопрос есть

Установил плагин:

http://www.dutchguys.com/plugins

В блоге, на которым он установлен, используются ссылки вида

/%year%/%monthnum%/%day%/%postname%.html

+ используется плагин: .html on PAGES

http://www.introsites.co.uk/wordpress/html-on-pages-plugin.html

Использование этих ссылок было не сразу после установки блога, - через некоторое время введено.

Вначале использовались стандарные ссылки вида: /?p=123

Теперь к плагину http://www.dutchguys.com/plugins:

При наведении на Случайные картинки, которые производит плагин - эти картинки ведут на ссылки стандартного вида /?p=123, если страницы отвечающие этим ссылкам были созданы до изменения вида постоянных ссылок . и потом через редирект всё как нужно - возникает требующаяся страница

А вот для страниц созданных после изменения вида постоянных ссылок, - происходит попадание на 404.

Собственно вот плагин состоит из одного файла:



<?php
/*
* Plugin Name: DG Random Image
* Plugin URI: http://www.dutchguys.com/plugins
* Description: Displays a random image from one of the children of a named page.<br> Read more about in on <a href="http://www.dutchguys.com">dutchguys.com</a>
* Version: 1.01
* Author: Menno Dekker
* Author URI: http://www.dutchguys.com
* License: GPL
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/

/**
* Display a random image attached to a named page or one of it's children.
*
* @param array $args key (default value) <b>title</b> (Gallery) <b>class</b> (null) <b>x</b> (125) <b>y</b> (125)
* @return thumbnail image linked to page
*/
function DG_Random_Image($args = '') {

static $aImages = array();
static $sPageTitle = '';

if (is_array($args)) {
$r = $args;
} else {
parse_str($args, $r);
}

//Parse the defaults
$defaults = array('title' => 'Gallery', 'class' => '', 'x' => 125, 'y' => 125);
$r = array_merge($defaults, $r);

//Now check if we used this page before and if so wether we have images or not
if (count($aImages) == 0 or $sPageTitle != $r['title']) {
$sPageTitle = $r['title'];
$c = array('child_of' => get_page_by_title($r['title'])->ID,
'name' => 'page_id'
);
$pages = get_pages($c);
//Now loop through all the child pages to find attached pictures
foreach ($pages as $pagg) {
$attachments = get_children(array('post_parent' => $pagg->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
if (!empty($attachments)) {
foreach ($attachments as $att) {
$aImages[] = array('ID' => $att->ID, 'parent' => $pagg->guid, 'title' => $pagg->post_title);
}
}
}
}
//Okay we have an array containing image id, page url and page title
$rId = rand(0, count($aImages) - 1);
$aImg = wp_get_attachment_image_src($aImages[$rId]['ID'], 'thumbnail', false);
if ($r[''] !== '')
$sClass = ' class="' . $r['class'] . '"';
$alt = ' alt="' . $aImages[$rId]['title'] . '"';
$title = ' title="' . $aImages[$rId]['title'] . '"';
$sReturn = '<a href="' . $aImages[$rId]['parent'] . '"><img src="' . $aImg[0] . '" width="' . $r['x'] . '" height="' . $r['y'] . '"' . $sClass . $alt . $title . '></a>';
return $sReturn;
}

/**
* Add function to widgets_init that'll load our widget.
* @since 1.01
*/
add_action('widgets_init', 'dg_random_image_load_widgets');

/**
* Register our widget.
* 'DG_Random_Image_Widget' is the widget class used below.
*
* @since 1.01
*/
function dg_random_image_load_widgets() {
register_widget('DG_Random_Image_Widget');
}

/**
* DG Random Image Widget class.
* This class handles everything that needs to be handled with the widget:
* the settings, form, display, and update. Nice!
*
* @since 1.01
*/
class DG_Random_Image_Widget extends WP_Widget {

/**
* Widget setup.
*/
function __construct() {

/* Widget settings. */
$widget_ops = array('title' => 'DG Random Image', 'description' => __('Displays a random image from your galleries', 'dg-random-image'));

/* Widget control settings. */
$control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'dg-random-image');

/* Create the widget. */
parent::__construct('dg-random-image', __('DG Random Image', 'dg-random-image'), $widget_ops, $control_ops);
}

/**
* How to display the widget on the screen.
*/
function widget($args, $instance) {
extract($args);

/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title']);
$pagetitle = $instance['ptitle'];
$x = $instance['x'];
$y = $instance['y'];
$class = $instance['class'];

/* Before widget (defined by themes). */
echo $before_widget;

/* Display the widget title if one was input (before and after defined by themes). */
if ($title)
echo $before_title . $title . $after_title;

echo DG_Random_Image(array('title'=>$pagetitle,
'class'=>$class,
'x'=>$x,
'y'=>$y));

/* After widget (defined by themes). */
echo $after_widget;
}

/**
* Update the widget settings.
*/
function update($new_instance, $old_instance) {
$instance = $old_instance;

/* Strip tags for title and name to remove HTML (important for text inputs). */
$instance['title'] = strip_tags($new_instance['title']);
$instance['ptitle'] = strip_tags($new_instance['ptitle']);
$instance['class'] = strip_tags($new_instance['class']);
$instance['x'] = strip_tags((int) $new_instance['x']);
$instance['y'] = strip_tags((int) $new_instance['y']);

return $instance;
}

/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form($instance) {

/* Set up some default widget settings. */
$defaults = array('title'=>'Widget title',
'ptitle'=>'Gallery',
'class'=>'gallery-class',
'x'=>125,
'y'=>125);
$instance = wp_parse_args((array) $instance, $defaults);
?>

<!-- Widget Title: Text Input -->
<p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'hybrid'); ?></label>
<input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />
</p>

<!-- Page title : Text Input -->
<p>
<label for="<?php echo $this->get_field_id('ptitle'); ?>"><?php _e('Top gallery title:', 'dg-random-image'); ?></label>
<input id="<?php echo $this->get_field_id('ptitle'); ?>" name="<?php echo $this->get_field_name('ptitle'); ?>" value="<?php echo $instance['ptitle']; ?>" style="width:100%;" />
</p>

<!-- Class : Text Input -->
<p>
<label for="<?php echo $this->get_field_id('class'); ?>"><?php _e('Image class:', 'dg-random-image'); ?></label>
<input id="<?php echo $this->get_field_id('class'); ?>" name="<?php echo $this->get_field_name('class'); ?>" value="<?php echo $instance['class']; ?>" style="width:100%;" />
</p>

<!-- Image width : Text Input -->
<p>
<label for="<?php echo $this->get_field_id('x'); ?>"><?php _e('Image width:', 'dg-random-image'); ?></label>
<input id="<?php echo $this->get_field_id('x'); ?>" name="<?php echo $this->get_field_name('x'); ?>" value="<?php echo $instance['x']; ?>" style="width:100%;" />
</p>

<!-- Image height : Text Input -->
<p>
<label for="<?php echo $this->get_field_id('y'); ?>"><?php _e('Image height:', 'dg-random-image'); ?></label>
<input id="<?php echo $this->get_field_id('y'); ?>" name="<?php echo $this->get_field_name('y'); ?>" value="<?php echo $instance['y']; ?>" style="width:100%;" />
</p>

<?php
}

}
?>


Этот трабл отмечен и на странице создателя плагина:

http://www.dutchguys.com/plugins


Sandro Says:
November 28th, 2010 at 9:08 pm

hello guys,
I’m wondering why i can’t manage to link the random image to the page of the gallery. Your wonderful plugin manages to get the title of the page and i guess other inportant stuff i even can’t imagine!

How could i modify $sReturn = ‘ to get the link to the page ?
for the moment, i only get a link to the home page of the site.

Sandro

Как это пролечить ? =)) :)

kaban1 добавил 11.09.2011 в 08:17

    $sReturn = '<a href="' . $aImages[$rId]['parent'] . '"><img src="' . $aImg[0] . '" width="' . $r['x'] . '" height="' . $r['y'] . '"' . $sClass . $alt . $title . '></a>';

return $sReturn;

a href как кажется нужно переписать иначе

Но как ? =)

Всего: 565