Ga naar inhoud

bbcode in poll


Gast

Aanbevolen berichten

Dit lijkt misschien simpel, maar ik ben niet de enige die het zoekt, en er is zo direct nog niemand geweest die er een deftig antwoord op kan geven. En bij dit alles maak ik het nog moeilijker met extra mods.

Om 'ter zaken' te komen: Ik wil mijn afbeeldingen laten weergeven in de poll. Ik heb phpbb uiteraard.

ik heb al wel wat zoekwerk vericht, en heb iets heel interessant gevonden: http://www.phpbbmods.nl/view.php?id=73

dacht ik van 'eindelijk!', maar nee, het werkte bij mij niet. Of de mod zelf werkt, weet ik niet, maar dat zal wel. Maar het probleem bij mij zal de liggen aan...Advanced Vote Manager!

Dat is het moeilijke aan de hele zaak.

euhm, die bbcode on poll van die site, is gewoon een tekst bestand, dit:

##############################################################

## MOD Title: BBCode on Vote Options

## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de

## MOD Description: Enables to use BBCodes, Smilies and HTML on Vote Options.

## Compatible to Multivote Mod.

## MOD Version: 1.0.1

##

## Installation Level: Easy

## Installation Time: 2 min

## Files To Edit: 3

## includes/functions_post.php

## posting.php

## viewtopic.php

##

## Included Files: n/a

##

## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2

##############################################################

## For security purposes, please check: http://www.phpbb.com/mods/

## for the latest version of this MOD. Although MODs are checked

## before being allowed in the MODs Database there is no guarantee

## that there are no security problems within the MOD. No support

## will be given for MODs not found within the MODs Database which

## can be found at http://www.phpbb.com/mods/

##############################################################

## Author Notes:

##

##############################################################

## MOD History:

##

## 2006-09-06 - Version 1.0.1

## - FIX Get BBCodes on option texts while editing the vote.

## For update installt the part for posting.php

##

## 2004-12-20 - Version 1.0.0

## - First release

##

##############################################################

## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD

##############################################################

#

#-----[ OPEN ]--------------------------------------------------

#

includes/functions_post.php

#

#-----[ FIND ]--------------------------------------------------

#

$temp_option_text[$option_id] = htmlspecialchars($option_text);

#

#-----[ BEFORE, ADD ]--------------------------------------------------

#

$option_text = prepare_message(trim($option_text), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);

#

#-----[ FIND ]--------------------------------------------------

#

$option_text = $temp_option_text;

#

#-----[ AFTER, ADD ]--------------------------------------------------

#

$poll_options = $option_text;

#

#-----[ OPEN ]--------------------------------------------------

#

posting.php

#

#-----[ FIND ]--------------------------------------------------

#

do

