[2.0.17] Quick poll insert

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
7
70%
Very Good
1
10%
Good
2
20%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 10

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Thu Jan 12, 2006 8:28 am

I'd like to suggest one minor enhancement. People tend to leave blank lines when creating a poll. These blank lines end up as poll choices. Can you add some code that would delete any blank lines prior to saving the poll. Thanks for considering this.

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Post by Manipe » Thu Jan 12, 2006 7:42 pm

beggers wrote: I'd like to suggest one minor enhancement. People tend to leave blank lines when creating a poll. These blank lines end up as poll choices. Can you add some code that would delete any blank lines prior to saving the poll. Thanks for considering this.

I'll look into it. I can't promise anything though.
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

Marill
Registered User
Posts: 113
Joined: Sun Oct 26, 2003 10:59 pm
Location: In a padded cell
Contact:

Post by Marill » Thu Jan 12, 2006 9:03 pm

It's not this MOD that messes that up anyway, as it doesn't go anywhere near the place that records the vote, that is unless you inserted the data in the wrong place.

I can easily re-do it incase I did do it wrong - I backed up everything twice. If I didn't what mod would of messed it up anyway. Poll wise the only mod I added is the one that lets guests vote.

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Post by Manipe » Fri Jan 13, 2006 4:05 pm

Marill wrote:
It's not this MOD that messes that up anyway, as it doesn't go anywhere near the place that records the vote, that is unless you inserted the data in the wrong place.

I can easily re-do it incase I did do it wrong - I backed up everything twice. If I didn't what mod would of messed it up anyway. Poll wise the only mod I added is the one that lets guests vote.

Try and re-install my MOD, and see if the same problem occurs. If it does, then it means that it's my MOD that is messing it up. If so, I'll take a look at the code for you, just to see what the problem is. :wink:
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

Marill
Registered User
Posts: 113
Joined: Sun Oct 26, 2003 10:59 pm
Location: In a padded cell
Contact:

Post by Marill » Sat Jan 14, 2006 12:50 am

Ok I had a go at uninstalling it.. the template file was easy to clear as it was the only mod that needed changes done to it and I had it backed up twice.. however posting has been changed so many times I wasn't sure if the last backup would overwrite anything else I had done, so I did it all manually. It's hard to do so considering, but I think I managed it.

I tested old and new polls just in case before reinstalling and the problem still exists, I report this to the support forum and I'm sent back here :?:

Geddy
Registered User
Posts: 19
Joined: Thu Jan 26, 2006 11:54 pm

Using with Other Templates

Post by Geddy » Sat Feb 04, 2006 2:04 am

To make this MOD work with other style templates, do you need to alter the posting_body.tpl and posting_poll_body.tpl files of the other styles?

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Re: Using with Other Templates

Post by Manipe » Sat Feb 04, 2006 12:14 pm

Geddy wrote: To make this MOD work with other style templates, do you need to alter the posting_body.tpl and posting_poll_body.tpl files of the other styles?

You just need to edit the posting_poll_body.tpl file. But yes, you need to edit it for all styles for the MOD to function properly.
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

niksa
Registered User
Posts: 612
Joined: Mon Sep 08, 2003 7:20 pm
Location: Future birthplace of James T. Kirk
Contact:

Post by niksa » Fri Feb 10, 2006 8:50 am

Very nice.. I have ALWAYS hated the old way of making polls.. half the time I'd forget to update and the other half the time I'd get ticked off and want to remove an option and end up re-doing the post out of frustration. So when I saw this mod I had to install it immediately. :)

I like the new style of having a text field, this is nice, and I LOVE the add-on by swiss. I allow a lot of poll options and so the add-on is a must have.

Now all I need to do is find some kind of javascript type function that will hide the poll box if not in use and I'll be completely poll-happy. :lol:

Anyway, thank you! Great mod, easy to install and easy to use. :mrgreen:

countz
Registered User
Posts: 65
Joined: Fri Jul 09, 2004 7:07 pm

Post by countz » Fri Apr 07, 2006 9:02 pm

i've installed this mod but now i've got a problem:

to upgrade from 2.0.19 to 2.0.20 i have to change this line:

Code: Select all

# 
#-----[ OPEN ]--------------------------------------------- 
# 
posting.php

#
#-----[ FIND ]---------------------------------------------
# Line 625
				$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$poll_options[intval($option_id)] = htmlspecialchars(trim(stripslashes($option_text)));
but i can't find it, beacuse i changed it with this mod.
it will work good?
This is a block of text that can be added to posts you make. There is a 800 character limit

http://www.bhq.it

Manipe
Former Team Member
Posts: 1146
Joined: Thu Jul 22, 2004 6:30 pm
Location: Éire
Contact:

Post by Manipe » Sat Apr 08, 2006 11:33 am

countz wrote: i've installed this mod but now i've got a problem:

to upgrade from 2.0.19 to 2.0.20 i have to change this line:

Code: Select all

# 
#-----[ OPEN ]--------------------------------------------- 
# 
posting.php

#
#-----[ FIND ]---------------------------------------------
# Line 625
				$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				$poll_options[intval($option_id)] = htmlspecialchars(trim(stripslashes($option_text)));
but i can't find it, beacuse i changed it with this mod.
it will work good?

It's not necissary to carry that command out, as with this MOD, there are no numbers assigned to a poll option in the page, but afterwards when you submit.

