Witam w poniższym kodzieto jest sonda) jest najprawdopodobniej kod który wysyła ciasteczka tylko ja się za bardzo nie orientuje w którym miejscu to jest bo potrzebuje to tak zmienić żeby można było głosować raz na dobę czyli musze to ustawić na 24h
<?php
//sondy
SQLvalidate($_GET['id']);
if(!perms_check('polls', 'results'))
{
redirect('index.php?module=error&error=auth_error');
}
$db = new dbquery;
$db->query("SELECT * FROM $conf[prefix]polls_defs ORDER BY id DESC LIMIT 1") or $db->err(__FILE__, __LINE__);
$poll = $db->fetch_object();
if(!$_GET['id'])
$id_ = $poll->id;
else
$id_ = $_GET['id'];
$db->query("SELECT * FROM $conf[prefix]polls_defs WHERE id = $id_") or $db->err(__FILE__, __LINE__);
$poll = $db->fetch_array();
//template dla itemu
$tmp=read_file($theme_path."poll_results_item.php");
$content='';
$db->query("SELECT * FROM $conf[prefix]polls_opts WHERE poll = $id_ ORDER BY top ASC") or $db->err(__FILE__, __LINE__);
while($item = $db->fetch_array())
{
if($poll[votes] == 0)
$perc = 0;
else
$perc = round(((100
*$item['votes'])/$poll['votes']), 0
);
$content .= string_template
($tmp, array("title" => read_text_rest
($item['title_'.$_SESSION['lang_short']]), "bar_width" => ($conf['poll_bar_module_width']+10), "perc" => $perc, "votes" => $item['votes'])); }
//wczytywanie template
$content=string_template
(read_file
($theme_path."poll.php"), array('content' => $content, 'title' => read_text_rest
($poll['title_'.$_SESSION['lang_short']]), 'lang_voted' => $lang['poll_voted'], 'votes' => $poll['votes'], 'id' => $poll['id'], 'lang_comments' => $lang['poll_comments'], 'comments' => $poll['comments'])); //
$db->query("SELECT * FROM $conf[prefix]polls_defs WHERE id < $poll[id] ORDER BY id DESC LIMIT 0,1") or $db->err(__FILE__, __LINE__);
if($db->num_rows() == 0)
$previous = '';
else
{
$prev = $db->fetch_array();
$previous = '<a href="index.php?module=poll&id='.$prev['id'].'"><< '.$lang['poll_previous'].'</a>';
}
$db->query("SELECT * FROM $conf[prefix]polls_defs WHERE id > $poll[id] ORDER BY id ASC LIMIT 0,1") or $db->err(__FILE__, __LINE__);
if($db->num_rows() == 0)
$next = '';
else
{
$n = $db->fetch_array();
$next = '<a href="index.php?module=poll&id='.$n['id'].'">'.$lang['poll_next'].' >></a>';
}
$content=string_template
(read_file
($theme_path."poll_main.php"), array('content' => $content, 'next'=>$next, 'prev'=>$previous));
//generating content of page - start
$description = $lang['poll'];
$content = string_template
(read_file
($theme_path.'middle.php'), array('theme_path' => $theme_path, 'content' => $content, 'description' => $description)); if($_GET['comments'] == 1) {
require_once("includes/functions/comments.php");
$content .= comments('poll', $id_, 'polls_defs');
}
//end
//generating menu_left blocks
$menu_left=menu('left', 'left');
//
//generating menu_right blocks
$menu_right=menu('right', 'right');
//
//gen both - left
//$menu_both_left=menu('left', 'left');
//$menu_both_left.=menu('right', 'left');
//gen both - right
//$menu_both_right=menu('left', 'right');
//$menu_both_right.=menu('right', 'right');
//generating menu_top menu
$menu_top=menu('top', 'top');
//
template
($theme_path.'body.php', array('theme_path' => $theme_path, 'menu_top' => $menu_top, 'menu_left' => $menu_left, 'menu_right' => $menu_right, "menu_left_right"=>$menu_left_right, 'menu_both_right'=>$menu_both_right, 'menu_both_left'=>$menu_both_left, 'content' => $content)); ?>