{

$poll_options[$row['vote_option_id']] = $row['vote_option_text'];

#

#-----[ REPLACE WITH ]--------------------------------------------------

#

do

{

$bbcode_uid = $post_info['bbcode_uid'];

$poll_option_temp = $row['vote_option_text'];

if ($bbcode_uid)

{

$poll_option_temp = preg_replace("/\:$bbcode_uid/si", '', $poll_option_temp);

}

$poll_options[$row['vote_option_id']] = $poll_option_temp;

#

#-----[ OPEN ]--------------------------------------------------

#

viewtopic.php

#

#-----[ FIND ]--------------------------------------------------

#

$poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0;

#

#-----[ AFTER, ADD ]--------------------------------------------------

#

$sql = "SELECT pt.bbcode_uid FROM " . TOPICS_TABLE . " t, " . POSTS_TEXT_TABLE . " pt

WHERE t.topic_id = $topic_id

AND t.topic_first_post_id = pt.post_id

LIMIT 1";

if (!$result = $db->sql_query($sql))

{

message_die(GENERAL_ERROR, 'Could not read bbcode for poll_options', '', __LINE__, __FILE__, $sql);

}

$row = $db->sql_fetchrow($result);

$bbcode_uid = $row['bbcode_uid'];

$db->sql_freeresult($result);

#

#-----[ FIND ]--------------------------------------------------

#

$template->assign_block_vars("poll_option", array(

'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],

#

#-----[ REPLACE WITH ]--------------------------------------------------

#

$vote_caption_text = $vote_info[$i]['vote_option_text'];

$vote_caption_text = (!$board_config['allow_html']) ? preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $vote_caption_text) : $vote_caption_text;

$vote_caption_text = ($board_config['allow_bbcode'] && $bbcode_uid != '') ? bbencode_second_pass($vote_caption_text, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $vote_caption_text);

$vote_caption_text = make_clickable($vote_caption_text);

$vote_caption_text = ($board_config['allow_smilies']) ? smilies_pass($vote_caption_text) : $vote_caption_text;

$template->assign_block_vars("poll_option", array(

'POLL_OPTION_CAPTION' => $vote_caption_text,

#

#-----[ FIND ]--------------------------------------------------

#

$template->assign_block_vars("poll_option", array(

'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],

'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'])

);

#

#-----[ REPLACE WITH ]--------------------------------------------------

#

$vote_caption_text = $vote_info[$i]['vote_option_text'];

$vote_caption_text = (!$board_config['allow_html']) ? preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $vote_caption_text) : $vote_caption_text;

$vote_caption_text = ($board_config['allow_bbcode'] && $bbcode_uid != '') ? bbencode_second_pass($vote_caption_text, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $vote_caption_text);

$vote_caption_text = make_clickable($vote_caption_text);

$vote_caption_text = ($board_config['allow_smilies']) ? smilies_pass($vote_caption_text) : $vote_caption_text;

$template->assign_block_vars("poll_option", array(

"POLL_OPTION_ID" => $vote_info[$i]['vote_option_id'],

"POLL_OPTION_CAPTION" => $vote_caption_text)

);

#

#-----[ SAVE/CLOSE ALL FILES ]--------------------------------------------------

#

# EoM

en de aanpassingen van de advanced voting systeem bij die 3 files:

#-----[ OPEN ]---------------------------------------------

#

posting.php

#

#-----[ FIND ]---------------------------------------------

#

$poll_length = $row['vote_length'] / 86400;

#

#-----[ REPLACE WITH ]---------------------------------------------

#

$poll_length = intval($row['vote_length'] / 86400);

$poll_length_h = intval( ( $row['vote_length'] - ( $poll_length * 86400) ) / 3600 ) ;

$max_vote = $row['vote_max'];

$hide_vote = $row['vote_hide'];

$undo_vote = $row['vote_undo'];

#

#-----[ FIND ]---------------------------------------------

#

if ( !empty($HTTP_POST_VARS['vote_id']) )

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

!empty

#

#-----[ IN-LINE BEFORE, ADD ]---------------------------------------------

#

(

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

$HTTP_POST_VARS['vote_id'])

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

) && (is_array($HTTP_POST_VARS['vote_id'])) && (isset($HTTP_POST_VARS['vote_id']))

#

#-----[ FIND ]---------------------------------------------

#

$vote_option_id = intval($HTTP_POST_VARS['vote_id']);

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$vote_id = $HTTP_POST_VARS['vote_id'];

#

#-----[ FIND ]---------------------------------------------

#

$sql = "SELECT vd.vote_id

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vd.vote_id

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, vd.vote_max

#

#-----[ FIND ]---------------------------------------------

#

if ( $vote_info = $db->sql_fetchrow($result) )

{

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$max_vote = $vote_info['vote_max'];

#

#-----[ FIND ]---------------------------------------------

#

$vote_id = $vote_info['vote_id'];

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

$vote_id

#

#-----[ IN-LINE REPLACE WITH ]---------------------------------------------

#

$id_vote

#

#-----[ FIND ]---------------------------------------------

#

$sql = "SELECT *

#

#-----[ BEFORE, ADD ]---------------------------------------------

#

}

#

#-----[ FIND ]---------------------------------------------

#

WHERE vote_id = $vote_id

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

$vote_id

#

#-----[ IN-LINE REPLACE WITH ]---------------------------------------------

#

$id_vote

#

#-----[ FIND ]---------------------------------------------

#

if ( !($row = $db->sql_fetchrow($result2)) )

{

#

#-----[ REPLACE WITH ]---------------------------------------------

#

$prev_vote = $db->sql_numrows();

$counter = 0;

$row = $db->sql_fetchrowset($result2);

#

#-----[ FIND ]---------------------------------------------

#

$sql = "UPDATE " . VOTE_RESULTS_TABLE . "

SET vote_result = vote_result + 1

WHERE vote_id = $vote_id

AND vote_option_id = $vote_option_id";

#

#-----[ BEFORE, ADD ]---------------------------------------------

#

$vbn = array();

for ($i = 0; $i < count($vote_id); $i++)

{

// check if already voted on certain options

$flag = false;

for ($j = 0; $j < $prev_vote; $j++)

{

if ($vote_id[$i] == $row[$j]['vote_option_id'])

{

$flag = true;

break;

}

}

if (!$flag)

{

$vbn[$counter] = $vote_id[$i];

$counter++;

}

}

$db->sql_freeresult($result2);

$sql = "SELECT vd.vote_id

FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr

WHERE vd.topic_id = $topic_id

AND vr.vote_id = vd.vote_id

AND vr.vote_option_id = $vote_option_id

GROUP BY vd.vote_id";

if ( !($result = $db->sql_query($sql)) )

{

message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);

}

if ( $vote_info = $db->sql_fetchrow($result) )

{

$vote_id = $vote_info['vote_id'];

$sql = "SELECT *

FROM " . VOTE_USERS_TABLE . "

WHERE vote_id = $vote_id

AND vote_user_id = " . $userdata['user_id'];

if ( !($result2 = $db->sql_query($sql)) )

{

message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql);

}

if ( $max_vote >= (count($vbn) + $prev_vote) ) // Modded

{

foreach ($vbn as $vote_option_id)

{

#

#-----[ FIND ]---------------------------------------------

#

$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vote_user_ip

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, vote_option_id

#

#-----[ FIND ]---------------------------------------------

#

VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

'$user_ip'

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, $vote_option_id

#

#-----[ FIND ]---------------------------------------------

#

if ( !$db->sql_query($sql, END_TRANSACTION) )

{

message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql);

}

#

#-----[ AFTER, ADD ]---------------------------------------------

#

}

if ( !($prev_vote) )

{

$sql = "UPDATE " . VOTE_DESC_TABLE . "

SET vote_voted = vote_voted + 1

WHERE vote_id = $vote_id

AND topic_id = $topic_id";

if ( !$db->sql_query($sql) )

{

message_die(GENERAL_ERROR, 'Could not update poll voted', '', __LINE__, __FILE__, $sql);

}

}

#

#-----[ FIND ]---------------------------------------------

#

$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';

#

#-----[ REPLACE WITH ]---------------------------------------------

#

$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? intval($HTTP_POST_VARS['poll_length']) : '0';

$poll_length_h = ( isset($HTTP_POST_VARS['poll_length_h']) && $is_auth['auth_pollcreate'] ) ? intval($HTTP_POST_VARS['poll_length_h']) : '0';

$max_vote = ( isset($HTTP_POST_VARS['max_vote']) && $is_auth['auth_pollcreate'] ) ? ( ( $HTTP_POST_VARS['max_vote'] == 0 ) ? 1 : intval($HTTP_POST_VARS['max_vote']) ) : '';

$undo_vote = ( isset($HTTP_POST_VARS['undo_vote']) && $is_auth['auth_pollcreate'] ) ? 1 : '';

$hide_vote = 0; // show all

if ( isset($HTTP_POST_VARS['hide_dr']) && $is_auth['auth_pollcreate'] )

{

// hide detailed results

$hide_vote++;

if ( $poll_length > 0 || $poll_length_h > 0 )

{

// show detailed after expiration

$hide_vote += ( isset($HTTP_POST_VARS['hide_exp']) ) ? 3 : 0;

if ( isset($HTTP_POST_VARS['hide_sr']) )

{

// hide simple results until expiration

$hide_vote++;

// hide voters until expiration

$hide_vote += ( isset($HTTP_POST_VARS['hide_voters']) ) ? 1 : 0;

}

}

}

#

#-----[ FIND ]---------------------------------------------

#

prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

, $poll_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, $poll_length_h, $max_vote, $undo_vote

#

#-----[ FIND ]---------------------------------------------

#

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

, $poll_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, $max_vote, $hide_vote, $undo_vote

#

#-----[ FIND ]---------------------------------------------

#

$poll_length = ( isset($HTTP_POST_VARS['poll_length']) ) ? max(0, intval($HTTP_POST_VARS['poll_length'])) : 0;

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$poll_length_h = ( isset($HTTP_POST_VARS['poll_length_h']) ) ? max(0, intval($HTTP_POST_VARS['poll_length_h'])) : 0;

$max_vote = ( isset($HTTP_POST_VARS['max_vote']) ) ? max(1, intval($HTTP_POST_VARS['max_vote'])) : 1;

$undo_vote = ( isset($HTTP_POST_VARS['undo_vote']) ) ? 1 : 0;

$hide_vote = 0; // show all

if ( isset($HTTP_POST_VARS['hide_dr']) && $is_auth['auth_pollcreate'] )

{

// hide detailed results

$hide_vote++;

if ( $poll_length > 0 || $poll_length_h > 0 )

{

// show detailed after expiration

$hide_vote += ( isset($HTTP_POST_VARS['hide_exp']) ) ? 3 : 0;

if ( isset($HTTP_POST_VARS['hide_sr']) )

{

// hide simple results until expiration

$hide_vote++;

// hide voters until expiration

$hide_vote += ( isset($HTTP_POST_VARS['hide_voters']) ) ? 1 : 0;

}

}

}

#

#-----[ FIND ]---------------------------------------------

#

$poll_length = '';

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$poll_length_h = '';

$max_vote = '1';

$hide_vote = 0;

$undo_vote = '';

#

#-----[ FIND ]---------------------------------------------

#

'L_POLL_LENGTH' => $lang['Poll_for'],

#

#-----[ AFTER, ADD ]---------------------------------------------

#

'L_VHIDE' => $lang['Vhide'],

'L_HIDE_DR' => $lang['Hide_detailed_results'],

'L_HIDE_DR_EXP' => $lang['Until_exp'],

'L_HIDE_SR' => $lang['Also_hide_simple'],

'L_HIDE_VOTERS' => $lang['Also_hide_voters'],

'L_HOURS' => $lang['Hours'],

'L_MAX_VOTE' => $lang['Max_vote'],

'L_MAX_VOTE_EXPLAIN' => $lang['Max_vote_explain'],

'L_UNDO' => $lang['Undo_votes'],

'L_UNDO_VOTE' => $lang['Allow_undo'],

'IMG_LIST_BRANCH0' => $images['list_branch'][0],

'IMG_LIST_BRANCH1' => $images['list_branch'][1],

#

#-----[ FIND ]---------------------------------------------

#

'POLL_LENGTH' => $poll_length)

#

#-----[ BEFORE, ADD ]---------------------------------------------

#

'HIDE_DR' => ( $hide_vote ) ? 'checked="checked" ' : '',

'HIDE_DR_EXP' => ( $hide_vote > 3 ) ? 'checked="checked" ' : '',

'HIDE_SR' => ( $hide_vote && $hide_vote % 3 != 1 ) ? 'checked="checked" ' : '',

'HIDE_VOTERS' => ( $hide_vote && !($hide_vote % 3) ) ? 'checked="checked" ' : '',

'UNDO_VOTE' => ( $undo_vote ) ? 'checked="checked"' : '',

'POLL_LENGTH_H' => $poll_length_h,

'MAX_VOTE' => $max_vote,

#

#-----[ OPEN ]---------------------------------------------

#

viewtopic.php

#

#-----[ FIND ]---------------------------------------------

#

$topic_id = $post_id = 0;

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$vote_id = array();

#

#-----[ FIND ]---------------------------------------------

#

$sql = "SELECT vd.vote_id, vd.vote_text, vd.vote_start, vd.vote_length, vr.vote_option_id, vr.vote_option_text, vr.vote_result

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vd.vote_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, vd.vote_max, vd.vote_voted, vd.vote_hide, vd.vote_undo

#

#-----[ FIND ]---------------------------------------------

#

ORDER BY vr.vote_option_id ASC";

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vr.vote_option_id

#

#-----[ IN-LINE BEFORE, ADD ]---------------------------------------------

#

vr.vote_result DESC,

#

#-----[ FIND ]---------------------------------------------

#

$vote_title = $vote_info[0]['vote_text'];

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$max_vote = $vote_info[0]['vote_max'];

$voted_vote = $vote_info[0]['vote_voted'];

$hide_vote = $vote_info[0]['vote_hide'];

#

#-----[ FIND ]---------------------------------------------

#

$sql = "SELECT vote_id

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vote_id

#

#-----[ IN-LINE REPLACE WITH ]---------------------------------------------

#

vote_option_id

#

#-----[ FIND ]---------------------------------------------

#

$user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0;

$db->sql_freeresult($result);

#

#-----[ REPLACE WITH ]---------------------------------------------

#

$user_voted = ( $db->sql_numrows() < $max_vote ) ? 0 : TRUE;

if ( $db->sql_numrows() > 0 && !($user_voted) ) // get options already voted for

{

$row = $db->sql_fetchrowset($result);

for ($i = 0; $i < count($row); $i++)

{

$vbn[$i] = $row[$i]['vote_option_id'];

}

$db->sql_freeresult($result);

}

#

#-----[ FIND ]---------------------------------------------

#

$poll_expired = ( $vote_info[0]['vote_length'] ) ? ( ( $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] < time() ) ? TRUE : 0 ) : 0;

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$auth_undo = ( $vote_info[0]['vote_undo'] ) ? true : false;

