Closed (fixed)
Project:
Simple Review
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2007 at 01:17 UTC
Updated:
22 Jan 2008 at 01:31 UTC
I'm trying to install the Simple Review module and it says to "
Copy the stub function yourtheme_comment() to your template.php and replace
"yourtheme" with the name of your theme."!!
I'm new to this and don't understand how to do it? Can you possibly help me?
Thanks in advance!
Comments
Comment #1
dvds2sell commentedI'm trying to install the Simple Review module and it says to "
Copy the stub function yourtheme_comment() to your template.php and replace
"yourtheme" with the name of your theme."!!
I'm new to this and don't understand how to do it? Can you possibly help me?
Thanks in advance!
Comment #2
dvds2sell commentedComment #3
rconstantine commentedWhy did you post several identical messages here in this post and here: http://drupal.org/node/192057??? I'm confused why you don't just follow the instructions. The stub function is at the bottom of the module file itself and is labeled as such, and the contents of comment.tpl.php need to be copied to your theme's comment.tpl.php file as well. Actually, you need to make sure that if you have a comment.tpl.php file that all of the elements in the example are included.
If you are going to use Drupal long-term, I would suggest picking up the new book by Matt Westgate Pro Drupal Development and pour over all of the Handbooks here on the site. This is all pretty basic theme stuff that is easily understood with just a little effort. In fact, non-programmers often stick to module configuration and themeing because those topics are easier than writing modules. So I'm sure you can figure this out with the little nudge I gave you. Good luck.
Comment #4
arien101 commentedOk, I had the same problem, but rconstantines comment and some trial & error got me there. Here's a step by step guide:
1. Unzip the module to your module folder
2. Use a text editor (Weaverslave for example) and open the file "simple_review.module" in the simple_review folder
3. Scroll to the bottom
4. Copy this block:
/**
* Theme function override.
*
* Stub function needs to be copied along with comment.tpl.php to your theme.
*
* @ingroup themable
*/
function yourtheme_comment($comment, $links = array()) {
// Remove reply link first
if (isset($links)) {
unset($links['comment_reply']);
}
return _phptemplate_callback('comment', array(
'author' => theme('username', $comment),
'comment' => $comment,
'content' => $comment->comment,
'date' => format_date($comment->timestamp),
'links' => isset($links) ? theme('links', $links) : '',
'new' => $comment->new ? t('new') : '',
'picture' => theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : '',
'submitted' => t('Submitted by !a on @b.',
array('!a' => theme('username', $comment),
'@b' => format_date($comment->timestamp))),
'title' => l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid"),
'rating' => isset($comment->rating) ? theme('fivestar_static', $comment->rating) : ''
));
}
5. Go into the folder of the theme you are using
6. Open the file template.php with the text editor
7. Paste the copied block in at the end of template.php
8. Substitute the yourtheme in "function yourtheme_comment" with the name of your theme (for example: "garland")
9. Copy the comment.tpl.php that comes with simple_review into the folder of your theme
If you load a commented page now you should see the five star rating right within the comment.
Hope it helped.
Comment #5
rconstantine commentedNote that in some cases, other modules may have you create these things and so you'll have to merge all versions of these functions and files so they work together.
Comment #6
sunI also think that these steps are quite basic and are well documented in the README.txt.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.