Page 17 of 21

Re: tabulated survey at topic head

Posted: Sat Aug 22, 2009 12:57 pm
by ddaddy
Hi Alan,
The MOD is the first release of the Force Poll Vote MOD.
I had to alter the queries slightly so it looks in the survey table to see if a user has completed it instead of the poll table.
I'm away from my pc at the moment so can't post the exact changes.

This has worked great by sending every user to the survey topic just once. If I want to Force them to fill it in, then it needs to keep redirecting them there until they fill it in.
This only lets them view the topic and not the page to fill the survey in.

The code above, is in viewtopic.php to check if they should be redirected. I need to add to the IF statement that it's ok to goto the complete survey page without being redirected.

Cheers

Re: tabulated survey at topic head

Posted: Sat Aug 22, 2009 12:59 pm
by ddaddy
Just seen the edit to your last post. I will try that when I get home.

Re: tabulated survey at topic head

Posted: Sat Aug 22, 2009 2:50 pm
by asinshesq
ddaddy wrote:...The code above, is in viewtopic.php to check if they should be redirected. I need to add to the IF statement that it's ok to goto the complete survey page without being redirected...
This doesn't make sense to me, but maybe I'm missing something. The user initially gets redirected to the topic where a survey exists that he has not yet completed, correct?

But once the user is there, when he clicks the fill out a survey button he goes straight to survey.php (he never goes back to viewtopic). So it seems to me that adding that if statement in viewtopic will not help. The mod must be redirecting the user with some other code that has nothing to do with viewtopic, right? And it's in that other code that you would have to carve out survey.php as an exception to the rule, I think.

Re: tabulated survey at topic head

Posted: Sat Aug 22, 2009 3:22 pm
by asinshesq
asinshesq wrote:
ddaddy wrote:...The code above, is in viewtopic.php to check if they should be redirected. I need to add to the IF statement that it's ok to goto the complete survey page without being redirected...
This doesn't make sense to me, but maybe I'm missing something. The user initially gets redirected to the topic where a survey exists that he has not yet completed, correct?

But once the user is there, when he clicks the fill out a survey button he goes straight to survey.php (he never goes back to viewtopic). So it seems to me that adding that if statement in viewtopic will not help. The mod must be redirecting the user with some other code that has nothing to do with viewtopic, right? And it's in that other code that you would have to carve out survey.php as an exception to the rule, I think.
I looked at the current version of the poll vote reminder mod and I see that the redirection happens in the page_header function that appears in includes/functions.php (not in viewtopic.php). If that's what you have too, the code I gave you (changing || to &&) should work.

Re: tabulated survey at topic head

Posted: Sat Aug 22, 2009 4:45 pm
by ddaddy
Many Thanks Alan.

I was looking at the wrong bit of code! There's similar code in viewtopic, I didn't realise what I needed actually happened in the page header part of functions.php.

All working great now. My members must fill in the survey before they can use the forum.

Many Many Thanks

Re: tabulated survey at topic head

Posted: Sun Aug 23, 2009 8:16 am
by saajid
:D nice mod

Re: tabulated survey at topic head

Posted: Thu Sep 03, 2009 2:49 pm
by asinshesq
If anyone using this mod sees extra unlabeled boxes in the group list that appears in the group notice tab, that's likely a conflict between this mod and another mod (for example, my own postnotices to groups mod :oops: ). If you have that problem, you can fix it by changing every occurence of 'listrow' in this mod to instead read 'surveylistrow'. The places where this mod adds listrow are as follows:

- includes/functions_survey.php (1 time)

- styles/prosilver/template/survey_posting_body.html (5 times)

- styles/subsilver2/template/survey_posting_body.html (5 times)

I would advise everyone to make this change even if you don't have the problem so that you won't run into the problem in the future when you install some other mod.

Re: tabulated survey at topic head

Posted: Thu Sep 03, 2009 4:53 pm
by Jaifaime
Good call. I actually downloaded the survey mod yesterday and was about to install it. Just happened to check this topic once more before I installed it, just in case.

Good lookin out for people ^^d

Re: tabulated survey at topic head

Posted: Wed Sep 09, 2009 3:55 pm
by t2ffn
Alan,

Something I've noticed when posting many many topics on my forum, if I write a new topic and add a survey, press preview, then decide to edit part of the post, press preview again, the survey is removed from the preview, so I couldn't press Submit, I have to add the survey again.

Basically, if you use the survey function twice, the second time removes the survey.

Is this a known occurance?

Thanks

Re: tabulated survey at topic head