if ( $userdata['user_level'] == ADMIN )

{

$auth_mod = true;

}

else if ( $userdata['user_level'] == MOD )

{

$sql = "SELECT ug.user_id

FROM " . AUTH_ACCESS_TABLE . " aa,

" . USER_GROUP_TABLE . " ug WHERE

aa.auth_mod = " . TRUE . " AND

aa.group_id = ug.group_id AND

aa.forum_id = $forum_id AND

ug.user_id = " . $userdata['user_id'];

if ( !$db->sql_query($sql) )

{

message_die(GENERAL_ERROR, "Could not obtain user permissions", '', __LINE__, __FILE__, $sql);

}

$auth_mod = ( $db->sql_numrows() ) ? true : false;

}

else

{

$auth_mod = false;

}

#

#-----[ FIND ]---------------------------------------------

#

$vote_graphic = 0;

$vote_graphic_max = count($images['voting_graphic']);

#

#-----[ AFTER, ADD ]---------------------------------------------

#

if ( ($hide_vote && ($hide_vote % 3 != 1)) && !$poll_expired && $vote_info[0]['vote_length'] && !$auth_mod )

{

// Resort the options - the results are hidden so we shouldn't

// give any inclination to what is winning

$new_sort = array();

for ($i = 0; $i < $vote_options; $i++)

{

$new_sort[$vote_info[$i]['vote_option_id']] = $i;

}

ksort($new_sort);

foreach ($new_sort as $i)

{

$vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0;

$vote_graphic_length = round($vote_percent * $board_config['vote_graphic_length']);

$vote_graphic_img = $images['voting_graphic'][$vote_graphic];

$vote_graphic = ($vote_graphic < $vote_graphic_max - 1) ? $vote_graphic + 1 : 0;

if ( count($orig_word) )

{

$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);

}

$template->assign_block_vars("poll_option", array(

'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'],

'POLL_OPTION_RESULT' => '',

'POLL_OPTION_PERCENT' => '',

'POLL_OPTION_IMG' => $vote_graphic_img,

'POLL_OPTION_IMG_WIDTH' => '0')

);

}

}

