vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Major Additions - vB Survey: Add a full-featured survey tool to your forum (https://vborg.vbsupport.ru/showthread.php?t=212244)

Spikeman 04-25-2009 10:00 PM

vB Survey: Add a full-featured survey tool to your forum
 
1 Attachment(s)
What this hack does:

This hack will add a full featured survey application system to your forum. You can survey your members opinions on various topics, or allow usergroups to create their own surveys.

Credits: John W. Holmes: Author of UCCASS Survey.
tamarian who initially released this hack for vB3.0 - 3.5 before I ported it to 3.6 - 3.8 outstanding work by him.

Application Features: See the UCCASS site for full details.

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: (some will be ported back to UCCASS)
Added anonymity option. If a survey is not anonymous, members can see how other members answered.
Added Hide/unhide survey option. This is useful to send surveys to specific users or usergroups.
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:
2 mins, all done via product file.

Installation:

* Unpack the included file
* Copy survey.php to your main forum directory
* Copy the survey directory into your forum directory (cannot change the directory name)
* Install the Product-Survey.xml
* The product file will also install all data for the 2 default surveys to get you started.
* Go to AdminCP => vBulletin Options => Survey System Options - and set the options for access 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

Notes:

1. The "do not remove" comment on the copyright link in the footer is from the original UCCASS footer template. You may contact the original author, John W. Holmes, for permission to remove the copyright notice, he's willing to talk according to their support forum.
2. 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.


Please click Install if you have installed this mod.


1. All tables, templates, phrases etc are installed via product file.
2. Support for wol has been added.
3. Some bugs fixed with the UCCASS system

I would grateful if you did click Install if you use it. Remember you only get notified of updates if you Install

Demo Here :- http://www.beta-tester.co.uk/iphone/survey.php please note the Demo may have restrictions as it is a live board. You may or may not be able to test the survey as a guest, this will not affect your sites as generally why would you want guests taking a survey on your site, you would never get a true survey result, I have only enabled this on my board so as to get the ball rolling and you guys can see it. you should all be able to see results page though.

If you have the older 3.5 Hack installed you MUST uninstall that before installing 3.8

Translations:-
Arabic - patch developer

Spikeman 04-26-2009 08:25 PM

If you are using my previous 3.6 version do not upgrade at this time, there are no significant changes, only to the installation script for 3.8 compatability. More features will be coming soon at which time a post will be made on the 3.6 script to make you aware.

Translations:- This is not as simple as just changing phrases in vBulletin as almost all phrases are coded into the smarty templates. Therefore individual packages will be listed, you can then download your appropriate languge.

Anyone wanting to help in translations pm me

Arabic :- Completed

pein87 04-26-2009 08:38 PM

thanks installed but will test it on a demo board first good work mate.

yahoooh 04-26-2009 10:13 PM

thank u very much , i will try it

silvermerc 04-26-2009 10:54 PM

it says iv already taken the survey ;s

Spikeman 04-27-2009 02:00 AM

Quote:

Originally Posted by silvermerc (Post 1799613)
it says iv already taken the survey ;s

I assume you are talking about the Demo Board? It is difficult to set up a demo board for guests to post as this is not how a survey is conducted, so it can be a bit hit and miss on the demo, Most demo users should be able to take the survey but all should be able to view results.

Brandon Sheley 04-27-2009 02:00 AM

great idea, I may install this one on our forums :)

Creative Liquid 04-27-2009 06:09 AM

Great idea. I can not upload the template_c files and there is no link on my forum to the survey. Any ideas?

vibedream 04-27-2009 09:36 AM

Good work
Thanks

Spikeman 04-27-2009 09:39 AM

Quote:

Originally Posted by Creative Liquid (Post 1799776)
Great idea. I can not upload the template_c files and there is no link on my forum to the survey. Any ideas?


1. Go to the location of survey.php example http://www.yourdomain.com/forums/survey.php

2. 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.

Sweeks 04-27-2009 11:00 AM

When trying your demo I get this:

You have already completed the requested survey.

When I never took one.
________
CHEVROLET KINGSWOOD ESTATE SPECIFICATIONS

Spikeman 04-27-2009 11:28 AM

Quote:

Originally Posted by Sweeks (Post 1799833)
When trying your demo I get this:

You have already completed the requested survey.

When I never took one.

It is difficult to set up a demo board for guests to post as this is not how a survey is conducted, so it can be a bit hit and miss on the demo, Most demo users should be able to take the survey but all should be able to view results.

The only real way around this to to register and take survey, but I do not want anyone registering on my site just to play with a demo also registering will only let you take a survey once!

Edit Just put a temp hack in place so you should not get the You have already completed the requested survey statement

vbboarder 04-27-2009 04:18 PM

Quote:

Originally Posted by Spikeman (Post 1799545)
If you are using my previous 3.6 version do not upgrade at this time, there are no significant changes, only to the installation script for 3.8 compatability. More features will be coming soon at which time a post will be made on the 3.6 script to make you aware.


Demos look great! Looking forward to the new features. Thanks a lot :)

Hornstar 04-28-2009 04:34 AM

yeah I think this would be really great to use to get some feedback on a new event I plan to run on my site soon :)

Alfa1 04-28-2009 09:45 AM

What new features are you preparing?

Spikeman 04-28-2009 10:01 AM

Quote:

Originally Posted by Alfa1 (Post 1800415)
What new features are you preparing?

I am looking into a number of possibilities right now,

1. Insert pre made survey modules, eg..surveys on sports, computing, etc... so user can download a pre made survey and insert into the survey hack, surveys can be time consuming to setup, so i will try to make some base files that will require minimun input by the survey owners.

2. Integrate available surveys into threads, with options to show stats, ACP configurable.

3. vBa CMPS modules - Latest - random etc..


These are some ideas that i have been working on, any more let me know & will see what can be done.

Hornstar 05-01-2009 06:33 AM

They sound great! looking forward to that update :)

jazz_aaf 05-02-2009 05:04 AM

problem with adding arabic text under windows-1256 encoding. It writes well to the database, but display blank space when trying to read from the dbase. Any solution for this problem? Our forum uses windows-1256 instead of utf-8 to display arabic.

Spikeman 05-02-2009 10:45 AM

Quote:

Originally Posted by jazz_aaf (Post 1802879)
problem with adding arabic text under windows-1256 encoding. It writes well to the database, but display blank space when trying to read from the dbase. Any solution for this problem? Our forum uses windows-1256 instead of utf-8 to display arabic.

Are you using the arabic version or English? I can take a look into this and see if there is a workable fix, its not something I have come across before.

To read arabic from mysql through php

1) The field containing the arabic text should have Charset utf8 collation utf8_unicode_ci
2) In the page where you want to read this field
a)set the charset of the page to windows-1256
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
b) After establishing the connection to the MySQL write this two lines
mysql_query("SET NAMES cp1256");
mysql_query("set characer set cp1256");

let me see if I can work this in.

jazz_aaf 05-02-2009 09:33 PM

thanks for the reply. I am using the arabic version. I managed to fix it by removing the htmlentities part of the safestring class.

Anyway to have a MM answer type with a limit number of answers? For example, to present the user with a question having 10 answers and limit his choice to 3 choices only?

TimberFloorAu 05-02-2009 11:48 PM

Instructions are incorrect:

In instructions above it says:

* Copy survey.php to your main forum directory
* Copy the survey directory into your forum directory (cannot change the directory name)

In instructions with hack, it says:

Copy survey.php to your main forum directory
Copy the survey directory below your forum directory (cannot change the directory name)

TimberFloorAu 05-03-2009 12:02 AM

We get errors.

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

Fatal error: require() [function.require]: Failed opening required 'survey/classes/main.class.php' (include_path='.:/usr/local/lib/php') in /home/oursite/public_html/forum/survey.php on line 8

Installed as per VB instruction set not your txt version with download.

jazz_aaf 05-03-2009 06:13 AM

how to limit the number of times a user can take a survey?

Spikeman 05-03-2009 03:45 PM

Quote:

Originally Posted by jazz_aaf (Post 1803434)
how to limit the number of times a user can take a survey?


Find this line in survey/classes/survey.class.php around line 129, comment these lines out.

Code:

$check = $this->_CheckAccess($sid,TAKE_PRIV,"survey.php?sid=$sid");

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

        if (!$check) print_no_permission();

