Review stuff is a plugin that adds a review process to post editing that includes a ranking, link, and spoiler warning. It was written with movies in mind, but was purposely kept vague enough to be used for pretty much anything.
| Administration panel |
|
|---|---|
| An example post |
|
If you have questions, comments, suggestions, etc... please feel free to contact me at dennis@hengeveld.com. If you are using it and enjoying it please let me know.
Download the plug in and ftp it to the Wordpress plugins directory (usually wp-content/plugins). Activate the plugin in the plugins section of the administration area in WordPress. Once activated you should see new fields in your post editing admin pages. To display the information in your blog posts, you will need to edit your WordPress templates.
There are two post specific functions at your disposal. You can use these at the post level in your templates. If you do not know how to edit templates you can find out how in the docs section of wordpress.org.
This function displays a paragraph containing review information. If you are, or will be using the spoiler checkbox you should put this function above the post texts so that folks will see the notice before reading.
This function returns an array of review information if review information exists. The array consists of variables "link", "rate", and "isspoiler".
... <?php rs_display_review(); ?> <div class="entry"> <?php the_content() ?> </div> ...
<?php
$rs = rs_get_review_array();
IF ($rs['link']) {
echo 'Find out more at <a href="'.$rs['link'].'">'.$rs['link'].'</a>';
}
?>
To use this, look for the line with the_content() that looks something like:
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
And replace it with the following code:
<?php
$rs = rs_get_review_array();
IF ($rs['isspoiler']=='true') {
echo '<div id="spoiler_warning" style="color:red; margin: 10px 0;">
WARNING, SPOILER TEXT!
<a href="javascript:void(0)" onclick="document.getElementById(\'entry-'.$post->ID.'\').style.display=\'block\'; document.getElementById(\'spoiler_warning\').style.display=\'none\'">Click here to view</a>
</div>';
}
?>
<div class="entry" id="entry-<?= $post->ID; ?>" <?php IF ($rs['isspoiler']=='true') { echo ' style="display:none;" '; } ?> >
<?php the_content('Read the rest of this entry »'); ?>
</div>