else

{

#

#-----[ FIND ]---------------------------------------------

#

'POLL_OPTION_IMG' => $vote_graphic_img,

'POLL_OPTION_IMG_WIDTH' => $vote_graphic_length)

);

}

#

#-----[ AFTER, ADD ]---------------------------------------------

#

}

#

#-----[ FIND ]---------------------------------------------

#

$template->assign_vars(array(

'L_TOTAL_VOTES' => $lang['Total_votes'],

'TOTAL_VOTES' => $vote_results_sum)

);

#

#-----[ REPLACE WITH ]---------------------------------------------

#

if ( ($hide_vote && ($hide_vote % 3 != 1)) && !$poll_expired && $vote_info[0]['vote_length'] && !$auth_mod )

{

$template->assign_block_vars("after", array(

'L_RESULTS_AFTER' => $lang['Results_after'])

);

if ( $hide_vote % 3 )

{

$template->assign_block_vars("voted", array(

'L_VOTED' => $lang['Voted_show'],

'VOTED' => $voted_vote)

);

}

}

else

{

$template->assign_block_vars("voted", array(

'L_VOTED' => $lang['Voted_show'],

'VOTED' => $voted_vote)

);

$template->assign_block_vars("total", array(

'L_TOTAL_VOTES' => $lang['Total_votes'],

'TOTAL_VOTES' => $vote_results_sum)

);

}

