PDA

View Full Version : vB Survey (UCCASS Survey app integration)


tamarian
06-01-2005, 10:00 PM
What this hack does:

This hack will add a full featured survey application system to your forum.

Credits: John W. Holmes (http://www.bigredspark.com/): Author of UCCASS Survey.

Application Features: See the UCCASS site for full details. After testing several survey apps, this one is the best:

http://www.bigredspark.com/survey.html

The UCCASS offers some advanced features such as branching conditionals (allows hiding/displaying questions based on specific answers), result filtrations and much more.

Integration features:
Replaced authentication with VB's user database
Set permissions per usergroup, for admin/edit/create/take and view results priviliges.
Replaced config files with vB admin settings
Applied vB style to the UCCASS templates (it uses Smarty)

vB Survey added features:
Added anonymity option. If a survey is not anonymous, members can see how other members answered.
Added Hide/unhide survey option
Added Date answer types (D), with dropdown lists for day, month, year to ensure correct date entry.
Added REGEX control for new answer types, to control the answer format.
Added size control for single like text answers and REGEX answers.

Liscense: The original UCCASS Survey application is released under a modified GPL Liscense (Aferro GPL) : http://www.bigredspark.com/survey/license.txt (or look under the /docs directory in the zip file)

Installation difficulty:
o File changes: None
o DB changes: No changes, 19 new tables

Installation:

Unpack the included file
Copy vbsurvey_install.php to your admincp directory
Copy survey.php to your main forum directory
Copy the survey directory below your forum directory (cannot change the directory name)
run the vbsurvey_install.php script in the admincp directory
Go to AdminCP => vBulletin Options => vB Survey (UCCASS) and set the toptions for acess and other settings
If you get permission errors, change file permissions for the survey directory and its contents to 744, and the owner/group to apache:apache (or, some servers are setup to nobody:nobody):

cd /path/to/main/forum
chown -R apache:apache survey
chmod -R 744 survey


Added in v1.5.4 (October, 17, 2005
Now checks primary and secondary permisisons.

Added in v1.5.3 (August 26, 2005
Don't show edit box unless user has permission.

Added in v1.5 (June 7th, 2005

Added a new answer type R, for Regular Expressions (REGEX). This will allow new types to be defined for answers, with controlled format. If the question is required, users will receive an error messages, until they enter the proper format. If the question is optional, the users will only get an error if they try to answer the question, but with the wrong format.
Note: You can disable REGEX type questions by editing the templates.
The Size of type 'S' (Sentence) can now be changed, and no longer hardcoded as 50 characters.
To upgrade, you will need to run the upgrade option in the installation script and re-upload all the files.


Added in v1.3 (June 5th, 2005

Added a new answer type D, for Dates. This will show 3 dropdown lists for day, month, year, to ensure a uniform formate for dates entered by the user, instead of a text box.
Fixed a bug in the anonymous message display. It would state survey is not anonymous, when it actually is.
To upgrade, just re-upload the files (classes and templates directories)



Added in v1.2 (June 4th, 2005)

Removed the "Previous page" button, if the page is the first page of a survey.
Answers in the new/edit answer page are sorted by the numeric value. This allows you to add a later value, but set the order higher, without re-editing the whole list to arrange it.
Fixed a bug in quotes and escapes in the answer types edit.
Upgrade instructions: Just re-upload the classes directory.


Added in v1.1 (June 4th, 2005)

Added anonymity option. This is decided when creating the survey. Once set, it cannot be changed. If the survey is not anonymous, users will see on the survey intro a message that they survey is not anonymous, and that their usernames will show in the results table. The results table will show the usernames and a link to their profile.
Added Hidden option: By default, all active surveys show up on the main page as available surveys. If you set the survey propert to hidden, the survey can still be active, but not show up for members. This can be useful if you want to email the link to a selected user group. Admins and the survey author will still be able to see hidden surveys.
Navbar update to list the various locations in the survey pages.
The previous version showed the "no permission" to guests. Now you can allow guests to view the surveys and results by putting usergoup 0 in the admin panel in usergroups who may see the results. But other priviliges will be ignored.
A couple of bug fixes
Upgrade instructions: Just re-upload all the files, including survey.php


Notes:
1. If you use FTP to upload the survey directory, you might have problems with subdirectories under /survey/smarty/template_c due to the directory names with % signs. In this case, you can delete all the directories under template_c (but not the template_c directory itself). Those subdirectories will be recreated automatically when the templates are read.

2. The "do not remove" comment on the copyright link in the footer is from the original UCCASS footer template. You may contac the original author, John W. Holmes (http://www.bigredspark.com/), for permission to remove the copyright notice, he's willing to talk :) according to their support forum.

hollyboy
06-02-2005, 07:51 AM
looks nice!
not even a file to be edited :)
very interesting hack I might need to use it ;)

TTG
06-02-2005, 12:00 PM
Useful and installed with only one problem .. Images for results of survey don't appear and had to chmod all directory's in survery 777

Clicked install

tamarian
06-02-2005, 01:32 PM
Useful and installed with only one problem .. Images for results of survey don't appear and had to chmod all directory's in survery 777

Try chmod -R 744 *

.Tim
06-02-2005, 11:30 PM
Maybe I'm doing something wrong or I'm just stupid but are the folders supposed to look like this? If so I'm unable to upload them to my survery because of that. :ermm:

http://www.mywasteoftime.net/images/surveyproblem.jpg

tamarian
06-02-2005, 11:35 PM
Maybe I'm doing something wrong or I'm just stupid but are the folders supposed to look like this? If so I'm unable to upload them to my survery because of that. :ermm:


If you can't upload the zip file and uncompres it on the server, here's what you can do: Delete all those directories under template_c, but keep the template_c directory itself. Those directories will then by created by smarty when those templates are accessed the first time.

.Tim
06-02-2005, 11:38 PM
That worked, thanks!

OrangeFlea
06-03-2005, 12:08 AM
I did the 744 thing, but I keep getting permission errors.

EDIT: Am I supposed to manually chmod every directory under /survey 744? There are a lot of sub folders and files underneath there...

tamarian
06-03-2005, 12:26 AM
I did the 744 thing, but I keep getting permission errors.

EDIT: Am I supposed to manually chmod every directory under /survey 744? There are a lot of sub folders and files underneath there...

Yes, the whole thing. You can type this command from your forum main directory:

chmod -R 744 survey

OrangeFlea
06-03-2005, 12:42 AM
Just tried that, this is what I got:

COMMAND:> chmod -R 744 survey
550 Could not change perms on 744 survey: No such file or directory

I feel like such a n00b ;(

tamarian
06-03-2005, 12:55 AM
Just tried that, this is what I got:

COMMAND:> chmod -R 744 survey
550 Could not change perms on 744 survey: No such file or directory

I feel like such a n00b ;(

You need to do this command while in your forum's main directory, where the survey directory is just below it.

Type pwd to find where you are in the directory structure:)

tamarian
06-03-2005, 01:08 AM
I'v re-uploaded the zip file with some minor changes. No need to upgrade. If you already installed it, just make this edit in this file:

./survey/templates/Default/results_table.tpl

Find this:

<tr class="alt1"<td>

Replace with this:

<tr class="alt1"><td>


Also made template_c empty, to help those FTP'in. The content will be auto generated when the templates are first accessed.

TTG
06-03-2005, 01:46 AM
Try chmod -R 744 *

That produces an error

Warning: getimagesize(/usr/home/thetechg/public_html/retreat/survey/templates/Default/images/bar.gif): failed to open stream: Permission denied in /survey/classes/results.class.php on line 233

tamarian
06-03-2005, 01:51 AM
That produces an error

Warning: getimagesize(/usr/home/thetechg/public_html/retreat/survey/templates/Default/images/bar.gif): failed to open stream: Permission denied in /survey/classes/results.class.php on line 233


Give me more details. Does this happen only when accessing results, but the rest is working?

TTG
06-03-2005, 01:55 AM
Give me more details. Does this happen only when accessing results, but the rest is working?

Only when accessing results .. everthing else works fine :)

tamarian
06-03-2005, 02:06 AM
Only when accessing results .. everthing else works fine :)

O.k., try chmod -R 777 instead of 744 just to see if it's really a permission problem.

If that works, then it may just be a matter of changing the owner.

If the apache server is running as apache user (or whatver the user:groupname is), you can then do this:

chown -R apache:apache survey
Then chmod -R 744 survey

TTG
06-03-2005, 02:26 AM
Problem solved .. I'd placed the survey directory in the same directory as forum, not below .. when I viewed page source to read the img src, I realised my error .. duh.

All works perfectly .. thanks for the help

OrangeFlea
06-03-2005, 08:10 AM
This is killing me. I did everything. The folders are in the right directory, I even manually changed all the permissions to 744, and I still get this:

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

tamarian
06-03-2005, 10:15 AM
This is killing me. I did everything. The folders are in the right directory, I even manually changed all the permissions to 744, and I still get this:

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Try this:

https://vborg.vbsupport.ru/showpost.php?p=661660&postcount=16

tamarian
06-03-2005, 02:08 PM
There are a couple of template changes. One causes not updating edited questions. I've changed the zip file. For those who already installed it, you just need to re-upload the .tpl files in this directory: ./survey/templates/Default/

Lionel
06-04-2005, 03:30 AM
I know this has nothing to do with your hack, but maybe you can help and give me some explanation or solution. When I try to run the install file from admincp, the page times out on first step and cannot be found...

OrangeFlea
06-04-2005, 08:59 AM
Hey, everything is working almost perfectly. Only issue is that when I look at the results, the images come up as red x's. I checked and it seems to be looking for the survey folder from the root directory, not the forum directory. How do I change this?

tamarian
06-04-2005, 10:42 AM
I know this has nothing to do with your hack, but maybe you can help and give me some explanation or solution. When I try to run the install file from admincp, the page times out on first step and cannot be found...

Is it in the admincp directory?

OrangeFlea
06-04-2005, 11:15 AM
All problems fixed.

I found a bug, though. It seems that when you erase the results of a survey, members who took it before it was erased are still blocked from taking the survey again.

tamarian
06-04-2005, 11:18 AM
Hey, everything is working almost perfectly. Only issue is that when I look at the results, the images come up as red x's. I checked and it seems to be looking for the survey folder from the root directory, not the forum directory. How do I change this?


Edit the file main.class.php find this line:


if(!$this->set_template_paths($this->CONF['default_template']))


Add above it:

$this->CONF['html'] = $vboptions['bburl'];

Let me know if this fixes it.

tamarian
06-04-2005, 11:38 AM
All problems fixed.

I found a bug, though. It seems that when you erase the results of a survey, members who took it before it was erased are still blocked from taking the survey again.

What did you change to get the images working?

To fix the "already taken" thing, Edit editsurvey.class.php

Find:

$tables = array('results','results_text','ip_track','time_li mit');
Replace with:

$tables = array('results','results_text','ip_track','time_li mit', 'completed_surveys');

OR, wait till later today, I'll make an update with a few added features.

tamarian
06-04-2005, 12:51 PM
Just uploaded the new version, 1.1 No upgrade script needed, just re-upload the files. Here's what's changed:


Added anonymity option. This is decided when creating the survey. Once set, it cannot be changed. If the survey is not anonymous, users will see on the survey intro a message that they survey is not anonymous, and that their usernames will show in the results table. The results table will show the usernames and a link to their profile.
Added Hidden option: By default, all active surveys show up on the main page as available surveys. If you set the survey propert to hidden, the survey can still be active, but not show up for members. This can be useful if you want to email the link to a selected user group. Admins and the survey author will still be able to see hidden surveys.
Navbar update to list the various locations in the survey pages.
The previous version showed the "no permission" to guests. Now you can allow guests to view the surveys and results by putting usergoup 0 in the admin panel in usergroups who may see the results. But other priviliges will be ignored.
A couple of bug fixes
Upgrade instructions: Just re-upload all the files, including survey.php

dsboyce8624
06-04-2005, 02:58 PM
Thaks for the update.

OrangeFlea
06-04-2005, 09:19 PM
What did you change to get the images working?

LOL, I just created a new folder at the area the hack was looking at and uploaded the images there. :P

Awesome hack, man.

tamarian
06-05-2005, 12:16 AM
Another update :)

Added in v1.2 (June 4th, 2005)


Removed the "Previous page" button, if the page is the first page of a survey.
Answers in the new/edit answer page are sorted by the numeric value. This allows you to add a later value, but set the order higher, without re-editing the whole list to arrange it.
Fixed a bug in quotes and escapes in the answer types edit.
Upgrade instructions: Just re-upload the classes directory.

Lionel
06-05-2005, 04:40 AM
Is it in the admincp directory?

yes it is

Lionel
06-05-2005, 04:43 AM
I am able to add the steps individually, except for the first one

tamarian
06-05-2005, 05:23 PM
I am able to add the steps individually, except for the first one

The first step adds a single phrase not currently used, so you should be fine.
This may be a browser issue.

tamarian
06-05-2005, 05:25 PM
Added in v1.3 (June 5th, 2005

Added a new answer type D, for Dates. This will show 3 dropdown lists for day, month, year, to ensure a uniform formate for dates entered by the user, instead of a text box.
Fixed a bug in the anonymous message display. It would state survey is not anonymous, when it actually is.

Lionel
06-05-2005, 05:29 PM
yes it works, thank you. I could not figure out why it was displaying all phrases since they were not installed :-)

tamarian
06-05-2005, 05:57 PM
Added in v1.3 (June 5th, 2005


Added a new answer type D, for Dates. This will show 3 dropdown lists for day, month, year, to ensure a uniform formate for dates entered by the user, instead of a text box.
Fixed a bug in the anonymous message display. It would state survey is not anonymous, when it actually is.


Forgot to add, to upgrade, just re-upload the files in the "classes" and "template" directory.

tamarian
06-05-2005, 05:59 PM
yes it works, thank you. I could not figure out why it was displaying all phrases since they were not installed :-)

I've only done phrasing for the admincp. The rest is ahrcoded, or in the templates. :)

dsboyce8624
06-05-2005, 06:51 PM
I've only done phrasing for the admincp. The rest is ahrcoded, or in the templates. :)

Dude, love the work, but need the update emails. I dunno if they're automatic or you have to do them by hand, but they sure do help us keep up with you.

Dennis

yoyoyoyo
06-05-2005, 07:25 PM
installed easily, and works great! thanks much!

tamarian
06-05-2005, 07:54 PM
Dude, love the work, but need the update emails. I dunno if they're automatic or you have to do them by hand, but they sure do help us keep up with you.

I just did that, for the first time :)

dsboyce8624
06-05-2005, 09:05 PM
I just did that, for the first time :)

