<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>PokrovBlog &#187; wordpress</title> <atom:link href="http://pokrovskii.com/category/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://pokrovskii.com</link> <description>Веб-дизайн устами фрилансера, глазами дизайнера, и руками верстальщика</description> <lastBuildDate>Wed, 24 Feb 2010 22:00:57 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Wordpress 2.8. У вас не работают некоторые плагины? Фиксим.</title><link>http://pokrovskii.com/wordpress-2-8-u-vas-ne-rabotayut-nekotorye-plaginy-fiksim/</link> <comments>http://pokrovskii.com/wordpress-2-8-u-vas-ne-rabotayut-nekotorye-plaginy-fiksim/#comments</comments> <pubDate>Fri, 18 Dec 2009 09:22:51 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[работа]]></category><guid
isPermaLink="false">http://pokrovskii.com/wordpress-2-8-u-vas-ne-rabotayut-nekotorye-plaginy-fiksim/</guid> <description><![CDATA[У многих перестали корректно работать некоторые плагины. В частности те которые используют JS. То есть пропали всякие рющечки, например голосовалки, контактные формы на ajax.
Сие из-за того, что в wordpress принято грузить скрипты через wp_enqueue_script(). Вот только в wp2.7 они грузились ДО загрузки страницы, а wp2.8 ПОСЛЕ.
Если посмотреть на синтаксис функции то выглядит она вот так
wp_enqueue_script( [...]]]></description> <content:encoded><![CDATA[<p>У многих перестали корректно работать некоторые плагины. В частности те которые используют JS. То есть пропали всякие рющечки, например голосовалки, контактные формы на ajax.</p><p>Сие из-за того, что в wordpress принято грузить скрипты через wp_enqueue_script(). Вот только в wp2.7 они грузились ДО загрузки страницы, а wp2.8 ПОСЛЕ.</p><p>Если посмотреть на синтаксис функции то выглядит она вот так</p><p><tt>wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );</tt></p><p>Фиксится проблема элементарно: просто подставьте <tt>wp_footer()</tt> перед <tt>&lt;/body&gt;</tt></p> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/wordpress-2-8-u-vas-ne-rabotayut-nekotorye-plaginy-fiksim/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Плагин Add code to RSS</title><link>http://pokrovskii.com/plagin-add-code-to-rss/</link> <comments>http://pokrovskii.com/plagin-add-code-to-rss/#comments</comments> <pubDate>Sun, 29 Nov 2009 21:50:48 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://pokrovskii.com/?p=241</guid> <description><![CDATA[Я уже делился (http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/) способом которым можно расширить вашу RSS ленту. Его недостаток заключался в том, что после каждого аптейта необходимо было проделвать процедуру заново. Тогда я написал плагин (спасибо за консультации Владимиру). Заодно и расширил функционал.
Теперь в RSS можно добавить любой текст или php-код. Как до основной ленты, так и после.
Это очень удобно. [...]]]></description> <content:encoded><![CDATA[<p>Я уже делился (<a
href="http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/" title="http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/" >http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/</a>) способом которым можно расширить вашу RSS ленту. Его недостаток заключался в том, что после каждого аптейта необходимо было проделвать процедуру заново. Тогда я написал плагин (спасибо за консультации <a
target="_blank" rel="nofollow" href="http://pokrovskii.com/goto/http://blog.sjinks.pro/" >Владимиру</a>). Заодно и расширил функционал.</p><p>Теперь в RSS можно добавить любой текст или php-код. Как до основной ленты, так и после.</p><p>Это очень удобно. Нет, правда!</p><p>Может картинку в начале ленты?</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">&lt;?php</span><br
/> &nbsp; &nbsp;<span
style="color: #000000; font-weight: bold;">global</span> <span
style="color: #000088;">$post</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #000088;">$big_img</span> <span
style="color: #339933;">=</span> get_post_meta<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$post</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">ID</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'BigImageURL'</span><span
style="color: #339933;">,</span> <span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #000088;">$img</span> <span
style="color: #339933;">=</span> get_post_meta<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$post</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">ID</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'ImageURL'</span><span
style="color: #339933;">,</span> <span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #000088;">$img_title</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$post</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">post_title</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$big_img</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;p&gt;&lt;img src=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$big_img</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; alt=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$img_title</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; title=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$img_title</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; /&gt;&lt;/p&gt;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp;<span
style="color: #b1b100;">else</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;p&gt;&lt;img src=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$img</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; alt=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$img_title</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; title=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$img_title</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; /&gt;&lt;/p&gt;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #009900;">&#125;</span><br
/> <span
style="color: #000000; font-weight: bold;">?&gt;</span></div></div><p>Количество комментариев в конце?</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">&lt;?php</span><br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;div class=&quot;comment&quot;&gt;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;a href=&quot;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp;the_permalink<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&quot;&gt;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;comments_number<span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'post a comment'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'1 comment'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'% comments'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;/a&gt;'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">echo</span> <span
style="color: #0000ff;">'&lt;/div&gt;'</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000000; font-weight: bold;">?&gt;</span></div></div><p>Не, идем дальше: выведем сами комментарии</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp;&lt;ol class=&quot;commentlist&quot;&gt;<br
/> <span
style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_comments<span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span> <span
style="color: #000000; font-weight: bold;">?&gt;</span><br
/> &lt;/ol&gt;</div></div><p>И копирайты напишем.</p><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">p</span>&gt;</span>Без спроса не копировать, а то атата сделаю.<span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">p</span>&gt;</span></div></div><p><a
target="_blank" rel="nofollow" href="http://pokrovskii.com/goto/http://wordpress.org/extend/plugins/add-code-to-rss/" >Скачать Add Code to RSS</a></p> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/plagin-add-code-to-rss/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Wordpress. Как сделать экспорт одной категории</title><link>http://pokrovskii.com/wordpress-kak-sdelat-eksport-odnoj-kategorii/</link> <comments>http://pokrovskii.com/wordpress-kak-sdelat-eksport-odnoj-kategorii/#comments</comments> <pubDate>Sat, 11 Jul 2009 14:28:09 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[blogging]]></category><guid
isPermaLink="false">http://pokrovskii.com/?p=219</guid> <description><![CDATA[Встроенный в Wordpress экспорт ущерблен как Квазимодо после аварии. И так же как и Квазимодо, ущербость эта врожденная, протекает с самого детства, и мы в силу воспитания стараемся не обращать на это внимание. До тех пор пока не приспичит перенести несколько сот записей из одной категории в другую.
Открываем админку нашего сайта, переходим “инструменты –&#62; Экспорт”Чем [...]]]></description> <content:encoded><![CDATA[<p>Встроенный в Wordpress экспорт ущерблен как Квазимодо после аварии. И так же как и Квазимодо, ущербость эта врожденная, протекает с самого детства, и мы в силу воспитания стараемся не обращать на это внимание. До тех пор пока не приспичит перенести несколько сот записей из одной категории в другую.</p><p>Открываем админку нашего сайта, переходим “инструменты –&gt; Экспорт”</p><p><img
style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://pokrovskii.com/wp-content/uploads/image3.png" width="464" height="389" /></p><p>Чем мотивировались разработчики привязывая экспорт к имени, для меня загадка, но и ляд с ним. Будем исправлять.</p><p>Открываем wp-admin/export.php и ищем там вот такие строчки:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span> <span
style="color: #990000;">isset</span><span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$_GET</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'download'</span><span
style="color: #009900;">&#93;</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp;export_wp<span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$_GET</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'author'</span><span
style="color: #009900;">&#93;</span> <span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #990000;">die</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p>Меняем их на:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span> <span
style="color: #990000;">isset</span><span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$_GET</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'download'</span><span
style="color: #009900;">&#93;</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp;export_wp<span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$_GET</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'category'</span><span
style="color: #009900;">&#93;</span> <span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp;<span
style="color: #990000;">die</span><span
style="color: #009900;">&#40;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p>Далее снова ищем&#8230;</p><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">table</span> <span
style="color: #000066;">class</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;form-table&quot;</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">tr</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">th</span>&gt;&lt;<span
style="color: #000000; font-weight: bold;">label</span> <span
style="color: #000066;">for</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;author&quot;</span>&gt;&lt;?php _e<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">'Restrict Author'</span><span
style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">th</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">td</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">select</span> <span
style="color: #000066;">name</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;author&quot;</span> <span
style="color: #000066;">id</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;author&quot;</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">option</span> <span
style="color: #000066;">value</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;all&quot;</span> <span
style="color: #000066;">selected</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;selected&quot;</span>&gt;&lt;?php _e<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">'All Authors'</span><span
style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">option</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;?php</span><br
/> <span
style="color: #009900;">$authors <span
style="color: #66cc66;">=</span> $wpdb-&gt;</span>get_col( &quot;SELECT post_author FROM $wpdb-&gt;posts GROUP BY post_author&quot; );<br
/> foreach ( $authors as $id ) {<br
/> $o = get_userdata( $id );<br
/> echo &quot;<span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">option</span> <span
style="color: #000066;">value</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">'$o-&gt;</span></span>ID'&gt;$o-&gt;display_name<span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">option</span>&gt;</span>&quot;;<br
/> }<br
/> ?&gt;<br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">select</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">td</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">tr</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">table</span>&gt;</span></div></div><p>&#8230; и меняем</p><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">table</span> <span
style="color: #000066;">class</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;form-table&quot;</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">tr</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">th</span>&gt;&lt;<span
style="color: #000000; font-weight: bold;">label</span> <span
style="color: #000066;">for</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;category&quot;</span>&gt;&lt;?php _e<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">'Выберете категорию'</span><span
style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">label</span>&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">th</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">td</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">select</span> <span
style="color: #000066;">name</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;category&quot;</span> <span
style="color: #000066;">id</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;category&quot;</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">option</span> <span
style="color: #000066;">value</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;all&quot;</span> <span
style="color: #000066;">selected</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;selected&quot;</span>&gt;&lt;?php _e<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">'All Categories'</span><span
style="color: #66cc66;">&#41;</span>; ?&gt;&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">option</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;?php</span><br
/> <span
style="color: #009900;">$categories <span
style="color: #66cc66;">=</span> <span
style="color: #66cc66;">&#40;</span>array<span
style="color: #66cc66;">&#41;</span> get_categories<span
style="color: #66cc66;">&#40;</span><span
style="color: #ff0000;">'get=all'</span><span
style="color: #66cc66;">&#41;</span>;</span><br
/> <br
/> <span
style="color: #009900;">foreach <span
style="color: #66cc66;">&#40;</span> $categories as $c <span
style="color: #66cc66;">&#41;</span> <span
style="color: #66cc66;">&#123;</span></span><br
/> <span
style="color: #009900;">echo <span
style="color: #ff0000;">&quot;&lt;option value='$c-&gt;</span></span>term_taxonomy_id'&gt;$c-&gt;cat_name<span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">option</span>&gt;</span>&quot;;<br
/> }<br
/> ?&gt;<br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">select</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">td</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">tr</span>&gt;</span><br
/> <span
style="color: #009900;">&lt;<span
style="color: #66cc66;">/</span><span
style="color: #000000; font-weight: bold;">table</span>&gt;</span></div></div><p>В результате получаем вот такую внушающую оптимизм, но пока еще не функционирающую картинку:</p><p><img
style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://pokrovskii.com/wp-content/uploads/image4.png" width="434" height="514" /></p><p>Продолжаем рыть землю. Открываем …wp-admin/includes/export.php</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">function</span> export_wp<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$author</span><span
style="color: #339933;">=</span><span
style="color: #0000ff;">''</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span></div></div><p>Меняем:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">function</span> export_wp<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$cat</span><span
style="color: #339933;">=</span><span
style="color: #0000ff;">''</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span></div></div><p>Теперь найдем:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$author</span> and <span
style="color: #000088;">$author</span> <span
style="color: #339933;">!=</span> <span
style="color: #0000ff;">'all'</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #000088;">$author_id</span> <span
style="color: #339933;">=</span> <span
style="color: #009900;">&#40;</span>int<span
style="color: #009900;">&#41;</span> <span
style="color: #000088;">$author</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$where</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$wpdb</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">prepare</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">&quot; WHERE post_author = <span
style="color: #009933; font-weight: bold;">%d</span> &quot;</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$author_id</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p>И поменяем:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span> <span
style="color: #000088;">$cat</span> and <span
style="color: #000088;">$cat</span> <span
style="color: #339933;">!=</span> <span
style="color: #0000ff;">'all'</span> <span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #000088;">$cat_id</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$cat</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$ids</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$wpdb</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">get_col</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">&quot;SELECT object_id FROM <span
style="color: #006699; font-weight: bold;">$wpdb-&gt;term_relationships</span> WHERE term_taxonomy_id=<span
style="color: #006699; font-weight: bold;">$cat</span>&quot;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000088;">$where</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$wpdb</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">prepare</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">&quot; WHERE ID IN(&quot;</span><span
style="color: #339933;">.</span><span
style="color: #990000;">join</span><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">','</span><span
style="color: #339933;">,</span><span
style="color: #000088;">$ids</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">&quot;)&quot;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span></div></div><p>На выходе получаем XML файл, который можно импортировать встроенными средствами Wordpress.</p> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/wordpress-kak-sdelat-eksport-odnoj-kategorii/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Как ускорить работу Wordpress</title><link>http://pokrovskii.com/kak-uskorit-rabotu-wordpress/</link> <comments>http://pokrovskii.com/kak-uskorit-rabotu-wordpress/#comments</comments> <pubDate>Mon, 24 Nov 2008 19:09:08 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://pokrovskii.com/?p=173</guid> <description><![CDATA[Собственно материал не мой, я просто наткнулся на проблему корявой работы ядра Wordpress, а один хороший человек &#8211; Владимир Колеснков ее решил. Проблема заключалась в том, что стандартный процесс работы виджетов календаря и архива, нагружает БД настолько серьёзно, что отважные служители серверов хостера бьют панику и отрубают услугу MySql (Вах!).
Вот тут можно найти весьма [...]]]></description> <content:encoded><![CDATA[<p>Собственно материал не мой, я просто наткнулся на проблему корявой работы ядра Wordpress, а один хороший человек &#8211; <a
target="_blank" rel="nofollow" href="http://pokrovskii.com/goto/http://blog.sjinks.org.ua" >Владимир Колеснков</a> ее решил. Проблема заключалась в том, что стандартный процесс работы виджетов календаря и архива, нагружает БД настолько серьёзно, что отважные служители серверов хостера бьют панику и отрубают услугу MySql (Вах!).</p><p>Вот тут можно найти весьма подробное описание проблемы, её решение, примеры кода и ещё много других разноцветных букв &#8211; <a
target="_blank" rel="nofollow" href="http://pokrovskii.com/goto/http://blog.sjinks.org.ua/mysql/381-study-mysql/" >http://blog.sjinks.org.ua/mysql/381-study-mysql/</a></p> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/kak-uskorit-rabotu-wordpress/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Как вывести в rss мета-данные</title><link>http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/</link> <comments>http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/#comments</comments> <pubDate>Mon, 01 Sep 2008 10:33:05 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category><guid
isPermaLink="false">http://pokrovskii.com/?p=124</guid> <description><![CDATA[Приспичело мне на одном проекте сделать так, чтобы выводились в rss картинки, которые прилагались к посту. Исторически сложилось, что ссылка на эту картинку хранится в метаданных.Задача решилась так. Ищем файл <tt>feed-rss2.php</tt>, он лежит в каталоге <tt>wp-include</tt>.
Сие и есть наша структура rss.]]></description> <content:encoded><![CDATA[<p>Приспичело мне на одном проекте сделать так, чтобы выводились в rss картинки, которые прилагались к посту. Исторически сложилось, что ссылка на эту картинку хранится в метаданных.</p><p>Задача решилась так. Ищем файл <tt>feed-rss2.php</tt>, он лежит в каталоге <tt>wp-include</tt>.<br
/> Сие и есть наша структура rss.</p><p>Формируем запрос и загоняем в переменную вывод картинки.</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span
style="color: #339933;">&lt;</span>php <br
/> &nbsp; <span
style="color: #000088;">$query</span> <span
style="color: #339933;">=</span> <span
style="color: #0000ff;">'SELECT * FROM '</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$wpdb</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">postmeta</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">' WHERE post_id = '</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$post</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">ID</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">' AND meta_key LIKE &quot;ImageURL&quot; LIMIT 1'</span><span
style="color: #339933;">;</span><br
/> &nbsp; <span
style="color: #000088;">$image</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$wpdb</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">get_row</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$query</span><span
style="color: #339933;">,</span> OBJECT<span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; <span
style="color: #000088;">$thumb</span> <span
style="color: #339933;">=</span> <span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$image</span> ? <span
style="color: #0000ff;">'&lt;img src=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$image</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">meta_value</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; alt=&quot;'</span><span
style="color: #339933;">.</span><span
style="color: #000088;">$post</span><span
style="color: #339933;">-&gt;</span><span
style="color: #004000;">post_title</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot; /&gt;&lt;br /&gt;'</span> <span
style="color: #339933;">:</span> <span
style="color: #0000ff;">''</span> <span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #000000; font-weight: bold;">?&gt;</span></div></div><p>Мне нужно вывести картинку в акурат над аннотацией. Ищем:</p><div
class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;description<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span><span
style="color: #339933;">&lt;![CDATA[&lt;?php the_excerpt_rss() ?&gt;]]&gt;</span><span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/description<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p>и меняем его на:</p><div
class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;description<span
style="color: #000000; font-weight: bold;">&gt;</span></span>&lt; !<span
style="color: #66cc66;">&#91;</span>CDATA<span
style="color: #66cc66;">&#91;</span><span
style="color: #000000; font-weight: bold;">&lt;?php</span> print $thumb; the_excerpt_rss<span
style="color: #66cc66;">&#40;</span><span
style="color: #66cc66;">&#41;</span> <span
style="color: #000000; font-weight: bold;">?&gt;</span></span>]]&gt;<span
style="color: #009900;"><span
style="color: #000000; font-weight: bold;">&lt;/description<span
style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div><p>Где <tt>$thumb</tt> и есть моя картинка.</p><p>Все. Делов то, да? Таким образом можно выводить любые метаданные.</p> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/kak-vyvesti-v-rss-meta-dannye/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Как сделать upload в комментариях</title><link>http://pokrovskii.com/kak-sdelat-upload-v-kommentariyax/</link> <comments>http://pokrovskii.com/kak-sdelat-upload-v-kommentariyax/#comments</comments> <pubDate>Wed, 21 May 2008 10:26:20 +0000</pubDate> <dc:creator>Максим Покровский</dc:creator> <category><![CDATA[wordpress]]></category> <category><![CDATA[plugin]]></category><guid
isPermaLink="false">http://pokrovskii.com/?p=89</guid> <description><![CDATA[Возникла необходимость сделать возможность добавления файлов пользователями в комментариях. С последующем выводом ссылки в комментарии. Сделал так:]]></description> <content:encoded><![CDATA[<p>Возникла необходимость сделать возможность добавления файлов пользователями в комментариях. С последующем выводом ссылки в комментарии. Сделал так:</p><dl><dt>Добавляем соответствующее поле</dt><dd><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">input</span> <span
style="color: #000066;">type</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;file&quot;</span> <span
style="color: #66cc66;">/</span>&gt;</span></div></div></dd><dt>Исправляем comments.php</dt><dd><p>Меняем</p><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">form</span> <span
style="color: #000066;">action</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;&lt;?php echo get_option('siteurl'); ?&gt;</span></span>/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;</div></div><p>на</p><div
class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #009900;">&lt;<span
style="color: #000000; font-weight: bold;">form</span> <span
style="color: #000066;">action</span><span
style="color: #66cc66;">=</span><span
style="color: #ff0000;">&quot;&lt;?php echo get_option('siteurl'); ?&gt;</span></span>/wp-comments-post.php&quot;<br
/> method=&quot;post&quot; id=&quot;commentform&quot; enctype=&quot;multipart/form-data&quot;&gt;</div></div><p>(т.е. добавить атрибут <tt>enctype="multipart/form-data"</tt> что бы можно было<br
/> закачивать файлы)</dd><dt>3.  Правим файл wp-comments-post.php</dt><dd><p>После</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span> <span
style="color: #0000ff;">''</span> <span
style="color: #339933;">==</span> <span
style="color: #000088;">$comment_content</span> <span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; wp_die<span
style="color: #009900;">&#40;</span> __<span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'Error: please type a comment.'</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span></div></div><p>(ориентировочна 58-60 строки)<br
/> добавить следующее:</p><div
class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #666666; font-style: italic;">/*! comment-upload plugin start<br
/> &nbsp;*<br
/> &nbsp;* Если расширение файла не разрешенно(устанавливается в массиве<br
/> $dissallowed_ext), то к имени файла дописывается &quot;.txt&quot;<br
/> &nbsp;*/</span><br
/> <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #990000;">isset</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$_FILES</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'cu_file'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">==</span><span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$uploaddir</span> <span
style="color: #339933;">=</span> <span
style="color: #0000ff;">'./wp-content/uploads/'</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$fn</span> <span
style="color: #339933;">=</span> <span
style="color: #990000;">basename</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$_FILES</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'cu_file'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'name'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$uploadfile</span> <span
style="color: #339933;">=</span> <span
style="color: #000088;">$uploaddir</span> <span
style="color: #339933;">.</span> <span
style="color: #000088;">$fn</span><span
style="color: #339933;">;</span><br
/> <br
/> &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/*! @todo add test for extension */</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$disallowed_ext</span> <span
style="color: #339933;">=</span> <span
style="color: #990000;">array</span> <span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'exe'</span><span
style="color: #339933;">,</span><span
style="color: #0000ff;">'php'</span><span
style="color: #339933;">,</span><span
style="color: #0000ff;">'php3'</span><span
style="color: #339933;">,</span><span
style="color: #0000ff;">'php4'</span><span
style="color: #339933;">,</span><span
style="color: #0000ff;">'php5'</span><span
style="color: #339933;">,</span><span
style="color: #0000ff;">'phtml'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #000088;">$allow</span> <span
style="color: #339933;">=</span> <span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #990000;">preg_match</span><span
style="color: #009900;">&#40;</span> <span
style="color: #0000ff;">'#\.([a-zA-Z0-9\-_]+)$#'</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$fn</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$match</span> <span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #990000;">count</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$match</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">&gt;</span>0<span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #990000;">isset</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$match</span><span
style="color: #009900;">&#91;</span>1<span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">==</span><span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #990000;">in_array</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$match</span><span
style="color: #009900;">&#91;</span>1<span
style="color: #009900;">&#93;</span><span
style="color: #339933;">,</span><span
style="color: #000088;">$disallowed_ext</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">==</span><span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$uploadfile</span> <span
style="color: #339933;">.=</span> <span
style="color: #0000ff;">&quot;.txt&quot;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$fn</span> <span
style="color: #339933;">.=</span> <span
style="color: #0000ff;">&quot;.txt&quot;</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">//$comment_content .= &quot;файл переименован&quot;;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$allow</span><span
style="color: #339933;">==</span><span
style="color: #009900; font-weight: bold;">true</span><span
style="color: #009900;">&#41;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #b1b100;">if</span> <span
style="color: #009900;">&#40;</span><span
style="color: #990000;">move_uploaded_file</span><span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$_FILES</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'cu_file'</span><span
style="color: #009900;">&#93;</span><span
style="color: #009900;">&#91;</span><span
style="color: #0000ff;">'tmp_name'</span><span
style="color: #009900;">&#93;</span><span
style="color: #339933;">,</span><br
/> <span
style="color: #000088;">$uploadfile</span><span
style="color: #009900;">&#41;</span><span
style="color: #009900;">&#41;</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/* ok */</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #000088;">$comment_content</span> <span
style="color: #339933;">.=</span> <span
style="color: #0000ff;">&quot;&lt;br /&gt;&lt;br /&gt;Загруженный файл: &lt;a<br
/> href=<span
style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span> <span
style="color: #339933;">.</span> get_option<span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'siteurl'</span><span
style="color: #009900;">&#41;</span> <span
style="color: #339933;">.</span> <span
style="color: #0000ff;">&quot;/uploads/&quot;</span> <span
style="color: #339933;">.</span> <span
style="color: #000088;">$fn</span> <span
style="color: #339933;">.</span> <span
style="color: #0000ff;">&quot;<span
style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span> <span
style="color: #339933;">.</span> <span
style="color: #000088;">$fn</span> <span
style="color: #339933;">.</span><br
/> <span
style="color: #0000ff;">&quot;&lt;/a&gt;&lt;br /&gt;&quot;</span> <span
style="color: #666666; font-style: italic;">/*. print_r($match,true)*/</span><span
style="color: #339933;">;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span> <span
style="color: #b1b100;">else</span> <span
style="color: #009900;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #666666; font-style: italic;">/*bad*/</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
style="color: #009900;">&#125;</span><br
/> &nbsp; &nbsp; <br
/> <span
style="color: #009900;">&#125;</span><br
/> <span
style="color: #666666; font-style: italic;">/*! comment-upload plugin end */</span></div></div><p>В <tt>$disallowed_ext = array ('exe','php','php3','php4','php5','phtml');</tt> дописать свои расширение, к которым будет добавляться <tt>.txt</tt> чтоб никто не догадался залить эксплоит <img
src='http://pokrovskii.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br
/> Т.е. если я закачаю <tt>shell.php</tt> он закачается как <tt>shell.php.txt</tt></dd><dd><p>Тому кто это загонит все это в плагин — респект, почет и девствениц в раю.</p></dd></dl> ]]></content:encoded> <wfw:commentRss>http://pokrovskii.com/kak-sdelat-upload-v-kommentariyax/feed/</wfw:commentRss> <slash:comments>20</slash:comments> </item><div
id="sharepage"><div
class="title"><a
rel="nofollow" href="http://pokrovskii.com/goto/http://blog.sjinks.org.ua/php/wordpress/202-onebutton-better-version-of-odnaknopka/">Add to Social Bookmarks</a></div><ul
class="clearfix"><li
id="blink" title="Add to Blink"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;url={url}&amp;title={title}&amp;description={title}">Blink</a></li><li
id="delicious" title="Add to del.ici.ous"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://del.icio.us/post?url={url}&amp;title={title}">del.ici.ous</a></li><li
id="digg" title="Add to Digg"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://digg.com/submit?phase=2&amp;url={url}">Digg</a></li><li
id="furl" title="Add to Furl"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.furl.net/storeIt.jsp?u={url}&amp;t={title}">Furl</a></li><li
id="google" title="Add to Google"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://fusion.google.com/add?feedurl={url}">Google</a></li><li
id="simpy" title="Add to Simpy"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://simpy.com/simpy/LinkAdd.do?href=&amp;title={title}&amp;note={title}&amp;_doneURI={url}&amp;v=6&amp;src=bookmarklet">Simpy</a></li><li
id="spurl" title="Add to Spurl"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.spurl.net/spurl.php?v=3&amp;url={url}&amp;title={title}&amp;blocked={title}">Spurl</a></li><li
id="ymyweb" title="Add to Y! MyWeb"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://myweb2.search.yahoo.com/myresults/bookmarklet?u={url}&amp;t={title}&amp;d=&amp;ei=UTF-8">Y! MyWeb</a></li><li
id="bobrdobr" title="Add to BobrDobr"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://bobrdobr.ru/addext.html?url={url}&amp;title={title}">BobrDobr</a></li><li
id="mrwong" title="Add to Mister Wong"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.mister-wong.ru/index.php?action=addurl&amp;bm_url={url}&amp;bm_description={title}">Mr. Wong</a></li><li
id="yabm" title="Add to Yandex.Bookmarks"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&amp;lurl={url}&amp;lname={title}">Yandex.Bookmarks</a></li><li
id="text20" title="Add to Text 2.0"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://text20.ru/add/?source={url}&amp;title={title}&amp;text={title}">Text 2.0</a></li><li
id="news2" title="Add to News2"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://news2.ru/add_story.php?url={url}">News2</a></li><li
id="addscoop" title="Add to AddScoop"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://myscoop.ru/add/?URL={url}&amp;title={title}">AddScoop</a></li><li
id="ruspace" title="Add to RuSpace"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.ruspace.ru/index.php?link=bookmark&amp;action=bookmarkNew&amp;bm=1&amp;url={url}&amp;title={title}">RuSpace</a></li><li
id="rumarkz" title="Add to RUmarkz"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://rumarkz.ru/bookmarks/?action=add&amp;popup=1&amp;address={url}&amp;title={title}">RUmarkz</a></li><li
id="memori" title="Add to Memori"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://memori.ru/link/?sm=1&amp;u_data[url]={url}&amp;u_data[name]={title}">Memori</a></li><li
id="googlebm" title="Add to Google Bookmarks"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.google.com/bookmarks/mark?op=add&amp;bkmk={url}&amp;title={title}">Google Bookmarks</a></li><li
id="pisali" title="Add to Pisali"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://pisali.ru/load_article/">Pisali</a></li><li
id="smi2" title="Add to SMI 2"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://smi2.ru/add/">SMI 2</a></li><li
id="myplace" title="Add to Moe Mesto"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://moemesto.ru/post.php?url={url}&amp;title={title}">Moe Mesto</a></li><li
id="bm100" title="Add to Sto Zakladok"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.100zakladok.ru/save/?bmurl={url}&amp;bmtitle={title}">100 Zakladok</a></li><li
id="wow" title="Add to Vaau!"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://www.vaau.ru/submit/?action=step2&amp;url={url}">Vaau!</a></li><li
id="technorati" title="Add to Technorati"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://technorati.com/faves?add={url}">Technorati</a></li><li
id="rucity" title="Add to RuCity"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://rucity.com/bookmarks.php?action=add&amp;address={url}&amp;title={title}&amp;description={title}">RuCity</a></li><li
id="linkstore" title="Add to LinkStore"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://linkstore.ru/servlet/LinkStore?a=add&amp;url={url}&amp;title={title}">LinkStore</a></li><li
id="newsland" title="Add to NewsLand"><a
rel="external nofollow" href="http://pokrovskii.com/goto/http://newsland.ru/News/Add/type/news/">NewsLand</a></li></ul></div> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 3/21 queries in 0.305 seconds using disk

Served from: pokrovskii.com @ 2010-07-31 13:32:18 -->