if ( !$poll_expired && $vote_info[0]['vote_length'] )

{

$time_left = $vote_info[0]['vote_start'] + $vote_info[0]['vote_length'] - time();

$days_left = intval($time_left / 86400);

$time_left = $time_left - ( $days_left * 86400 );

$hours_left = intval($time_left / 3600);

$time_left = $time_left - ( $hours_left * 3600 );

$minutes_left = intval($time_left / 60);

$time_left = (( $days_left == 1 ) ? $days_left . ' ' . $lang['Day'] : $days_left . ' ' . $lang['Days']) . ', ';

$time_left .= (( $hours_left == 1 ) ? $hours_left . ' ' . $lang['Hour'] : $hours_left . ' ' . $lang['Hours']) . ', ';

$time_left .= ( $minutes_left == 1 ) ? $minutes_left . ' ' . $lang['Minute'] : $minutes_left . ' ' . $lang['Minutes'];

$template->assign_block_vars("expires", array(

'L_POLL_EXPIRES' => $lang['Poll_expires'],

'POLL_EXPIRES' => $time_left)

);

}

else if ($poll_expired == 1)

{

$template->assign_block_vars("expires", array(

'L_POLL_EXPIRES' => $lang['Poll_expired'],

'POLL_EXPIRES' => '')

);

}

