Wordpress plugins
Recently Viewed Posts

Recently Viewed Posts

Version : 2.1.0.1
Tested up to : 2.9.2
Number of download : 4162
Author : Pinoy.ca
Average rating : 0 / 5 on 0 votes 0 votes, 0 avg.rating

Screenshots

Recently Viewed Posts
Recently Viewed Posts
Recently Viewed Posts
Recently Viewed Posts

Display the titles of the last x number of posts that readers visited on your blog, and the amount of time elapsed since they visited it, in a variety of forms: return them as a string of list items. print a ul list with a h3 heading and enclosed as a div. as a WordPress widget. Rationale Readers are curious what other readers have found interesting to read. That’s why RVP is very addictive. Put it on your site where readers can see it and watch your traffic increase. Features Insanely fast. It has to be because it needs to run on each page load. Creates and uses no tables, writes no files, uses no cookies, loads no css or javascript, needs no plugin initialization. Produces XHTML-compliant, semantic markup. Each IP is identified by and anonymized with a graphical 10×10 icon using Gravatar. Can be modified to record and display the posts’ publication date, referer data, search keywords or cookies. Whatever you want or what your Privacy Policy allows. Comprehensive API to let you do everything you want without touching the plugin source code. Technobabbly features IP addresses are hashed before being stored, so nobody can get them from your database backups. Hashing uses your blog’s SECRET_KEY where available, to protect against rainbow tables. Uses $_SERVER['HTTP_CLIENT_IP'] or $_SERVER['HTTP_X_FORWARDED_FOR'] instead of $_SERVER['REMOTE_ADDR'] where available. Uses the WordPress Object Cache. If the posts’ data were already retrieved earlier, this plugin will use that instead of querying the database. If you list more than 5 items, the plugin retrieves the posts’ data in one wp_query, instead of individually. Uses the WordPress 2.8 Transients API where available. Usage get_recently_viewed_posts( $max_shown = 10 ) returns a string of li’s. recently_viewed_posts( $max_shown = 10 ) prints a div Configure the widget inside your Widget Admin screen Sample markup <div class="recently-viewed-posts"><h3 class="recently-viewed-posts-header">What others are reading right now</h3><div class="recently-viewed-posts-list"><ul class="recently-viewed-posts-list"> <li class="recently-viewed-posts-item"><img src="https://secure.gravatar.com/avatar/1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E.jpg?s=10&amp;d=identicon" alt=" " width="10" height="10" f />&nbsp;<a href="http://www.blog.com/foobar-post/" class="recently-viewed-posts-link">Title of Post</a> <span class="recently-viewed-posts-timespan">3 seconds ago</span></li> <li class="recently-viewed-posts-item"><img src="https://secure.gravatar.com/avatar/1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E1A2B3C4D5E.jpg?s=10&amp;d=identicon" alt=" " width="10" height="10" class="recently-viewed-posts-icon" />&nbsp;<a href="http://www.blog.com/foobar-page/" class="recently-viewed-posts-link">Name of Page</a> <span class="recently-viewed-posts-timespan">2 minutes, 15 seconds ago</span></li> </ul></div></div> Demo http://www.pinoy.ca/eharmony/1616 shows two versions of it in action. API Here is the complete set of filters and hooks, so you never have to need to edit the plugin. How’s that for service? recently_viewed_posts_cache_set Filter applied to the data saved to the RVP cache before it is saved. Possible use: Saving the data to file or to a database. recently_viewed_posts_cache_get Filter applied to the value retrieved from the RVP cache before it is used. Possible use: Retrieving the data from file or from a database. recently_viewed_posts_uninstall_pre Action run before uninstallation. recently_viewed_posts_new Filter applied to the visit’s data before processing. For more information, see the code snippet below. $item = array( $post->ID, recently_viewed_posts_get_remote_IP(), time() ); $item = apply_filters( "recently_viewed_posts_new", $item ); if ( empty( $item ) ) return; array_unshift( $recently_viewed_posts, $item ); Possible use: Saving whatever you like about the visit. recently_viewed_posts_entry_format Filter applied to the display format of each entry. For more information, see the code snippet below. $subject = '<li class="recently-viewed-posts-item"><img src="%ICON%" alt=" " width="10" height="10" class="recently-viewed-posts-icon" />&nbsp;<a href="%URL%" class="recently-viewed-posts-link">%LINK%</a> <span class="recently-viewed-posts-timespan">%TIME% ago</span></li>'; $subject = apply_filters( "recently_viewed_posts_entry_format", $subject, $item ); Possible uses: Rewrite the HTML markup of the plugin to whatever you like. Process what you saved with recently_viewed_posts_new. Display additional information about the visit. recently_viewed_posts_entry Filter applied to each visit entry before it is compiled as a list. Possible uses: same as recently_viewed_posts_entry_format get_recently_viewed_posts Filter applied to the output of the get_recently_viewed_posts function. Possible uses: same as recently_viewed_posts_entry_format recently_viewed_posts_time_since Filter applied to the text indicating the time duration. Possible use: Displaying additional information other than time. recently_viewed_posts_get_remote_IP Filter applied to the visit’s IP address after it has been anonymized and before it is used by the plugin. Possible use: Use another way of identifying visitors, such as cookies, Flash cookies, ISPs, etc.

Download now