A note on setting up Google Maps automatic embeds.

One of the “automatic embed” features of MyReviewPlugin is the Google Maps embeds on the Setup Embeds page. When you drag the Setup Embeds widget, you’re instructing MyReviewPlugin to integrate a Google Map in to each one of your posts that is set up with appropriate location data.

Google Maps Setup Embeds

Once you’ve done this, you’ll want to set up location data on your posts. If you’ve already created custom fields with location data, you can use them directly or you can go create your own. First the process for creating your own.

When you’re on the edit post page, go to the Custom Fields section (Where is this?) and create a custom field with the name “–Address” and the value being the address you want to associate with your post.

Setting up a custom field.

This field will not, by default display in your custom field tables (despite having the MyReviewPlugin “–” prefix). You can change that behavior, it’s field name, and other settings related to Google Maps on MyRP > Settings > Google Maps.

Now, if you’ve already loaded your site with content (maybe you’re upgrading an existing site) and you have addresses set in a field that isn’t –Address, you can go to MyReviewPlugin > Settings > Google Maps and find the field titled “Address field”. Change that to the field name where your addresses are stored and MyReviewPlugin will go find them as needed!

If you don’t want to use the automatic embeds, we have a shortcode mode available which allows you to flexibly add maps to any post where you like. You’ll find this under the post area, in it, you can enter an address and some dimensions, and it will create the code to add a Google Map right within your post, anywhere you like.

Creating Your Own Star Image in MyReviewPlugin

MyReviewPlugin comes with over 50 great star images… they range from traditional stars, to cartoon stars, to things that aren’t stars at all: hearts, blocks, etc. Lots of different ways of representing ratings.

That said: a lot of users want something more appropriate to their niche. For example, a children’s review site might want to award happy faces or stuffed animals instead of stars; a wine review site, may wish to represent their ratings as glasses of wine; etc. MyReviewPlugin supports this very easily.

To add a new star image, simply upload it to the star image directory, which is located in wp-content/plugins/MyRP/includes/images/stars/ – this directory has a list of all the .png star images that are included with MyReviewPlugin, and in it, you can simply add your own new image.

Your image needs to be in the appropriate format. Specifically, it needs to have 1/3rd the image for each status – on (the state when the star is selected), off (unselected), hover (when the user hovers over the star), they can be any size: MyReviewPlugin will automatically adjust the size of all relevant widgets. We do strongly recommend making sure the size you do decide upon is both square and divisible by 3. Here is an example “source file”:

The default star image:

You’ll note that the image is broken in to three pieces off, on, and hover. The hover is a slightly brighter version of on, and off is the grayed out version.

When you’ve created your file, upload the file to wp-content/plugins/MyRP/includes/images/stars/ (with any unique file name) and it will show up in MyRP > Settings where you pick your star.

Make sure the size is divisible by 3 in both width and height, so sizes (widths, the height of the total file would be the width times 3) like 24, 36, 48, 64 are good choices. If you don’t want your star image to be one of those sizes, you can pad the file with transparent/white space.

If you would like to use “big stars” on some of your widgets, make sure that when you create the file, you also create a bigger version of the file, and upload it to the big/ subdirectory, with the same name. For example, if your filename is mystar.png, upload a bigger version of it to big/big-mystar.png as well. If you do not create a big version, MyReviewPlugin will simply use the small version for all embeds.

When you’ve done all this – your new star image will appear on the MyReviewPlugin > Settings page with all the other star images. Don’t fret that it doesn’t have a preview image like the others do. :-)

Big Google Maps in MyRP 6

This is one of the coolest features of MyReviewPlugin 6 in my opinion, at least for local niche sites (a growing business!). And better yet, its also one of the simplest.

A Google Map with multiple businesses on it.

What does it do? It allows you to render a Google Map with multiple locations on it — either your own list, all posts, or the top posts on your site. The above picture is generated from the top 10 restaurants in New York (according to a randomly generated rating, don’t take this as a recommendation!): when you click on the markers, you see the post title, rating, excerpt and a link to read the user’s reviews — you can customize what it outputs in this widget in the template file1.