$vote_manage_text = '';

if ( ($hide_vote > 4 && $poll_expired) || !$hide_vote || $auth_mod )

{

$vote_manage_text = $lang['Detailed_results'];

}

$vote_manage_text .= ( strlen($vote_manage_text) && ($auth_undo || $auth_mod) ) ? '/'.$lang['Undo_votes'] : (( $auth_undo ) ? $lang['Undo_votes'] : '');

if ( $vote_manage_text == $lang['Undo_votes'] )

{

$vote_manager = ''.$vote_manage_text.'';

}

else if ( strlen($vote_manage_text) )

{

$vote_manager = ''.$vote_manage_text.'';

}

if ( strlen($vote_manager) )

{

$template->assign_block_vars("vote_manage", array(

'VOTE_MANAGE' => $vote_manager)

);

}

#

#-----[ FIND ]---------------------------------------------

#

'pollbox' => 'viewtopic_poll_ballot.tpl')

);

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$vote_box = ( $max_vote > 1 && ($max_vote - count($vbn) > 1) ) ? 'checkbox' : 'radio';

#

#-----[ FIND ]---------------------------------------------

#

for($i = 0; $i < $vote_options; $i++)

#

#-----[ BEFORE, ADD ]---------------------------------------------

#

// Resort the options -- the user has not voted yet,