Basically, you don't have to do anything.
My MODs: [ Topics a user has started ] , [ Profile views ] , [ Colour on poll results ] , [ Topic posters ] , [ Add number to PM ] , [ Default avatar ] , [ View category name ] , [ Null vote ] , [ Forum description in viewforum ] , [ Resync forum ids ] , [ View PM while replying ] , [ Quick poll insert ] , [ Limit login attempts ] , [ Track PMs ]

www.ManipeF1.com

francefong
Registered User
Posts: 6
Joined: Sat Apr 29, 2006 12:28 am

Post by francefong » Sat Apr 29, 2006 12:35 am

I wanted to point out an interesting error I get each time I go in and try to correct text on a poll.


Let's say I create a poll with the following four options:
Red
Blue
Gren
Yellow


And then let's say that I realize that I misspelled "Gren," and go back in and try to fix the poll. So I go ahead and do that, and instead end up with the following:
Blue
Blue
Green
Yellow


It appears that the second option also takes on whatever votes have been casted to the first option. I go in and try to edit the poll again, and all the options are still there, exactly as I had submitted them. Any idea on what I can do to get that corrected? ^^

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Sat Apr 29, 2006 6:26 am

francefong wrote: I wanted to point out an interesting error I get each time I go in and try to correct text on a poll.


Let's say I create a poll with the following four options:
Red
Blue
Gren
Yellow


And then let's say that I realize that I misspelled "Gren," and go back in and try to fix the poll. So I go ahead and do that, and instead end up with the following:
Blue
Blue
Green
Yellow


It appears that the second option also takes on whatever votes have been casted to the first option. I go in and try to edit the poll again, and all the options are still there, exactly as I had submitted them. Any idea on what I can do to get that corrected? ^^


Just to let you know, I tried that test myself but it worked okay on my system.

francefong
Registered User
Posts: 6
Joined: Sat Apr 29, 2006 12:28 am

Post by francefong » Sat Apr 29, 2006 9:45 pm

Hrm...I tried it on a clean install of phpBB 2.0.19 and it was fine.

Tried it on a clean install of phpBB 2.0.19 with the Categories Hierarchy 2.1.4 mod, and it wouldn't work.

I guess it was the CH mod that was interfering with it.

But I really like the hack, and would appreciate it if someone could point me out on what I could change to get that fixed. ^^

francefong
Registered User
Posts: 6
Joined: Sat Apr 29, 2006 12:28 am

Post by francefong » Sat Apr 29, 2006 10:44 pm

Sorry for the double post, but I figured out the problem. :D

Turns out that in the posting.php file, the CH mod had inserted some extra lines of text as shown below:
switch ( $mode )
{
case 'editpost':
case 'newtopic':
case 'reply':
$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : '';
$message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : '';
$poll_title = ( isset($HTTP_POST_VARS['poll_title']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_title'] : '';
$poll_options = ( $HTTP_POST_VARS['poll_option_text'] && $is_auth['auth_pollcreate'] ) ? explode("\n", $HTTP_POST_VARS['poll_option_text']) : '';
$poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';
$bbcode_uid = '';

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

if ( $error_msg == '' )
{
$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;


//THE CODE NEEDS TO BE INSERTED HERE
// Quick poll insert MOD, By Manipe (Begin)
if ($poll_options){
array_unshift($poll_options, "");
}
// Quick poll insert MOD, By Manipe (End)


//-- mod : categories hierarchy --------------------------------------------------------------------
//-- delete
/*
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);
*/
//-- add
$input_data = array(
'topic_type' => $topic_type,
'bbcode_on' => $bbcode_on,
'html_on' => $html_on,
'smilies_on' => $smilies_on,
'attach_sig' => $attach_sig,
'bbcode_uid' => $bbcode_uid,
'post_username' => str_replace("\'", "''", $username),
'post_subject' => str_replace("\'", "''", $subject),
'post_message' => str_replace("\'", "''", $message),
'poll_title' => str_replace("\'", "''", $poll_title),
'poll_options' => $poll_options,
'poll_length' => $poll_length,
'post_icon' => $post_icon,
'topic_duration' => $topic_duration,
'calendar_time' => $calendar_time,
'calendar_duration' => $calendar_duration,
'sub_title' => $sub_title,
'topic_sub_type' => $topic_sub_type,
);


//THE CODE DOES NOT GO HERE LIKE I ORIGINALLY THOUGHT IT DID


submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $input_data);
unset($input_data);
//-- fin mod : categories hierarchy ----------------------------------------------------------------


Thanks to any who had a chance to look my previous posts over. ^____^

XFFreakyK
Registered User
Posts: 36
Joined: Tue Oct 18, 2005 12:16 am

Post by XFFreakyK » Tue Jun 06, 2006 10:25 pm

From the sounds of it, this exactly what I'm looking for and based on previous users' comments, I can't wait to get it installed.

I'm using both the latest versions of PHPBB (2.020) and Easymod. Nothing else has been installed whatsoever, not even another template. When I try installing via Easymod, I get the following critical error:

Code: Select all

FIND FAILED: In file [posting.php] could not find:

while( list($option_id, $option_text) = @each($HTTP_POST_VARS['poll_option_text']) )
{
if( isset($HTTP_POST_VARS['del_poll_option'][$option_id]) )
{
unset($poll_options[$option_id]);
}
else if ( !empty($option_text) )
{
$poll_options[$option_id] = htmlspecialchars(trim(stripslashes($option_text)));
}
}

MOD script line #144 
Could this be a compatability issue, or just some minor character that's off?

Thanks,

Keven

Post Reply

Return to “[2.0.x] MOD Database Releases”