Thanks!

tamarian
06-14-2005, 01:08 AM
vB Survey has now been ported to vB 3.5 beta 1
https://vborg.vbsupport.ru/showthread.php?t=83038

subnet_rx
07-13-2005, 04:34 AM
anyone that has tried this and vBSurvey 1.0? I'm looking for something that is viewable by guests, but they can't vote.

tamarian
07-13-2005, 09:40 AM
anyone that has tried this and vBSurvey 1.0? I'm looking for something that is viewable by guests, but they can't vote.

What part do you want viewable by guests? The list of surveys can be viewd by guests. But the actualy survey questions canot be viewd, since that will start entry/answer mode.

subnet_rx
07-13-2005, 03:35 PM
Can the results and comments be viewed?

Also, how this different from Zero Tolerance's vbSurvey 1.0? I'm sure that's a question that many people would like to know that look through both survey mods.

tamarian
07-13-2005, 04:35 PM
Can the results and comments be viewed?

Not currently, as I didn't think of that. But should be easy to add this ability.

Also, how this different from Zero Tolerance's vbSurvey 1.0? I'm sure that's a question that many people would like to know that look through both survey mods.

This is the first time I heard of this :) I just took a look, and sure enough it's there, and he used the name before I did. I have not used his version, so I'm not sure about the differences.

