tabulated survey at topic head

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

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
ddaddy
Registered User
Posts: 100
Joined: Sun Dec 21, 2008 6:24 pm

Re: tabulated survey at topic head

Post by ddaddy »

May I suggest for the next release?

I have combined it with this Poll Reminder MOD
http://www.phpbb.com/community/viewtopi ... &t=1662195

It sends members straight to the survey when they log in, to remind them to vote.
It works well, however using the 'Force Vote' part doesn't work with this where it doesn't let users browse the board until the have filled in the survey.
I'm sure they can be combined if more people want it too.
I can help with the changes i've made to it to get it to work with this mod.

Thanks

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

ddaddy wrote:May I suggest for the next release?
I have combined it with this Poll Reminder MOD
http://www.phpbb.com/community/viewtopi ... &t=1662195

It sends members straight to the survey when they log in, to remind them to vote.
Sorry, but since I don't need the reminder feature for my board I won't be spending time doing that myself. If you need some hints to help you do it, feel free to ask.

Keep in mind when you tinker with this that you would presumably not want to remind people to take a survey (or force them to take it) unless they are a member of a group who is supposed to take the survey in the first place. That's no problem if your surveys tend to be open to all registered users (the way polls are), but if you limit a survey to a particular group I assume you should likewise limit the reminders to that group.

Also, what's supposed to happen if there are more than one surveys the user is supposed to be reminded of? (I guess the same question comes up with polls.)

ddaddy
Registered User
Posts: 100
Joined: Sun Dec 21, 2008 6:24 pm

Re: tabulated survey at topic head

Post by ddaddy »

Thanks for the reply. I'm actually using version 0.0.1 which only worked for 1 survey/poll and not several.
My board only uses registered users and I wanted everyone to fill out my survey.
The reminder isn't getting everyone filling it in, so i'm going to have to use the force part of it.

The only problem I can see with it not working, is for a poll if you go to any page but the poll's post, it takes you to the poll's post. So keeps looping back to the post when you try to navigate anywhere.
With this, you need to navigate to survey.php page to fill in the survey, but when navigating to this page it takes you back to the post page with the results.

I just need to find how to allow you to navigate to survey.php. I'll give it a go tomorrow, cheers.

t2ffn
Registered User
Posts: 61
Joined: Tue Jun 02, 2009 7:44 pm
Location: Hull, England

Re: tabulated survey at topic head

Post by t2ffn »

Hi Asinshesq,

I've been using this for a while thanks to your earlier help, I'm going to download the newer version today (I'm even installing mods myself while my IT guy is on holiday! and doing pretty well if I do say so! :lol:) One thing I asked him to do before he left was move the survey to below the post, so users read the post, then complete the survey.

He hasn't done this, so could you advise how this couls be done. I'm fine using Note++ etc to edit it, think he made it seem more difficult than it is, afterall the installation instructions make it clear ;) :D

Thanks in advance

Paul

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

t2ffn wrote:One thing I asked him to do before he left was move the survey to below the post, so users read the post, then complete the survey.

He hasn't done this, so could you advise how this couls be done.
Probably not a good idea (will mess up the page look), but are you using subsilver or prosilver?

t2ffn
Registered User
Posts: 61
Joined: Tue Jun 02, 2009 7:44 pm
Location: Hull, England

Re: tabulated survey at topic head

Post by t2ffn »

asinshesq wrote: Probably not a good idea (will mess up the page look), but are you using subsilver or prosilver?
Using prosilver (slighlty modified by replacing colours etc)

The reason for this is it's a business forum and every post has a survey certain people must answer. I think it would make it easier for them to see the post before the survey with lists of names etc

I'll try it and see if it flows right,

Thanks

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

t2ffn wrote:
asinshesq wrote: Probably not a good idea (will mess up the page look), but are you using subsilver or prosilver?
Using prosilver (slighlty modified by replacing colours etc)

The reason for this is it's a business forum and every post has a survey certain people must answer. I think it would make it easier for them to see the post before the survey with lists of names etc

I'll try it and see if it flows right,

Thanks
You can try this:

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
styles/prosilver/template/viewtopic_body.html

#
#-----[ FIND AND DELETE]------------------------------------------------
#
<!-- IF S_SHOW_SURVEY --><!-- INCLUDE survey_preview_or_viewtopic.html --><!-- ENDIF -->

#
#-----[ FIND ]------------------------------------------------
#
<!-- END postrow -->

#
#-----[ AFTER, ADD ]------------------------------------------------
#
<!-- IF S_SHOW_SURVEY --><!-- INCLUDE survey_preview_or_viewtopic.html --><!-- ENDIF -->
But the better approach for your problem is to ask your IT guy to take a look at viewtopic.php and revise it so that whenever someone goes to a topic with a survey in it and does not specify a post_id, viewtopic.php takes the user directly to the first post in the topic (rather than to the very top of the page). That should be pretty easy to do. But if the above change works for you, I guess there's no reason to bother.

t2ffn
Registered User
Posts: 61
Joined: Tue Jun 02, 2009 7:44 pm
Location: Hull, England

Re: tabulated survey at topic head

Post by t2ffn »

Legend.

So how do you learn this witch-craft? :lol: :lol:

Works perfectly on my test forum. This is great, as most posts will have no replies, but if they do, it forces the reader to scroll through them to get to the survey which is what I wanted.

Thanks

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

Thanks for letting me know, and glad it looks ok.

t2ffn
Registered User
Posts: 61
Joined: Tue Jun 02, 2009 7:44 pm
Location: Hull, England

Re: tabulated survey at topic head

