Can you use allow_duplicates twice in one page? 
Posted: 02 August 2007 02:03 PM   [ Ignore ]
Newbie
Rank
Total Posts:  17
Joined  2006-10-16

Each of my weblog posts has two criteria for rating, both of which use allow_duplicates="no".

When I rate one, then try to rate the other, it tells me I’ve already rated that item. Can this be resolved?

Profile
 
 
Posted: 02 August 2007 02:53 PM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

Not easily, I think. Take a look at lines 1425 and following of mod.rating.php

$prior  $DB->query"SELECT COUNT(*) AS count FROM exp_ratings WHERE rating_author_id != '0' AND entry_id = '$entry_id' AND rating_author_id = '".$SESS->userdata('member_id')."'" );

                        if ( 
$prior->row['count')
                        
{
                                
return $this->_fetch_error$LANG->line('no_duplicates') );
                        
}
                }

The module checks how many submissions there are already from the current author (using sessions management). If there are more than 0, the submission is rejected. You could probably change that value to 1, but that would mean that “regular” double submission would work also (once).

 Signature 

Ingmar Greil

Profile