Перейти к содержанию
Официальный форум поддержки Simpla

Изменение даты добавления комментария / отзыва


Рекомендуемые сообщения

Добрый день!

 

Хотел спросить, есть ли возможность настроить в админке изменение даты добавления комментария / отзыва. И насколько это сложно?

 

Как я понимаю по идее это не должно быть проблемой.

 

Ставил обновление отсюда http://forum.simplacms.ru/topic/5705-%D0%BE%D1%82%D0%B2%D0%B5%D1%82-%D0%BD%D0%B0-%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%80%D0%B8%D0%B9-%D1%81-%D1%83%D0%B2%D0%B5%D0%B4%D0%BE%D0%BC%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%D0%BC-%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D1%83/?p=64767

 

Все норм поставилось но этой функции недостает.

Ссылка на сообщение
Поделиться на другие сайты

Собственно, как я понимаю, что отвечает за обработку комментариев

 

Comments.php

 

<?php

/**
 * Simpla CMS
 *
 * @copyright	2011 Denis Pikusov
 * @link		http://simplacms.ru
 * @author		Denis Pikusov
 *
 */

require_once('Simpla.php');

class Comments extends Simpla
{

	// Возвращает комментарий по id
	public function get_comment($id)
	{
		$query = $this->db->placehold("SELECT c.id, c.object_id, c.name, c.email, c.ip, c.type, c.text, c.otvet, c.date, c.approved FROM __comments c WHERE id=? LIMIT 1", intval($id));

		if($this->db->query($query))
			return $this->db->result();
		else
			return false; 
	}
	