subnet_rx
07-13-2005, 10:58 PM
yes, I'm using his system now, because when I searched, it's the only result that was a vB Survey mod at the time. I'd like for guests to be able to view the results so that these surveys could be indexed.

tamarian
07-13-2005, 11:07 PM
yes, I'm using his system now, because when I searched, it's the only result that was a vB Survey mod at the time. I'd like for guests to be able to view the results so that these surveys could be indexed.

Could you elaborate on what you want, in as much details as possible.

The surveys are indexed, they are listed by title for all to see. Some surveys can be set as hidden, and some as anonymous. Do you really mean guets, as in unsubscribed members, or do you mean you want members to see the results of the survey?

subnet_rx
07-14-2005, 03:30 AM
hmm, if they are indexed, and can have properties like you say, then I think this is worth a download instead of talking more about it. Thanks for your help, clicking install.

subnet_rx
07-16-2005, 05:05 AM
Another question, what's the version of the UCCASS script included in the mod?

tamarian
07-16-2005, 07:22 AM
Another question, what's the version of the UCCASS script included in the mod?

1.8.0 plus some of 1.8.1. I didn't put in all of the 1.8.1 since it won't work on MySQL less than 4.

Tradjick
07-25-2005, 05:37 PM
This is an incredibly useful hack! Thanks a million :)))

