cotonti.com : Slight improvement for poll / vote https://www.cotonti.com Останні повідомлення в темі Cotonti en Sun, 01 Feb 2026 07:16:34 -0000 GHengeveld Ср, 05 Січ 2011 17:20:26 -0000 ToM Ср, 05 Січ 2011 16:58:38 -0000 esclkm Вт, 04 Січ 2011 23:41:49 -0000 ToM
This improve a bit the poll plug-in because sometimes ID or IP is not enough.
Sometimes two different users could have the same IP but you don't want to cut the guests from the vote.
You can set "id then ip" for this case.

1.
-------

EDIT:
(into file) functions.admin.php:

function sed_loadconfigmap()
{
$result[] = array ('polls', '02', 'ip_id_polls', 2, 'ip', array('ip','id','id then ip')); // N-0.0.2

}

2.
------

ADD:
(into file) polls.functions.php (into the function) function sed_poll_vote() and (into the function) function sed_poll_form($id, $formlink='', $skin='', $type=''):


elseif($cfg['ip_id_polls']=='id then ip')
{
if ($usr['id']>0)
{
$sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$id' AND pv_userid='".$usr['id']."' LIMIT 1");
}

else
{
$sql2 = sed_sql_query("SELECT pv_id FROM $db_polls_voters WHERE pv_pollid='$id' AND pv_userip='".$usr['ip']."' LIMIT 1");
}

$alreadyvoted = (sed_sql_numrows($sql2)==1) ? 1 : 0;
}]]>
Вт, 04 Січ 2011 18:06:21 -0000