	// Возвращает комментарии, удовлетворяющие фильтру
	public function get_comments($filter = array())
	{	
		// По умолчанию
		$limit = 0;
		$page = 1;
		$object_id_filter = '';
		$type_filter = '';
		$keyword_filter = '';
		$approved_filter = '';

		if(isset($filter['limit']))
			$limit = max(1, intval($filter['limit']));

		if(isset($filter['page']))
			$page = max(1, intval($filter['page']));

		if(isset($filter['ip']))
			$ip = $this->db->placehold("OR c.ip=?", $filter['ip']);
		if(isset($filter['approved']))
			$approved_filter = $this->db->placehold("AND (c.approved=? $ip)", intval($filter['approved']));
			
		if($limit)
			$sql_limit = $this->db->placehold(' LIMIT ?, ? ', ($page-1)*$limit, $limit);
		else
			$sql_limit = '';

		if(!empty($filter['object_id']))
			$object_id_filter = $this->db->placehold('AND c.object_id in(?@)', (array)$filter['object_id']);

		if(!empty($filter['type']))
			$type_filter = $this->db->placehold('AND c.type=?', $filter['type']);

		if(!empty($filter['keyword']))
		{
			$keywords = explode(' ', $filter['keyword']);
			foreach($keywords as $keyword)
				$keyword_filter .= $this->db->placehold('AND c.name LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" OR c.text LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" OR c.email LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" ');
		}

			
		$sort='DESC';
		
		$query = $this->db->placehold("SELECT c.id, c.object_id, c.ip, c.name, c.email, c.text, c.otvet, c.type, c.date, c.approved
										FROM __comments c WHERE 1 $object_id_filter $type_filter $keyword_filter $approved_filter ORDER BY id $sort $sql_limit");
	
		$this->db->query($query);
		return $this->db->results();
	}
	
	// Количество комментариев, удовлетворяющих фильтру
	public function count_comments($filter = array())
	{	
		$object_id_filter = '';
		$type_filter = '';
		$approved_filter = '';
		$keyword_filter = '';

		if(!empty($filter['object_id']))
			$object_id_filter = $this->db->placehold('AND c.object_id in(?@)', (array)$filter['object_id']);

		if(!empty($filter['type']))
			$type_filter = $this->db->placehold('AND c.type=?', $filter['type']);

		if(isset($filter['approved']))
			$approved_filter = $this->db->placehold('AND c.approved=?', intval($filter['approved']));

		if(!empty($filter['keyword']))
		{
			$keywords = explode(' ', $filter['keyword']);
			foreach($keywords as $keyword)
				$keyword_filter .= $this->db->placehold('AND c.name LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" OR c.text LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" OR c.email LIKE "%'.mysql_real_escape_string(trim($keyword)).'%" ');
		}

		$query = $this->db->placehold("SELECT count(distinct c.id) as count
										FROM __comments c WHERE 1 $object_id_filter $type_filter $keyword_filter $approved_filter", $this->settings->date_format);
	
		$this->db->query($query);	
		return $this->db->result('count');

	}
	
	// Добавление комментария
	public function add_comment($comment)
	{	
		$query = $this->db->placehold('INSERT INTO __comments
		SET ?%,
		date = NOW()',
		$comment);

		if(!$this->db->query($query))
			return false;

		$id = $this->db->insert_id();
		return $id;
	}
	
	// Изменение комментария
	public function update_comment($id, $comment)
	{
		$date_query = '';
		if(isset($comment->date))
		{
			$date = $comment->date;
			unset($comment->date);
			$date_query = $this->db->placehold(', date=STR_TO_DATE(?, ?)', $date, $this->settings->date_format);
		}
		$query = $this->db->placehold("UPDATE __comments SET ?% $date_query WHERE id in(?@) LIMIT 1", $comment, (array)$id);
		$this->db->query($query);
		return $id;
	}

	// Удаление комментария
	public function delete_comment($id)
	{
		if(!empty($id))
		{
			$query = $this->db->placehold("DELETE FROM __comments WHERE id=? LIMIT 1", intval($id));
			$this->db->query($query);
		}
	}	
}

CommentAdmin.php

 

<?PHP

require_once('api/Simpla.php');

class CommentAdmin extends Simpla
{
	public function fetch()
	{
		if($this->request->method('POST'))
		{
			$comment->id = $this->request->post('id', 'integer');
			$comment->name = $this->request->post('name');
			$comment->email = $this->request->post('email');
			
			$comment->type = $this->request->post('type');
			$comment->object_id = $this->request->post('object_id');
			$comment->approved = $this->request->post('approved', 'boolean');

			$comment->text = $this->request->post('text');
			$comment->otvet = $this->request->post('otvet');
			
			$is_notify = $this->request->post('notify_user');

  			$comment_id = $this->comments->update_comment($comment->id, $comment);
			if ($comment_id and $is_notify and $comment->email and $comment->otvet)
				$this->notify->email_comment_user($comment_id);
				
  			$comment = $this->comments->get_comment($comment->id);
			$this->design->assign('message_success', 'updated');
		}
		else
		{
			$comment->id = $this->request->get('id', 'integer');
			$comment = $this->comments->get_comment(intval($comment->id));
		}

		// Выбирает объект, который прокомментирован:
		if($comment->type == 'product')
		{
			$products = array();
			$products_ids = array();
			$products_ids[] = $comment->object_id;
			foreach($this->products->get_products(array('id'=>$products_ids)) as $p)
				$products[$p->id] = $p;
			if(isset($products[$comment->object_id]))
				$comment->product = $products[$comment->object_id];
		}

		if($comment->type == 'blog')
		{
			$posts = array();
			$posts_ids = array();
			$posts_ids[] = $comment->object_id;
			foreach($this->blog->get_posts(array('id'=>$posts_ids)) as $p)
				$posts[$p->id] = $p;
			if(isset($posts[$comment->object_id]))
				$comment->post = $posts[$comment->object_id];
		}
 		
		$this->design->assign('comment', $comment);
		
 	  	return $this->design->fetch('comment.tpl');
	}
}

comment.tpl

 

{* Вкладки *}
{capture name=tabs}
	<li class="active"><a href="index.php?module=CommentsAdmin">Комментарии</a></li>
	{if in_array('feedbacks', $manager->permissions)}<li><a href="index.php?module=FeedbacksAdmin">Обратная связь</a></li>{/if}
{/capture}


{* Title *}
{$meta_title = "Изменение комментария" scope=parent}

{* On document load *}
<script src="design/js/jquery/datepicker/jquery.ui.datepicker-ru.js"></script>

{literal}
<script>
$(function() {

	$('input[name="date"]').datepicker({
		regional:'ru'
	});
	
	// отлавливаем передачу формы и если отмечено уведомление, но ответ пустой - ругаемся!
	$('#product').submit(function(){
		var notify = $('#notify_user').prop("checked");
		var otvet  = $('textarea[name=otvet]').val();
		if (notify && otvet == '') {
			alert ("Укажите ответ на комментарий или отключите уведомление!");
			return false;
		}
	});
	
	// отлавливаем каждое нажатие кнопки клавиатуры и если после этого нажатие ответ остается пустой,
	// мы снимаем отметку уведомление, а если в ответ что-то написали - то ставим уведомление
	$('textarea[name=otvet]').keyup(function(){
		if ($(this).val()=='')
			$('#notify_user').prop("checked",false);
		else
			$('#notify_user').prop("checked",true);
		
	});
});
</script>
{/literal}

{if $message_success}
<!-- Системное сообщение -->
<div class="message message_success">
	<span>{if $message_success == 'updated'}Комментарий изменен{/if}</span>
	{if $smarty.get.return}
	<a class="button" href="{$smarty.get.return}">Вернуться</a>
	{/if}
</div>
<!-- Системное сообщение (The End)-->
{/if}

<!-- Основная форма -->
<form method="post" id="product" enctype="multipart/form-data">
<input type="hidden" name="session_id" value="{$smarty.session.id}">
	<div id="name">
		<input class="name" name="name" type="text" value="{$comment->name|escape}"/> 
		<input name="id" type="hidden" value="{$comment->id|escape}"/> 
		<input name="type" type="hidden" value="{$comment->type|escape}">
		<input name="email" type="hidden" value="{$comment->email|escape}">
		<input name="object_id" type="hidden" value="{$comment->object_id|escape}">
		<div class="checkbox">
			<input name="approved" value="1" type="checkbox" id="active_checkbox" {if $comment->approved}checked{/if}/> <label for="active_checkbox">Одобрен</label>
		</div>
	</div> 

	<!-- Левая колонка -->
	<div id="column_left">
			
		<!-- Параметры страницы -->
		<div class="block">
			<ul>
				<li><label class="property">E-mail комментируемого</label> {if $comment->email}<a href="{$comment->email|escape}">{$comment->email|escape}</a></li>{else}не указан{/if}
					{if $comment->type == 'product'}
				<li><label class="property">Комментарий к товару</label><a target="_blank" href="{$config->root_url}/products/{$comment->product->url}#comment_{$comment->id}">{$comment->product->name}</a></li>
					{elseif $comment->type == 'blog'}
				<li><label class="property">Комментарий к статье</label><a target="_blank" href="{$config->root_url}/blog/{$comment->post->url}#comment_{$comment->id}">{$comment->post->name}</a></li>
					{/if}

			</ul>
		</div>
	</div>
	<!-- Левая колонка (The End)--> 
	
	<!-- Правая колонка -->	
	<div id="column_right">
		<div class="block">
			<ul>
				<li><label class="property">Дата комментария</label>{$comment->date|date} {$comment->date|time}</li>
				<li><label class="property">IP комментатора</label>{$comment->ip}</li>
			</ul>
		</div>
	</div>
	<!-- Правая колонка (The End)--> 

	<!-- Комментарий -->
	<div class="block layer">
		<h2>Текст комментария</h2>
		<textarea name="text" class="editor_small" style="width:100%; height:100px;">{$comment->text|escape}</textarea>
		</br></br>
		<h2>Ответ администратора</h2> 
		<textarea name="otvet" class="editor_small" style="width:100%; height:100px;">{$comment->otvet|escape}</textarea>
		{if $comment->email}		
			<input type="checkbox" value="1" id="notify_user" name="notify_user">
			<label for="notify_user">Уведомить пользователя об ответе на комментарий</label>
		{/if}
	</div>

	<input class="button_green button_save" type="submit" name="" value="Изменить" />
	
</form>
<!-- Основная форма (The End) -->

Я добавил в код шаблона comment.tpl 

 

<li><label class="property">Комментарий к товару</label><a target="_blank" href="{$config->root_url}/products/{$comment->product->url}#comment_{$comment->id}">{$comment->product->name}</a></li>

                    {elseif $comment->type == 'blog'}

 

А в  CommentAdmin.php добавил код

 

$comment->date = date('Y-m-d', strtotime($this->request->post('date')));

 

Но к сожалению дата сохраняется всегда в таком виде 30.11.-0001

 

Возможно это из за того что в базе у s_comments в значении date стоит s_comments а в s_blog в значении date стоит timestamp. Но даже когда я в таблице s_comments меняю значение date на timestamp, дата в комментарии не сохраняется. Может я что то упускаю?

Ссылка на сообщение
Поделиться на другие сайты

Я в файле comment.tpl заменил 


 



<li><label class="property">Дата комментария</label>{$comment->date|date}

на


 



<label>Дата</label> <input type=text name=date value='{$comment->date|date}'> 

но это не помогло(


Ссылка на сообщение
Поделиться на другие сайты

comment.tpl

 

{* Вкладки *}
{capture name=tabs}
	<li class="active"><a href="index.php?module=CommentsAdmin">Комментарии</a></li>
	{if in_array('feedbacks', $manager->permissions)}<li><a href="index.php?module=FeedbacksAdmin">Обратная связь</a></li>{/if}
{/capture}


{* Title *}
{$meta_title = "Изменение комментария" scope=parent}

{* On document load *}
<script src="design/js/jquery/datepicker/jquery.ui.datepicker-ru.js"></script>

{literal}
<script>
$(function() {

	$('input[name="date"]').datepicker({
		regional:'ru'
	});
	
	// отлавливаем передачу формы и если отмечено уведомление, но ответ пустой - ругаемся!
	$('#product').submit(function(){
		var notify = $('#notify_user').prop("checked");
		var otvet  = $('textarea[name=otvet]').val();
		if (notify && otvet == '') {
			alert ("Укажите ответ на комментарий или отключите уведомление!");
			return false;
		}
	});
	
	// отлавливаем каждое нажатие кнопки клавиатуры и если после этого нажатие ответ остается пустой,
	// мы снимаем отметку уведомление, а если в ответ что-то написали - то ставим уведомление
	$('textarea[name=otvet]').keyup(function(){
		if ($(this).val()=='')
			$('#notify_user').prop("checked",false);
		else
			$('#notify_user').prop("checked",true);
		
	});
});
</script>
{/literal}

{if $message_success}
<!-- Системное сообщение -->
<div class="message message_success">
	<span>{if $message_success == 'updated'}Комментарий изменен{/if}</span>
	{if $smarty.get.return}
	<a class="button" href="{$smarty.get.return}">Вернуться</a>
	{/if}
</div>
<!-- Системное сообщение (The End)-->
{/if}

<!-- Основная форма -->
<form method="post" id="product" enctype="multipart/form-data">
<input type="hidden" name="session_id" value="{$smarty.session.id}">
	<div id="name">
		<input class="name" name="name" type="text" value="{$comment->name|escape}"/> 
		<input name="id" type="hidden" value="{$comment->id|escape}"/> 
		<input name="type" type="hidden" value="{$comment->type|escape}">
		<input name="email" type="hidden" value="{$comment->email|escape}">
		<input name="object_id" type="hidden" value="{$comment->object_id|escape}">
		<div class="checkbox">
			<input name="approved" value="1" type="checkbox" id="active_checkbox" {if $comment->approved}checked{/if}/> <label for="active_checkbox">Одобрен</label>
		</div>
	</div> 

	<!-- Левая колонка -->
	<div id="column_left">
			
		<!-- Параметры страницы -->
		<div class="block">
			<ul>
				<li><label class="property">E-mail комментируемого</label> {if $comment->email}<a href="{$comment->email|escape}">{$comment->email|escape}</a></li>{else}не указан{/if}
					{if $comment->type == 'product'}
				<li><label class="property">Комментарий к товару</label><a target="_blank" href="{$config->root_url}/products/{$comment->product->url}#comment_{$comment->id}">{$comment->product->name}</a></li>
					{elseif $comment->type == 'blog'}
				<li><label class="property">Комментарий к статье</label><a target="_blank" href="{$config->root_url}/blog/{$comment->post->url}#comment_{$comment->id}">{$comment->post->name}</a></li>
					{/if}

			</ul>
		</div>
	</div>
	<!-- Левая колонка (The End)--> 
	
	<!-- Правая колонка -->	
	<div id="column_right">
		<div class="block">
			<ul>
				<li><label class="property">Дата комментария</label><input type=text name=date value='{$comment->date|date}'></li>
				<li><label class="property">Дата комментария</label>{$comment->date|date} {$comment->date|time}</li>
				<li><label class="property">IP комментатора</label>{$comment->ip}</li>
			</ul>
		</div>
	</div>
	<!-- Правая колонка (The End)--> 

	<!-- Комментарий -->
	<div class="block layer">
		<h2>Текст комментария</h2>
		<textarea name="text" class="editor_small" style="width:100%; height:100px;">{$comment->text|escape}</textarea>
		</br></br>
		<h2>Ответ администратора</h2> 
		<textarea name="otvet" class="editor_small" style="width:100%; height:100px;">{$comment->otvet|escape}</textarea>
		{if $comment->email}		
			<input type="checkbox" value="1" id="notify_user" name="notify_user">
			<label for="notify_user">Уведомить пользователя об ответе на комментарий</label>
		{/if}
	</div>

	<input class="button_green button_save" type="submit" name="" value="Изменить" />
	
</form>
<!-- Основная форма (The End) -->

 

 

CommentAdmin.php

<?PHP

require_once('api/Simpla.php');

class CommentAdmin extends Simpla
{
	public function fetch()
	{
		if($this->request->method('POST'))
		{
			$comment->id = $this->request->post('id', 'integer');
			$comment->name = $this->request->post('name');
			$comment->email = $this->request->post('email');
			
			$comment->type = $this->request->post('type');
			$comment->object_id = $this->request->post('object_id');
			$comment->approved = $this->request->post('approved', 'boolean');

			$comment->text = $this->request->post('text');
			$comment->otvet = $this->request->post('otvet');
			
			$comment->date = date('Y-m-d', strtotime($this->request->post('date')));
			$comment->date = date($this->settings->date_format, time());
			
			$is_notify = $this->request->post('notify_user');

  			$comment_id = $this->comments->update_comment($comment->id, $comment);
			if ($comment_id and $is_notify and $comment->email and $comment->otvet)
				$this->notify->email_comment_user($comment_id);
				
  			$comment = $this->comments->get_comment($comment->id);
			$this->design->assign('message_success', 'updated');
		}
		else
		{
			$comment->id = $this->request->get('id', 'integer');
			$comment = $this->comments->get_comment(intval($comment->id));
		}

		// Выбирает объект, который прокомментирован:
		if($comment->type == 'product')
		{
			$products = array();
			$products_ids = array();
			$products_ids[] = $comment->object_id;
			foreach($this->products->get_products(array('id'=>$products_ids)) as $p)
				$products[$p->id] = $p;
			if(isset($products[$comment->object_id]))
				$comment->product = $products[$comment->object_id];
		}

		if($comment->type == 'blog')
		{
			$posts = array();
			$posts_ids = array();
			$posts_ids[] = $comment->object_id;
			foreach($this->blog->get_posts(array('id'=>$posts_ids)) as $p)
				$posts[$p->id] = $p;
			if(isset($posts[$comment->object_id]))
				$comment->post = $posts[$comment->object_id];
		}
 		
		$this->design->assign('comment', $comment);
		
 	  	return $this->design->fetch('comment.tpl');
	}
}
Ссылка на сообщение
Поделиться на другие сайты
			$comment->date = date('Y-m-d', strtotime($this->request->post('date')));
			$comment->date = date($this->settings->date_format, time());

вы перезаписываете дату которую принимаете из страницы текущей.

Ссылка на сообщение
Поделиться на другие сайты

Когда я этот код убираю дата все равно не меняется. Следовательно мне нужна команда на изменение даты, как я понимаю. Но я не знаю как ее описать(

Ссылка на сообщение
Поделиться на другие сайты

У меня кажется получилось. Я просто перенес строчку

 

$comment->date = date('Y-m-d', strtotime($this->request->post('date')));

 ниже в другой if. Вторую соответственно удалил)

 

CommentAdmin.php

 

<?PHP

require_once('api/Simpla.php');

class CommentAdmin extends Simpla
{
	public function fetch()
	{
		if($this->request->method('POST'))
		{
			$comment->id = $this->request->post('id', 'integer');
			$comment->name = $this->request->post('name');
			$comment->email = $this->request->post('email');
			
			$comment->type = $this->request->post('type');
			$comment->object_id = $this->request->post('object_id');
			$comment->approved = $this->request->post('approved', 'boolean');

			$comment->text = $this->request->post('text');
			$comment->otvet = $this->request->post('otvet');
			
			$is_notify = $this->request->post('notify_user');

  			$comment_id = $this->comments->update_comment($comment->id, $comment);
			if ($comment_id and $is_notify and $comment->email and $comment->otvet)
				$this->notify->email_comment_user($comment_id);
				
  			$comment = $this->comments->get_comment($comment->id);
			$this->design->assign('message_success', 'updated');
			
			$comment->date = date('Y-m-d', strtotime($this->request->post('date')));

		}
		else
		{
			$comment->id = $this->request->get('id', 'integer');
			$comment = $this->comments->get_comment(intval($comment->id));
		}

		// Выбирает объект, который прокомментирован:
		if($comment->type == 'product')
		{
			$products = array();
			$products_ids = array();
			$products_ids[] = $comment->object_id;
			foreach($this->products->get_products(array('id'=>$products_ids)) as $p)
				$products[$p->id] = $p;
			if(isset($products[$comment->object_id]))
				$comment->product = $products[$comment->object_id];
		}

		if($comment->type == 'blog')
		{
			$posts = array();
			$posts_ids = array();
			$posts_ids[] = $comment->object_id;
			foreach($this->blog->get_posts(array('id'=>$posts_ids)) as $p)
				$posts[$p->id] = $p;
			if(isset($posts[$comment->object_id]))
				$comment->post = $posts[$comment->object_id];
		}
 		
		$this->design->assign('comment', $comment);
		
 	  	return $this->design->fetch('comment.tpl');
	}
}

Правда в базе теперь время поменялось а на странице вывода комментариев осталось прежним

Ссылка на сообщение
Поделиться на другие сайты

 это вообще не нужно было:

$comment->date = date($this->settings->date_format, time());

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

$comment->date = date('Y-m-d', strtotime($this->request->post('date')));

$comment_id = $this->comments->update_comment($comment->id, $comment);
	if ($comment_id and $is_notify and $comment->email and $comment->otvet)
		$this->notify->email_comment_user($comment_id);
				
$comment = $this->comments->get_comment($comment->id);
$this->design->assign('message_success', 'updated');
Ссылка на сообщение
Поделиться на другие сайты

Наконец разобрался) Помимо всего выше перечисленного нужно еще в api/Comments.php закомментировать ниже указанный код)

 