chrisu
08-08-2005, 04:37 PM
I guess this is only in english, and no language support available? Didn't find any front-end phrases in language manager...

/chris

tamarian
08-08-2005, 05:20 PM
I guess this is only in english, and no language support available? Didn't find any front-end phrases in language manager...

No, not yet :) However, you can edite the templates in the template directory.

tomshawk
08-09-2005, 11:40 PM
Anybody know why I would be getting this

Error: Cannot find file: ./survey/ADOdb/adodb.inc.php

when running survey.php
http://www.golfinforums.com/forums/survey.php

the 2 require statements in survey.php

require("./global.php");
require('./survey/classes/main.class.php');

any help would be appriciated

tamarian
08-10-2005, 07:24 AM
Anybody know why I would be getting this

Error: Cannot find file: ./survey/ADOdb/adodb.inc.php


Have you uploaded the entire content of the zip file in the exact directory structure? And did you set the file permissions and ownership?

tomshawk
08-10-2005, 12:38 PM
Have you uploaded the entire content of the zip file in the exact directory structure? And did you set the file permissions and ownership?

Yes I did, and for some reason, I logged in today and its working.

wierd, but Thanks for the quick response ;)

zkilzz
08-10-2005, 04:04 PM
I have now installed this and made a survey. But everyone has acces to edit the survey? I cannot find any admin options for rhis nor to happend.

Neither any were i can type how many times they can answer it etc...
Please help me out... :disappointed:

tamarian
08-10-2005, 04:15 PM
I have now installed this and made a survey. But everyone has acces to edit the survey? I cannot find any admin options for rhis nor to happend.

Neither any were i can type how many times they can answer it etc...
Please help me out... :disappointed:

The edit permissions are set for usergroups in vBulletin options -> vB Survey.

Users can only fill the survey once.

eljeffe
08-22-2005, 08:44 PM
I installed this hack and ran the install process. Everything seemed to install just fine. Went to run the hack at http://www.mydoman.com/forums/survey.php and the browser just hangs.

Any ideas?

tamarian
08-22-2005, 09:00 PM
I installed this hack and ran the install process. Everything seemed to install just fine. Went to run the hack at http://www.mydoman.com/forums/survey.php and the browser just hangs.

Any ideas?

You have posted this twice, in the 3.0 version, and the 3.5 version, so I don't know which hack you installed.

Second, the link you posted shows that the file was not there, so you may not have uploaded it, or uploaded it to the wrong location.

eljeffe
08-22-2005, 10:13 PM
You have posted this twice, in the 3.0 version, and the 3.5 version, so I don't know which hack you installed.