// so they don't need to see them in order of what's winning

$new_sort = array();

#

#-----[ AFTER, ADD ]---------------------------------------------

#

# NOTE: This is still after the same for loop we found with FIND

#

{

$new_sort[$vote_info[$i]['vote_option_id']] = $i;

}

ksort($new_sort);

foreach ($new_sort as $i)

#

#-----[ FIND ]---------------------------------------------

#

if ( count($orig_word) )

{

$vote_info[$i]['vote_option_text'] = preg_replace($orig_word, $replacement_word, $vote_info[$i]['vote_option_text']);

}

#

#-----[ AFTER, ADD ]---------------------------------------------

#

$disable = false;

if (isset($vbn))

{

foreach ($vbn as $option)

{

if ($option == $vote_info[$i]['vote_option_id'])

{

$disable = true;

}

}

}

$disabled = ($disable) ? "disabled=\"disabled\" " : "";

#

#-----[ FIND ]---------------------------------------------

#

'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],

#

#-----[ BEFORE, ADD ]---------------------------------------------

#

'POLL_VOTE_BOX' => $vote_box,

'POLL_OPTION_DISABLED' => $disabled,

#

#-----[ FIND ]---------------------------------------------

#

$s_hidden_fields = '<input type="hidden" name="topic_id" value="' . $topic_id . '" /><input type="hidden" name="mode" value="vote" />';

}

#

#-----[ AFTER, ADD ]---------------------------------------------

#

if ( $max_vote > 1 && ($max_vote - count($vbn) > 1) )

{

$vote_br = '

';

$max_vote_nb = $max_vote - count($vbn);

}

else

{

$vote_br = '';

$lang['Max_voting_1_explain'] = '';

$lang['Max_voting_2_explain'] = '';

$max_vote_nb = '';

}

#

#-----[ FIND ]---------------------------------------------

#

'POLL_QUESTION' => $vote_title,

#

#-----[ AFTER, ADD ]---------------------------------------------

#

'POLL_VOTE_BR' => $vote_br,

'MAX_VOTING_1_EXPLAIN' => $lang['Max_voting_1_explain'],

'MAX_VOTING_2_EXPLAIN' => $lang['Max_voting_2_explain'],

'MAX_VOTE' => $max_vote_nb,

#

#-----[ OPEN ]---------------------------------------------

#

includes/functions_post.php

#

#-----[ FIND ]---------------------------------------------

#

function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length)

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

&$poll_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, &$poll_length_h, &$max_vote, &$undo_vote

#

#-----[ FIND ]---------------------------------------------

#

$poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0;

#

#-----[ REPLACE WITH ]---------------------------------------------

#

$poll_length = (isset($poll_length)) ? max(0, ($poll_length+$poll_length_h/24)) : 0;

$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;

$undo_vote = (isset($undo_vote)) ? max(0, intval($undo_vote)) : 0;