You can configure where the map centers in on (allowing users to pan around to find products), how many posts to display on the map, the size, and other details of the map, etc. You can do this right within the UI.

A Google Map with multiple businesses on it.

Or using the new 6.0 API functions3, or the new 6.0 shortcode [myrpbigmap], which has the options post_ids (a comma separated list), width, height, zoom, mapType, center (address the map should start centered at), source and limit. It also has a special option “allposts” which, if set, will cause MyReviewPlugin to render the map from all the posts available on your site (i.e., the ones that are rated and have addresses), still subject to the limit command of course2.

A Google Map with multiple businesses on it.

As usual, if you have any questions, feature suggestions, whatever. Send them via the support system and we’ll make sure you get sorted out as soon as possible. If you run in to any problems, make sure you’re running the latest version from the download recovery page, this is a new feature, undergoing improvements almost every day.

1 The big map marker template file is in MyRP/includes/big_map_template.
2 allposts is obviously only a good idea for sites with a relatively small number of posts. If you have thousands of posts, you should definitely not use allposts without a limit.

3 As always, these are located in api/standard.php and only meant for developers, other users can get by with the shortcodes. They include myrp_api_big_google_map_arrayposts (which takes an array of post IDs for its first parameter) and myrp_api_big_google_map.

MyReviewPlugin on Custom Post Types

As of 6.0, MyReviewPlugin (and SuperChartBoy) fully supports custom post types. We do require that you add your post type to the list of enabled post types to realize the features. Here is a quick discussion on how to do that.

In a minor revision of MyReviewPlugin 5 (about the time they started to become popular among WordPress users), we added support for custom post types to MyReviewPlugin. To define custom post types which you would like to be able to use in MyReviewPlugin, you simply do the following:

  1. Open the file myrp-defines.php (plugins/MyRP/myrp-defines.php)
  2. Find, near the first line of the file the code $myrp_post_types_supported = array("post","page");
  3. Modify this code to contain your custom post type as follows: $myrp_post_types_supported = array("post","page", "your-post-type");
  4. You’re done.

Its likely some users won’t want to mess around with editing files (its a simple change, but if you’re worried or just want some support): that is fine, we can do it for you. Just contact support via the ticket system and we’ll add your desired post type to your installation for you.

It is worth noting that most users who begin using custom post types, probably don’t need to be. It is almost always best to stick with the post post type if they do what you need: it ensures compatibility with older plugins (and more importantly themes), they behave in a predictable manner, etc. Unless you need to display posts and some other taxonomy on your site in some way that cannot easily be done with categories or tags as separators, you should probably stick with just using posts. :)

If you’d like to discuss this, need advice, or want someone to guide you through adding support for other post types, just get in touch. Someone at MyReviewPlugin will help you with anything you need!

Where did the “Custom Fields” option go in WordPress 3.0+?

For some strange reason, the WordPress team made the decision to “simplify” the user interface in 3.0+ by removing the majority of the functionality from the Edit Posts page. This was likely a good design move for those who use WordPress almost exclusively for simple blogging, but for users who are trying to do more managed content approaches to web publishing with WordPress (such as say, review sites), all this missing functionality temporarily appears to be a disaster:

Good news though. It’s not gone. It’s just default hidden. At the top right of your screen, when you’re on the edit posts page, you’ll see two gray dropdown boxes. “Help” and “Screen Options” – if you are like most users, you probably never even noticed they were there. Click “Screen Options” and reenable the fields you want. If you’re looking to use MyRP Custom Field tables (or in the upcoming 6.0: Data Tables) make sure to turn of “Custom Fields”.

Speaking of 6.0, the core work is done (the new charts functionality, on the other hand, is still needing some CSS). I sent out a dozen beta copies last week, and I’m currently in the process of upgrading my own sites to it as a test. There are at least 15 websites running 6.0 at this point, which is a decent test-base. Of course, 6.0 will be a free, easy, one-step (just drop it in and reactivate) upgrade for all 5.0 owners.

Advanced MyRP, how to position the comment embeds.

A fairly common question in the support area is one about the comment form hooks. In MyReviewPlugin, under the Setup Embeds > “Ratings in Comments” menu (and actually, this advice applies to other form hooks such as comment fields) you can instruct MyRP to automatically include the star rating fields (options, for the user of your site to pick) in the comment form.

