poll_votes

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 poll_votes($node)

Callback for the 'votes' tab for polls you can see other votes on

Code

modules/poll/poll.pages.inc, line 30

<?php
function poll_votes($node) {
  drupal_set_title(check_plain($node->title));
  $output = t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.');

  $header[] = array('data' => t('Visitor'), 'field' => 'u.name');
  $header[] = array('data' => t('Vote'), 'field' => 'pv.chorder');

  $result = pager_query("SELECT pv.chorder, pv.uid, pv.hostname, u.name FROM {poll_votes} pv LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d" . tablesort_sql($header), 20, 0, NULL, $node->nid);
  $rows = array();
  while ($vote = db_fetch_object($result)) {
    $rows[] = array(
      $vote->name ? theme('username', $vote) : check_plain($vote->hostname),
      check_plain($node->choice[$vote->chorder]['chtext']));
  }
  $output .= theme('table', $header, $rows);
  $output .= theme('pager', NULL, 20, 0);
  return $output;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen