safesql( $_SERVER['REMOTE_ADDR'] );
if( $is_logged ) $log_id = intval( $member_id['user_id'] ); else $log_id = $_IP;
$poll = $db->super_query( "SELECT * FROM " . PREFIX . "_poll where news_id = '{$row['id']}'" );
$log = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_poll_log WHERE news_id = '{$row['id']}' AND member ='{$log_id}'" );
$poll['title'] = stripslashes( $poll['title'] );
$poll['frage'] = stripslashes( $poll['frage'] );
$body = explode( "
", stripslashes( $poll['body'] ) );
$tpl->load_template( 'poll.tpl' );
$tpl->set( '{title}', $poll['title'] );
$tpl->set( '{question}', $poll['frage'] );
$tpl->set( '{votes}', $poll['votes'] );
if( $log['count']) {
$tpl->set_block( "'\\[not-voted\\](.+?)\\[/not-voted\\]'si", "" );
$tpl->set( '[voted]', '' );
$tpl->set( '[/voted]', '' );
} else {
$tpl->set_block( "'\\[voted\\](.+?)\\[/voted\\]'si", "" );
$tpl->set( '[not-voted]', '' );
$tpl->set( '[/not-voted]', '' );
}
$list = "