[MODDB] Tabulated Survey at Topic Head

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Get Involved
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

[MODDB] Tabulated Survey at Topic Head

Post by asinshesq »

MOD Title:Tabulated survey at topic head for phpbb3

MOD Description: Allow users who are entitled to post polls to design surveys that will appear at the top of a topic. Users will be able to respond to the survey by clicking a button...each user response will appear at the topic head

MOD Version: 0.0.3

MOD Download: http://phpbbmods.asinsh.com/tabulated_s ... _0-0-3.zip

This mod is a port over to phpbb3 of my tabulated survey at topic head for phpbb2.

I am in the back and forth process of getting it validated. Once I get it validated, the final package will have an upgrade mod that will show the changes needed to upgrade from version 0.0.3 to the final validated version (1.0.4 as of February 25, 2008 ;) ). As I said earlier, I have no plans to provide an upgrade path for versions before 0.0.3.
Last edited by asinshesq on Thu Apr 03, 2008 2:40 pm, edited 7 times in total.
User avatar
Quezza
Registered User
Posts: 212
Joined: Sat Oct 23, 2004 7:17 pm
Location: Hertfordshire, UK
Contact:

Re: ALPHA Tabulated Survey at Topic Head

Post by Quezza »

Have you got a demo?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: ALPHA Tabulated Survey at Topic Head

Post by asinshesq »

Quezza wrote:Have you got a demo?
No, but the download has a contrib folder that includes screenshots from the phpbb2 version. At least it should - let me know if I forgot to include the screenshots and I'll remedy that and in the meantime you can get those screenshots by downloading the phpbb2 version in the released mods section for phpbb2 mods, which you can find by following the link in my sig below.
User avatar
Quezza
Registered User
Posts: 212
Joined: Sat Oct 23, 2004 7:17 pm
Location: Hertfordshire, UK
Contact:

Re: ALPHA Tabulated Survey at Topic Head

Post by Quezza »

I can't see any screenshots in this package or the phpBB2 version. Am I missing something?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: ALPHA Tabulated Survey at Topic Head

Post by asinshesq »

Quezza wrote:I can't see any screenshots in this package or the phpBB2 version. Am I missing something?
Look in the contrib folder, where I think there is a screenshots folder. I'm not at a pc (I'm responding via blackberry) so I can't tell you anything more now but later today I'll check and see.

By the way, if you try this mod you may want to use easymod to install it. There's a simple workaround that will allow you to use easymod on a phpbb2 board to install a mod on a phpbb3 board. The workaround works fine (I've used it many times to install my mods in developlment into phpbb3). See http://www.phpbb.com/community/viewtopi ... 5#p2913845
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: ALPHA Tabulated Survey at Topic Head

Post by asinshesq »

asinshesq wrote:Look in the contrib folder, where I think there is a screenshots folder. I'm not at a pc (I'm responding via blackberry) so I can't tell you anything more now but later today I'll check and see.
Senior moment. The screenshots for the phpbb2 version are here: http://phpbbmods.asinsh.com/screenshots ... ad_mod.zip
joebanana
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 6:28 pm

Re: [ALPHA] Tabulated Survey at Topic Head

Post by joebanana »

I'm having 2 issues:

1) Although I allowed all groups to reply to the survey, normal users don't see the 'fill survey' button.

2) If I try to 'fill the survey for another user', i have the following error message when submitting the answers:
SQL ERROR [ mysql4 ]

Unknown column 'SURVEY_ALL_REGISTERED_USERS' in 'where clause' [1054]

SQL

SELECT u.user_id, u.username FROM phpbb_users u INNER JOIN phpbb_user_group ug ON ug.user_id = u.user_id WHERE ((ug.group_id = '5,6,4,1,7,2,3,8' AND ug.user_pending = 0) OR SURVEY_ALL_REGISTERED_USERS = '5,6,4,1,7,2,3,8') AND u.username_clean = "martin duguay" AND u.user_id <> 1 LIMIT 1

BACKTRACE


FILE: includes/db/mysql.php
LINE: 133
CALL: dbal->sql_error()

FILE: survey.php
LINE: 64
CALL: dbal_mysql->sql_query()
Any clue?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [ALPHA] Tabulated Survey at Topic Head

Post by asinshesq »

joebanana wrote:I'm having 2 issues:

1) Although I allowed all groups to reply to the survey, normal users don't see the 'fill survey' button.

2) If I try to 'fill the survey for another user', i have the following error message when submitting the answers:
SQL ERROR [ mysql4 ]

Unknown column 'SURVEY_ALL_REGISTERED_USERS' in 'where clause' [1054]

SQL

