Changeset 1524167
- Timestamp:
- 10/28/2016 05:04:33 PM (9 years ago)
- Location:
- wp-custom-comments/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wp-custom-comments.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-custom-comments/trunk/readme.txt
r1522633 r1524167 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Замена стандартной формы комментариев WordPress на произвольный HTML-код.10 Replacing the standard WordPress commenting form with custom HTML/JavaScript code. 11 11 12 12 == Description == 13 13 14 С помощью плагина вы легко сможете заменить стандартную форму комментариев **WordPress** на виджет любой из популярных систем комментирования, таких как [**Disqus**](https://disqus.com/) и [**HyperComments**](https://www.hypercomments.com/), либо на виджет комментариев **ВКонтакте**.14 With this plugin you can easily replace the standard **WordPress** commenting form with one of the popular commenting system's widget, such as [**Disqus**](https://disqus.com/) and [**HyperComments**](https://www.hypercomments.com/) or with the **VKontakte** comments widget. 15 15 16 = Работа с плагином=17 * После установки необходимо перейти на страницу настроек плагина в разделе ***Комментарии*** и вставить код виджета комментариев в единственное поле формы, после чего нажать кнопку ***Сохранить изменения***.18 * Чтобы получить код виджета, вы должны будете зарегистрироваться в соответствующей системе комментирования (либо создать простое приложение для **ВКонтакте**).19 * Вы можете добавить к коду виджета произвольную HTML-разметку.20 * Любой произвольный текст и HTML/JavaScript-код будет отображаться вместо стандартной формы комментариев **WordPress**.21 * Просто оставьте поле пустым, чтобы скрыть комментарии на всех страницах сайта.16 = Working with plugin = 17 * After installation you should go to the plugin settings page in the ***Comments*** section and paste the comments widget into a single form field and then click ***Save Changes***. 18 * To get the widget code you will need to register at the appropriate commenting system's website (or create a simple application for **VKontakte**). 19 * You can add to the widget code any custom HTML markup. 20 * Any custom text or HTML/JavaScript code will be displayed instead of the standard **WordPress** comments. 21 * Just leave the field empty to hide the comments on all pages. 22 22 23 23 == Installation == 24 24 25 Установите плагин через установщик **WordPress** либо скопируйте файлы плагина в папку */wp-content/plugins/* сайта, после чего активируйте его через панель управления.25 Install the plugin through the **WordPress** installer or copy the plugin's files into your site's */wp-content/plugins/* folder and then activate it via the control panel. 26 26 27 27 == Changelog == 28 28 29 29 = 1.0 = 30 * Первая версия плагина30 * Initial release -
wp-custom-comments/trunk/wp-custom-comments.php
r1523323 r1524167 4 4 Plugin URI: http://riselab.ru/ 5 5 Text Domain: wp-custom-comments 6 Description: Плагин позволяет заменить стандартную форму комментариев WordPress на произвольный HTML/JavaScript-код, например на виджет одной из популярных систем комментирования (Disqus, HyperComments) либо на виджет комментариев ВКонтакте.6 Description: The plugin allows you to replace the standard WordPress commenting form with custom HTML/JavaScript code, such as one of the popular commenting system's widget (Disqus, HyperComments) or with the VKontakte comments widget. 7 7 Version: 1.0 8 Author: Kei8 Author: Vadim Alekseyenko 9 9 Author URI: http://riselab.ru/ 10 10 */ 11 11 12 12 /** 13 * Абстрактный класс плагина13 * Plugin abstract class 14 14 */ 15 15 class WPCustomComments 16 16 { 17 17 18 // Функция инициализации18 // Init function 19 19 public static function Init() 20 20 { 21 // Загрузка домена плагина21 // Loading plugin's text domain 22 22 add_action('plugins_loaded', Array(get_called_class(), 'LoadTextDomain')); 23 23 24 // Добавление страницы настроек в меню панели администрирования24 // Adding settings page to the administration panel menu 25 25 if (defined('ABSPATH') && is_admin()){ 26 26 add_action('admin_menu', Array(get_called_class(), 'SettingsMenu')); 27 27 } 28 28 29 // Замена стандартного шаблона комментариев29 // Replacing default commenting form 30 30 add_filter('comments_template', Array(get_called_class(), 'GetCommentsTemplate')); 31 31 } 32 32 33 // Функция получения страницы настроек33 // Get settings page content function 34 34 public static function SettingsPage() 35 35 { 36 // Изменение шаблона комментариев при сохранении36 // Changing commenting form template on save 37 37 if (isset($_POST['submit'])){ 38 38 file_put_contents(self::GetCommentsTemplate(), stripslashes($_POST['commentsTemplate'])); 39 39 } 40 // Вывод формы настроек40 // Show settings form 41 41 echo ' 42 42 <div class="wrap"> 43 43 <h1>' . get_admin_page_title() . '</h1> 44 <p> Код для замены стандартной формы комментирования:</p>44 <p>' . __('Enter HTML/JavaScript code to replace the standard WordPress commenting form:', 'wp-custom-comments') . '</p> 45 45 <form action="" method="post"> 46 46 <textarea name="commentsTemplate" style="height: 340px; width: 100%;">' . file_get_contents(self::GetCommentsTemplate()) . '</textarea> … … 53 53 } 54 54 55 // Функция добавления страницы настроек в меню панели администрирования55 // Add settings page to the administration panel menu function 56 56 public static function SettingsMenu() 57 57 { 58 // Проверка прав пользователя58 // Checking permissions 59 59 if (!current_user_can('manage_options')){ 60 60 return; … … 63 63 } 64 64 65 // Функция получения имени файла шаблона комментариев65 // Get comments template file path function 66 66 public static function GetCommentsTemplate() 67 67 { … … 69 69 } 70 70 71 // Функция загрузки домена плагина71 // Load plugin's text domain function 72 72 public static function LoadTextDomain() 73 73 { … … 77 77 } 78 78 79 // Инициализация79 // Plugin initialization 80 80 WPCustomComments::Init();
Note: See TracChangeset
for help on using the changeset viewer.