Second, the link you posted shows that the file was not there, so you may not have uploaded it, or uploaded it to the wrong location.

Sorry, I accidently posted in the 3.5 forum. I thought I deleted it.

Anyway it's the 3.0 version (1.5 vBSurvey).

The URL is just an example. I'll PM you the URL when I get it reinstalled again.

eljeffe
08-26-2005, 03:25 AM
Sorry, I accidently posted in the 3.5 forum. I thought I deleted it.

Anyway it's the 3.0 version (1.5 vBSurvey).

The URL is just an example. I'll PM you the URL when I get it reinstalled again.

I got it to work. For some reason, it doesn't like running on a NFS mounted volume. Every time I tried to access the survey.php file, it would hang at the first function call and create a .nfs<string of 9 numbers> file in the template/Default directory. I've got no idea why, but that is the behavior that is being exhibited.

The work around was to create the survey directory on the local disk and create a symbolic link to that directory in the /home/www/mydomain.com/forums directory.

I've created my first survey and it works great.

A couple questions:

1. Is there a modification or hack to the survey that will make Multiple Choice Single Selection into a dropdown listbox instead of a bunch of radio select buttons?

2. I'd like to only display the "Edit Survey" box only when a user has the permissions to do so. Have you got anything to do that?

Thanks. Works great -- very flexible, very powerful!!!

tamarian
08-26-2005, 11:57 AM
I got it to work. For some reason, it doesn't like running on a NFS mounted volume. Every time I tried to access the survey.php file, it would hang at the first function call and create a .nfs<string of 9 numbers> file in the template/Default directory. I've got no idea why, but that is the behavior that is being exhibited.

The work around was to create the survey directory on the local disk and create a symbolic link to that directory in the /home/www/mydomain.com/forums directory.


Glad you got it to work :)

1. Is there a modification or hack to the survey that will make Multiple Choice Single Selection into a dropdown listbox instead of a bunch of radio select buttons?

It's already available. Just edit the multiple choice question, change it from vertical to dropdown, then it will become a select box allowing multiple picks.

2. I'd like to only display the "Edit Survey" box only when a user has the permissions to do so. Have you got anything to do that?

I've overlooked this, but it does make sense. Download the new zip file, and just upload 2 files:
1. survey/templates/Default/available_surveys.tpl
2. survey/classes/survey.class.php

eljeffe
08-26-2005, 02:53 PM
Glad you got it to work :)



It's already available. Just edit the multiple choice question, change it from vertical to dropdown, then it will become a select box allowing multiple picks.



I've overlooked this, but it does make sense. Download the new zip file, and just upload 2 files:
1. survey/templates/Default/available_surveys.tpl
2. survey/classes/survey.class.php

You are DA-MAN!!!

Thanks.

BTW, I added the following to survey.php to keep people who didn't belong in the survey page in the first place completely out:

Find:

require("./global.php");
require('survey/classes/main.class.php');
Paste After:

// enabled check
if (!$vboptions['enablememberlist'])
{
eval(print_standard_error('error_nomemberlist'));
}

// permissions check
if (!($permissions['forumpermissions'] & CANVIEW) OR !($permissions['genericpermissions'] & CANVIEWMEMBERS))
{
print_no_permission();
}

pachitalk
09-02-2005, 03:40 PM
Looking forward to using this! Installed fine, changed the survey folder to 744 and all subfolders. Did the Admincp changes. Using vb 3.07

Getting Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Line 8 is require('survey/classes/main.class.php'); CHMOD is 744

What am I missing?

Did I delete my install file too soon?

tamarian
09-02-2005, 03:45 PM
Looking forward to using this! Installed fine, changed the survey folder to 744 and all subfolders. Did the Admincp changes. Using vb 3.07

Getting Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Line 8 is require('survey/classes/main.class.php'); CHMOD is 744

What am I missing?

Did I delete my install file too soon?

For this error, no need to re-install, just check the ownership on the directories.

pachitalk
09-02-2005, 03:51 PM
Thanks for the quick reply, is that setting through my FTP program?

tamarian
09-02-2005, 03:59 PM
Thanks for the quick reply, is that setting through my FTP program?


I don't think so, I usually set it from the command line through SSH.

But to confirm that it's an ownership issue, chmod to 777, and see if it works. With FTP, make sure you give it enough time to recursively change all files and directories.

pachitalk
09-02-2005, 04:10 PM
Okay, 777 allows it to work. So??? The 744 isn't sticking? Or is it's the SSH?

My parent folder "forums" is set to 755. Could that be interfering?

tamarian
09-02-2005, 04:19 PM
Okay, 777 allows it to work. So??? The 744 isn't sticking? Or is it's the SSH?

My parent folder "forums" is set to 755. Could that be interfering?

No, the forums directory shouldn't be a problem. Since 777 works, and 744 doesn't, this means it's the group ownership issue. If you have telnet or SSH, login and change the ownership to the apache process, as mentioned in the first post.

pachitalk
09-02-2005, 05:06 PM
Thanks for your help guys! That worked!