SELECT u.user_id, u.username FROM phpbb_users u INNER JOIN phpbb_user_group ug ON ug.user_id = u.user_id WHERE ((ug.group_id = '5,6,4,1,7,2,3,8' AND ug.user_pending = 0) OR SURVEY_ALL_REGISTERED_USERS = '5,6,4,1,7,2,3,8') AND u.username_clean = "martin duguay" AND u.user_id <> 1 LIMIT 1

BACKTRACE


FILE: includes/db/mysql.php
LINE: 133
CALL: dbal->sql_error()

FILE: survey.php
LINE: 64
CALL: dbal_mysql->sql_query()
Any clue?
The second to last version of this mod treated 'all registered users' as a special case but then I realized that phpbb3 now has a special user group for all registered users, so I deleted all the references to it. I must have somehow missed that reference in my master mod file (but it's all working fine on my board so when I get home tonight it should be easy for me to tell you what to change).

In the meantime, if you want you can simply delete the OR...survey_all_registered_users part of the $sql definitin if you know your way around php.
joebanana
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 6:28 pm

Re: [ALPHA] Tabulated Survey at Topic Head

Post by joebanana »

I'll try that and let you know. Does that problem affect my first issue as well?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [ALPHA] Tabulated Survey at Topic Head

Post by asinshesq »

joebanana wrote:I'll try that and let you know. Does that problem affect my first issue as well?
It's probably a related issue. So change the survey you are trying (for now) to be open for particular groups rather than all registered users and see if the users in those groups have fill in buttons.
User avatar
Quezza
Registered User
Posts: 212
Joined: Sat Oct 23, 2004 7:17 pm
Location: Hertfordshire, UK
Contact:

Re: [ALPHA] Tabulated Survey at Topic Head

Post by Quezza »

Nice looking MOD. I might install this later :)
joebanana
Registered User
Posts: 134
Joined: Tue Nov 23, 2004 6:28 pm

Re: [ALPHA] Tabulated Survey at Topic Head

Post by joebanana »

I tried both putting the user in a group and only allowing this group to reply, and removing the OR part in survey.php.

I no longer have the error message, but if the user tries, the fill button still doesn't appear, and if I try to fill it for the user, it says the user doesn't have the permission to fill it :(
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [ALPHA] Tabulated Survey at Topic Head

Post by asinshesq »

I can't actually test things until tonight, but at a quick look at the files this simple change should fix the sql error you reported:

Code: Select all

OPEN
survey.php

FIND
		WHERE ((' . $db->sql_in_set('ug.group_id', $group_ids) . ' AND ug.user_pending = 0) OR ' . $db->sql_in_set(SURVEY_ALL_REGISTERED_USERS, $group_ids) . ')

REPLACE WITH
		WHERE (' . $db->sql_in_set('ug.group_id', $group_ids) . ' 
			AND ug.user_pending = 0 
I see nothing else wrong in viewtopic or survey.php or functions_survey.php that accounts for a user not being given a fill in button when he is in a group authorized to take a survey (or for a moderator not being able to fill out a survey for someone who is authorized to take a survey). So I'll install this tonight if I get a chance, do a comparison against my working phpbb3 board and see where I forgot to document a change.

Edit: one thing that might help track this down is if you could tell me what happens when you click to edit the post that has the survey in it and re-open the survey posting form. Did it retain the group information you originally gave it or has that disappeared?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [ALPHA] Tabulated Survey at Topic Head

Post by asinshesq »

Ok, I just checked my test board that has a clean install of phpbb3 and this mod (and no other mods), and once I make the one change I described above all seems to work. In particular, when I specify a particular group or groups, users who are in that group properly have the fill in survey button (and users who are not in those groups do not). And, when I specify 'REGISTERED' as the group that can take the survey, all users who are logged in get the fill in button. And similarly moderators can fill in the survey for anyone who is in the right group or groups.

So I wonder what's going on, joebanana. How did you isntall this? Since the guts of it are in new files the mod provides, it's hard to believe you have an installation error. Is there maybe something weird going on with your groups?

Can you take a look at the phpbb_survey table, look up the survey you are working on and take a look at what is in the groups_id field for that survey? Does it match the group_ids for the groups you specified as the ones to take the survey? And when you edit the post with the survey in it, can you check the survey and see if the groups you selected are still selected?

Lastly, are you really sure the users you are trying to get to take the survey are users in the right groups?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: [BETA] Tabulated Survey at Topic Head

Post by asinshesq »

I just uploaded a slightly revised version of this mod. Here's the changelog:

Code: Select all

##   2007-07-04	- Version 0.0.2
##		  deleted incorrect reference to survey_all_registered_users in survey.php;
##		  deleted the language/en/mods/survey.php file since it is no longer used
Seems to work fine on RC2. I'm now changing the designation to Beta.
Locked

Return to “[3.0.x] MODs in Development”