Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Sr feuser register

From TYPO3Wiki
Jump to: navigation, search


notice - Draft

Change the {{draft}} marker to {{review}} when you need a reviewer for text and TypoScript. info

sr_feuser_register

It enables (frontend) users to register themselves. It is very feature rich extension including things like confirmation emails, registration forms, invitation letters and more.

See also

Tips and Tricks

Next version

Maybe the latest version of sr_feuser_register in TER is already a bit old. Then you should try out a newer code of sr_feuser_register containing more bug fixes. Check it out from the subversion at https://forge.typo3.org and import it using your EM.

Gender

The entry of gender fields is optional. An empty string will be entered if the user choses nothing for his gender. You can force the gender to be set by overwriting the default $TCA of fe_users or tt_address. Add the following line to the file Configuration/TCA/Overrides/fe_users.php of your project specific extension:

 unset($TCA['fe_users']['columns']['gender']['config']['items']['0']);

Translation for gender

 plugin.tx_srfeuserregister._LOCAL_LANG.de {
  fe_users.gender.I.0 = male_label
  fe_users.gender.I.1 = female_label
  gender = Anrede
  male_label = Herr
  female_label = Frau
}

The "fe_users.gender.I.0" part seems to define the label for the corresponding part in the TCA which will afterwards be translated with the defined translation. "gender.I.99" seems to not get rendered in the frontend by simply defining labels for the other genders and omitting "fe_users.gender.I.99".

Adding a static template in initial configuration

In the extension manual, configuration step two, it says:

"Add one of the following static templates to your TypoScript template: 'FE User Registration CSS-styled' or 'FE User Registration Old Style'."

This is done (after installing the extension) by: - going to "Template" on the side bar - select your root folder - click "Click here to edit whole template record" at the bottom of the page - Select the "Includes" tab (TYPO3 v4.2). - In the section headed "Include static (from extensions):"" - and select the appropriate template from the right hand box

Preconfiguration of Country and Language

Put this to your TS Setup field (e.g. in your root page template):

 plugin.tx_srfeuserregister_pi1.create.defaultValues.static_info_country = DEU
 plugin.tx_srfeuserregister_pi1.create.defaultValues.language = DE
 plugin.tx_srfeuserregister_pi1.create.defaultValues.zone = BAY

If this doesn't work, one might configure static_info_tables directly:

 plugin.tx_staticinfotables_pi1.languageCode = DE

Moreover add this in TS Setup to limit to european countrys in the country dropdown (!!! e.g. Switzerland will be skiped out !!!):

 plugin.tx_srfeuserregister_pi1.where.static_countries = cn_eu_member = 1

Unfortunately the "old" way to write it like plugin.tx_staticinfotables_pi1.countryCode = DEU does not seems to work anymore.


Correction to use module_sys_dmail_category as a required field

Apparently Sr feuser register (v.2.5.15) does not check for required field module_sys_dmail_category. This patch corrects this problem.

Index: model/class.tx_srfeuserregister_data.php
===================================================================
--- model/class.tx_srfeuserregister_data.php	(revision 14)
+++ model/class.tx_srfeuserregister_data.php	(working copy)
@@ -311,7 +311,7 @@
 	* @return void  on return, the ControlData failure will contain the list of fields which were not ok
 	*/
 	function evalValues ($theTable, &$dataArray, &$origArray, &$markContentArray, $cmdKey, $requiredArray) {
-
+   
 		$displayFieldArray = t3lib_div::trimExplode(',', $this->conf[$cmdKey.'.']['fields'], 1);
 		if($this->controlData->useCaptcha())	{
 			$displayFieldArray[] = 'captcha_response';
@@ -395,8 +395,9 @@
 									$this->failureMsg[$theField][] = $this->getFailureText($theField, $theCmd, 'evalErrors_valid_email');
 								}
 							break;
-							case 'required':
-								if (!trim($dataArray[$theField])) {
+							case 'required': 
+							
+								if ((!is_array($dataArray[$theField]) && !trim($dataArray[$theField])) || (is_array($dataArray[$theField]) && !sizeof($dataArray[$theField]))) {
 									$failureArr[] = $theField;
 									$this->inError[$theField] = TRUE;
 									$this->failureMsg[$theField][] = $this->getFailureText($theField, $theCmd, 'evalErrors_required');


Functionality for where.languages (like where.static_countries)

diff -uriwbB sr_feuser_register.orig/marker/class.tx_srfeuserregister_marker.php sr_feuser_register/marker/class.tx_srfeuserregister_marker.php
--- sr_feuser_register.orig/marker/class.tx_srfeuserregister_marker.php	2009-03-04 14:49:41.000000000 +0100
+++ sr_feuser_register/marker/class.tx_srfeuserregister_marker.php	2009-03-18 12:02:20.000000000 +0100
@@ -469,7 +469,12 @@
 				}
 				$selected = (is_array($row) && isset($row['static_info_country']) ? $row['static_info_country'] : array());
 				if (isset($this->conf['where.']) && is_array($this->conf['where.']))	{
-					$where = $this->conf['where.']['static_countries'];
+					if (isset($this->conf['where.']['static_countries'])){
+						$whereCountries = $this->conf['where.']['static_countries'];
+					}
+					if (isset($this->conf['where.']['languages'])){
+						$whereLanguages = $this->conf['where.']['languages'];
+					}
 				}
 				$markerArray['###SELECTOR_STATIC_INFO_COUNTRY###'] = $this->staticInfo->buildStaticInfoSelector(
 					'COUNTRIES',
@@ -480,7 +485,7 @@
 					$this->conf['onChangeCountryAttribute'],
 					$idCountry,
 					$titleCountry,
-					$where
+					$whereCountries
 				);
 				$markerArray['###SELECTOR_ZONE###'] =
 					$this->staticInfo->buildStaticInfoSelector(
@@ -506,7 +511,8 @@
 					,
					,
					$idLanguage,
-					$titleLanguage
+					$titleLanguage,
+					$whereLanguages
				);
			}
		}


Discussion