That should do it

Spikeman 05-03-2009 04:26 PM

Quote:

Originally Posted by TimberFloorAu (Post 1803337)
Instructions are incorrect:

In instructions above it says:

* Copy survey.php to your main forum directory
* Copy the survey directory into your forum directory (cannot change the directory name)

In instructions with hack, it says:

Copy survey.php to your main forum directory
Copy the survey directory below your forum directory (cannot change the directory name)

My bad will change file in download.

Quote:

Originally Posted by TimberFloorAu (Post 1803342)
We get errors.

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

Fatal error: require() [function.require]: Failed opening required 'survey/classes/main.class.php' (include_path='.:/usr/local/lib/php') in /home/oursite/public_html/forum/survey.php on line 8

Installed as per VB instruction set not your txt version with download.

1.This is caused by permissions
2.ensure that you set the permissions correctly
3.some servers will be a pain!, try a 777 chmod on the survey folder and included directories and file
4. Also verify that all files were uploaded, this has happened before when files were missing and it throws an error, this is normally caused by the server and not user/admin.

TimberFloorAu 05-03-2009 10:00 PM

Will see what others say, and then give it another go. Many thanks for prompt response.

Watching :)

silly rabbit 05-07-2009 12:13 AM

Spikeman, just wanted to say 'nice job', adaptation to vB, working great on 3.8.2

I added the "custom url" redirect at survey end back in, it seems to be working fine after limited testing. To accomplish in "\survey\templates\Default\edit_survey_properties. tpl":

Find:
Code:

<input type="radio" name="redirect_page" value="results"{$data.redirect_results}> Survey Results Page <span class="example">(Results Access should be Public)</span><br />
After Add:
Code:

