{"id":200340,"date":"2013-10-31T12:44:03","date_gmt":"2013-10-31T08:44:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=200340"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=200340","title":{"rendered":"<span class=\"post_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0434 Drupal 7<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u0434 Drupal 7. \u041d\u0430\u0447\u0430\u043b \u0440\u044b\u0441\u043a\u0430\u0442\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432, \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e, \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u0434\u0430\u043b\u0430 \u043c\u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0421 \u0433\u043e\u0440\u0435\u043c \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u0441\u043e\u0431\u0440\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0435\u0439 \u0441 \u0412\u0430\u043c\u0438.<\/p>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Drupal, \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0445\u0443\u043a\u043e\u0432 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Drupal. \u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/api.drupal.org\/api\/drupal\">API Drupal<\/a>.<\/p>\n<h4>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p>  \u042f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c RSS \u043b\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u00ab\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0438\u043c\u044f\u00bb \u043c\u043e\u0434\u0443\u043b\u044f. \u041e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438 \u0438\u043c\u0435\u043d\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044f. \u041e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0431\u0443\u043a\u0432\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0438 \u0437\u043d\u0430\u043a &quot;_&quot;. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u00abrss_feeds\u00bb.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443: <i>sites\/all\/modules\/rss_feeds<\/i> (\u0432\u0441\u0435 \u043d\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435). \u0412 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <i>rss_feeds.info<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 META-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0435:<\/p>\n<p>  <i>name = RSS Feeds<br \/>  description = Makes a compact page to navigate on RSS feeds.<br \/>  package = \u00abRSS\u00bb<br \/>  core = 7.x<br \/>  version = \u00ab7.x-1.0\u00bb<br \/>  configure = admin\/config\/content\/rss_feeds<br \/>  files[]= rss_feeds.module<br \/>  <\/i><\/p>\n<ul>\n<li>name \u2014 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435;<\/li>\n<li>description \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c;<\/li>\n<li>package \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439;<\/li>\n<li>core \u2014 \u0432\u0435\u0440\u0441\u0438\u044f Drupal, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f;<\/li>\n<li>version \u2014 \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f;<\/li>\n<li>configure \u2014 \u043f\u0443\u0442\u044c, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0434\u0443\u043b\u044f;<\/li>\n<li>files[] \u2014 \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u0432;<\/li>\n<\/ul>\n<p>  \u0415\u0441\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u044f, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/drupal.org\/node\/542202\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>  \u041d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0411\u0414, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e RSS (\u0435\u0433\u043e \u0438\u043c\u044f, \u0438 URL). \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <i>rss_feeds.install<\/i>:<\/p>\n<pre><code class=\"php\">&lt;?php function rss_feeds_uninstall() { \tcache_clear_all('rss_feeds', 'cache', TRUE); \tdrupal_uninstall_schema('rssfeeds'); \tmenu_rebuild(); }  function rss_feeds_schema() { \t$schema['rssfeeds'] = array( \t\t'fields'      =&gt; array( \t\t\t'id'         =&gt; array('type' =&gt; 'serial', 'not null' =&gt; TRUE), \t\t\t'name'       =&gt; array('type' =&gt; 'varchar', 'length' =&gt; 255, 'not null' =&gt; TRUE), \t\t\t'url'        =&gt; array('type' =&gt; 'varchar', 'length' =&gt; 255, 'not null' =&gt; TRUE), \t\t\t'created_at' =&gt; array('type' =&gt; 'int', 'not null' =&gt; TRUE), \t\t\t'updated_at' =&gt; array('type' =&gt; 'int', 'not null' =&gt; TRUE), \t\t), \t\t'primary key' =&gt; array('id'), \t); } <\/code><\/pre>\n<p>  \u0412 \u0445\u0443\u043a\u0435 <i>schema()<\/i> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0425\u0443\u043a <i>uninstall()<\/i> \u0447\u0438\u0441\u0442\u0438\u0442 \u043a\u044d\u0448, \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u043d\u044e \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f (\u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0442\u0435\u0433 &quot;?&gt;&quot; \u0432 Drupal \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c).<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 .module<\/h4>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0444\u0430\u0439\u043b \u043c\u043e\u0434\u0443\u043b\u044f &#8212;<i> rss_feeds.module<\/i>:<\/p>\n<pre><code class=\"php\">&lt;?php  function rss_feeds_block_info() { \t$blocks['rss_feeds'] = array( \t\t'info'  =&gt; t('RSS Feeds'), \t\t'cache' =&gt; DRUPAL_CACHE_PER_ROLE, \/\/ \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \t);  \treturn $blocks; } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0445\u0443\u043a\u0435 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0431\u043b\u043e\u043a\u0438. \u0423 \u043d\u0430\u0441 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f<i> &#8216;rss_feeds&#8217;<\/i>. <i>&#8216;info&#8217;<\/i> \u2014 \u044d\u0442\u043e \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0431\u043b\u043e\u043a\u0435, \u0430 <i>&#8216;cache&#8217;<\/i> \u2014 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c <a href=\"https:\/\/api.drupal.org\/api\/drupal\/modules!block!block.api.php\/function\/hook_block_info\/7\"><i>hook_block_info()<\/i><\/a>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c <i>hook_menu()<\/i>:<\/p>\n<pre><code class=\"php\">function rss_feeds_menu() {  \t$items = array();  \t$items['admin\/config\/content\/rss_feeds'] = array( \t\t'title'            =&gt; 'RSS Feeds', \t\t'description'      =&gt; 'Configure the RSS feeds list.', \t\t'page callback'    =&gt; 'rss_list', \t\t'access arguments' =&gt; array('administer site configuration'), \t); \t$items['admin\/config\/content\/rss_feeds\/list'] = array( \t\t'title'  =&gt; 'RSS feeds list', \t\t'type'   =&gt; MENU_DEFAULT_LOCAL_TASK, \t\t'weight' =&gt; 1, \t);  \t\/\/ rss add form \t$items['admin\/config\/content\/rss_feeds\/add'] = array( \t\t'title'            =&gt; 'Add rss', \t\t'page callback'    =&gt; 'drupal_get_form', \t\t'page arguments'   =&gt; array('rss_feeds_form'), \t\t'access arguments' =&gt; array('administer site configuration'), \t\t'type'             =&gt; MENU_LOCAL_TASK, \t\t'weight'           =&gt; 2, \t);  \t\/\/ rss edit form \t$items['admin\/config\/content\/rss_feeds\/%rss\/edit'] = array( \t\t'title'            =&gt; 'Edit RSS', \t\t'page callback'    =&gt; 'drupal_get_form', \t\t'page arguments'   =&gt; array('rss_feeds_form', 4), \t\t'access arguments' =&gt; array('administer site configuration'), \t\t'type'             =&gt; MENU_CALLBACK, \t);  \t\/\/ rss delete \t$items['admin\/config\/content\/rss_feeds\/%rss\/delete'] = array( \t\t'title'            =&gt; 'Delete RSS', \t\t'page callback'    =&gt; 'rss_feeds_delete', \t\t'page arguments'   =&gt; array(4), \t\t'access arguments' =&gt; array('administer site configuration'), \t\t'type'             =&gt; MENU_CALLBACK, \t);  \t$items['rss_feeds'] = array( \t\t'title'            =&gt; 'RSS feeds', \t\t'page callback'    =&gt; '_rss_feeds_page', \t\t'access arguments' =&gt; array('access content'), \t);  \t$items['rss_feeds\/%rss\/items'] = array( \t\t'title'            =&gt; 'RSS feed content', \t\t'page callback'    =&gt; 'rss_content', \t\t'page arguments'   =&gt; array(1), \t\t'access callback'  =&gt; TRUE, \t\t'access arguments' =&gt; array('access content'), \t\t'type'             =&gt; MENU_CALLBACK, \t);   \treturn $items; } <\/code><\/pre>\n<p>  \u0412 items \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c URL, \u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a (title), \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 (description), \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (page callback), \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b (page arguments), \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 (access arguments), \u0442\u0438\u043f (type) \u0438 \u00ab\u0432\u0435\u0441\u00bb (weight). \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c <i>page callback<\/i> \u2014 <i>drupal_get_from<\/i>. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0444\u043e\u0440\u043c\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0435\u0435. \u0412 <i>\u00abpage arguments =&gt; array(1)\u00bb<\/i>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c 1-\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 URL (\u043e\u0442\u0441\u0447\u0435\u0442 \u0438\u0434\u0435\u0442 \u043e\u0442 0).<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e <a href=\"https:\/\/api.drupal.org\/api\/drupal\/modules%21system%21system.api.php\/function\/hook_menu\/7\">hook_menu()<\/a>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043e\u043f\u0438\u0448\u0435\u043c \u0444\u043e\u0440\u043c\u0443, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 RSS-\u043b\u0435\u043d\u0442\u044b:<\/p>\n<pre><code class=\"php\">function rss_feeds_form($form, &$form_state, $rss = null) { \t$form['name'] = array( \t\t'#title'         =&gt; t('RSS feed name.'), \t\t'#description'   =&gt; t('Insert RSS shortcut name'), \t\t'#type'          =&gt; 'textfield', \t\t'#default_value' =&gt; $rss ? $rss['name'] : '', \t\t'#required'      =&gt; true, \t);  \t$form['url'] = array( \t\t'#title'         =&gt; t('RSS feed url.'), \t\t'#description'   =&gt; t('Insert RSS url'), \t\t'#type'          =&gt; 'textfield', \t\t'#default_value' =&gt; $rss ? $rss['url'] : '', \t\t'#required'      =&gt; true, \t);  \t$form['submit'] = array( \t\t'#type'  =&gt; 'submit', \t\t'#value' =&gt; $rss ? t('Save') : t('Add'), \t);  \tif ($rss) { \t\t$form['id'] = array( \t\t\t'#type'  =&gt; 'value', \t\t\t'#value' =&gt; $rss['id'], \t\t); \t}  \treturn $form; } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0412\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0435\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>$rss<\/i>, \u0444\u043e\u0440\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u044b \u043d\u043e\u0432\u0443\u044e \u043b\u0435\u043d\u0442\u0443, \u0438\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <i>t()<\/i> (translate), \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c (\u043e\u0431 \u044d\u0442\u043e\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435). \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e <a href=\"https:\/\/api.drupal.org\/api\/drupal\/modules%21node%21node.api.php\/function\/hook_form\/7\"><i>hook_form()<\/i><\/a>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c <i>hook_form_validate()<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443:<\/p>\n<pre><code class=\"php\">function rss_feeds_form_validate($form, &$form_state) { \t$url = $form_state['values']['url'];  \tif (fopen($url, &quot;r&quot;)) { \t\tlibxml_use_internal_errors(true); \t\t$rss_feed = simplexml_load_file($url); \t\tif (empty($rss_feed)) { \t\t\tform_set_error('url', t('URL is invalid!')); \t\t} \t} else { \t\tform_set_error('url', t('URL is invalid!')); \t} } <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 <i>$form_state<\/i>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u2014 \u0432\u044b\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <i>form_set_error()<\/i>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043c\u044f \u043f\u043e\u043b\u044f \u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <i>hook_form_submit()<\/i>:<\/p>\n<pre><code class=\"php\">function rss_feeds_form_submit($form, &$form_state) { \t$rss = array( \t\t'name'       =&gt; $form_state['values']['name'], \t\t'url'        =&gt; $form_state['values']['url'], \t\t'created_at' =&gt; time(), \t\t'updated_at' =&gt; time(), \t);  \t\/\/ save edit data \tif (isset($form_state['values']['id'])) { \t\t$rss['id'] = $form_state['values']['id']; \t\tdrupal_write_record('rssfeeds', $rss, 'id'); \t\tdrupal_set_message(t('RSS Feed saved!')); \t} \/\/ add new data \telse { \t\tdrupal_write_record('rssfeeds', $rss); \t\tdrupal_set_message(t('RSS Feed added!')); \t}  \tdrupal_goto('admin\/config\/content\/rss_feeds'); } <\/code><\/pre>\n<p>  \u0414\u0443\u043c\u0430\u044e \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. <i>drupal_write_record()<\/i> \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0411\u0414, <i>drupal_set_message()<\/i> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, <i>drupal_goto()<\/i> \u043f\u0435\u0440\u0435\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 URL.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e ID \u043b\u0435\u043d\u0442\u044b (<i>$rss<\/i>), \u0430 \u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c<i> hool_load()<\/i>:<\/p>\n<pre><code class=\"php\">function rss_load($id) { \t$rss = db_select('rssfeeds', 'n') \t\t-&gt;fields('n', array('id', 'name', 'url', 'created_at', 'updated_at')) \t\t-&gt;condition('n.id', $id) \t\t-&gt;execute()-&gt;fetchAssoc();  \treturn $rss; } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <i>$rss<\/i> \u0432 \u0444\u043e\u0440\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b RSS \u043b\u0435\u043d\u0442 &#8212;<i> rss_list()<\/i>:<\/p>\n<pre><code class=\"php\">function rss_list() { \t$header = array( \t\tarray('data' =&gt; t('Name')), \t\tarray('data' =&gt; t('URL')), \t\tarray('data' =&gt; t('Actions')) \t); \t$rss = db_select('rssfeeds', 'n') \t\t-&gt;fields('n', array('id', 'name', 'url')) \t\t-&gt;execute()-&gt;fetchAll(); \t$row = array(); \tif ($rss) { \t\tforeach ($rss as $rss_feed) { \t\t\t$actions = array( \t\t\t\tl(t('edit'), 'admin\/config\/content\/rss_feeds\/' . $rss_feed-&gt;id . '\/edit'), \t\t\t\tl(t('delete'), 'admin\/config\/content\/rss_feeds\/' . $rss_feed-&gt;id . '\/delete'), \t\t\t);  \t\t\t$row [] = array( \t\t\t\tarray('data' =&gt; $rss_feed-&gt;name), \t\t\t\tarray('data' =&gt; $rss_feed-&gt;url), \t\t\t\tarray('data' =&gt; implode(' | ', $actions)), \t\t\t); \t\t} \t}  \treturn theme('table', array( \t\t'header' =&gt; $header, \t\t'rows'   =&gt; $row, \t)); } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <i>l()<\/i> (link) \u2014 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0443. \u041d\u043e \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2014 <i><a href=\"https:\/\/api.drupal.org\/api\/drupal\/includes!theme.inc\/function\/theme\/7\">theme()<\/a><\/i>. \u0421 \u043d\u0435\u0439 \u0412\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u0441\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0442.\u043a. \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f \u0438 \u0438\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 <i>rss_feeds_delete()<\/i>: <\/p>\n<pre><code class=\"php\">function rss_feeds_delete($rss) { \t$rss_deleted = db_delete('rssfeeds') \t\t-&gt;condition('id', $rss['id']) \t\t-&gt;execute(); \tdrupal_set_message(t('RSS Feed deleted!')); \tdrupal_goto('admin\/config\/content\/rss_feeds'); } <\/code><\/pre>\n<p>  \u0411\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 (\u0431\u043b\u043e\u043a \u0438\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430). \u0412\u043e\u0442 \u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<pre><code class=\"php\">function rss_contents($display) { \t$query = db_select('rssfeeds', 'n') \t\t-&gt;fields('n', array('id', 'name', 'url')) \t\t-&gt;orderBy('name', 'DESC');  \tif ($display == 'block') { \t\t$query-&gt;range(0, 5); \t}  \treturn $query-&gt;execute(); } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u044b \u0443\u043a\u0430\u0436\u0435\u043c <i>&#8216;block&#8217;<\/i>, \u0442\u043e \u043d\u0430\u043c \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043b\u0438\u0448\u044c 5 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0445\u0443\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043b\u043e\u043a\u0430 \u2014 <a href=\"https:\/\/api.drupal.org\/api\/drupal\/modules!block!block.api.php\/function\/hook_block_view\/7\"><i>hook_block_view()<\/i><\/a>:<\/p>\n<pre><code class=\"php\">function rss_feeds_block_view($delta = '') { \t$blocks = array(); \tswitch ($delta) { \t\tcase 'rss_feeds': \t\t\t$select = db_select('rssfeeds', 'tc'); \t\t\t$select-&gt;addField('tc', 'name'); \t\t\t$select-&gt;addField('tc', 'url');  \t\t\t$entries = $select-&gt;execute()-&gt;fetchAll();  \t\t\t$blocks['subject'] = t('List of URLs'); \t\t\t$blocks['content'] = theme('rssfeeds_block', array('urls' =&gt; $entries)); \t}  \treturn $blocks; } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043b\u0435\u043d\u0442, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442 (\u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435):<\/p>\n<pre><code class=\"php\">function _rss_feeds_page() { \tdrupal_set_title(t('RSS Feeds'));  \t$result = rss_contents('page')-&gt;fetchAll();  \tif (!$result) { \t\t$page_array['rss_feeds_arguments'] = array( \t\t\t'#title'  =&gt; t('RSS Feeds page'), \t\t\t'#markup' =&gt; t('No RSS feeds available'), \t\t);  \t\treturn $page_array; \t} else { \t\t$page_array = theme('rssfeeds_page', array('urls' =&gt; $result));  \t\treturn $page_array; \t} } <\/code><\/pre>\n<p>  \u2026 \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430: <\/p>\n<pre><code class=\"php\">function rss_content($rss) { \t$url = $rss['url'];  \tlibxml_use_internal_errors(true); \t$rss_feed = simplexml_load_file($url); \tif (!empty($rss_feed)) { \t\tdrupal_set_title($rss_feed-&gt;channel-&gt;title); \t\t$page_array = theme('rssfeeds_content', array('items' =&gt; $rss_feed));  \t\treturn $page_array; \t} else { \t\t$page_array['rss_feeds_arguments'] = array( \t\t\t'#title'  =&gt; t('All posts from the last week'), \t\t\t'#markup' =&gt; t('No posts available.'), \t\t);  \t\treturn $page_array; \t} } <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u042f \u0443\u043a\u0430\u0437\u0430\u043b \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>theme()<\/i> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>&#8216;rssfeeds_block&#8217;<\/i> \u0438 <i>&#8216;rssfeeds_content&#8217;<\/i>. \u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u0421\u0434\u0435\u043b\u0430\u0435\u043c <a href=\"https:\/\/api.drupal.org\/api\/drupal\/modules!system!system.api.php\/function\/hook_theme\/7\"><i>hook_theme()<\/i><\/a> \u0434\u043b\u044f \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"php\">function rss_feeds_theme() { \treturn array( \t\t'rssfeeds_block'   =&gt; array( \t\t\t'variables' =&gt; array( \t\t\t\t'urls' =&gt; NULL \t\t\t), \t\t\t'template'  =&gt; 'rssfeeds-block', \t\t), \t\t'rssfeeds_page'    =&gt; array( \t\t\t'variables' =&gt; array( \t\t\t\t'urls' =&gt; NULL \t\t\t), \t\t\t'template'  =&gt; 'rssfeeds-page', \t\t), \t\t'rssfeeds_content' =&gt; array( \t\t\t'variables' =&gt; array( \t\t\t\t'items' =&gt; NULL \t\t\t), \t\t\t'template'  =&gt; 'rssfeeds-content', \t\t) \t); } <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u0435 <i>&#8216;template&#8217;<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e: <i>rssfeeds-block.tpl.php<\/i>, <i>rssfeeds-page.tpl.php<\/i> \u0438 <i>rssfeeds-content.tpl.php<\/i>.<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430: <\/p>\n<pre><code class=\"php\">&lt;div id=&quot;rssfeeds-pager&quot;&gt; \t&lt;?php foreach ($urls as $url): ?&gt; \t\t&lt;span&gt;             &lt;a target=&quot;_blank&quot; href=&quot;http:\/\/&lt;?php echo $url-&gt;url; ?&gt;&quot;&gt;&lt;?php echo $url-&gt;url; ?&gt;&lt;\/a&gt;&lt;br&gt;         &lt;\/span&gt; \t&lt;?php endforeach; ?&gt; &lt;\/div&gt;  <\/code><\/pre>\n<p>  \u2026 \u0432\u0442\u043e\u0440\u043e\u0433\u043e:<\/p>\n<pre><code class=\"php\">&lt;div id=&quot;rssfeeds-pager&quot;&gt; \t&lt;?php foreach ($urls as $url): ?&gt; \t\t&lt;span&gt;             &lt;a target=&quot;_blank&quot; href=&quot;rss_feeds\/&lt;?php echo $url-&gt;id; ?&gt;\/items&quot;&gt;&lt;?php echo $url-&gt;name; ?&gt;&lt;\/a&gt;&lt;br&gt;         &lt;\/span&gt; \t&lt;?php endforeach; ?&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u2026 \u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e:<\/p>\n<pre><code class=\"php\">&lt;?php foreach ($items-&gt;channel-&gt;item as $item): ?&gt; \t&lt;span class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php echo $item-&gt;link; ?&gt;&quot;&gt;&lt;?php echo $item-&gt;title; ?&gt;&lt;\/a&gt;&lt;\/span&gt;&lt;br&gt;&lt;br&gt; \t&lt;?php echo $item-&gt;description; ?&gt;&lt;br&gt;&lt;br&gt;&lt;?php echo $item-&gt;pubDate; ?&gt; \t&lt;hr&gt;&lt;br&gt;&lt;br&gt; &lt;?php endforeach; ?&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e, \u0412\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u2014 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e \u0444\u0430\u0439\u043b CSS \u0441\u0442\u0438\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b .info \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443: <\/p>\n<p>  <i>stylesheets[all][] = main.css<\/i><\/p>\n<p>  \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <i>main.css<\/i>: <\/p>\n<pre><code class=\"css\">.title { \tfont-size: 16px; text-shadow: 0px 0px 1px black; font-weight: bold; }  .title a { \ttext-decoration: none; color: #B81007; }  .title a:hover { \ttext-decoration: underline; } <\/code><\/pre>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u0415\u0441\u043b\u0438 \u0412\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c js-\u0444\u0430\u0439\u043b\u044b \u043a \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b-\u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u043d\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/200340\/\"> http:\/\/habrahabr.ru\/post\/200340\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h4>\n<p>  \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u043f\u043e\u0434 Drupal 7. \u041d\u0430\u0447\u0430\u043b \u0440\u044b\u0441\u043a\u0430\u0442\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432, \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0438\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u043e, \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u0434\u0430\u043b\u0430 \u043c\u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0421 \u0433\u043e\u0440\u0435\u043c \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u0441\u043e\u0431\u0440\u0430\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0435\u0439 \u0441 \u0412\u0430\u043c\u0438.<\/p>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Drupal, \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u0442\u0435\u0445, \u043a\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b \u0445\u0443\u043a\u043e\u0432 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f Drupal. \u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/api.drupal.org\/api\/drupal\">API Drupal<\/a>.<\/p>\n<h4>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/h4>\n<p>  \u042f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c RSS \u043b\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-200340","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200340"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200340\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}