gregwatson
09-05-2005, 07:30 PM
I've worked through most of the "fixes" already mentioned ...

However, I haven't seen this one - I am now down to the following error:

Fatal error: session_start(): Failed to initialize storage module: user (path: /tmp) in /home/bhm1264/public_html/forums/survey/classes/main.class.php on line 28

Any tips on what to look for here?

Thanks
GW

tamarian
09-05-2005, 07:53 PM
I've worked through most of the "fixes" already mentioned ...

However, I haven't seen this one - I am now down to the following error:

Fatal error: session_start(): Failed to initialize storage module: user (path: /tmp) in /home/bhm1264/public_html/forums/survey/classes/main.class.php on line 28

Any tips on what to look for here?

Thanks
GW

It's PHP session issue. Check this fix:

http://forum.mamboserver.com/showthread.php?t=14198

gregwatson
09-05-2005, 09:17 PM
It's PHP session issue. Check this fix:

http://forum.mamboserver.com/showthread.php?t=14198

Any quick way a remote user with cpanel can check for this? I don't think I've ever seen anything about users vs files in a setting I have access to, either in through a control panel or file edit ...

Greg

subnet_rx
09-05-2005, 09:35 PM
Any quick way a remote user with cpanel can check for this? I don't think I've ever seen anything about users vs files in a setting I have access to, either in through a control panel or file edit ...

Greg

I'm looking for a quick way to add choices to this system. I have it installed, but so far, have not used it since most of my surveys are more like elaborate polls. For instance, how could I add a list of restaurants to chose from or a list of Presidents? Right now, I have to add a category, the add all the choices, then set up the survey. I have very few questions in my surveys that use the default answer sets. Any solutions?

tamarian
09-05-2005, 10:04 PM
Any quick way a remote user with cpanel can check for this? I don't think I've ever seen anything about users vs files in a setting I have access to, either in through a control panel or file edit ...

Yes, I should have been more specific :) That fix is php.ini which is the PHP config file. It's usually placed in /etc/php.ini

tamarian
09-05-2005, 10:05 PM
For instance, how could I add a list of restaurants to chose from or a list of Presidents? Right now, I have to add a category, the add all the choices, then set up the survey. I have very few questions in my surveys that use the default answer sets. Any solutions?

In UCCASS/vB Survey, you can easily create new answer types, where you can define the available answer choices.

gregwatson
09-06-2005, 01:29 AM
Yes, I should have been more specific :) That fix is php.ini which is the PHP config file. It's usually placed in /etc/php.ini
<grin> ... before I try this and bring down about 20 websites <grin> ... I don't have a php.ini file in that directory, so I assume that php.ini will essentially create a local override ...

Anyspecial formating other than a blank text file with the following command line in it?

-----php.ini--------------
php_value session.save_handler files
-------------------------

Greg

tamarian
09-06-2005, 01:41 AM
<grin> ... before I try this and bring down about 20 websites <grin> ... I don't have a php.ini file in that directory, so I assume that php.ini will essentially create a local override ...

Anyspecial formating other than a blank text file with the following command line in it?

-----php.ini--------------
php_value session.save_handler files
-------------------------

No, there's a single php.ini file for your PHP server

You will find in it a line like this one:

session.save_handler = user

Change to this:

session.save_handler = files

subnet_rx
09-06-2005, 08:27 PM
Another quick question. I have certain surveys marked as hidden and inactive, yet they still show up for everyone on the Edit Survey menu. Is there a way to hide this entire menu if the usergroup doesn't have permission to edit any surveys?

tamarian
09-06-2005, 09:23 PM
Another quick question. I have certain surveys marked as hidden and inactive, yet they still show up for everyone on the Edit Survey menu. Is there a way to hide this entire menu if the usergroup doesn't have permission to edit any surveys?

Open classes/survey.class.php and find:

$this->smarty->assign_by_ref('show',$show);

Add befor it:

if($this->_hasPriv(EDIT_PRIV))
{ $show['edit_survey'] = TRUE; }
else
{ $show['edit_survey'] = FALSE; }

then open templates/Default/available_surveys.tpl and find:

<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:{$stylevar.formwidth}" align="{$stylevar.left}">

<fieldset class="fieldset">
<legend> Edit Surveys </legend>
<table cellpadding="0" cellspacing="{$stylevar.formspacer}" border="0" width="100%">
<tr>
<td>
<form class="indented_cell" method="get" action="{$conf.html}/survey.php?do=edit_survey">
<input type="hidden" name="do" value="edit_survey">
<input type="hidden" name="s" value="{$session.dbsessionhash}" />
Survey:&nbsp;
<select name="sid" size="1">
{section name="as" loop=$survey.all_surveys.sid}
<option value="{$survey.all_surveys.sid[as]}">{$survey.all_surveys.name[as]}</option>
{/section}
</select>
&nbsp;<input type="submit" name="submit" value="Edit Survey">
</form>
</td>
</tr>
</table>
</fieldset>
</div>
</div>
</td>
</tr>

And replace with this:

