Report #25: Poll Block
This commit is contained in:
@@ -163,8 +163,14 @@ $lang = array_merge($lang, array(
|
||||
'POSTS_PER_TOPIC_OTHER' => 'Beiträge pro Thema: <strong>%d</strong>',
|
||||
'POSTS_PER_TOPIC_ZERO' => 'Beiträge pro Thema: <strong>0</strong>',
|
||||
|
||||
// other
|
||||
// Poll
|
||||
'POLL' => 'Umfrage',
|
||||
'LATEST_POLLS' => 'Latest Polls',
|
||||
'NO_OPTIONS' => 'This poll has no available options.',
|
||||
'NO_POLL' => 'No polls available',
|
||||
'RETURN_PORTAL' => '%sReturn to the portal%s',
|
||||
|
||||
// other
|
||||
'CLOCK' => 'Uhr',
|
||||
'SPONSOR' => 'Sponsoren',
|
||||
'PORTAL_COPY' => '<a href="http://www.board3.de" title="board3.de">board3 Portal</a> - based on <a href="http://www.phpbb3portal.com" title="phpBB3 Portal">phpBB3 Portal</a>',
|
||||
|
||||
@@ -157,8 +157,12 @@ $lang = array_merge($lang, array(
|
||||
'ACP_PORTAL_POLLS_SETTINGS_EXPLAIN' => 'Hier kannst du die Einstellungen für Umfragen ändern.',
|
||||
'PORTAL_POLL_TOPIC' => 'Umfragen Block anzeigen',
|
||||
'PORTAL_POLL_TOPIC_EXPLAIN' => 'Diesen Block auf dem Portal anzeigen.',
|
||||
'PORTAL_POLL_TOPIC_ID' => 'Umfragen Topic ID',
|
||||
'PORTAL_POLL_TOPIC_ID_EXPLAIN' => 'Die Nummer des Themas, aus dem die Umfrage angezeigt werden soll. Nur eine Topic ID / Umfrage möglich.',
|
||||
'PORTAL_POLL_TOPIC_ID' => 'Poll forum id(s)',
|
||||
'PORTAL_POLL_TOPIC_ID_EXPLAIN' => 'The id(s) of the forums from which the polls should be displayed. Use a comma to separate multiple forums, or leave blank to use all available forums.',
|
||||
'PORTAL_POLL_LIMIT' => 'Poll display limit',
|
||||
'PORTAL_POLL_LIMIT_EXPLAIN' => 'The number of polls you would like to display on the portal page.',
|
||||
'PORTAL_POLL_ALLOW_VOTE' => 'Allow voting',
|
||||
'PORTAL_POLL_ALLOW_VOTE_EXPLAIN' => 'Allow users with the required permissions to vote from the portal page.',
|
||||
|
||||
// most poster
|
||||
'ACP_PORTAL_MOST_POSTER_INFO' => 'Vielschreiber',
|
||||
|
||||
@@ -189,7 +189,9 @@ class acp_portal
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_PORTAL_POLLS_SETTINGS',
|
||||
'portal_poll_topic' => array('lang' => 'PORTAL_POLL_TOPIC' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'portal_poll_topic_id' => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
|
||||
'portal_poll_topic_id' => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'text:10:200', 'explain' => true),
|
||||
'portal_poll_limit' => array('lang' => 'PORTAL_POLL_LIMIT' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||
'portal_poll_allow_vote' => array('lang' => 'PORTAL_POLL_ALLOW_VOTE' , 'validate' => 'ibool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -170,8 +170,14 @@ $lang = array_merge($lang, array(
|
||||
'POSTS_PER_TOPIC_OTHER' => 'Posts per topic: <strong>%d</strong>',
|
||||
'POSTS_PER_TOPIC_ZERO' => 'Posts per topic: <strong>0</strong>',
|
||||
|
||||
// Poll
|
||||
'POLL' => 'Poll',
|
||||
'LATEST_POLLS' => 'Latest Polls',
|
||||
'NO_OPTIONS' => 'This poll has no available options.',
|
||||
'NO_POLL' => 'No polls available',
|
||||
'RETURN_PORTAL' => '%sReturn to the portal%s',
|
||||
|
||||
// other
|
||||
'POLL' => 'Poll',
|
||||
'CLOCK' => 'Clock',
|
||||
'SPONSOR' => 'Sponsors',
|
||||
|
||||
|
||||
@@ -159,8 +159,12 @@ $lang = array_merge($lang, array(
|
||||
'ACP_PORTAL_POLLS_SETTINGS_EXPLAIN' => 'Here you can change your poll information and certain specific options.',
|
||||
'PORTAL_POLL_TOPIC' => 'Display poll blocks',
|
||||
'PORTAL_POLL_TOPIC_EXPLAIN' => 'Display this block on portal.',
|
||||
'PORTAL_POLL_TOPIC_ID' => 'Poll topic id',
|
||||
'PORTAL_POLL_TOPIC_ID_EXPLAIN' => 'The id of the topic from wich the poll should be displayed. Only one ID number / poll is possible.',
|
||||
'PORTAL_POLL_TOPIC_ID' => 'Poll forum id(s)',
|
||||
'PORTAL_POLL_TOPIC_ID_EXPLAIN' => 'The id(s) of the forums from which the polls should be displayed. Use a comma to separate multiple forums, or leave blank to use all available forums.',
|
||||
'PORTAL_POLL_LIMIT' => 'Poll display limit',
|
||||
'PORTAL_POLL_LIMIT_EXPLAIN' => 'The number of polls you would like to display on the portal page.',
|
||||
'PORTAL_POLL_ALLOW_VOTE' => 'Allow voting',
|
||||
'PORTAL_POLL_ALLOW_VOTE_EXPLAIN' => 'Allow users with the required permissions to vote from the portal page.',
|
||||
|
||||
// most poster
|
||||
'ACP_PORTAL_MOST_POSTER_INFO' => 'Most poster',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
/*
|
||||
*
|
||||
* @package - Board3portal
|
||||
* @version $Id$
|
||||
@@ -8,203 +7,36 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('IN_PORTAL'))
|
||||
{
|
||||
exit;
|
||||
die('Hacking attempt');
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
|
||||
// Initial var setup
|
||||
$forum_id = request_var('f', 0);
|
||||
$topic_id = request_var('t', ((!empty($portal_config['portal_poll_topic_id'])) ? $portal_config['portal_poll_topic_id'] : 0));
|
||||
$topic_id = preg_replace('/[^0-9]/', '', $topic_id); // just a temporary solution to get rid of sql errors
|
||||
$post_id = request_var('p', 0);
|
||||
$voted_id = request_var('vote_id', array('' => 0));
|
||||
$user->add_lang('viewtopic');
|
||||
|
||||
$start = request_var('start', 0);
|
||||
$view = request_var('view', '');
|
||||
$view = request_var('view', '');
|
||||
$update = request_var('update', false);
|
||||
$poll_view = request_var('polls', '');
|
||||
|
||||
$sort_days = request_var('st', ((!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0));
|
||||
$sort_key = request_var('sk', ((!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'));
|
||||
$sort_dir = request_var('sd', ((!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'));
|
||||
$poll_view_ar = ( strpos(urldecode($poll_view), ',') !== FALSE ) ? explode(',', urldecode($poll_view)) : (($poll_view != '') ? array($poll_view) : array());
|
||||
|
||||
$update = request_var('update', false);
|
||||
|
||||
// Do we have a topic or post id?
|
||||
if (!$topic_id && !$post_id)
|
||||
if ($update && $portal_config['portal_poll_allow_vote'])
|
||||
{
|
||||
// trigger_error('NO_TOPIC');
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
|
||||
// Find topic id if user requested a newer or older topic
|
||||
if ($view && !$post_id)
|
||||
{
|
||||
if (!$forum_id)
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . TOPICS_TABLE . "
|
||||
WHERE topic_id = $topic_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$forum_id = (int) $db->sql_fetchfield('forum_id');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$forum_id)
|
||||
{
|
||||
trigger_error('NO_TOPIC');
|
||||
}
|
||||
}
|
||||
|
||||
// Check for global announcement correctness?
|
||||
if ((!isset($row) || !$row['forum_id']) && !$forum_id)
|
||||
{
|
||||
//trigger_error('NO_TOPIC');
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
else if (isset($row) && $row['forum_id'])
|
||||
{
|
||||
$forum_id = $row['forum_id'];
|
||||
}
|
||||
}
|
||||
|
||||
// This rather complex gaggle of code handles querying for topics but
|
||||
// also allows for direct linking to a post (and the calculation of which
|
||||
// page the post is on and the correct display of viewtopic)
|
||||
$sql_array = array(
|
||||
'SELECT' => 't.*, f.*',
|
||||
|
||||
'FROM' => array(
|
||||
FORUMS_TABLE => 'f',
|
||||
)
|
||||
);
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql_array['SELECT'] .= ', tw.notify_status';
|
||||
$sql_array['LEFT_JOIN'] = array();
|
||||
|
||||
$sql_array['LEFT_JOIN'][] = array(
|
||||
'FROM' => array(TOPICS_WATCH_TABLE => 'tw'),
|
||||
'ON' => 'tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id'
|
||||
);
|
||||
}
|
||||
|
||||
if (!$post_id)
|
||||
{
|
||||
$sql_array['WHERE'] = "t.topic_id = $topic_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
|
||||
$sql_array['FROM'][POSTS_TABLE] = 'p';
|
||||
}
|
||||
|
||||
$sql_array['WHERE'] .= ' AND (f.forum_id = t.forum_id';
|
||||
|
||||
$sql_array['WHERE'] .= ')';
|
||||
$sql_array['FROM'][TOPICS_TABLE] = 't';
|
||||
|
||||
// Join to forum table on topic forum_id unless topic forum_id is zero
|
||||
// whereupon we join on the forum_id passed as a parameter ... this
|
||||
// is done so navigation, forum name, etc. remain consistent with where
|
||||
// user clicked to view a global topic
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $db->sql_query($sql);
|
||||
$topic_data = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$topic_data)
|
||||
{
|
||||
// If post_id was submitted, we try at least to display the topic as a last resort...
|
||||
if ($post_id && $forum_id && $topic_id)
|
||||
{
|
||||
redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"));
|
||||
}
|
||||
|
||||
//trigger_error('NO_TOPIC');
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
|
||||
$forum_id = (int) $topic_data['forum_id'];
|
||||
$topic_id = (int) $topic_data['topic_id'];
|
||||
|
||||
// Setup look and feel
|
||||
$user->setup('viewtopic', $topic_data['forum_style']);
|
||||
|
||||
if (!$topic_data['topic_approved'] && !$auth->acl_get('m_approve', $forum_id))
|
||||
{
|
||||
//trigger_error('NO_TOPIC');
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
|
||||
// Start auth check
|
||||
if (!$auth->acl_get('f_read', $forum_id))
|
||||
{
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
{
|
||||
//trigger_error('SORRY_AUTH_READ');
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
|
||||
//login_box('', $user->lang['LOGIN_VIEWFORUM']);
|
||||
$portal_config['portal_poll_topic'] = false;
|
||||
}
|
||||
|
||||
// Forum is passworded ... check whether access has been granted to this
|
||||
// user this session, if not show login box
|
||||
if ($topic_data['forum_password'])
|
||||
{
|
||||
login_forum_box($topic_data);
|
||||
}
|
||||
|
||||
// Post ordering options
|
||||
$limit_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
|
||||
|
||||
$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
|
||||
$sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
|
||||
|
||||
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
|
||||
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
|
||||
|
||||
// General Viewtopic URL for return links
|
||||
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start&$u_sort_param");
|
||||
|
||||
// This is only used for print view so ...
|
||||
$server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
|
||||
|
||||
// Does this topic contain a poll?
|
||||
if (!empty($topic_data['poll_start']))
|
||||
{
|
||||
$sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid
|
||||
FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p
|
||||
WHERE o.topic_id = $topic_id
|
||||
AND p.post_id = {$topic_data['topic_first_post_id']}
|
||||
AND p.topic_id = o.topic_id
|
||||
ORDER BY o.poll_option_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$poll_info = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$poll_info[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$up_topic_id = request_var('t', 0);
|
||||
$up_forum_id = request_var('f', 0);
|
||||
$voted_id = request_var('vote_id', array('' => 0));
|
||||
|
||||
$cur_voted_id = array();
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql = 'SELECT poll_option_id
|
||||
FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . $topic_id . '
|
||||
WHERE topic_id = ' . $up_topic_id . '
|
||||
AND vote_user_id = ' . $user->data['user_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -219,60 +51,77 @@ if (!empty($topic_data['poll_start']))
|
||||
// Cookie based guest tracking ... I don't like this but hum ho
|
||||
// it's oft requested. This relies on "nice" users who don't feel
|
||||
// the need to delete cookies to mess with results.
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $up_topic_id]))
|
||||
{
|
||||
$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
|
||||
$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $up_topic_id]);
|
||||
$cur_voted_id = array_map('intval', $cur_voted_id);
|
||||
}
|
||||
}
|
||||
|
||||
$s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
|
||||
($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) &&
|
||||
$sql = 'SELECT t.poll_length, t.poll_start, t.poll_vote_change, t.topic_status, f.forum_status, t.poll_max_options
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
|
||||
WHERE t.forum_id = f.forum_id AND t.topic_id = " . (int) $up_topic_id . " AND t.forum_id = " . (int) $up_forum_id;
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$topic_data = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$s_can_up_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $up_forum_id)) ||
|
||||
($auth->acl_get('f_votechg', $up_forum_id) && $topic_data['poll_vote_change'])) &&
|
||||
(($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
|
||||
$topic_data['topic_status'] != ITEM_LOCKED &&
|
||||
$topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
$s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
|
||||
|
||||
if ($update && $s_can_vote)
|
||||
if( $s_can_up_vote )
|
||||
{
|
||||
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'])
|
||||
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
|
||||
{
|
||||
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
|
||||
$redirect_url = append_sid("./portal.$phpEx");
|
||||
|
||||
meta_refresh(5, $redirect_url);
|
||||
|
||||
$message = (!sizeof($voted_id)) ? 'NO_VOTE_OPTION' : 'TOO_MANY_VOTE_OPTIONS';
|
||||
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
|
||||
if (!sizeof($voted_id))
|
||||
{
|
||||
$message = 'NO_VOTE_OPTION';
|
||||
}
|
||||
else if (sizeof($voted_id) > $topic_data['poll_max_options'])
|
||||
{
|
||||
$message = 'TOO_MANY_VOTE_OPTIONS';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = 'VOTE_CONVERTED';
|
||||
}
|
||||
|
||||
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_PORTAL'], '<a href="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
|
||||
foreach ($voted_id as $option)
|
||||
{
|
||||
if (in_array($option, $cur_voted_id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
|
||||
SET poll_option_total = poll_option_total + 1
|
||||
WHERE poll_option_id = ' . (int) $option . '
|
||||
AND topic_id = ' . (int) $topic_id;
|
||||
AND topic_id = ' . (int) $up_topic_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql_ary = array(
|
||||
'topic_id' => (int) $topic_id,
|
||||
'topic_id' => (int) $up_topic_id,
|
||||
'poll_option_id' => (int) $option,
|
||||
'vote_user_id' => (int) $user->data['user_id'],
|
||||
'vote_user_ip' => (string) $user->ip,
|
||||
);
|
||||
|
||||
$sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
|
||||
$sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($cur_voted_id as $option)
|
||||
{
|
||||
if (!in_array($option, $voted_id))
|
||||
@@ -280,116 +129,224 @@ if (!empty($topic_data['poll_start']))
|
||||
$sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
|
||||
SET poll_option_total = poll_option_total - 1
|
||||
WHERE poll_option_id = ' . (int) $option . '
|
||||
AND topic_id = ' . (int) $topic_id;
|
||||
AND topic_id = ' . (int) $up_topic_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . (int) $topic_id . '
|
||||
WHERE topic_id = ' . (int) $up_topic_id . '
|
||||
AND poll_option_id = ' . (int) $option . '
|
||||
AND vote_user_id = ' . (int) $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot'])
|
||||
{
|
||||
$user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
|
||||
$user->set_cookie('poll_' . $up_topic_id, implode(',', $voted_id), time() + 31536000);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET poll_last_vote = ' . time() . "
|
||||
WHERE topic_id = $topic_id";
|
||||
WHERE topic_id = $up_topic_id";
|
||||
//, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
|
||||
$db->sql_query($sql);
|
||||
|
||||
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
|
||||
|
||||
$redirect_url = append_sid("./portal.$phpEx");
|
||||
|
||||
meta_refresh(5, $redirect_url);
|
||||
trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_PORTAL'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
|
||||
$poll_total = 0;
|
||||
foreach ($poll_info as $poll_option)
|
||||
{
|
||||
$poll_total += $poll_option['poll_option_total'];
|
||||
}
|
||||
|
||||
if ($poll_info[0]['bbcode_bitfield'])
|
||||
{
|
||||
$poll_bbcode = new bbcode();
|
||||
}
|
||||
else
|
||||
{
|
||||
$poll_bbcode = false;
|
||||
}
|
||||
|
||||
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
|
||||
{
|
||||
$poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
|
||||
$poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
|
||||
|
||||
if ($poll_bbcode !== false)
|
||||
{
|
||||
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
|
||||
}
|
||||
|
||||
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
|
||||
}
|
||||
|
||||
$topic_data['poll_title'] = censor_text($topic_data['poll_title']);
|
||||
$topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
|
||||
|
||||
if ($poll_bbcode !== false)
|
||||
{
|
||||
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
|
||||
}
|
||||
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
|
||||
|
||||
unset($poll_bbcode);
|
||||
|
||||
foreach ($poll_info as $poll_option)
|
||||
{
|
||||
$option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
|
||||
$option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
|
||||
|
||||
$template->assign_block_vars('poll_option', array(
|
||||
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
|
||||
'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
|
||||
'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
|
||||
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
||||
'POLL_OPTION_PCT' => round($option_pct * 100),
|
||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 10)),
|
||||
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false
|
||||
));
|
||||
}
|
||||
|
||||
$poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
'POLL_QUESTION' => $topic_data['poll_title'],
|
||||
'TOTAL_VOTES' => $poll_total,
|
||||
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
|
||||
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
|
||||
|
||||
'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
|
||||
'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
|
||||
|
||||
'S_HAS_POLL' => true,
|
||||
'S_CAN_VOTE' => $s_can_vote,
|
||||
'S_DISPLAY_RESULTS' => $s_display_results,
|
||||
'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false,
|
||||
'S_POLL_ACTION' => $viewtopic_url,
|
||||
|
||||
'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll'
|
||||
));
|
||||
unset($poll_end, $poll_info, $voted_id);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_POLL' => true
|
||||
));
|
||||
$where = '';
|
||||
$poll_forums = false;
|
||||
|
||||
if( $portal_config['portal_poll_topic_id'] !== '' )
|
||||
{
|
||||
$poll_forums_config = explode(',' ,$portal_config['portal_poll_topic_id']);
|
||||
foreach($poll_forums_config as $poll_forum )
|
||||
{
|
||||
if ( is_numeric(trim($poll_forum)) === TRUE )
|
||||
{
|
||||
$poll_forum = (int) trim($poll_forum);
|
||||
if( $auth->acl_get('f_read', $poll_forum) )
|
||||
{
|
||||
$poll_forums = true;
|
||||
$where .= ($where == "") ? "t.forum_id = '{$poll_forum}'" : " OR t.forum_id = '{$poll_forum}'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_list = $auth->acl_getf('f_read', true);
|
||||
|
||||
foreach($forum_list as $pf => $pf_data )
|
||||
{
|
||||
$pf = (int) trim($pf);
|
||||
$poll_forums = true;
|
||||
$where .= ($where == "") ? "t.forum_id = '{$pf}'" : " OR t.forum_id = '{$pf}'";
|
||||
}
|
||||
}
|
||||
|
||||
$where = ($where !== '') ? "AND ({$where})" : '';
|
||||
|
||||
if( $poll_forums === TRUE )
|
||||
{
|
||||
|
||||
$sql = 'SELECT t.poll_title, t.poll_start, t.topic_id, t.forum_id, t.poll_length, t.poll_vote_change, t.poll_max_options, t.topic_status, f.forum_status
|
||||
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
|
||||
WHERE t.forum_id = f.forum_id AND t.topic_approved = 1 AND t.poll_start > 0
|
||||
{$where}
|
||||
ORDER BY t.poll_start DESC";
|
||||
|
||||
$limit = ( isset($portal_config['portal_poll_limit']) ) ? $portal_config['portal_poll_limit'] : 3;
|
||||
|
||||
$result = $db->sql_query_limit($sql, $limit);
|
||||
|
||||
$has_poll = false;
|
||||
|
||||
if ($result)
|
||||
{
|
||||
|
||||
while( $data = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$has_poll = true;
|
||||
$poll_has_options = false;
|
||||
|
||||
$topic_id = (int) $data['topic_id'];
|
||||
|
||||
$cur_voted_id = array();
|
||||
if( $portal_config['portal_poll_allow_vote'] )
|
||||
{
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$vote_sql = 'SELECT poll_option_id
|
||||
FROM ' . POLL_VOTES_TABLE . '
|
||||
WHERE topic_id = ' . $topic_id . '
|
||||
AND vote_user_id = ' . $user->data['user_id'];
|
||||
$vote_result = $db->sql_query($vote_sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($vote_result))
|
||||
{
|
||||
$cur_voted_id[] = $row['poll_option_id'];
|
||||
}
|
||||
$db->sql_freeresult($vote_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cookie based guest tracking ... I don't like this but hum ho
|
||||
// it's oft requested. This relies on "nice" users who don't feel
|
||||
// the need to delete cookies to mess with results.
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
|
||||
{
|
||||
$cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
|
||||
$cur_voted_id = array_map('intval', $cur_voted_id);
|
||||
}
|
||||
}
|
||||
|
||||
$s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
|
||||
($auth->acl_get('f_votechg', $forum_id) && $data['poll_vote_change'])) &&
|
||||
(($data['poll_length'] != 0 && $data['poll_start'] + $data['poll_length'] > time()) || $data['poll_length'] == 0) &&
|
||||
$data['topic_status'] != ITEM_LOCKED &&
|
||||
$data['forum_status'] != ITEM_LOCKED) ? true : false;
|
||||
} else {
|
||||
$s_can_vote = false;
|
||||
}
|
||||
|
||||
$s_display_results = ( !$s_can_vote || ( $s_can_vote && sizeof($cur_voted_id) ) || ( $view == 'viewpoll' && in_array($topic_id, $poll_view_ar) ) ) ? true : false;
|
||||
|
||||
$poll_sql = 'SELECT po.poll_option_id, po.poll_option_text, po.poll_option_total
|
||||
FROM ' . POLL_OPTIONS_TABLE . " po
|
||||
WHERE po.topic_id = {$topic_id}
|
||||
ORDER BY po.poll_option_id";
|
||||
|
||||
$poll_result = $db->sql_query($poll_sql);
|
||||
|
||||
$poll_total_votes = 0;
|
||||
|
||||
$poll_data = array();
|
||||
|
||||
if ($poll_result)
|
||||
{
|
||||
while( $polls_data = $db->sql_fetchrow($poll_result) )
|
||||
{
|
||||
$poll_has_options = true;
|
||||
$poll_data[] = $polls_data;
|
||||
$poll_total_votes += $polls_data['poll_option_total'];
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($poll_result);
|
||||
|
||||
$forum_id = (int) $data['forum_id'];
|
||||
|
||||
$make_poll_view = array();
|
||||
|
||||
if( in_array($topic_id, $poll_view_ar) === FALSE )
|
||||
{
|
||||
$make_poll_view[] = $topic_id;
|
||||
$make_poll_view = array_merge($poll_view_ar, $make_poll_view);
|
||||
}
|
||||
|
||||
$poll_view_str = urlencode( implode(',', $make_poll_view) );
|
||||
|
||||
$portalpoll_url= append_sid("./portal.$phpEx", "polls=$poll_view_str");
|
||||
$portalvote_url= append_sid("./portal.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
|
||||
|
||||
$poll_end = $data['poll_length'] + $data['poll_start'];
|
||||
|
||||
$template->assign_block_vars('poll', array(
|
||||
'S_POLL_HAS_OPTIONS' => $poll_has_options,
|
||||
'POLL_QUESTION' => $data['poll_title'],
|
||||
'U_POLL_TOPIC' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $topic_id . '&f=' . $forum_id),
|
||||
'POLL_LENGTH' => $data['poll_length'],
|
||||
'TOPIC_ID' => $topic_id,
|
||||
|
||||
'TOTAL_VOTES' => $poll_total_votes,
|
||||
|
||||
'L_MAX_VOTES' => ($data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $data['poll_max_options']),
|
||||
'L_POLL_LENGTH' => ($data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
|
||||
|
||||
'S_CAN_VOTE' => $s_can_vote,
|
||||
'S_DISPLAY_RESULTS' => $s_display_results,
|
||||
'S_IS_MULTI_CHOICE' => ($data['poll_max_options'] > 1) ? true : false,
|
||||
'S_POLL_ACTION' => $portalvote_url,
|
||||
|
||||
'U_VIEW_RESULTS' => $portalpoll_url . '&view=viewpoll',
|
||||
'U_VIEW_TOPIC' => $viewtopic_url
|
||||
));
|
||||
|
||||
foreach($poll_data as $pd)
|
||||
{
|
||||
$option_pct = ($poll_total_votes > 0) ? $pd['poll_option_total'] / $poll_total_votes : 0;
|
||||
$option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
|
||||
|
||||
$template->assign_block_vars('poll.poll_option', array(
|
||||
'POLL_OPTION_ID' => $pd['poll_option_id'],
|
||||
'POLL_OPTION_CAPTION' => $pd['poll_option_text'],
|
||||
'POLL_OPTION_RESULT' => $pd['poll_option_total'],
|
||||
'POLL_OPTION_PERCENT' => $option_pct_txt,
|
||||
'POLL_OPTION_PCT' => round($option_pct * 100),
|
||||
'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
|
||||
'POLL_OPTION_VOTED' => (in_array($pd['poll_option_id'], $cur_voted_id)) ? true : false
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_POLL' => true,
|
||||
'S_HAS_POLL' => $has_poll,
|
||||
'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
|
||||
'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
|
||||
));
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -2,46 +2,73 @@
|
||||
<ul class="topiclist">
|
||||
<li class="header"><dl><dt>{L_POLL}</dt></dl></li>
|
||||
</ul>
|
||||
<form method="post" action="{S_POLL_ACTION}">
|
||||
<div class="panel" style="margin-bottom: 0px;"><span class="corners-top"><span></span></span>
|
||||
<h3>{POLL_QUESTION}</h3>
|
||||
<div class="content">
|
||||
<p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE -->{L_MAX_VOTES}<!-- ENDIF --></p>
|
||||
<fieldset class="polls">
|
||||
<!-- BEGIN poll_option -->
|
||||
<dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF -->>
|
||||
<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
|
||||
<!-- IF S_CAN_VOTE --><dd style="width: auto;"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF -->/><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
|
||||
<!-- IF S_DISPLAY_RESULTS --><dd class="resultbar"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT};">{poll_option.POLL_OPTION_RESULT}</div></dd>
|
||||
<dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- END poll_option -->
|
||||
|
||||
<!-- IF S_DISPLAY_RESULTS -->
|
||||
<dl>
|
||||
<dt> </dt>
|
||||
<dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}<br /><br /><a href="{U_VIEW_RESULTS}">{L_JUMP_TO_POST}</a></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_CAN_VOTE -->
|
||||
<dl style="border-top: none;">
|
||||
<dt> </dt>
|
||||
<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF not S_DISPLAY_RESULTS -->
|
||||
<dl style="border-top: none;">
|
||||
<dt> </dt>
|
||||
<dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
</fieldset>
|
||||
<div class="panel">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
<!-- IF S_HAS_POLL -->
|
||||
<!-- BEGIN poll -->
|
||||
<!-- IF poll.S_CAN_VOTE --><form method="post" action="{poll.S_POLL_ACTION}"><!-- ENDIF -->
|
||||
<div class="content">
|
||||
<h2>{poll.POLL_QUESTION}</h2>
|
||||
<p class="author">{poll.L_POLL_LENGTH}<!-- IF poll.S_CAN_VOTE and poll.L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF poll.S_CAN_VOTE -->{poll.L_MAX_VOTES}<!-- ENDIF --></p>
|
||||
|
||||
<fieldset class="polls">
|
||||
<!-- IF poll.S_POLL_HAS_OPTIONS -->
|
||||
<!-- BEGIN poll_option -->
|
||||
<dl class="<!-- IF poll.poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll.poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF -->>
|
||||
<dt><!-- IF poll.S_CAN_VOTE --><label for="poll_{poll.TOPIC_ID}_vote_{poll.poll_option.POLL_OPTION_ID}">{poll.poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll.poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
|
||||
<!-- IF poll.S_CAN_VOTE --><dd style="width: auto;"><!-- IF poll.S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="poll_{poll.TOPIC_ID}_vote_{poll.poll_option.POLL_OPTION_ID}" value="{poll.poll_option.POLL_OPTION_ID}"<!-- IF poll.poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="poll_{poll.TOPIC_ID}_vote_{poll.poll_option.POLL_OPTION_ID}" value="{poll.poll_option.POLL_OPTION_ID}"<!-- IF poll.poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
|
||||
<!-- IF poll.S_DISPLAY_RESULTS --><dd class="resultbar"><div class="<!-- IF poll.poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll.poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll.poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll.poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll.poll_option.POLL_OPTION_PERCENT};">{poll.poll_option.POLL_OPTION_RESULT}</div></dd>
|
||||
<dd><!-- IF poll.poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll.poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
|
||||
</dl>
|
||||
<!-- END poll_option -->
|
||||
<!-- ELSE -->
|
||||
<dl><dt>{L_NO_OPTIONS}</dt></dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF poll.S_DISPLAY_RESULTS -->
|
||||
<dl>
|
||||
<dt> </dt>
|
||||
<dd class="resultbar">{L_TOTAL_VOTES} : {poll.TOTAL_VOTES}</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF poll.S_CAN_VOTE -->
|
||||
<dl style="border-top: none;">
|
||||
<dt> </dt>
|
||||
<dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF not poll.S_DISPLAY_RESULTS -->
|
||||
<dl style="border-top: none;">
|
||||
<dt> </dt>
|
||||
<dd class="resultbar"><a href="{poll.U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<dl style="border-top: none;">
|
||||
<dt> </dt>
|
||||
<dd class="resultbar"><a href="{poll.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</div>
|
||||
<!-- IF poll.S_CAN_VOTE -->{poll.S_HIDDEN_FIELDS}<!-- ENDIF -->
|
||||
<!-- IF poll.S_CAN_VOTE --></form><!-- ENDIF -->
|
||||
<hr />
|
||||
<!-- END poll -->
|
||||
<!-- ELSE -->
|
||||
<div class="panel">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<div class="content">
|
||||
<p>{L_NO_POLL}</p>
|
||||
</div>
|
||||
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
<span class="corners-bottom"><span></span></span>
|
||||
</div>
|
||||
{S_HIDDEN_FIELDS}
|
||||
</form>
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
<br style="clear:both" />
|
||||
@@ -95,7 +95,7 @@
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_POLL and S_HAS_POLL -->
|
||||
<!-- IF S_DISPLAY_POLL -->
|
||||
<!-- INCLUDE portal/block/poll.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
|
||||
84
root/styles/subsilver2/template/portal/block/poll.html
Normal file
84
root/styles/subsilver2/template/portal/block/poll.html
Normal file
@@ -0,0 +1,84 @@
|
||||
O<table class="tablebg" cellspacing="1" width="100%">
|
||||
<tr>
|
||||
<th>{L_LATEST_POLLS}</th>
|
||||
</tr>
|
||||
<tr class="row1" align="center">
|
||||
<td>
|
||||
<!-- IF S_HAS_POLL -->
|
||||
<!-- BEGIN poll -->
|
||||
<!-- IF poll.S_CAN_VOTE --><form method="post" action="{poll.S_POLL_ACTION}"><!-- ENDIF -->
|
||||
|
||||
<table class="tablebg" cellspacing="1" cellpadding="4" border="0" align="center" width="100%">
|
||||
<tr>
|
||||
<td class="cat">
|
||||
<span class="gen"><b>{poll.POLL_QUESTION}</b></span><br /><span class="gensmall">{poll.L_POLL_LENGTH}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- IF poll.S_POLL_HAS_OPTIONS -->
|
||||
<tr>
|
||||
<td class="row1" align="center">
|
||||
<table cellspacing="0" cellpadding="2" border="0">
|
||||
<!-- BEGIN poll_option -->
|
||||
<tr>
|
||||
<!-- IF poll.S_CAN_VOTE -->
|
||||
<td>
|
||||
<!-- IF poll.S_IS_MULTI_CHOICE -->
|
||||
<input type="checkbox" class="radio" name="vote_id[]" value="{poll.poll_option.POLL_OPTION_ID}"<!-- IF poll.poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
|
||||
<!-- ELSE -->
|
||||
<input type="radio" class="radio" name="vote_id[]" value="{poll.poll_option.POLL_OPTION_ID}"<!-- IF poll.poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
<!-- ENDIF -->
|
||||
<td><span class="gen">{poll.poll_option.POLL_OPTION_CAPTION}</span></td>
|
||||
<!-- IF poll.S_DISPLAY_RESULTS -->
|
||||
<td dir="ltr">{POLL_LEFT_CAP_IMG}{poll.poll_option.POLL_OPTION_IMG}{POLL_RIGHT_CAP_IMG}</td>
|
||||
<td class="gen" align="{S_CONTENT_FLOW_END}"><b> {poll.poll_option.POLL_OPTION_PERCENT} </b></td>
|
||||
<td class="gen" align="center">[ {poll.poll_option.POLL_OPTION_RESULT} ]</td>
|
||||
<!-- IF poll.poll_option.POLL_OPTION_VOTED -->
|
||||
<td class="gensmall" valign="top"><b title="{L_POLL_VOTED_OPTION}">x</b></td>
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
</tr>
|
||||
<!-- END poll_option -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ELSE -->
|
||||
<tr>
|
||||
<td class="row1" align="center">
|
||||
{L_NO_OPTIONS}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF poll.S_CAN_VOTE -->
|
||||
<tr>
|
||||
<td class="row1" align="center"><span class="gensmall">{poll.L_MAX_VOTES}</span><br /><br /><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="btnlite" /></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF poll.S_DISPLAY_RESULTS -->
|
||||
<tr>
|
||||
<td class="row1" colspan="4" align="center"><span class="gensmall"><b>{L_TOTAL_VOTES} : {poll.TOTAL_VOTES}</b> <b><a href="{poll.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a></b></span></td>
|
||||
</tr>
|
||||
<!-- ELSE -->
|
||||
<tr>
|
||||
<td class="row1" align="center"><span class="gensmall"><b><a href="{poll.U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></b> <b><a href="{poll.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a></b></span></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
</table>
|
||||
<!-- IF poll.S_CAN_VOTE -->{S_HIDDEN_FIELDS}
|
||||
|
||||
</form><!-- ENDIF -->
|
||||
<!-- END poll -->
|
||||
<!-- ELSE -->
|
||||
<table class="tablebg" cellspacing="1" width="100%">
|
||||
<tr>
|
||||
<td class="row1" class="cat">
|
||||
<strong>{L_NO_POLL}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
212
root/styles/subsilver2/template/portal/portal_body.html
Normal file
212
root/styles/subsilver2/template/portal/portal_body.html
Normal file
@@ -0,0 +1,212 @@
|
||||
<!-- DEFINE $S_IN_PORTAL = 1 -->
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<!-- $Id$ //-->
|
||||
|
||||
<!--
|
||||
.gensmall {
|
||||
margin: 1px 1px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
small, .small {
|
||||
font-size:10px;
|
||||
font-weight:bold;
|
||||
font-family:Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
/* Container for sub-navigation list */
|
||||
#navigation {
|
||||
padding-top: 0px;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
/* Link styles for the sub-section links */
|
||||
#navigation a {
|
||||
color: #105289;
|
||||
font-weight: normal;
|
||||
padding: 1px;
|
||||
display:block;
|
||||
}
|
||||
|
||||
#navigation a:hover {
|
||||
color: #d31141;
|
||||
}
|
||||
//-->
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
|
||||
<tr>
|
||||
<!-- [+] left block area -->
|
||||
<td width="{PORTAL_LEFT_COLLUMN}" valign="top" style="padding-right:6px;">
|
||||
|
||||
<!-- INCLUDE portal/block/main_menu.html -->
|
||||
|
||||
<!-- IF S_DISPLAY_SEARCH -->
|
||||
<!-- INCLUDE portal/block/search.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_ADS_SMALL -->
|
||||
<!-- INCLUDE portal/block/ads_small.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_CHANGE_STYLE -->
|
||||
<!-- INCLUDE portal/block/change_style.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_PAY_S -->
|
||||
<!-- INCLUDE portal/block/donation/donation_small.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_LATEST_MEMBERS -->
|
||||
<!-- INCLUDE portal/block/latest_members.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_TOP_POSTERS -->
|
||||
<!-- INCLUDE portal/block/top_poster.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_RANDOM_MEMBER -->
|
||||
<!-- INCLUDE portal/block/random_member.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_CLOCK -->
|
||||
<!-- INCLUDE portal/block/clock.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_MINICAL -->
|
||||
<!-- INCLUDE portal/block/mini_calendar.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_LINK_US -->
|
||||
<!-- INCLUDE portal/block/link_us.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_LINKS -->
|
||||
<!-- INCLUDE portal/block/links.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_LAST_BOTS and S_LAST_VISITED_BOTS -->
|
||||
<!-- INCLUDE portal/block/latest_bots.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
|
||||
<!-- INCLUDE portal/block/birthday_list.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
</td>
|
||||
<!-- [-] left block area -->
|
||||
<td width="4" valign="top"></td>
|
||||
|
||||
<!-- [+] center block area -->
|
||||
<td valign="top">
|
||||
|
||||
<!-- IF S_DISPLAY_WELCOME -->
|
||||
<!-- INCLUDE portal/block/welcome.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_ADS_CENTER -->
|
||||
<!-- INCLUDE portal/block/ads_center.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_PAY_C -->
|
||||
<!-- INCLUDE portal/block/donation/donation.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_RECENT -->
|
||||
<!-- INCLUDE portal/block/recent.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_POLL -->
|
||||
<!-- INCLUDE portal/block/poll.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ANNOUNCEMENTS -->
|
||||
<!-- IF S_ANNOUNCE_COMPACT -->
|
||||
<!-- INCLUDE portal/block/announcements_compact.html -->
|
||||
<!-- ELSE -->
|
||||
<!-- INCLUDE portal/block/announcements.html -->
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_NEWS -->
|
||||
<!-- IF S_NEWS_COMPACT -->
|
||||
<!-- INCLUDE portal/block/news_compact.html -->
|
||||
<!-- ELSE -->
|
||||
<!-- INCLUDE portal/block/news.html -->
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_WORDGRAPH -->
|
||||
<!-- INCLUDE portal/block/wordgraph.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_JUMPBOX -->
|
||||
<!-- INCLUDE portal/block/jumpbox.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
</td>
|
||||
<!-- [-] center block area -->
|
||||
<td width="4" valign="top"></td>
|
||||
|
||||
<!-- [+] right block area -->
|
||||
<td width="{PORTAL_RIGHT_COLLUMN}" valign="top" style="padding-left:6px;">
|
||||
|
||||
<!--// [+] latest files => only for site version
|
||||
<div class="panel">
|
||||
<div class="inner">
|
||||
<span class="corners-top"><span></span></span>
|
||||
<h3>Latest Files</h3>
|
||||
<span style="font-weight: bold">Latest version:</span> 1.1.0b<br />
|
||||
<span style="font-weight: bold">Released:</span> 2007-08-01<br /><br />
|
||||
<span style="font-weight: bold">Download:</span><br />
|
||||
<a href="http://www.phpbb3portal.com/viewtopic.php?f=4&t=9">phpbb3-portal.110b.tar.gz</a><br /><br />
|
||||
<span style="font-weight: bold">Development:</span><br />
|
||||
<a href="http://www.phppbb3ortal.com">phpbb3portal.com</a><br />
|
||||
<a href="http://sourceforge.net/projects/canverportal/" rel="nofollow">SourceForge Project</a>
|
||||
<span class="corners-bottom"><span></span></span>
|
||||
</div>
|
||||
</div>
|
||||
<br clear="all" />
|
||||
[-] latest files => only for site version //-->
|
||||
|
||||
<!-- IF not S_USER_LOGGED_IN -->
|
||||
<!-- INCLUDE portal/block/login_box.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_USER_LOGGED_IN -->
|
||||
<!-- INCLUDE portal/block/user_menu.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_FRIENDS and S_ZEBRA_ENABLED and S_USER_LOGGED_IN -->
|
||||
<!-- INCLUDE portal/block/online_friends.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ADVANCED_STAT -->
|
||||
<!-- INCLUDE portal/block/statistics.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ONLINE_LIST -->
|
||||
<!-- INCLUDE portal/block/whois_online.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_LEADERS -->
|
||||
<!-- INCLUDE portal/block/leaders.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ATTACHMENTS -->
|
||||
<!-- INCLUDE portal/block/attachments.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF S_DISPLAY_ACTIVE_TOPIC -->
|
||||
<!--INCLUDE portal/block/active.html-->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!--INCLUDE portal/block/_sample_block_design.html-->
|
||||
|
||||
</td>
|
||||
<!-- [-] right block area -->
|
||||
</tr>
|
||||
</table>
|
||||
<!--// phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com //-->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
Reference in New Issue
Block a user