But here’s the gotcha: in many modern themes, the comment_form hook occurs underneath the <input>┬átag which submits the form. This is why hen you use plugins that add fields to your comments form, you find that they are underneath the “post comment” button: rarely is this what you really want, but this is how many of the most popular themes are designed.

Luckily, there are many ways to fix this:

Option 1: Move the comment_form hook. If you open your theme’s comments.php file (go to Themes > Editor, and select the file on the right labeled comments.php), you will see the code that outputs the comments area. In “modern” style themes, a function called comment_form(…) is called to output the actual form, but in older themes, you’ll find the form, complete with >form< tags, and you’ll find a block that looks like this:

<?php do_action("comment_form"); ?>

This is where your MyRP comment form hooks are going to go, so cut that piece of code, and move it up to above the code that looks something like this:

<input type="submit" ... value="Post Comment" />

This will move the comment fields to be above the Post Comment button (if you want to put them somewhere else, such as above the Name field, or above the comment textarea, feel free to customize!)

Option 2: Hook one of the notes positions instead.

In newer themes, particularly one’s that the above method doesn’t work for, you’ll find code that looks like this (this is excerpted from the included WordPress theme Twenty-Eleven, but it is often already more complicated than this)

<?php comment_form(); ?>

This function is documented on the WordPress website, as taking a parameter in the first spot called $args. In simple terms, what that means is simply that you can tell it how to behave by creating an object that contains a set of parameters. There are two primary locations that you can use to output things in this $args array, one is called comment_notes_before and the other comment_notes_after.

So what we’re going to do, is call a MyReviewPlugin API function (MyReviewPlugin API, or MyRP/api/standard.php in your plugins files) called myrp_api_ratings_form_table. Most MyReviewPlugin API functions take two parameters, one that indicates the post ID (or null to use the current post) you wish to get the data for, and one that indicates whether to RETURN (allow it to be used in other code) or to ECHO (put it on the website right now) the data. In this case, we want to return, because we want to use it in the $args array mentioned above.

The code for this method then looks like (for the “comment_notes_before” option)…


<?php
$args = array("comment_notes_before" => myrp_api_ratings_form_table(null, true));
comment_form($args);
?>

Or, you can switch out comment_notes_before with comment_notes_after to use the other location:


<?php
$args = array("comment_notes_after" => myrp_api_ratings_form_table(null, true));
comment_form($args);
?>

Themes often manipulate their comment_forms to behave differently, so try both locations, see which one works best for you.

When you call API functions, like you are here, you will want to go to MyRP > Setup Embeds > Ratings in Comments in the WordPress administration area to make sure you turn off the automatic embeds. The MyRP online quickdocs have more information about API (manual) vs. automatic embeds.

Option 3: Just call the ratings form directly, with caveats. The third option (which is really a more general case of the above option), is simply to call the API call <?php myrp_api_ratings_form_table(); ?> where-ever you want the form. The caveat here is that it must appear after the <form> tag, but before the closing </form> tag in the comments field. If you can see the form tag in your comments.php, you can simply copy and paste the code anywhere in there.


Solving this problem for plugins that don’t provide an API function may not be as easy — you’ll want to look in to your theme’s functions.php file, to see if there’s somewhere that defines the comments form. If you can find that, you can use option 1 above to move the do_action call.


As always, if you have any trouble with any of that, feel free to submit a support ticket. We will not be able to help you via blog comments, so please do use the support system at tickets.myreviewplugin.com to get assistance!

(RFO) Downtime Information

August 10th, 2011

Downtime Information

If you’re not interested in what happened, just jump down to the paragraph that starts with “Now,” — the rest is a description of the morning catastrophe.

At about 11:30am (EDT) this morning, there was a widespread power outage in the Dallas-Fort Worth area possibly related to high-temperature caused blackouts (it has been over 100┬║ F in Dallas for the last week). It effected hundreds of customers, but most importantly: it effected the datacenter (Colo4) that our web server was located in. We host with KnownHost.com, a reputable high quality web host with thousands of affected customers.

Continue reading