{section name="create_link" show=$show.edit_survey}
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:{$stylevar.formwidth}" align="{$stylevar.left}">

<fieldset class="fieldset">
<legend> Edit Surveys </legend>
<table cellpadding="0" cellspacing="{$stylevar.formspacer}" border="0" width="100%">
<tr>
<td>
<form class="indented_cell" method="get" action="{$conf.html}/survey.php?do=edit_survey">
<input type="hidden" name="do" value="edit_survey">
<input type="hidden" name="s" value="{$session.dbsessionhash}" />
Survey:&nbsp;
<select name="sid" size="1">
{section name="as" loop=$survey.all_surveys.sid}
<option value="{$survey.all_surveys.sid[as]}">{$survey.all_surveys.name[as]}</option>
{/section}
</select>
&nbsp;<input type="submit" name="submit" value="Edit Survey">
</form>
</td>
</tr>
</table>
</fieldset>
</div>
</div>
</td>
</tr>
{/section}

subnet_rx
09-07-2005, 01:22 AM
that worked great, I'd recommend that fix for future releases. :)

subnet_rx
09-07-2005, 07:48 PM
Guess I have yet another question. I have survey questions that are two dependencies deep. Meaning if they answer yes to one, the next is shown, and a yes to that, then the next is shown. Only, the third is shown whether the second is a yes or no. Any idea what could be going on? I have the third question setup on the dependency that the second is a yes.

tamarian
09-07-2005, 08:49 PM
Guess I have yet another question. I have survey questions that are two dependencies deep. Meaning if they answer yes to one, the next is shown, and a yes to that, then the next is shown. Only, the third is shown whether the second is a yes or no. Any idea what could be going on? I have the third question setup on the dependency that the second is a yes.

No idea, as I have not used dependencies. Best thing is to check the docs, or post in the UCCASS forum:

http://www.bigredspark.com/forums/

eljeffe
09-10-2005, 01:37 PM
Aside from me going into the database and updating the vb3_vbsurvey_completed table by hand, is there a way I can flag surveys that can be taken multiple times?

We have a situation where we want to survey multiple instances of the same event. In our example, we want to survey the owner each time a certain component fails. Since we have some users who have had multiple failures of this component, we would like to get their survey information for each failure. Currently, the survey only allows a user to take it once.

I can update the table manually, but I didn't know if there was a mechanism that I am missing, or an untapped feature that is not enabled to allow for this.

Thanks!

This is one of our favorite hacks!

tamarian
09-10-2005, 02:08 PM
Aside from me going into the database and updating the vb3_vbsurvey_completed table by hand, is there a way I can flag surveys that can be taken multiple times?

We have a situation where we want to survey multiple instances of the same event. In our example, we want to survey the owner each time a certain component fails. Since we have some users who have had multiple failures of this component, we would like to get their survey information for each failure. Currently, the survey only allows a user to take it once.

I can update the table manually, but I didn't know if there was a mechanism that I am missing, or an untapped feature that is not enabled to allow for this.


Try this, in survey/classes/survey.class.php delete or comment this line:

if($check === ALREADY_COMPLETED) eval(print_standard_error("You have already completed the requested survey.", 0));

I haven't tried it, but it should allow a user to take the survey multiple times.

eljeffe
09-11-2005, 04:11 PM
Try this, in survey/classes/survey.class.php delete or comment this line:

if($check === ALREADY_COMPLETED) eval(print_standard_error("You have already completed the requested survey.", 0));

I haven't tried it, but it should allow a user to take the survey multiple times.

Thanks, man! That worked! As always, you've got the answers!

SirJonathan
09-11-2005, 07:59 PM
Hey there!

I've been using Erwin's hack for almost a year now to accept 'Membership Applications' and post them to an Admin only viewing area. From there we would approve or deny the applications and grant access to the members.

The trouble with that is that it doesn't post for an alarmingly high amount of applicants.. They hit submit, and for some reason or another it just doesn't post!

So I'm wondering if the results from this survey tool as each user fills out the 'application' could be posted as a new thread in a private forum?

Thanks! I'm really anxious to find a solution :).

-Jonathan

tamarian
09-11-2005, 09:22 PM
So I'm wondering if the results from this survey tool as each user fills out the 'application' could be posted as a new thread in a private forum?

It's doable/hackable, but not streight forward. :)

eljeffe
09-30-2005, 05:23 AM
It appears that the can_% checks for permissions is just looking at the Primary Usergroup. I have certain members who's primary must be "Registered Users", but I have created an additional usergroup called "Survey Editor", which my users are a member of. The selection dropdown and edit button are not showing up. Do you have a quick fix to look in the addtional usergroups field as well as the primary usergroup field when you are doing the can_% checks?

Thanks,

Jeff

tamarian
09-30-2005, 08:56 PM
It appears that the can_% checks for permissions is just looking at the Primary Usergroup. I have certain members who's primary must be "Registered Users", but I have created an additional usergroup called "Survey Editor", which my users are a member of. The selection dropdown and edit button are not showing up. Do you have a quick fix to look in the addtional usergroups field as well as the primary usergroup field when you are doing the can_% checks?

