Модуль Plus1 в drupal - не дает голосовать
Опубликовано admin в Вс, 22/01/2012 - 08:32
После обновления модуля Plus1 до версии 2.7 голосовать за статьи могут только авторы. Чтобы поправить это недоразумение следует заменить
следующий код
'; '; ';elseif (user_access('vote on content')) {
// Is this the user's own content and do we allow them to vote on it?
if ($is_author && variable_get('plus1_vote_on_own', 1)) {
if ($vote_text = variable_get('plus1_vote', 'Vote')) {
// User is eligible to vote.
// The class name provided by Drupal.settings.plus1.vote_class what
// we will search for in our jQuery later.
$output_content .= 'nid",
array('query' => 'token=' . drupal_get_token($node->nid) . '&' . drupal_get_destination()))
. '" method="post">
';
$output_content .= '' . t(filter_xss_admin($vote_text)) . '';
$author_text = variable_get('plus1_author_text', 'Your content');
if ($author_text) {
$output_content .= '
}
$output_content .= '
}
}
}
зы. будьте внимательны - на официальном сайте пропущена с самом низу еще одна закрывающая скобка.
на следующий код.
elseif (user_access('vote on content')) {
// Is this the user's own content and do we allow them to vote on it?
if (!$is_author || ($is_author && variable_get('plus1_vote_on_own', 1))) {
$vote_text = variable_get('plus1_vote', 'Vote');
if ($vote_text) {
// User is eligible to vote.
// The class name provided by Drupal.settings.plus1.vote_class what
// we will search for in our jQuery later.
$output_content .= 'nid",
array('query' => 'token=' . drupal_get_token($node->nid) . '&' . drupal_get_destination()))
. '" method="post">
';
$output_content .= '' . t(filter_xss_admin($vote_text)) . '';
$output_content .= '
}
}
else if($is_author && !variable_get('plus1_vote_on_own', 1)) {
$author_text = variable_get('plus1_author_text', 'Your content');
if ($author_text) {
$output_content .= '
';
}
}
}
И тогда все заработает. Удачи.
- admin's blog
- Добавить комментарий
- 4969 просмотров
- 11919 Votes