Invision Byte: (T30) Close Only Poll - Invision Byte

Jump to content

Welcome to Invision Byte

Welcome to Invision Byte, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information. Take advantage of it immediately, Register Now or Sign In.

  • Start new topics and reply to others
  • Subscribe to topics and forums to get automatic updates
  • Purchase one of the products available and quickly receive support for it!
  • View and use the shoutbox to communicate
  • Get your own profile and make new friends
  • Customize your experience here
Guest Message by DevFuse
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

(T30) Close Only Poll File Updated: 29 Jun 2009

#1
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious
File Name: (T30) Close Only Poll
File Submitter: terabyte
File Submitted: 09 Jun 2009
File Updated: 16 Jul 2011
File Category: IP.Board
IP.Board 3.0 Compatible: Yes
IP.Board 3.1 Compatible: Yes
IP.Board 3.2 Compatible: No

This mod adds a new option while editing a poll to close it to new votes leaving the topic open for replying.

Click here to download this file
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#2
User is offline   Jemima 

  • n00b
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 26-June 09
  • IP.Board:2.3.x
  • Current Mood: Current Mood: None Chosen
hi terabyte,

i need a little bit of clarification with this mod. i dl it from invision power resources. i was doign ok with the file edits until this section.

Open the file "admin/applications/forums/sources/classes/post/classPost.php"

Find:
'poll_only' => $poll_only,

Add Below:
//-----------------------------------------
// (T30) Close Only Poll
//-----------------------------------------
'tb_cop_closed' => ( $this->request['tb_cop_closed'] == 1 ) ? 1 : 0,




Save and upload the file back on the server

the section in Find, appeared 4 times in my classpost.php document and i got myself a little confused as to where to add it. should i add it under all 4 ?

-------------------------------------------------------

step 3: the skin edits, i ran into a bit of trouble here too.

Open the skin template "Online List -> showOnlineList", i did this in the acp through look and feel, i then copied the text into dreamweaver and used find to locate the text <if test="voteButton:|:$topicData['state'] != 'closed' AND $forumData['status']"> and it said the document didnt contain this line of text.

at the top of the readme, it said to back up the topicview > poll display template, i checked the acp look and feel section for this and searched the text i found in that section and it does contain the <if test="voteButton:|:$topicData['state'] != 'closed' AND $forumData['status']"> text, im guessing its here i alter the text not online list > show online section ?

i hope i made sense and thanks in advance for any help you can offer me, and im sorry if im being a bit dumb, i just cant figure it out :)

Jemima

This post has been edited by Jemima: 29 June 2009 - 02:14 AM

0

#3
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious

Quote

hi terabyte,

i need a little bit of clarification with this mod. i dl it from invision power resources. i was doign ok with the file edits until this section.

Open the file "admin/applications/forums/sources/classes/post/classPost.php"

Find:
'poll_only' => $poll_only,

Add Below:
//-----------------------------------------
// (T30) Close Only Poll
//-----------------------------------------
'tb_cop_closed' => ( $this->request['tb_cop_closed'] == 1 ) ? 1 : 0,




Save and upload the file back on the server

the section in Find, appeared 4 times in my classpost.php document and i got myself a little confused as to where to add it. should i add it under all 4 ?

No, if you search properly the "find text" that is in the readme using also all the tabs included there is only 1 line with this code. Anyway the correct edit is around line 1794, here below how the code looks around that line:
				if( $topic['poll_state'] )
				{
					$this->DB->update( 'polls', array( 
														'votes'				=> intval( $this->poll_total_votes ),
														'choices'			=> addslashes(serialize( $this->poll_questions )),
														'poll_question'		=> IPSText::stripAttachTag( $this->request['poll_question'] ),
														'poll_only'			=> $poll_only,
														'poll_view_voters'	=> intval( $poll_view_voters ) 
													), 'tid='.$topic['tid'] );



Quote

step 3: the skin edits, i ran into a bit of trouble here too.

Open the skin template "Online List -> showOnlineList", i did this in the acp through look and feel, i then copied the text into dreamweaver and used find to locate the text <if test="voteButton:|:$topicData['state'] != 'closed' AND $forumData['status']"> and it said the document didnt contain this line of text.

at the top of the readme, it said to back up the topicview > poll display template, i checked the acp look and feel section for this and searched the text i found in that section and it does contain the <if test="voteButton:|:$topicData['state'] != 'closed' AND $forumData['status']"> text, im guessing its here i alter the text not online list > show online section ?

i hope i made sense and thanks in advance for any help you can offer me, and im sorry if im being a bit dumb, i just cant figure it out :)

Jemima

Yes sorry, my mistake there :P

The correct template is Topic View -> pollDisplay, I'll upload the download immediately with the fixed readme.
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#4
User is offline   Jemima 

  • n00b
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 26-June 09
  • IP.Board:2.3.x
  • Current Mood: Current Mood: None Chosen
i think i did search using the whole of the text u included tabs and all (selected everything from the start to the end of the box), but it still showed as finding more than one area of that text. however i followed your instructions and chose the text on line 1794 and it now works perfectly :thumbsup:

thanks for your explanation, i appreciate your help a lot :D