Try this, and make sure you test it, because I haven't :)

In survey.php find:
$bbuserinfo['can_admin_surveys'] = in_array($bbuserinfo['usergroupid'], explode(',', $vboptions['vb_survey_admin_groups']));
$bbuserinfo['can_edit_surveys'] = in_array($bbuserinfo['usergroupid'], explode(',', $vboptions['vb_survey_edit_groups']));
$bbuserinfo['can_create_surveys'] = in_array($bbuserinfo['usergroupid'], explode(',', $vboptions['vb_survey_create_groups']));
$bbuserinfo['can_take_surveys'] = in_array($bbuserinfo['usergroupid'], explode(',', $vboptions['vb_survey_take_groups']));
$bbuserinfo['can_view_survey_results'] = in_array($bbuserinfo['usergroupid'], explode(',', $vboptions['vb_survey_result_groups']));

Replace with:

$bbuserinfo['can_admin_surveys'] = is_member_of($bbuserinfo, explode(',', $vboptions['vb_survey_admin_groups']));
$bbuserinfo['can_edit_surveys'] = is_member_of($bbuserinfo, explode(',', $vboptions['vb_survey_edit_groups']));
$bbuserinfo['can_create_surveys'] = is_member_of($bbuserinfo, explode(',', $vboptions['vb_survey_create_groups']));
$bbuserinfo['can_take_surveys'] = is_member_of($bbuserinfo, explode(',', $vboptions['vb_survey_take_groups']));
$bbuserinfo['can_view_survey_results'] = is_member_of($bbuserinfo, explode(',', $vboptions['vb_survey_result_groups']));

eljeffe
09-30-2005, 09:51 PM
I see where you are going, but that didn't work.

Aren't you missing something in:

is_member_of($bbuserinfo,

Shouldn't it be:

is_member_of($bbuserinfo['something here'],

tamarian
09-30-2005, 11:13 PM
I see where you are going, but that didn't work.

Aren't you missing something in:

is_member_of($bbuserinfo,

Shouldn't it be:

is_member_of($bbuserinfo['something here'],

No, it's not that. The code I posted earlier would only work in vB 3.5 :)

Give this a try (replacing the same section), but test it, as I'm currently reinstalling my test server.

foreach (explode(',', $vboptions['vb_survey_admin_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_admin_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_edit_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_edit_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_create_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_create_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_take_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_take_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_result_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_view_survey_results'] = TRUE;
break;
}
}

eljeffe
10-01-2005, 04:26 AM
No, it's not that. The code I posted earlier would only work in vB 3.5 :)

Give this a try (replacing the same section), but test it, as I'm currently reinstalling my test server.

foreach (explode(',', $vboptions['vb_survey_admin_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_admin_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_edit_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_edit_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_create_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_create_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_take_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_take_surveys'] = TRUE;
break;
}
}
foreach (explode(',', $vboptions['vb_survey_result_groups']) as $gid) {
if (is_member_of($bbuserinfo, $gid)) {
$bbuserinfo['can_view_survey_results'] = TRUE;
break;
}
}

That fixed it! Very cool man, very cool!

jrcart
12-27-2005, 04:20 PM
The Custom URL function at Survey End doesn;t seem to be there? It just has Main Survey Page and Survey Results page. How can I get a custom url to be the destination upon survey completion? Thanks

tamarian
12-28-2005, 01:42 AM
The Custom URL function at Survey End doesn;t seem to be there? It just has Main Survey Page and Survey Results page. How can I get a custom url to be the destination upon survey completion? Thanks

I took it off, as it didn't seem a good idea to let users enter redirects, other than either the survey main page, or the results.

jrcart
12-28-2005, 11:56 AM
It's just not a very good user experience to send them back to the survey page. How do I at least get rid of the "View Results" link next to the survey for users who do not have access to view that?

wtrk
01-04-2006, 03:00 AM
is there a 3.5.x version of this?

freefallu
04-21-2006, 11:06 PM
i too would like to know if this works on 3.5.4

Dr Steevil
05-20-2006, 01:32 AM
This is killing me. I did everything. The folders are in the right directory, I even manually changed all the permissions to 744, and I still get this:

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Warning: main(survey/classes/main.class.php): failed to open stream: Permission denied in /survey.php on line 8

Ok, this is killing me too. Been at this for HOURS and my wife is ready to kill me if I don't get off this computer. I've looked everywhere I can think of trying to do the chmod and chown thing. The survey folder and all sub folders have 744 permissions, but I can't figure out how to do the chown bit. I am using WS_FTP and can't make heads or tails out of how to use the command line editor. The script editor doesn't help either. Can someone please help me here? I need "plain english" help. I am quite the newbie at this and have no problems admitting it - LOL! I do learn quickly though.

mister
07-31-2006, 05:25 PM
It doesn't work (out of the box) in 3.5.4.

Does anybody know if it is easy to port over, or is being updated?

I need to know asap .. thanks!

i too would like to know if this works on 3.5.4