Posted: Wed Sep 09, 2009 4:15 pm
by asinshesq
t2ffn wrote:if I write a new topic and add a survey, press preview, then decide to edit part of the post, press preview again, the survey is removed from the preview, so I couldn't press Submit, I have to add the survey again.
If I am following you correctly, that does not happen on my test board. If I start a new topic, create a survey in it, click preview, edit the post some more, click preview again, edit the post some more, click the preview again, etc., the survey stays in there the way it is supposed to. If yours disappears, something is wrong on your board and we'll have to investigate further. But do you mean something else?
t2ffn wrote:Basically, if you use the survey function twice, the second time removes the survey.
I'm not sure what you mean when you talk about using the survey function twice. If you just mean clicking preview a few times in a new topic that includes a survey, see my answer above. But do you mean something different?

Re: tabulated survey at topic head

Posted: Wed Sep 09, 2009 4:17 pm
by t2ffn
Yeah thats exactly what I mean. I can't keep on previewing it, as the survey is removed on the second preview. I thought it was a bit daft for it to get deleted by previewing :oops:
I'm not sure what you mean when you talk about using the survey function twice. If you just mean clicking preview a few times in a new topic that includes a survey, see my answer above. But do you mean something different?
Sorry, mean preview twice not survey. :oops:

Re: tabulated survey at topic head

Posted: Wed Sep 09, 2009 4:45 pm
by asinshesq
t2ffn wrote:Yeah thats exactly what I mean. I can't keep on previewing it, as the survey is removed on the second preview. I thought it was a bit daft for it to get deleted by previewing :oops:
I'm not sure what you mean when you talk about using the survey function twice. If you just mean clicking preview a few times in a new topic that includes a survey, see my answer above. But do you mean something different?
Sorry, mean preview twice not survey. :oops:
Sounds like something non-standard is going on on your board - probably in posting.php. If you pm me your posting.php file I'll take a look to see if the problem jumps out at me. And if you have made changes to includes/functions_survey.php you might as well pm that to me as well though it seems unlikely that that would be where the problem is.

Re: tabulated survey at topic head

Posted: Tue Oct 27, 2009 11:35 am
by milplus
hi can I understand how accessing these option?
I've successfully installed the MOD but because no demo I cannot find the menu where creating the survey and so on
thanks
viktor

Re: tabulated survey at topic head

Posted: Tue Oct 27, 2009 12:36 pm
by asinshesq
milplus wrote:hi can I understand how accessing these option?
I've successfully installed the MOD but because no demo I cannot find the menu where creating the survey and so on
thanks
viktor
The screenshots in the contrib folder show where the button is but it's so clear anyway that my guess is that you forgot to grant permissions like the screen tells you to do (you got a big red warning label after you navigated to http://[your_address]/install_survey.php that said to set permissions ;) ).

So, do the following:

- go to the permissions tab in the acp

- click the forum permissions link

- select a forum for which you want to grant permissions

- select a user or group you want to grant permissions to

- click the 'surveys' tab and answer 'yes' for "Can design surveys in posts"

- click 'apply permissions'.

Once you do that, whenever that user or a member of that group starts a new topic in that forum, he will see a tab next to the regular options, upload attachment and poll survey tabs that he can click to design a survey.

Re: tabulated survey at topic head

Posted: Sat Dec 05, 2009 9:37 pm
by manic2
asinshesq

Could you kindly help me with a problem in selecting users when answering surveys for others? This is when you hit the 'Find a member' button. On the next screen when you click [Select] under a users name then this should link straight back to the survey.php screen & insert that users name.

Now firstly this is NOT I believe anything to do directly with yoru mod as I downloaded a vanilla copy of phpBB3 & your mod & all installed & worked correctly.

If you remember I actually have two of your survey mods running at the same time & each thread shows two separate surveys. From memory I am running versions 1.06 & 1.07. I can't (easily) just update to 1.08 as I have heavily modified your mod.

In the vaniilla /working copy when on the Find a member screen the taskbar contains:-
/memberlist.php?mode=searchuser&form=answer_survey&field=username&select_single=true
on the non working one it contained:-
/memberlist.php?mode=searchuser&form=post&field=username&select_single=true
I had this in survey.php:-

Code: Select all

'U_SEARCH_USER'					=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username&select_single=true'),
Which I replaced with this:-

Code: Select all

'U_SEARCH_USER'					=> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=answer_survey&field=username&select_single=true'),
& this now shows the correct taskbar line. I still can't however select a user. When I hit the [Select] link it just jumps back to the top of the 'Find a member' page with a small alert saying Error on page at the bottom of the window.

Can you point me in the rght direction?

I did see this in the 1.08 changelog:-
fixed problems in prosilver template that interfered with use of FIND when using answer for another user
& wondered if this was connected?

Many thanks.