	// Изменение комментария
	public function update_comment($id, $comment)
	{
		$date_query = '';
		if(isset($comment->date))
		{
		//	$date = $comment->date;
		//	unset($comment->date);
		//	$date_query = $this->db->placehold(', date=STR_TO_DATE(?, ?)', $date, $this->settings->date_format);
		}
		$query = $this->db->placehold("UPDATE __comments SET ?% $date_query WHERE id in(?@) LIMIT 1", $comment, (array)$id);
		$this->db->query($query);
		return $id;

 

Может я и не програмер, но по крайне мере теперь это точно работает))

Ссылка на сообщение
Поделиться на другие сайты

Наконец разобрался) Помимо всего выше перечисленного нужно еще в api/Comments.php закомментировать ниже указанный код)

 

	// Изменение комментария
	public function update_comment($id, $comment)
	{
		$date_query = '';
		if(isset($comment->date))
		{
		//	$date = $comment->date;
		//	unset($comment->date);
		//	$date_query = $this->db->placehold(', date=STR_TO_DATE(?, ?)', $date, $this->settings->date_format);
		}
		$query = $this->db->placehold("UPDATE __comments SET ?% $date_query WHERE id in(?@) LIMIT 1", $comment, (array)$id);
		$this->db->query($query);
		return $id;

 

Может я и не програмер, но по крайне мере теперь это точно работает))

 

Судя по тому, что Вы нашли такое решение, то продемонстрировали хорошие программистские навыки, как минимум на интуитивном уровне.

Для полной красоты можно закомментировать 3 строки до и 1 строку после этого фрагмента, оставив в теле функции лишь 3 последние строки...

Изменено пользователем Kors
Ссылка на сообщение
Поделиться на другие сайты

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

Загрузка...
×
×
  • Создать...