OJS 3 registration form

Hi All,
I want to change the appearance of the registration form in OJS 3. I have been following this instructions How to add phone number fields on OJS 3 registration form? » Open Journal Theme but a problem appears as the picture is shown below. What should I do? I think there are other files that may need to be changed?

image

Please, anyone who knows the answer, please reply. Very urgent.

Hello @Hengkov .

Perhaps, if you are using en_US language. you can edit:

lib/pkp/locale/en_US/user.po

At the end, you can add:

msgid "user.firstName"
msgstr "Name"

msgid "user.phone"
msgstr "Phone"

1 Like

Hi @Hengkov
The problem is the missing Form titles (###), isn’t it?

These titles are located within locale files.
For ex; user.firstName is located within user.po file in lib/pkp/locale/tr_TR (I use both Turkish & English langues) but missing in en_US/user.po file.
This is due to those missing titles in English language file and should be fixed.
You may edit .po files by poedit or some other software.
Or the better one, instead of using old terms, you should current terms such as Given Name (user.name, user.givenName, user.familyName) etc. This way, you won’t lose your changes with each update.
Regards,

@drugurkocak

Problem solved. Thanks. :wink:

But, after I tried registering for a new user, it didn’t work.

I mean, after I filled out all the registration forms and signed up, it appeared a blank white screen. What happened, friend? I can’t register as a new user after this change.

@juanito

Problem solved. Thanks. :wink:

But, after I tried registering for a new user, it didn’t work.

I mean, after I filled out all the registration forms and signed up, it appeared a blank white screen. What happened, friend? I can’t register as a new user after this change.

Is this part correct? Could you please show me the images you have in this section - lib / pkp / classes / user / form / RegistrationForm.inc.php.

I think something is missing here.
image

Hi @Hengkov

My OJS installation is version 3.2.1.2 and the corresponding lines at the RegistrationForm.inc.php are different;

  // Set the base user fields (name, etc.)
  $user->setGivenName($this->getData('givenName'), $currentLocale);
  $user->setFamilyName($this->getData('familyName'), $currentLocale);
  $user->setEmail($this->getData('email'));
  $user->setCountry($this->getData('country'));
  $user->setAffiliation($this->getData('affiliation'), $currentLocale);

  if ($sitePrimaryLocale != $currentLocale) {
  	$user->setGivenName($this->getData('givenName'), $sitePrimaryLocale);
  	$user->setFamilyName($this->getData('familyName'), $sitePrimaryLocale);
  	$user->setAffiliation($this->getData('affiliation'), $sitePrimaryLocale);
  }

So, you are probably getting a php fatal error. Please could you tell which OJS version you are using?
You might need to use different variables,
Regards,

@drugurkocak

Thank you very much.

I am using OJS 3.2.1.2 too. I remember, I deleted 1-2 items in this section, because of a previous problem. I think this is what’s causing the problem. Can I restore the syntax that has been deleted to default? Is there such a way?

Please can you provide me with the PHP syntax details on lines 220-259 (RegistrationForm.inc.php). Mine is as below.

Regards

// New user
$this->user = $user = $userDao->newDataObject();
$user->setMiddleName($this->getData(‘middleName’));
$user->setUsername($this->getData(‘username’));

	// The multilingual user data (firstName, middleName, lastName and affiliation) will be saved
	// in the current UI locale and copied in the site's primary locale too
	$request = Application::get()->getRequest();
	$site = $request->getSite();
	$sitePrimaryLocale = $site->getPrimaryLocale();
	$currentLocale = AppLocale::getLocale();

	// Set the base user fields (name, etc.)
	$user->setGivenName($this->getData('givenName') $currentLocale);
	$user->setFamilyName($this->getData('familyName')$currentLocale);
	$user->setEmail($this->getData('email'));
	$user->setCountry($this->getData('country'));
	$user->setAffiliation($this->getData('affiliation') $currentLocale);
    
    if ($sitePrimaryLocale != $currentLocale) {
        $user->setGivenName($this->getData('givenName'), $sitePrimaryLocale);
        $user->setFamilyName($this->getData('familyName'), $sitePrimaryLocale);
        $user->setAffiliation($this->getData('affiliation'), $sitePrimaryLocale);
    }
	$user->setDateRegistered(Core::getCurrentDate());
	$user->setInlineHelp(1); // default new users to having inline help visible.

	if (isset($this->defaultAuth)) {
		$user->setPassword($this->getData('password'));
		// FIXME Check result and handle failures
		$this->defaultAuth->doCreateUser($user);
		$user->setAuthId($this->defaultAuth->authId);
	}
	$user->setPassword(Validation::encryptCredentials($this->getData('username'), $this->getData('password')));

	if ($requireValidation) {
		// The account should be created in a disabled
		// state.
		$user->setDisabled(true);
		$user->setDisabledReason(__('user.login.accountNotValidated', array('email' => $this->getData('email'))));

@drugurkocak

My friend,

Please send me 5 PHP files below (to my email hlccorp776@gmail.com):

  1. lib / pkp / clases / user / user.DAO.inc.php
  2. lib / pkp / clases / user / userStageAssigmentDAO.inc.php
  3. lib / pkp / clases / user / form / RegistrationFrom.inc.php
  4. lib / pkp / clases / user / form / IdentityFrom.inc.php
  5. lib / pkp / templates / frontned / fRegistrationFrom.tpl

I will check all the changes that I have made (I changed something that caused this fatal error). I think there is some PHP syntax error between these files. I’ll check the compatibility of these files with yours. I will ignore the variable name.

I only changed the 5 files above at the moment, so the problem is with these files.

I appreciated your help.

Best Regards

Hi @Hengkov

You may always download all versions of OJS from the official download page.
URL: https://pkp.sfu.ca/ojs/ojs_download/
Regards,

@drugurkocak

Bro, many thanks for your help.

My website is back on the right track. :wink:

It just took a few tricks to correct my PHP syntax errors.

I just tried, the new user registration was SUCCESSFUL. Ha Ha Ha…

BTW, can you share your website link?

Who knows, I can learn web design from you? :slight_smile:

Stay Safe and Best Regards

Hi @Hengkov
Thank you very much for kind message.
I am not a programmer, but I can say that I have gained some experience over the years. I am trying to share my experience like others.
My journal’s link is written on my profile :slight_smile: but I am only managing it.
I might suggest you to follow a great talent @Vitaliy.
Regards,

@drugurkocak

Thanks. Wow, your website is very beautiful, my friend. Did you make it yourself?

How do I create a three column footer?
I also like your sidebars. It looks professional.

What additional programs should I use for it?