<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Ultimate Web Development (CSS, HTML, jQuery, WordPress) - Dimox.net</title>
	
	<link>http://dimox.net</link>
	<description>CSS, HTML, jQuery, WordPress</description>
	<lastBuildDate>Fri, 04 May 2012 13:26:44 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Dimox_net" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="dimox_net" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>WordPress Top Authors List Without a Plugin</title>
		<link>http://dimox.net/wordpress-top-authors-list-without-a-plugin/</link>
		<comments>http://dimox.net/wordpress-top-authors-list-without-a-plugin/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:50:11 +0000</pubDate>
		<dc:creator>Dimox</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://dimox.net/?p=29</guid>
		<description><![CDATA[WordPress engine allows to create sites with big number of users of different levels. And authors, which have corresponding right, can fill the site content. On such a multi-user sites will be useful to have a list with top authors.

In this post I will show you one of the ways how to display <strong>list of the top authors without using a plugin</strong>.]]></description>
			<content:encoded><![CDATA[<p>WordPress engine allows to create sites with big number of users of different levels. And authors, which have corresponding right, can fill the site content. On such a multi-user sites will be useful to have a list with top authors.</p>
<p>In this post I will show you one of the ways how to display <strong>list of the top authors without using a plugin</strong>.</p>
<p>You can use the following small function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> top_authors<span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$uc</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$blogusers</span> <span style="color: #339933;">=</span> get_users<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$blogusers</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$blogusers</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$bloguser</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$post_count</span> <span style="color: #339933;">=</span> count_user_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$bloguser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$uc</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$bloguser</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post_count</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">arsort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$uc</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$number</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> get_userdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$author_posts_url</span> <span style="color: #339933;">=</span> get_author_posts_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$post_count</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_count</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$author_posts_url</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">display_name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt; ('</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$post_count</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">')&lt;/li&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Paste this function in the <strong>functions.php</strong> file of your theme and then put the following code in a place of your theme, where you want to see the top authors list:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'top_authors_list'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> top_authors_list<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>10 here is the number of authors you want to show in the list.</p>
<p>That&#8217;s all.</p>
<p>As a result you will see the list of top authors with their names and number of published posts. Author&#8217;s name is linked to his archive page where is a list of all his posts.</p>
<p>List of top authors is sorted by number of posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://dimox.net/wordpress-top-authors-list-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress Comments Pagination Without a Plugin</title>
		<link>http://dimox.net/wordpress-comments-pagination-without-a-plugin/</link>
		<comments>http://dimox.net/wordpress-comments-pagination-without-a-plugin/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 14:21:50 +0000</pubDate>
		<dc:creator>Dimox</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://dimox.net/?p=27</guid>
		<description><![CDATA[There is a possibility to create a <strong>pagination in WordPress comments without using any plugins</strong>. WordPress has a built-in function <code>paginate_comments_links()</code> for this, which is appeared in WordPress 2.7.

It works on the basis of the function for a <a href="http://dimox.net/wordpress-pagination-without-a-plugin-wp-pagenavi-alternative/">pagination on archive pages</a> (as you know, it also may work without a plugin), therefore very similar to it.]]></description>
			<content:encoded><![CDATA[<p>There is a possibility to create a <strong>pagination in WordPress comments without using any plugins</strong>. WordPress has a built-in function <code>paginate_comments_links()</code> for this, which is appeared in WordPress 2.7.</p>
<p>It works on the basis of the function for a <a href="http://dimox.net/wordpress-pagination-without-a-plugin-wp-pagenavi-alternative/">pagination on archive pages</a> (as you know, it also may work without a plugin), therefore very similar to it.</p>
<p>Code of the function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wp_comments_corenavi<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$max</span> <span style="color: #339933;">=</span> get_comment_pages_count<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cpage'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$page</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'echo'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//1 - display the text &quot;Page N of N&quot;, 0 - not display</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mid_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//how many links to show on the left and right of the current</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'end_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//how many links to show in the beginning and end</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prev_text'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&amp;laquo; Previous'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//text of the &quot;Previous page&quot; link</span>
   <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'next_text'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Next &amp;raquo;'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//text of the &quot;Next page&quot; link</span>
&nbsp;
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;commentNavigation&quot;&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span class=&quot;pages&quot;&gt;Page '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' of '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$max</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">.</span> paginate_comments_links<span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>You need to paste this code the <strong>functions.php</strong> file of your theme. As you see the function also contains just five options.</p>
<p>To show the comments pagination on your site, paste the following code in <strong>comments.php</strong> of your theme near the <code>wp_list_comments()</code> function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_comments_corenavi'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> wp_comments_corenavi<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></pre></div></div>

<p>HTML code of the function will looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;commentNavigation&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pages&quot;</span>&gt;</span>Page 7 of 14<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;prev page-numbers&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://site.name/post/comment-page-6/#comments&quot;</span>&gt;</span><span style="color: #ddbb00;">&amp;laquo;</span> Previous<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-1/#comments'</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page-numbers dots&quot;</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-4/#comments'</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-5/#comments'</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-6/#comments'</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers current'</span>&gt;</span>7<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-8/#comments'</span>&gt;</span>8<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-9/#comments'</span>&gt;</span>9<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-10/#comments'</span>&gt;</span>10<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;page-numbers dots&quot;</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/post/comment-page-14/#comments'</span>&gt;</span>14<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;next page-numbers&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://site.name/post/comment-page-8/#comments&quot;</span>&gt;</span>Next <span style="color: #ddbb00;">&amp;raquo;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>And you can use a CSS classes for styling this navigation. That&#8217;s it.</p>
<p>One more thing. Don&#8217;t forget to activate the option &#8220;<strong>Break comments into pages</strong>&#8221; in WordPress admin area.</p>
]]></content:encoded>
			<wfw:commentRss>http://dimox.net/wordpress-comments-pagination-without-a-plugin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress Pagination Without a Plugin (WP-PageNavi alternative)</title>
		<link>http://dimox.net/wordpress-pagination-without-a-plugin-wp-pagenavi-alternative/</link>
		<comments>http://dimox.net/wordpress-pagination-without-a-plugin-wp-pagenavi-alternative/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 11:00:54 +0000</pubDate>
		<dc:creator>Dimox</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://dimox.net/?p=23</guid>
		<description><![CDATA[Almost every blogger, who maintains a blog on WordPress, familiar with the WP-PageNavi plugin, which displays the pagination like on the image above.

But not everyone knows (including me until recently), what <strong>WordPress has a built-in function (starting from version 2.1) which implements virtually the same functional</strong>. And compared with the WP-PageNavi plugin this function very small in size.]]></description>
			<content:encoded><![CDATA[<p>Almost every blogger, who maintains a blog on WordPress, familiar with the WP-PageNavi plugin, which displays the pagination like on the image above.</p>
<p>But not everyone knows (including me until recently), what <strong>WordPress has a built-in function (starting from version 2.1) which implements virtually the same functional</strong>. And compared with the WP-PageNavi plugin this function very small in size.</p>
<p>Here&#8217;s what this function looks like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wp_corenavi<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$max</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">max_num_pages</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$current</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'paged'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$current</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'base'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">999999999</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%#%'</span><span style="color: #339933;">,</span> get_pagenum_link<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">999999999</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'total'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$max</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'current'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$current</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//1 - display the text &quot;Page N of N&quot;, 0 - not display</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'mid_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//how many links to show on the left and right of the current</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'end_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//how many links to show in the beginning and end</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prev_text'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&amp;laquo; Previous'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//text of the &quot;Previous page&quot; link</span>
  <span style="color: #000088;">$a</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'next_text'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Next &amp;raquo;'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//text of the &quot;Next page&quot; link</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;navigation&quot;&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;span class=&quot;pages&quot;&gt;Page '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$current</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' of '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$max</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$pages</span> <span style="color: #339933;">.</span> paginate_links<span style="color: #009900;">&#40;</span><span style="color: #000088;">$a</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$max</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This code must be placed in the <strong>functions.php</strong> file of your template. The function have just five options, they are separated by line breaks.</p>
<p>To show the navigation, paste the following code in your template:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_corenavi'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> wp_corenavi<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></pre></div></div>

<p>As a result the HTML code will looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;navigation&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;pages&quot;</span>&gt;</span>Page 7 of 27<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'prev page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/6/'</span>&gt;</span><span style="color: #ddbb00;">&amp;laquo;</span> Previous<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/1/'</span>&gt;</span>1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers dots'</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/4/'</span>&gt;</span>4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/5/'</span>&gt;</span>5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/6/'</span>&gt;</span>6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers current'</span>&gt;</span>7<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/8/'</span>&gt;</span>8<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/9/'</span>&gt;</span>9<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/10/'</span>&gt;</span>10<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers dots'</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/27/'</span>&gt;</span>27<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'next page-numbers'</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'http://site.name/page/8/'</span>&gt;</span>Next <span style="color: #ddbb00;">&amp;raquo;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>As you can see it contains all the necessary classes to stylize navigation with CSS (the current page, dots, links to previous and next page).</p>
<p>I&#8217;ve tested this function on WordPress 2.3.3 and 3.1 and also tested variants with active and inactive permalinks. Everything works as expected. I think it will work also in a new versions of WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://dimox.net/wordpress-pagination-without-a-plugin-wp-pagenavi-alternative/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
		<item>
		<title>WordPress Trick: Detecting the Comment Authors, Subscribed to the Comments</title>
		<link>http://dimox.net/wordpress-trick-detecting-the-comment-authors-subscribed-to-the-comments/</link>
		<comments>http://dimox.net/wordpress-trick-detecting-the-comment-authors-subscribed-to-the-comments/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 12:46:32 +0000</pubDate>
		<dc:creator>Dimox</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://dimox.net/?p=22</guid>
		<description><![CDATA[If you are the owner of at least one site on WordPress, it is quite possible that you're already familiar with such popular plugin like <a href="http://wordpress.org/extend/plugins/subscribe-to-comments/" target="_blank">Subscribe To Comments</a>, which makes it possible to monitor new comments by email.

This plugin contains one interesting function, which may add a little bit of informativity for your site. It allows you <strong>to mark the commentators of your site who subscribed to comments</strong>.]]></description>
			<content:encoded><![CDATA[<p>If you are the owner of at least one site on WordPress, it is quite possible that you&#8217;re already familiar with such popular plugin like <a href="http://wordpress.org/extend/plugins/subscribe-to-comments/" target="_blank">Subscribe To Comments</a>, which makes it possible to monitor new comments by email.</p>
<p>This plugin contains one interesting function, which may add a little bit of informativity for your site. It allows you <strong>to mark the commentators of your site who subscribed to comments</strong>.</p>
<p>The function looks as follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_subscription_status'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>comment_subscription_status<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Image or text, speaking about subscription.'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>On this blog it looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_subscription_status'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>comment_subscription_status<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;subscribed&quot; title=&quot;Subscribed to comments via email&quot;&gt;@&lt;/div&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>I.e. I&#8217;m adding the symbol <code>@</code> with the tooltip. You can see live example in a comments of this blog.</p>
<p><strong>You need to paste the function in the comment template</strong>, for example near the comment author name.</p>
<p>I found in this thing a couple of goodies:</p>
<ul>
<li><strong>Firstly</strong>, it gives me to understand, will see my comment or not the person to whom it is addressed. For example, I often observe the following situation. Some comment was added to my new post and I have responded to him, but later turns out that the addressee did not see it, because he was not subscribed on new comments. It looks as though I wrote to nowhere and spent my time in vain.</li>
<li><strong>Secondly</strong>, this is one of ways for detecting spam. For example, someone asked a question on the post with an obvious answer and did now subscribed to comments. If at the same time he left under his nickname a link to a questionable site, a high probability that he is spammer.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dimox.net/wordpress-trick-detecting-the-comment-authors-subscribed-to-the-comments/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Say “Welcome back!” to Commentators on WordPress Using jQuery</title>
		<link>http://dimox.net/say-welcome-back-to-commentators-on-wordpress-using-jquery/</link>
		<comments>http://dimox.net/say-welcome-back-to-commentators-on-wordpress-using-jquery/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 11:53:18 +0000</pubDate>
		<dc:creator>Dimox</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[comment form]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://dimox.net/?p=21</guid>
		<description><![CDATA[I wrote a small jQuery script, which aims to improve the convenience of commenting on WordPress site, and I want to share it with you.

The essence of the script is as follows: it shows a welcome message for regular commentators.]]></description>
			<content:encoded><![CDATA[<p>I wrote a small jQuery script, which aims to improve the convenience of commenting on WordPress site, and I want to share it with you.</p>
<p>The essence of the script is as follows: it shows a welcome message for regular commentators.</p>
<h3>How it works</h3>
<p>It&#8217;s very simple. Script checks whether the required fields <code>Name/E-mail</code> are filled and performs the following:</p>
<ul>
<li>If a visitor of your blog at least once left a comment, next time he will see a &#8220;<strong>Welcome back, %username%!</strong>&#8221; message at the comment form.</li>
<li>The <code>Name/E-mail/URL</code> fields will hide, there will be only comment field.</li>
<li>Commentator can change his data by clicking on &#8220;Edit&#8221; link.</li>
<li>If visitor has disabled JavaScript in his browser, he will see the full comment form.</li>
</ul>
<p>For working the script it&#8217;s necessary to satisfy the two conditions:</p>
<ol>
<li>Cookies must work in visitor&#8217;s browser.</li>
<li>WordPress must remember a previously entered data in comment form.</li>
</ol>
<p>Always be sure that the second condition is satisfied, otherwise there will no sense in connecting the script. I know what some WordPress plugins can prevent to output entered data in the comment form.</p>
<h3>Examples</h3>
<ol>
<li>If you at least once left a comment on this blog, you will see &#8220;Welcome back&#8221; message near the comment form.</li>
<li>Also you can see an example on a separate page:</li>
</ol>
<div class="download">
<div class="dl">
<div class="demo"><a href="http://dimox.net/demo/welcome-back-commentator.html">View Demo</a></div>
<div class="leftFold"></div>
</div>
</div>
<h3>How to use it</h3>
<ol>
<li>
<p>Find in the <code>comments.php</code> file of your theme the code of a name, e-mail and URL fields and wrap them into the <code>&lt;div id="authorData">&lt;/div></code> container.</p>
<p>I&#8217;ll show an example with default WordPress theme.</p>
<p>Before:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</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> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;1&quot; <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;aria-required='true'&quot;</span>; ?&gt;</span> /&gt;
<span style="color: #009900;">&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;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Name <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;(required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author_email); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;2&quot; <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;aria-required='true'&quot;</span>; ?&gt;</span> /&gt;
<span style="color: #009900;">&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;email&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Mail (will not be published) <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;(required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author_url); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
<span style="color: #009900;">&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;url&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span></pre></div></div>

<p>After:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;authorData&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</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> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;1&quot; <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;aria-required='true'&quot;</span>; ?&gt;</span> /&gt;
  <span style="color: #009900;">&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;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Name <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;(required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author_email); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;2&quot; <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;aria-required='true'&quot;</span>; ?&gt;</span> /&gt;
  <span style="color: #009900;">&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;email&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Mail (will not be published) <span style="color: #009900;">&lt;?php if <span style="color: #66cc66;">&#40;</span>$req<span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">&quot;(required)&quot;</span>; ?&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span>
&nbsp;
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;&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;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;?php echo esc_attr($comment_author_url); ?&gt;</span></span>&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
  <span style="color: #009900;">&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;url&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">small</span>&gt;</span>Website<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">small</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;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

</li>
<li>
<p>Connect the following jQuery script to your site (and also don&#8217;t forget to connect the jQuery framework, if it still isn&#8217;t connected):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">var</span> author <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#author'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> author <span style="color: #339933;">!=</span><span style="color: #3366CC;">''</span> <span style="color: #339933;">&amp;&amp;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#email'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span><span style="color: #3366CC;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#authorData'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#authorData'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;welcome&quot;&gt;Welcome back, &lt;strong&gt;'</span> <span style="color: #339933;">+</span> author <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/strong&gt;! &lt;a href=&quot;#&quot;&gt;Edit &amp;raquo;&lt;/a&gt;&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#welcome a'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span>
      <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#authorData'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Minimize &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
      <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#authorData'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Edit &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span></pre></div></div>

</li>
<li>That&#8217;s all.</li>
</ol>
<p>I think the commentators of you site will appreciate this feature ;0)</p>
]]></content:encoded>
			<wfw:commentRss>http://dimox.net/say-welcome-back-to-commentators-on-wordpress-using-jquery/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

