Tribiq CMS

Choose your language

7.3 Creating a Signup Model

Tip: Bundled Model File
We suggest that you take a look at the bundled (tribal-GPL-1066) extranet model at /incudes/extranet/model_1.inc.php to understand how to modify the Tribiq extranet. The majority of Tribiq CMS Community Site Administrators will only require one model, so we suggest you just copy the one included with your distribution.
An Extranet Signup Model must be used by your Extranet Templates.

An extranet model must take into account the following cases:

  • Register
 - $mode “register”
  • Update User Details
 - $mode “edituser”
  • Lost Password 
- $mode “forgottenpss”
  • Change Password
 - $mode “changepss”
  • Confirmation
 - $mode “thankyou”
  • Login / Extranet Homepage (once logged in)
 - default mode, no mode parameter needed


The mode the viewer will be served is determined by the value of the parameter ‘mode’ passed to the extranet template, so you can provide URLs directly to the “forgottenpss” mode or the “register” mode, e.g.

http://mytribiqsite.com/?cID=1&cType=extranet&mode=forgottenpss

A signup model controls registration variables such as the data required from the visitor, the minimum length of password, what documents they must consent with etc. These settings are all controlled via the database. The _enet_user_val database table contains the list of Signup models.

You must add a signup model to this database table in order to use the file you are about to create (or if you are only using one signup model, you may want to just modfiy the existing record). See 7.3.2 below.

7.3.1 Create the File

The top of all extranet model files templates must include a functionality file. By default, this is the common file: /tempateincludes/extranet_form_functionality.inc.php. As per usual, it is recommended that this is duplicated to be used as a template family-specific file.

<?php
include "templateincludes/extranet_form_functionality.inc.php";
?>

However It is suggested that you copy the standard functionality include from /templateincludes/ to your new template family, and use this.

cp /templateincludes/extranet_form_functionality.inc.php /templates/mytribiqsite/newtemplatefamily/includes/

We can then include this file instead of the /templateincludes file.

<?php
include $template_path."/includes/extranet_form_functionality.inc.php";
?>

Create your Extranet Signup Model, providng the different forms and content at each mode.

Save this file to the folder in your template family /includes/extranet.

Name the file model_(signup_model_id).inc.php where (signup_model_id) is the ID of the Model you created.

Make sure this snippet is in your Base Extranet Template.


<?php
include "templates/".$template_path."/includes/extranet/model_".$signup_model_id.".inc.php";
?>

7.3.2 Add to Database

Your extranet template will now load an extranet model file depending on the ID of the Signup Model it has been associated with.

By default, only one Signup Model exists. You must manually create signup models in the database before you can associate them with a content item.

To add a Signup Model to the database, you must run the following SQL query, complete with the values you want for the model. You can see the Appendix: Database Documentation section for an overview of this table.

SQL Code:

INSERT INTO `[[DATABASE PREFIX]]_enet_user_val` (`signup_model_id`, `name`, `user_signup_initial_groupids`, `user_signup_initial_status`, `username_minlength`, `email_is_username`, `register_confirmation_email`, `auto_create_password`, `passwordless_signup`, `password_minlength`, `password_mand_tough`, `title_mand`, `first_name_minlength`, `last_name_minlength`, `email_minlength`, `email_req_unique`, `website_minlength`, `job_title_minlength`, `company_name_minlength`, `address1_minlength`, `address2_minlength`, `town_minlength`, `state_minlength`, `postcode_minlength`, `country_id_mand`, `address_val_applies_to`, `mobile_minlength`, `phone_minlength`, `fax_minlength`, `spare_varchar1_minlength`, `spare_varchar2_minlength`, `spare_varchar3_minlength`, `spare_varchar4_minlength`, `spare_varchar5_minlength`, `spare_text1_minlength`, `spare_blob1_mand_notnull`, `spare_date1_mand_notnull`, `spare_date2_mand_notnull`, `spare_datetime1_mand_notnull`, `spare_datetime2_mand_notnull`, `spare_time1_mand_notnull`, `spare_time2_mand_notnull`, `spare_enum1_mand_set`, `spare_enum2_mand_set`, `spare_int1_mand_nonzero`, `spare_int2_mand_nonzero`, `spare_float1_minlength`, `spare_float2_minlength`, `consent1_mand_yes`, `consent2_mand_yes`, `consent3_mand_yes`, `post_login_target_content_id`, `post_login_target_content_type`) VALUES
(1, 'Default', '', 'pending', 5, 'Yes', 'No', 'No', 'No', 5, 'No', 'No', 0, 0, 5, 'Yes', 0, 0, 0, 0, 0, 0, 0, 0, 'No', NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'No', 'No', NULL, NULL);


Your signup model ID must match the same name/ID as the signup model file.

Top of Page