1 of 2
1
Just purchased - Couple questions and a couple problems
Posted: 16 March 2008 02:02 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Just purchased the rating module and am trying to use it on on a current site I’m developing. I’ve ran into a couple problems and have a couple questions about it as well.

Problems:

1. For some reason, I’m getting some notice messages at the top of an entry which already has received a rating:

Notice: Undefined index: sum_3 in /www/eh6420/public_html/kygolfing/system/modules/rating/mod.rating.php on line 3500

Notice: Undefined index: sum_4 in /www/eh6420/public_html/kygolfing/system/modules/rating/mod.rating.php on line 3500

Here is the entry this is happening on: http://www.kentuckygolfing.com/courses/details/valhalla-golf-club
Here is another entry which has not received a rating yet (no notices): http://www.kentuckygolfing.com/courses/details/kearney-hill-golf-links

EDIT: I got the above error message to go away. I ended up just uninstalling the module and re-installing it. That seemed to fix that.


2. As you can see, at the very top of the entry (next to the Google map) I’m showing the current rating. I’m showing this current rating use the example that was given in the docs:

{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
{stars_overall_avg}
<p>Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
{/exp:rating:stats} 

It works just fine once a rating has been received: http://www.kentuckygolfing.com/courses/details/valhalla-golf-club but if a rating has not been received yet, it shows nothing. I was under the impression that it would show grayed out stars until the first rating was received? What am I doing wrong here?


——————————————————————————————————————-


Questions:

1. I have removed the “return” parameter from the rating form. I’m just using the default “thank you” message with redirect. Is there any way to speed up the redirect? Seems like it took around 5 seconds to finally redirect me back to the entry.

2. On the Modules >> Rating >> Ratings Tab (Manage Entries) it isn’t showing the name and email of the user that left the rating. I’m using just the simple name and email input fields which are outlined in the docs:

<div class="formField">
<
label for="name" class="labelName"><span class="requiredAst">*</spanName:</label><br />
<
input type="text" name="name" size="40" id="name" class="inputField" /> 
</
div>

<
div class="formField">   
<
label for="email" class="labelName"><span class="requiredAst">*</spanEmail Address:</label><br />
<
input type="text" name="email" size="40" id="email" class="inputField" />
</
div

Is there a way to make the name and email show up for the person that left the rating?

3. In the admin notification email, right now I’m just using the default notification email template, which shows the name, email, rating, and date of the most recent rating. What would I need to add so that I can also include a link to the entry that received the rating inside of the admin notification email?

Profile
 
 
Posted: 17 March 2008 06:45 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18
deronsizemore - 16 March 2008 02:02 PM

2. As you can see, at the very top of the entry (next to the Google map) I’m showing the current rating. I’m showing this current rating use the example that was given in the docs:

{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
{stars_overall_avg}
<p>Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
{/exp:rating:stats} 

It works just fine once a rating has been received: http://www.kentuckygolfing.com/courses/details/valhalla-golf-club but if a rating has not been received yet, it shows nothing. I was under the impression that it would show grayed out stars until the first rating was received? What am I doing wrong here?

Give the {if no_results} content {/if} conditional a whirl. smile

deronsizemore - 16 March 2008 02:02 PM

1. I have removed the “return” parameter from the rating form. I’m just using the default “thank you” message with redirect. Is there any way to speed up the redirect? Seems like it took around 5 seconds to finally redirect me back to the entry.

You’ll need to open up mod.rating.php

Around line 2202:

$data = array('title'  => $LANG->line('rating_accepted'),
  
'heading' => $LANG->line('thank_you'),
  
'content' => $this->_prep_message(),
  
'redirect' => $return,
  
'rate'  => 10,
  
'link'  => array($return$LANG->line('return_to_ratings'))
  ); 

And around line 2235:

$data = array('title'  => $LANG->line('success'),
 
'heading' => $LANG->line('success'),
 
'content' => $data['message'],
 
'redirect' => $return,
 
'rate'  => 10,
 
'link'  => array($return$LANG->line('return'))
 ); 

Change the “10“ to however many seconds you want the page to wait until redirecting smile

 

deronsizemore - 16 March 2008 02:02 PM

2. On the Modules >> Rating >> Ratings Tab (Manage Entries) it isn’t showing the name and email of the user that left the rating. I’m using just the simple name and email input fields which are outlined in the docs…

Have these fields been created in the Rating Module CP? wink
CP Home ›  Modules ›  Rating ›  Manage Fields

deronsizemore - 16 March 2008 02:02 PM

3. In the admin notification email, right now I’m just using the default notification email template, which shows the name, email, rating, and date of the most recent rating. What would I need to add so that I can also include a link to the entry that received the rating inside of the admin notification email?

Create a new Template:
CP Home ›  Modules ›  Rating ›  Manage Templates
Then click “Create New Template”

All of your Ratings Module custom fields should be available. As far as including a link to the entry, try {entry_id}, so your template would look like this:

http://www.yoursite.com/template/template/{entry_id}/ 

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 March 2008 07:15 AM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19
Pie Man - 17 March 2008 06:45 AM

Give the {if no_results} content {/if} conditional a whirl. smile

I now have this for my code in the template to show gray stars when there has been no rating:

{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
{if no_results}
{stars_overall_avg}
{
/if}

{stars_overall_avg}
<class="reviewsBasedOn">Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
{/exp:rating:stats} 

Still nothing at http://www.kentuckygolfing.com/courses/details/kearney-hill-golf-links. What am I doing wrong?


————————————————————-

Pie Man - 17 March 2008 06:45 AM

Have these fields been created in the Rating Module CP? wink
CP Home ›  Modules ›  Rating ›  Manage Fields


Well, I tried to create them, but had no such luck doing so. I went in to create “name” and “email” but just got a message saying something to the effect of “these are reserved words… and cannot be used.“


————————————————————-

Pie Man - 17 March 2008 06:45 AM

All of your Ratings Module custom fields should be available. As far as including a link to the entry, try {entry_id}, so your template would look like this:

http://www.yoursite.com/template/template/{entry_id}/ 

Thanks, I’ll give that a shot. I never thought about doing that using {entry_id}. Sometimes the entry_id really throws me for a loop because I have always just called that segment of the URL the “{url_title}“ so referring to it as the {entry_id} confuses me sometimes. wink

Profile
 
 
Posted: 17 March 2008 07:37 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18
deronsizemore - 17 March 2008 07:15 AM
Pie Man - 17 March 2008 06:45 AM

Give the {if no_results} content {/if} conditional a whirl. smile

I now have this for my code in the template to show gray stars when there has been no rating:

{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
{if no_results}
{stars_overall_avg}
{
/if}

{stars_overall_avg}
<class="reviewsBasedOn">Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
{/exp:rating:stats} 

Still nothing at http://www.kentuckygolfing.com/courses/details/kearney-hill-golf-links. What am I doing wrong?

Nothing…. I’m assuming there’s no support for that conditional yet… I’ll add it to the list smile
What if you tried this though:

{if overall_count == "0"} content {/if} 

deronsizemore - 17 March 2008 07:15 AM
Pie Man - 17 March 2008 06:45 AM

Have these fields been created in the Rating Module CP? wink
CP Home ›  Modules ›  Rating ›  Manage Fields

Well, I tried to create them, but had no such luck doing so. I went in to create “name” and “email” but just got a message saying something to the effect of “these are reserved words… and cannot be used.“

Yeah… that’s right too shut eye
I sometimes get these things mixed up from module to module… I apologize for that.
It seems to default to not showing that information in the CP. Strange… I’ll add that to the list as well wink

deronsizemore - 17 March 2008 07:15 AM
Pie Man - 17 March 2008 06:45 AM

All of your Ratings Module custom fields should be available. As far as including a link to the entry, try {entry_id}, so your template would look like this:

http://www.yoursite.com/template/template/{entry_id}/ 

Thanks, I’ll give that a shot. I never thought about doing that using {entry_id}. Sometimes the entry_id really throws me for a loop because I have always just called that segment of the URL the “{url_title}“ so referring to it as the {entry_id} confuses me sometimes. wink

Let me know if the {name} and {email} variables work out for you wink

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 March 2008 10:17 AM   [ Ignore ]   [ # 4 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19
Pie Man - 17 March 2008 07:37 AM

Nothing…. I’m assuming there’s no support for that conditional yet… I’ll add it to the list smile
What if you tried this though:

{if overall_count == "0"} content {/if} 

Nope, still nothing. Surprises me that this isn’t easily done or is a feature built into the module. I would assume it would be a pretty requested feature?

 

Pie Man - 17 March 2008 07:37 AM

Yeah… that’s right too shut eye
I sometimes get these things mixed up from module to module… I apologize for that.
It seems to default to not showing that information in the CP. Strange… I’ll add that to the list as well wink

Thanks, I appreciate that.

Pie Man - 17 March 2008 06:45 AM

All of your Ratings Module custom fields should be available. As far as including a link to the entry, try {entry_id}, so your template would look like this:

http://www.yoursite.com/template/template/{entry_id}/ 

Let me know if the {name} and {email} variables work out for you wink

Nope, didn’t work. My admin template looks like this:

Someone has posted a rating. Here are the details:

Entry Date: {entry_date}

Entry: http://www.kentuckygolfing.com/courses/details/{entry_id}/
Name: {name}
Email: {email}

Everything works with the notification email (name and email variables work fine) but the Entry link does not. In the notification email, it shows up exactly as I have it in the template (http://www.kentuckygolfing.com/courses/details/{entry_id} so it doesn’t actually work or take you anywhere in particular. wink

Profile
 
 
Posted: 17 March 2008 10:22 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18
deronsizemore - 17 March 2008 10:17 AM
Pie Man - 17 March 2008 07:37 AM

Nothing…. I’m assuming there’s no support for that conditional yet… I’ll add it to the list smile
What if you tried this though:

{if overall_count == "0"} content {/if} 

Nope, still nothing. Surprises me that this isn’t easily done or is a feature built into the module. I would assume it would be a pretty requested feature?

Hehe… officially? Surprisingly not… although in my opinion, it should be there wink

deronsizemore - 17 March 2008 10:17 AM

Everything works with the notification email (name and email variables work fine) but the Entry link does not. In the notification email, it shows up exactly as I have it in the template (http://www.kentuckygolfing.com/courses/details/{entry_id} so it doesn’t actually work or take you anywhere in particular. wink

I had a plan ‘B’ in mind then…

Create a custom Rating field, have it gather the Entry ID or URL Title, then output the custom field into that URL (instead of the {entry_id} variable)

That should do it wink

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 March 2008 10:59 AM   [ Ignore ]   [ # 6 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19
Pie Man - 17 March 2008 07:37 AM

Hehe… officially? Surprisingly not… although in my opinion, it should be there wink

I’m glad you think like me! smile

So, in the meantime, can you think of anything at all I can do to duplicate what I’m after? I don’t even have to show gray stars when there is no rating… I could just use a conditional to show the text “no rating yet” or similar if you could think of a conditional that I could use? I’m drawing a blank.

Pie Man - 17 March 2008 07:37 AM

Create a custom Rating field, have it gather the Entry ID or URL Title, then output the custom field into that URL (instead of the {entry_id} variable)

You lost me after “create a custom rating field shut eye

I’m not sure what you mean by “gather the entry ID or URL title then output the custom field into that URL. Would this custom field need to be included into the rating form but hidden?

Profile
 
 
Posted: 17 March 2008 11:08 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18
deronsizemore - 17 March 2008 10:59 AM

So, in the meantime, can you think of anything at all I can do to duplicate what I’m after? I don’t even have to show gray stars when there is no rating… I could just use a conditional to show the text “no rating yet” or similar if you could think of a conditional that I could use? I’m drawing a blank.

I’m an idiot again… that count conditional wont work because there’s no data for it to base itself off of…
I’m afraid I cannot think of any easy workaround for this at the moment…

deronsizemore - 17 March 2008 10:59 AM

I’m not sure what you mean by “gather the entry ID or URL title then output the custom field into that URL. Would this custom field need to be included into the rating form but hidden?

Correct! smile

Create the custom rating field, place as ‘hidden’ in your form, and, if you’re displaying the form on a Single Entry page, then grab that part of the URL by placing {segment_3} as the value. wink

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 March 2008 11:12 AM   [ Ignore ]   [ # 8 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19
Pie Man - 17 March 2008 11:08 AM

I’m afraid I cannot think of any easy workaround for this at the moment…

NNNNNNnnnnnnoooooooooooooooooooo! wink

I’ll make a quick post over at the EE forums to see if anyone has any bright ideas.

Pie Man - 17 March 2008 11:08 AM

Correct! smile

Create the custom rating field, place as ‘hidden’ in your form, and, if you’re displaying the form on a Single Entry page, then grab that part of the URL by placing {segment_3} as the value. wink

Ah, I think that make sense. I’ll giver ‘er a shot.

Thanks

Profile
 
 
Posted: 17 March 2008 02:29 PM   [ Ignore ]   [ # 9 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

Just a follow up here. I posted the question over at the EE forums about showing grayed out stars when no ratings had be left yet and received a similar response to what you had my try initially.

Maybe you have some thoughts? The responder seemed pretty confident that what they gave me would in fact work.

http://expressionengine.com/forums/viewthread/74395/

Profile
 
 
Posted: 17 March 2008 02:33 PM   [ Ignore ]   [ # 10 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3717
Joined  2006-10-18

How is this form being loaded? On a single entry page, or on a list of entries? smile

 Signature 

Check out the new Solspace Blog!

Profile
 
 
Posted: 17 March 2008 02:36 PM   [ Ignore ]   [ # 11 ]
Sr. Member
RankRankRankRank
Total Posts:  161
Joined  2007-02-19

I’m not sure what you mean by loading the form exactly but I’m using all of this on a single entry page…

Here’s my whole template:

{embed="includes/.meta" page_title="Photo Gallery - Kentucky Golfing"}

<body id="courses">

{embed="includes/.header"}

<div id="wrapper">
 <
div id="wrapperInner" class="clearfix">
  <
div id="mainContent" class="clearfix">
  
{exp:weblog:entries weblog="courses" disable="categories|pagination|trackbacks" require_entry="yes"}
  
<h1>{title}</h1>
  
  <
div id="coursesTop" class="clearfix">
   <
div id="ratingFavoriteInfo">
    <
class="strong">Course Rating:</p>
    
{exp:rating:stats entry_id="{entry_id}" theme="default" scale="5"}
    {if overall_count 
== "0" OR overall_count == ""}
    
<img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" /><img src="{base_url}assets/images/design/themes/rating_themes/default/images/star-0.gif" alt="0" border="0" class="rating_star" />
    
{/if}

    {stars_overall_avg}
    
<class="reviewsBasedOn">Based on {overall_count} review{if overall_count !="1"}s{/if}</p>
    
{/exp:rating:stats} 

    
<class="favorites"><a href="#" title="Add to Favorites List" class="favoriteIt">Add to Favorites List</a></p>
   </
div>
   
   <
div id="map" style="height: 125px; width: 400px;"></div>
   
{exp:coollocation:map lat="{courses-lat}" long="{courses-long}" zoom="12"}
  
</div>

  <
h2>Contact Information</h2>
  <
p>{courses-address}</p>
  <
p>{courses-city} KY{courses-zip}</p>
  <
p>Phone{courses-phone}</p>

  <
h2>Course Details</h2>
  <
p>Course Type{courses-type}</p>
  <
p>Holes{courses-holes}</p>
  <
p>Tee Time Policy{courses-adv-tee}</p>
  <
p>Weekend Rate{courses-rates}</p>
  
  <
hr />

  <
h2>Past Reviews</h2>
  <
ul id="reviews">
  
{exp:rating:entries limit="20"}
  
<li>
  <
class="clearfix"><span class="reviewsName"><strong>{rating_name}</strongsaid...</span> <span class="reviewsStars">{stars}{rating}{/stars}</span></p>
  <
class="review">{review}</p>
  <
class="reviewsDate">{rating_date  format="%F %j, %Y"}</span>
  </
li>
  
{/exp:rating:entries}
  
</ul>

  <
hr />

  <
h2>Review this Course</h2>
  
{exp:rating:form entry_id="{entry_id}" form_name="review" require_membership="no" admin_template="admin_template" status="open"}
  
<fieldset>
  <
div class="formField">
  <
label for="name" class="labelName"><span class="requiredAst">*</spanName:</label><br />
  <
input type="text" name="name" size="40" id="name" class="inputField" /> 
  </
div>

  <
div class="formField">   
  <
label for="email" class="labelName"><span class="requiredAst">*</spanEmail Address:</label><br />
  <
input type="text" name="email" size="40" id="email" class="inputField" />
  </
div>

  <
div class="formField">
  <
label for="review">Your Rating:</label><br />
  <
select name="rating">
  <
option value="1">1</option>
  <
option value="2">2</option>
  <
option value="3">3</option>
  <
option value="4">4</option>
  <
option value="5">5</option>
  </
select>
  </
div>
  
  <
div class="formField">
  <
label for="review">Your Review</label><br />
  <
textarea name="review" rows='' cols=''></