1
jordi_rc
What is this commented code in registerform.php?
  • 2006/9/27 16:47

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello!

I am customizing my register of users and I saw that the file registerform.php has this code under comments:

//$avatar_select = new XoopsFormSelect("", "user_avatar", $user_avatar);
//$avatar_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
//$avatar_select->addOptionArray($avatar_array);
//$a_dirlist =& XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH."/images/avatar/");
//$a_dir_labels = array();
//$a_count = 0;
//$a_dir_link = "XOOPS";
//$a_count = $a_count + count($avatar_array);
//$a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
//foreach ($a_dirlist as $a_dir) {
// if ( $a_dir == "users" ) {
// continue;
// }
// $avatars_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/images/avatar/".$a_dir."/", $a_dir."/");
// $avatar_select->addOptionArray($avatars_array);
// $a_dir_link = "".$a_dir."";
// $a_dir_labels[] = new XoopsFormLabel("", $a_dir_link);
// $a_count = $a_count + count($avatars_array);
//}
//$avatar_select->setExtra("onchange='showImgSelected(\"avatar\", \"user_avatar\", \"images/avatar\", \"\", \"".XOOPS_URL."\")'");
//$avatar_label = new XoopsFormLabel("", "");
//$avatar_tray = new XoopsFormElementTray(_US_AVATAR, " ");
//$avatar_tray->addElement($avatar_select);
//$avatar_tray->addElement($avatar_label);
//foreach ($a_dir_labels as $a_dir_label) {
// $avatar_tray->addElement($a_dir_label);
//}


What is this for??
I think it is for selecting an avatar when one registers.
But I remove the // and nothing seems to change. Why?

And if this is not for that, how will I be able to do ONE of the following:

1) TO HAVE 2 REGISTER FORMS OR PAGES. One is the neccesary fields to fill to enter the community, and the other is to fill other fields that are not necesary but helpful like avatar, hobbiens, etc.

2) Redirect the user after filling the needed fields to register to the view/edit profile page.

Any ideas? Thanks.

Jordi.
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

2
jordi_rc
Re: What is this commented code in registerform.php?
  • 2006/9/27 17:27

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


I discovered that if you uncomment another line that is under all these between others, avatar selection is activated on register.

But I see that it doesn't seems to work.

It appears a drop down list that contains no options, and a link that says "XOOPS". If you clic the link, it opens a window that shows avaliable avatars. (Where is the template for that?? It needs some improving)
But if you select one, and clic the button, nothing seems to happen.

Is this an experimental code or how can I activate it?

I see in the code that it refers to images/avatars. And my avatars are stored in uploads directory. How can I customize the place to save my avatars? I mean, to store them in images/avatars so they are apart from other images.

Thanks again, please say anything that may help, or any ideas.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

3
jordi_rc
Re: What is this commented code in registerform.php?
  • 2006/9/27 17:34

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


More:

If I create a folder in images/ called avatar/ and save my avatars there, the list appears, an image by its side and the window buttons showing avatars work perfect.
Don't forget to make chmod 777 to all those files and folder.

NOW PLEASE how to modify the place where avatars are stored?
I will try to find it, but please tell me all the places where I should modify to not forget any... remember: I am a beginner in Xoops.

Hope all this may be valuable for someone else.
Thanks.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

4
jordi_rc
Re: What is this commented code in registerform.php?
  • 2006/9/27 17:40

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Sorry 2 questions:

1) Where should I modify where are the avatars stored? For user uploaded avatars and avatars added by the admin.

2) How to make the avatar image change as I move cursor between the drop down list in registerform?

Thanks.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

5
jordi_rc
Re: What is this commented code in registerform.php?
  • 2006/9/27 18:16

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


I see the form for edit user included in xoops, when you press the button Avatar it displays a better form that has the name of the avatars, very similar to the other but better.
I look at html code and I see this function is in edituser.php and $op=='avatarform'.
I will try to copy it, but please gimme some advice if I should take some care of something.

Please answer the 2 questions asked before:

1) Where should I modify where are the avatars stored? For user uploaded avatars and avatars added by the admin.

2) How to make the avatar image change as I move cursor between the drop down list in registerform?

Thanks.

Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

Login

Who's Online

180 user(s) are online (38 user(s) are browsing Support Forums)


Members: 0


Guests: 180


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits