Support Forums

Rating Module v1.7.1 - disabling self rating?

This is a discussion on Rating Module v1.7.1 - disabling self rating? within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Using rating module v1.7.1 and developer v4.1.10 with default theme. Question: during checkout in "step7.tpl" file, or while the ad ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 09-17-2010, 02:33 PM   #1
Customer
 
Join Date: Aug 2008
Posts: 9
Rep Power: 0
John_6x6 is on a distinguished road
Question Rating Module v1.7.1 - disabling self rating?

Using rating module v1.7.1 and developer v4.1.10 with default theme.

Question: during checkout in "step7.tpl" file, or while the ad poster is viewing their own listing, I noticed this module (I think) allows the user to give themselves a rating. How can I disable the logged-in ad poster from rating themselves? I only want guest to be able to rate the listings. Both files call on: {include file="viewlisting.tpl"} - the place the rating module code is added.
Thanks! By the way, other than this, the module works great!
__________________
John_6x6
Version: v4.2 Developer
Template: default
John_6x6 is offline   Reply With Quote
Old 09-17-2010, 04:26 PM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

What? You don't like cheaters?

That's a very interesting catch there. What I would do is modify the listing_rating.tpl file in the module itself and use smarty to hide these lines starting around line 23:
HTML Code:
<tr>
	<td class="formstrip" colspan="3" align="center"><a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a></td>
</tr>
I didn't test this or check to see if the these are the right variables and checks, you'll need to use the smarty debug to verify, but this should get you going in the right direction.
HTML Code:
{if $template ne "step7.tpl" || $smarty.session.username ne $l_UserName}
<tr>
	<td class="formstrip" colspan="3" align="center"><a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a></td>
</tr>
{else}
{/if}
That should prevent the link from showing. The first part of the if will check if they are in checkout and the second part will check their username (if logged in) against the seller's name if they are just viewing the listing.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 09-17-2010, 04:30 PM   #3
Customer
 
Join Date: Aug 2008
Posts: 9
Rep Power: 0
John_6x6 is on a distinguished road
Default

Sweet! I'll give it a shot and report back. Thanks for the quick response.
__________________
John_6x6
Version: v4.2 Developer
Template: default
John_6x6 is offline   Reply With Quote
Old 09-17-2010, 10:36 PM   #4
Customer
 
Join Date: Aug 2008
Posts: 9
Rep Power: 0
John_6x6 is on a distinguished road
Default

Well, not sure how to utilize debug but I did add {debug} to the layout.tpl and activated the module but have no clue what it is showing me. I added your suggested smarty code as shown above but as you said, it may not work. It doesn't. Don't know what to do next. Any ideas?
__________________
John_6x6
Version: v4.2 Developer
Template: default
John_6x6 is offline   Reply With Quote
Old 09-21-2010, 08:07 PM   #5
Customer
 
Join Date: Aug 2008
Posts: 9
Rep Power: 0
John_6x6 is on a distinguished road
Smile

Works like a champ! Thank you so much, Mike. For anyone else needing this, here's the code to insert into the listing_rating.tpl files located within the rating module's template folder - on or about line #23:

HTML Code:
{if $smarty.session.username ne $username}
     <tr>
         <td class="formstrip" colspan="3" align="center"><a href="javascript:writereview()">{$smarty.const.LANG_WRITE_REVIEW}</a></td>
    </tr>
    {/if}
Mike, you're a true professional. Thanks again.
__________________
John_6x6
Version: v4.2 Developer
Template: default
John_6x6 is offline   Reply With Quote
Reply

Tags
module , rating

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
V4.1.x Rating module : Show member rating on listing page damiun Modules / Plugins / Modifications 8 04-30-2010 11:36 AM
Rating Module Eric Barnes Modification Release 1 11-30-2008 07:08 AM
Module - Rating Mod Eric Barnes Modules / Plugins / Modifications 7 08-26-2008 08:31 AM


All times are GMT -4. The time now is 01:54 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0