We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Height and Weight Class | Forum

Jeff
Jeff Jul 20 '15
So for People who wants to add a Height and Weight class, follow the 4 steps  included in the word file !

1 - You need to modify some data in your database, go to phpmyadmin in your database, and simply launch the following sql request :

ALTER TABLE `ow_base_question` CHANGE `presentation` `presentation`
ENUM('text','textarea','select','date','location','checkbox','multicheckbox','radio','url','password','age','birthdate','range','high','weight') CHARACTER SET utf8 COLLATE
utf8_general_ci NOT NULL

2 - You need to declare the two new class in :

ow_system_plugins\base\bol\question_service.php

Line 82 aftrer const Password add like this :
const QUESTION_PRESENTATION_PASSWORD = 'password';
const QUESTION_PRESENTATION_HIGH = 'high';
const QUESTION_PRESENTATION_WEIGHT = 'weight';

Then Line 175 add 2 lines like this ;
self::QUESTION_PRESENTATION_PASSWORD => self::QUESTION_VALUE_TYPE_TEXT,
self::QUESTION_PRESENTATION_HIGH => self::QUESTION_VALUE_TYPE_TEXT,
self::QUESTION_PRESENTATION_WEIGHT => self::QUESTION_VALUE_TYPE_TEXT

Then Line 346 add :
case self::QUESTION_PRESENTATION_HIGH :
                    $class = new HighField($fieldName);
                    break;
case self::QUESTION_PRESENTATION_WEIGHT :
                     $class = new WeightField($fieldName);
                    break;

Do the same line 498 :
case self::QUESTION_PRESENTATION_HIGH :
                    $class = new HighField($fieldName);
                    break;
case self::QUESTION_PRESENTATION_WEIGHT :
                     $class = new WeightField($fieldName);
                    break;

Save the file !

3 -  You need to declare also the two new class in :

ow_system_plugins\base\bol\user_service.php

Line 1822 :
case BOL_QuestionService::QUESTION_PRESENTATION_WEIGHT:
case BOL_QuestionService::QUESTION_PRESENTATION_HIGH:
case BOL_QuestionService::QUESTION_PRESENTATION_URL:

Save and closed your file !

4 - Eventually you have to make the new class :
open ow_core\form_element.php

See de class on word file, this forum do not accept enough size post...
Save your file and closed It !!

That's set !! Now you have to new class on admin user question, create a question size, just select high class
Create a question weight, select weight class !

Attachments:
  Height and Weight Class.docx (15Kb)
Andrew Dent
Andrew Dent Oct 29 '15
Has anyone tried this code on 1.8?