Post by t2ffn »

Seeing as I've got your attention... :oops:

I change two or three things when designing a survey. These are consistent, so can I go in and change them to the default settings?

In particular:

The list of non-responders layout. (yes, comma sparated, left justified)
Hide results. (yes)

I'm sure this is very easy to do :D

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

t2ffn wrote:I change two or three things when designing a survey. These are consistent, so can I go in and change them to the default settings?

In particular:

The list of non-responders layout. (yes, comma sparated, left justified)
Hide results. (yes)

I'm sure this is very easy to do :D
Now it's your chance to see how easy this is. The following is the code from includes/functions_surve.php that sets the defaults when you are creating a new survey:

Code: Select all

	// now set variables to their defaults if there is not already a designed survey in there...
	else
	{
		$survey_caption									= '';
		$designated_groups								= array();
		$widths											= array();
		$select_alphabetical							= '';
		$select_order_of_response						= 'selected="selected"';
		$select_sort_by_first_answer					= '';
		$select_sort_by_first_answer_descending_order	= '';
		$select_nonresponders_no						= '';
		$select_nonresponders_center_column				= 'selected="selected"';
		$select_nonresponders_left_column				= '';
		$select_nonresponders_center_comma_separated	= '';
		$select_nonresponders_left_comma_separated		= '';
		$select_skip_one								= 'selected="selected"';
		$select_skip_two								= '';
		$select_skip_three								= '';
		$select_allow_change_answers_yes				= 'selected="selected"';
		$select_allow_change_answers_no					= '';
		$select_hide_names_of_respondents_yes			= '';
		$select_hide_names_of_respondents_no			= 'selected="selected"';
		$select_hide_survey_results_yes					= '';
		$select_hide_survey_results_no					= 'selected="selected"';
		$max_number_of_questions						= 8;
		$survey_length									= '';
		$survey_height									= '';
		$width_username									= '';
	}
Should be a fun exercise for you to tinker with that to set the defaults however you want ;)

t2ffn
Registered User
Posts: 61
Joined: Tue Jun 02, 2009 7:44 pm
Location: Hull, England

Re: tabulated survey at topic head

Post by t2ffn »

:lol:

Thanks, thats all I needed; to know where they were, and I've managed to change over the defaults! :D :D :D :D

(This is all on the test forum... not allowed to "learn" on the live one! :lol: )

I by no means think its easy to write, not what I meant. To write these takes some sort of black magic :lol: , but little edits like this just need a bit of guidance.

Thanks, glad you let me have a go :D

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

t2ffn wrote:Thanks, thats all I needed; to know where they were, and I've managed to change over the defaults! :D :D :D :D
You're a legend :mrgreen:
(I fear for your IT guy's job when he gets badck ;) )

ddaddy
Registered User
Posts: 100
Joined: Sun Dec 21, 2008 6:24 pm

Re: tabulated survey at topic head

Post by ddaddy »

Can anyone help me incorporate this slightly into another mod?
The other mod forces users to vote. If they haven't voted they are automatically sent to the topic with the survey until they have completed it. The redirect works fine for users that havent yet filled it in, but when they press the button to fill in the survey, they get taken straight back to the topic again.

This is the code I have that decides whether to redirect the user to the topic or not, and I somehow need to add to it to let a user navigate to the complete_survey page

Code: Select all

if ($config['vote_reminder_topic_id'] && $user->data['user_vote_reminder'] == 0 && $topic_id != $config['vote_reminder_topic_id'])
{
	if (!function_exists('user_vote_reminder'))
	{
		include($phpbb_root_path . 'includes/functions_vote_reminder.' . $phpEx);
	}
	user_vote_reminder();
}
I have tried adding this to the IF statement but with no luck.

Code: Select all

|| ($user->page['page_name'] != 'survey.php')
I'm not a php coder so am trying to cut and paste bits of code, so maybe the $user->page code is the wrong thing to use??

Thanks

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: tabulated survey at topic head

Post by asinshesq »

ddaddy wrote:Can anyone help me incorporate this slightly into another mod?
The other mod forces users to vote. If they haven't voted they are automatically sent to the topic with the survey until they have completed it. The redirect works fine for users that havent yet filled it in, but when they press the button to fill in the survey, they get taken straight back to the topic again.

This is the code I have that decides whether to redirect the user to the topic or not, and I somehow need to add to it to let a user navigate to the complete_survey page

Code: Select all

if ($config['vote_reminder_topic_id'] && $user->data['user_vote_reminder'] == 0 && $topic_id != $config['vote_reminder_topic_id'])
{
	if (!function_exists('user_vote_reminder'))
	{
		include($phpbb_root_path . 'includes/functions_vote_reminder.' . $phpEx);
	}
	user_vote_reminder();
}
I have tried adding this to the IF statement but with no luck.

Code: Select all

|| ($user->page['page_name'] != 'survey.php')
I'm not a php coder so am trying to cut and paste bits of code, so maybe the $user->page code is the wrong thing to use??

Thanks
Sorry, I'm not following you. Is there a mod that forces the vote for SURVEYS or do you only mean POLLS? If it's just for polls, what did you do to adapt it to this survey mod? And when you say you added some code, you didn't say where. In what file?

In any event, your added code does the opposite of what I think you want. If the idea is to skip redirection when the user is on survey.php, I wold think that particular added code should read

Code: Select all

&& ($user->page['page_name'] != 'survey.php')
because you are trying to say if you are on survey.php you want the redirection to be skipped, right?

(Again, I'm not sure about where the code you are talking about is so I may have this wrong.)

Locked

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