This post has been edited by Jemima: 29 June 2009 - 05:48 PM

0

#5
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious
You're welcome :)
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#6
User is offline   geewhzz 

  • n00b
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 11-August 09
  • IP.Board:3.0.x
  • Current Mood: Current Mood: None Chosen
hi, having an issue.

Fatal error: Call to a member function tb_cop_hook() on a non-object in C:\Program Files\EasyPHP 2.0b1\www\hooks\tbCloseOnlyPoll_2ca64a514dcb32b0e0cf1486c90c5c17.php on line 24


i have checked and tb_cop_hook is in the 'post screen' skin section with:

<li class='field checkbox'>
	<input type='checkbox' class='input_check' name='tb_cop_closed' id='tb_cop_closed' value='1'<if test="$this->caches['tb_cop']"> checked='checked'</if>/>
	<label for='tb_cop_closed'>{$this->lang->words['tb_cop_text']}</label>
	<span class='desc'>{$this->lang->words['tb_cop_desc']}</span>
</li>


any help? thanks.
0

#7
User is offline   geewhzz 

  • n00b
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 11-August 09
  • IP.Board:3.0.x
  • Current Mood: Current Mood: None Chosen
okay i see the problem. i'm in IN_DEV mode, i don't really understand how skinning works. there are 3 cache folders and a master folder. the skin is in the database so it shows in the acp but it isn't actually in any of the skin php files as a function.

is there anywhere i can read about how skinning works more indepth?
0

#8
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious
There is a good guide on IPS Resources on how to use IN_DEV, this support topic for the hooks it not really the right place to talk about it :wacko:
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#9
User is offline   emmi 

  • n00b
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 09-October 07
  • IP.Board:2.3.x
  • Current Mood: Current Mood: None Chosen
I just tried to get this to work, I can see the check box, I check it and save the thread but people are still able to vote. When I edit the poll the check box is unchecked. :/

I noticed also that this is on several places throughout the classPost.php. Where should this go?

//-----------------------------------------
// (T30) Close Only Poll
//-----------------------------------------
'tb_cop_closed' => ( $this->request['tb_cop_closed'] == 1 ) ? 1 : 0,

Should I put the code above everywhere where "'poll_only' => $poll_only," is found?

This post has been edited by emmi: 03 January 2010 - 08:55 PM

0

#10
User is offline   Black-Elmo 

  • n00b
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 30-April 10
  • IP.Board:3.0.x
  • Current Mood: Current Mood: Inspired
I am running this on IP.Board 3.1 and works fine however when posting a blog entry using IP.Blog 2.2.0 I am getting PHP errors on the top of the page

[b]Warning[/b]: func_get_arg(): Argument 9 not passed to function in [b]/home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php[/b] on line [b]80[/b]

[b]Warning[/b]: func_get_arg(): Argument 10 not passed to function in [b]/home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php[/b] on line [b]81[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]109[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]120[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]129[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]130[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]134[/b]


What would I need to add to allow this to work with IP.Blogs as well
0

#11
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious

View PostBlack-Elmo, on 13 June 2010 - 12:31 PM, said:

I am running this on IP.Board 3.1 and works fine however when posting a blog entry using IP.Blog 2.2.0 I am getting PHP errors on the top of the page

[b]Warning[/b]: func_get_arg(): Argument 9 not passed to function in [b]/home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php[/b] on line [b]80[/b]

[b]Warning[/b]: func_get_arg(): Argument 10 not passed to function in [b]/home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php[/b] on line [b]81[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]109[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]120[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]129[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]130[/b]

[b]Warning[/b]: Cannot modify header information - headers already sent by (output started at /home2/account/public_html/community/cache/skin_cache/cacheid_4/skin_post.php:80) in [b]/home2/account/public_html/community/admin/sources/classes/output/formats/html/htmlOutput.php[/b] on line [b]134[/b]


What would I need to add to allow this to work with IP.Blogs as well

I never tested the mod with the polls in the blog app. For now it is probably best if you disable the mod completely and wait for an updated version with the fix.
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#12
User is offline   Feronso 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 70
  • Joined: 15-April 08
  • IP.Board:2.3.x
  • Current Mood: Current Mood: None Chosen
I Have waiting for its update for 3.1.2 version.
0

#13
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious
As far as I know this should work just fine on 3.1.2? (Except the blog bug of course..)
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

#14
User is offline   AMIGAnTOMEK 

  • n00b
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 03-August 08
  • IP.Board:N/A
  • Current Mood: Current Mood: None Chosen
Can you planned upgrade this mod for 3.2.3 ??
0

#15
User is offline   terabyte 

  • Administrator
  • PipPipPipPipPipPipPipPip
  • Group: Management
  • Posts: 8,907
  • Joined: 30-September 07
  • Location:Italy
  • IP.Board:3.1.x
  • Current Mood: Current Mood: Insomnious
Yes I have plans to upgrade this for IPB 3.2, I just didn't have time yet.. :wacko:
Board Rules - Available Products - Products Faqs - Need a Custom Work?


* Don't PM me for support, post in the forum or submit a ticket from the client area! *
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users