#

#-----[ FIND ]---------------------------------------------

#

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

&$poll_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, &$max_vote, &$hide_vote, &$undo_vote

#

#-----[ FIND ]---------------------------------------------

#

$sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id";

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vote_length

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, vote_max, vote_hide, vote_undo

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

$current_time, " . ($poll_length * 86400) . "

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, '$max_vote', '$hide_vote', '$undo_vote'

#

#-----[ IN-LINE FIND ]---------------------------------------------

#

vote_length = " . ($poll_length * 86400) . "

#

#-----[ IN-LINE AFTER, ADD ]---------------------------------------------

#

, vote_max = '$max_vote', vote_hide = '$hide_vote', vote_undo = '$undo_vote'

#

zware taak, no idee of het lukt. alle ideeën zijn welkom. maar als ik dat aanpas van die bbcode on poll, dan krijg ik foutmelding van viewtopic.php ivm de laatste aanpassing ofwel werkt het niet. dus er is wel een grotere aanpassing nodig.

Link naar reactie
Delen op andere sites

ooooh niemand? :)

voor de mensen die niet graag lezen: je moet geen schrik hebben omdat het zo'n lang bericht is, als je het eerst stukje leest weet je over wat het gaat, de rest is maar gecopyed uit de install, moet je niet lezen :D

Link naar reactie
Delen op andere sites

ik heb het reeds bekeken,

normaal zou je beide mods kunnen combineren als je geen dubbele waarden hebt erin

ik zou het eens puzzelen maar moet wel lukken denk ik

overloop eens de code en laat eens weten welke regels je twijfels bij hebt, diegene die je kan wijzigen zo zijn ok

dus: geef de stukken code die je niet kan doorvoeren en geef dan het het bestand waar het in moet, ik kijk dan wel ff

edit: ik begrijp wel niet echt waarom je figuren wilt in je poll

Link naar reactie
Delen op andere sites

volgens mij het stuk van viewtopic.php

het zoeken naar:

$template->assign_block_vars("poll_option", array(

'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'],

'POLL_OPTION_CAPTION' => $vote_info[$i]['vote_option_text'])

);

die is redelijk anders, en die heb ik ook moet aanpassen met de advanced bb code

als ik deze aanpas, krijg ik ofwel geen effect, ofwel een foutmelding dat er iets niet klokt met die regel.

en waarom dat ik dat nodig heb: wel ja, nu moet ik steeds in mijn bericht de afbeeldingen zetten met nummers en namen bij en dan die nummers en namen in de poll zetten, dat is 2 keer werk. Het zou veel handiger zijn, moesten die afbeeldingen rechtstreeks in de poll kunnen.

Link naar reactie
Delen op andere sites

hmm, kweet niet, is er geen simpele oplossing voor? het klikt toch simpel: "bbcode in poll" :-D

gaat dat niet door een aanpassing aan de voting bestanden van phpbb, door daar ergens bbcode in te brengen?

misschien ergens een stukje kopieren, ik kan dat hier nu niet zien, maar zou dat zo nergens staan in het post bestand, als je dat copy en past bij het poll bestand.

ik zal anders die advanced bbcode op men test forum zetten en daar wat proberen

Link naar reactie
Delen op andere sites

thx om te proberen, maar nee daar ben ik niets mee:

## MOD Description: Gives poll topics there own folder image

## (Like Announcements and Sticky topics)

dat is dus voor die afbeelding. Dat topic waar een poll instaat een eigen afbeelding krijgt

:-)

Link naar reactie
Delen op andere sites

Gast
Dit topic is nu gesloten voor nieuwe reacties.
×
×
  • Nieuwe aanmaken...

Belangrijke informatie

We hebben cookies geplaatst op je toestel om deze website voor jou beter te kunnen maken. Je kunt de cookie instellingen aanpassen, anders gaan we er van uit dat het goed is om verder te gaan.