<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>WordPress &#8250; Support Topic: [Plugin: WP-PostViews Plus] Monitoring Users Post Views</title>
<link>http://wordpress.org/support/</link>
<description>WordPress &#8250; Support Topic: [Plugin: WP-PostViews Plus] Monitoring Users Post Views</description>
<language>en</language>
<pubDate>Thu, 26 Nov 2009 03:56:42 +0000</pubDate>

<item>
<title>adam.sykes on "[Plugin: WP-PostViews Plus] Monitoring Users Post Views"</title>
<link>http://wordpress.org/support/topic/283817#post-1116006</link>
<pubDate>Thu, 25 Jun 2009 11:41:29 +0000</pubDate>
<dc:creator>adam.sykes</dc:creator>
<guid isPermaLink="false">1116006@http://wordpress.org/support/</guid>
<description>&#60;p&#62;If you wish to keep track of the tags which users frequently visit as well as the posts they visit, and on a per user basis. Add the following code after the lines:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$post_views = intval(get_post_meta($post-&#38;gt;ID, &#38;#39;views&#38;#39;, true));
					if( !update_post_meta($post-&#38;gt;ID, &#38;#39;views&#38;#39;, ($post_views+1)) ) {
						add_post_meta($post-&#38;gt;ID, &#38;#39;views&#38;#39;, 1, true);
					}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;in the file postviews_plus.php, the data is stored in the usermeta table with the field name of tagview_ and then the name of your tag.&#60;/p&#62;
&#60;p&#62;CODE TO ADD BELOW&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;//User Tracking Code
					global $user_ID;
					get_currentuserinfo();
					$posttags = get_the_tags();
					if ($posttags) {
						foreach($posttags as $tag) {
							$meta_key = &#38;quot;tagview_&#38;quot; . $tag-&#38;gt;name;
							$tag_views = intval(get_usermeta($user_ID, $meta_key, true));
							echo $tag_views;
							if( !update_usermeta($user_ID, $meta_key, ($tag_views+1)) ) {
								update_usermeta($user_ID, $meta_key, 1);
							}
						}
					}
					//End of User Tracking Code&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;a href=&#34;http://wordpress.org/extend/plugins/wp-postviews-plus/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/wp-postviews-plus/&#60;/a&#62;
&#60;/p&#62;</description>
</item>

</channel>
</rss>