<input type="radio" name="redirect_page" value="custom"{$data.redirect_custom}> Custom URL <span class="example">(If URL does not start with http:// or https://, it is assumed to be a relative URL from {$conf.html})</span><br />
        <div style="margin-left:20px">
          URL: <input type="text" name="redirect_page_text" value="{$data.redirect_page_text}" size="50" maxlength="255">

Everything else seems to be intact, working fine!

Thanks! Rabbit

jazz_aaf 05-08-2009 02:48 PM

how to sort results based on the total for each answer?

fred13 05-08-2009 07:02 PM

I downloaded it and there is no admin cp modual.

Spikeman 05-10-2009 04:35 PM

Quote:

Originally Posted by jazz_aaf (Post 1806996)
how to sort results based on the total for each answer?

I am looking into a better reporting module to break down results, which will be accessible in Admin CP

Quote:

Originally Posted by fred13 (Post 1807112)
I downloaded it and there is no admin cp modual.

go to Admin CP - vB options - Survey System Settings

Spikeman 05-10-2009 04:38 PM

Quote:

Originally Posted by silly rabbit (Post 1806120)
Spikeman, just wanted to say 'nice job', adaptation to vB, working great on 3.8.2

I added the "custom url" redirect at survey end back in, it seems to be working fine after limited testing. To accomplish in "\survey\templates\Default\edit_survey_properties. tpl":

Find:
Code:

<input type="radio" name="redirect_page" value="results"{$data.redirect_results}> Survey Results Page <span class="example">(Results Access should be Public)</span><br />
After Add:
Code:

<input type="radio" name="redirect_page" value="custom"{$data.redirect_custom}> Custom URL <span class="example">(If URL does not start with http:// or https://, it is assumed to be a relative URL from {$conf.html})</span><br />
        <div style="margin-left:20px">
          URL: <input type="text" name="redirect_page_text" value="{$data.redirect_page_text}" size="50" maxlength="255">

Everything else seems to be intact, working fine!

Thanks! Rabbit

Fixed in next release

Skyrider 05-23-2009 02:56 PM

When I click on values, I get:
The requested URL /display_answers.php was not found on this server.

PS, I'm getting the error as a Guest:
Quote:

The following surveys are available. Click on a link to begin taking the survey. Some surveys may be restricted to specific groups:

There are no surveys available at this time.
I did selected that the Guest usergroup can take surveys. Please make it IP locked, should solve some issues that you already took the survey.

EDIT:
When I wish to preview a Survey I already made, I'm getting:
Quote:

You have already completed the requested survey.
I love this plugin btw, thanks!

Spikeman 05-23-2009 04:58 PM

Quote:

Originally Posted by FF|Skyrider (Post 1815788)
When I click on values, I get:
The requested URL /display_answers.php was not found on this server.

Check that that file has been uploaded to server.

Quote:

PS, I'm getting the error as a Guest:

The following surveys are available. Click on a link to begin taking the survey. Some surveys may be restricted to specific groups:

There are no surveys available at this time.


I did selected that the Guest usergroup can take surveys. Please make it IP locked, should solve some issues that you already took the survey.
If you take a look in survey.php, this will allow guests to take surveys.

Code:

if ($vbulletin->userinfo['userid']==0) { // override permissions for guests, since userid zero is messy
                                // They can only see the results, if allowed in the admincp settings
        $vbulletin->userinfo['can_admin_surveys'] = 0;
        $vbulletin->userinfo['can_take_surveys'] = 0;
        $vbulletin->userinfo['can_create_surveys'] = 0;
        $vbulletin->userinfo['can_edit_surveys'] = 0;change to

Change to:-

Code:

if ($vbulletin->userinfo['userid']==1) { // override permissions for guests, since userid zero is messy
                                // They can only see the results, if allowed in the admincp settings
        $vbulletin->userinfo['can_admin_surveys'] = 0;
        $vbulletin->userinfo['can_take_surveys'] = 1;
        $vbulletin->userinfo['can_create_surveys'] = 0;
        $vbulletin->userinfo['can_edit_surveys'] = 0;



This will allow surveys to be taken more than once.

Find this line in survey/classes/survey.class.php around line 129, comment these lines out.


Code:

$check = $this->_CheckAccess($sid,TAKE_PRIV,"survey.php?sid=$sid");

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

        if (!$check) print_no_permission();

That should do it

Skyrider 05-23-2009 06:26 PM

Thanks, I'll try. But I'm sorry, display_answers.php is not in the zip file you uploaded on this thread. I checked both.

EDIT:
Just edited survey.php and changed the 0 setting to 1 (even tried copy/pasting), and I still get:
Quote:

The following surveys are available. Click on a link to begin taking the survey. Some surveys may be restricted to specific groups:

There are no surveys available at this time.
And yes, I checked "Available Survey", for registered people there is 1 available. I also added everyone within the usergroup list to the allow to take survey list.

PPS, the "admincp" folder you added within the zip file is empty.

Spikeman 05-27-2009 09:17 AM

pm me your site details and I will take a look.

Nadeemjp 05-27-2009 11:18 AM

wonderful mod.
installed and nominated for MOM.

please tell me what code should i add in the navbar to have this option display there as [survey]

thanx

BlackJacket 06-01-2009 08:30 PM

Quote:

Originally Posted by Spikeman (Post 1817973)
pm me your site details and I will take a look.

Could i install this outside my forum directory?

www.mysite.com/survey.php

Thanks for the great mod.

Spikeman 06-02-2009 12:56 AM

Quote:

Originally Posted by Nadeemjp (Post 1818028)


please tell me what code should i add in the navbar to have this option display there as [survey]

Add this to your navbar template where you want it to appear

Code:

<!-- Survey -->
<td class="vbmenu_control"><a href="survey.php$session[sessionurl_q]" rel="nofollow">Survey</a></td>
<!-- / Survey -->


Spikeman 06-02-2009 01:05 AM

Quote:

Originally Posted by NittoMOD (Post 1821567)
Could i install this outside my forum directory?

www.mysite.com/survey.php

I have not tested it, however you will need to change the variables in survey.php to begin with and take it from there. If you need help on the changes let me know.

Spikeman 06-02-2009 01:20 AM

Quote:

Originally Posted by FF|Skyrider (Post 1815788)
When I click on values, I get:
The requested URL /display_answers.php was not found on this server.

My bad i just re read this! There is no display_answers.php nor should there be, so I do not know how you are getting this as I cannot replicate the error.

Can you go to my demo and see if you get the same error from my board. http://www.beta-tester.co.uk/iphone/survey.php


All times are GMT. The time now is 12:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04137 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete