Jump to content

Recommended Posts

Posted

@horst, thank you for your quick support! I had already activated the "by user" option. But I didn't integrate the public function in my template, because you didn't have to include it for the other options (with cookie and IP address). But these work.

My attempt to call the public fuction in the template unfortunately fails.

Posted

Hi @astock, ok. I think then something is not working as expected, and I cannot help any further here, as I never used this module. Maybe we can ping @Soma, or we need the help of someone who already used this.

What is the PW version you are using?

  • Thanks 1
Posted
13 hours ago, astock said:

Is there someone who uses Pollinio and the option with registered users?

It's been a while since I did that, but I'm pretty sure it worked. Can you share the relevant code for the poll from your template?

Posted

Hi @BitPoet,

Quote

Can you share the relevant code for the poll from your template?

I have inserted the default call for the poll:

Quote

$content .= $modules->Pollino->renderPoll($page);
echo $content;

 

 

Posted

I'm trying to show users who have voted and who have not yet voted. To do this, I first collect the users who have already voted (certainly not very elegant). After that I try to remove these users from the list of all users. But I get an error message. Have anyone an idea where the fault is?

$datenbank = $this->wire('database');
$sql = "SELECT user_id, vote_id FROM pollino_votes WHERE ".$seitenID."=page_id";
foreach ($datenbank->query($sql) as $row) {
  $teilnehmer = $users->get($row['user_id']);
  $antwort = $pages->get($row['vote_id']);
  echo "<tr>";
    echo "<td>".$teilnehmer->nachname.", ".$teilnehmer->vorname."</td>";
    echo "<td>".$antwort->title."</td>";
  echo "</tr>";
  // This first part works nice!

  foreach ($users->find("start=0") as $nutzer) {
    $nu = $nutzer->nachname.$nutzer->vorname;
    $tn = $teilnehmer->nachname.$teilnehmer->vorname;
    $nu->removeItems($tn);
	echo $nu;
	// Here comes the error message: Uncaught Error: Call to a member function removeItems() on string in ...
  }
}

 

Posted

@astock, you don't have the lists you mention anywhere in your code.

$abgestimmt = [];

foreach ($datenbank->query($sql) as $row) {
  $teilnehmer = $users->get($row['user_id']);
  $antwort = $pages->get($row['vote_id']);
  echo "<tr>";
  echo "<td>".$teilnehmer->nachname.", ".$teilnehmer->vorname."</td>";
  echo "<td>".$antwort->title."</td>";
  echo "</tr>";
  // This first part works nice!

  // And here we fill the list of users who have already voted
  $abgestimmt[] = $teilnehmer;
}

$alleUser = $users->find("start=0");
// Now we remove the users who have voted and iterate
// over the rest
foreach($alleUser->removeItems($abgestimmt) as $nutzer) {
    $nu = $nutzer->nachname.$nutzer->vorname;
    $tn = $teilnehmer->nachname.$teilnehmer->vorname;
	echo $nu;
}

 

  • Like 1
  • Thanks 1
  • 1 year later...
Posted

Hi there.
First of all many thanks for the great module!

We are using it only for logged users and it works like a charm.

Any suggestions on how to send an email after the user vote ? (Maybe the simplyest way, if there's one...)

Could it be an implementation for this module?

Tons of thanks in advance.

 

  • 2 weeks later...
Posted
On 3/17/2021 at 4:01 PM, Cybermano said:

...

Any suggestions on how to send an email after the user vote ? (Maybe the simplyest way, if there's one...)

...

 

Hi all!

In free time, I've played a bit with WireMailSmtp.

Thanks to a lot of tutorials/explanation found on these forum and in the API pages, I find my way and my settings.

For future readers taht maybe could need somthing similar, I've started here, here and here ( tks @ryan, @horst and many other contributors) .

The power of PW always impresses...

Bye!

 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...