Pb with Gender Mod in usercp_register.php

Mod that adds a extra field to the users profile, the gender is displayed beside the posts

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Pb with Gender Mod in usercp_register.php

Postby Figti on Tue 04. Jun, 2002 03:32

I've searched quite a lot around my problem, on several phpbb hack support forum. No success at all.
Here is what happens : account activation set to "none" (in Admin Panel), new registering users are not well created. I.E, after a normal registration process, they can not login at all.

I've probably circumscribed what's responsible for my problem : I tried to install gender hack (designed for 2.0.0) on a 2.0.1 board, and thus experienced a bit of confusion at some places...

In the usercp_register.php file, switching from one SQL query to a "backed up" 2.0.1 one, I "discovered" the following :
Code: Select all
         $sql = "INSERT INTO " . USERS_TABLE . "   (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
            VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";


Above is the original 2.0.1 query... if I use it in my "modified_for_gender usercp_register.php", my "new registering users" can login after the registration process. Everything works clean... Unfortunately, I do not benefit from the gender hack anymore... :(

Below is my "modified for Gender" SQL query. I might have missed something with a new 2.0.1 feature. I actually was not really sure about what to do when I implemented the hack.
This only thing I know is that, after registering (without any problem), my new users can not login...
Swithing to Admin Panel, I'm still able to activate them "manually" (setting a new password brings the things back on...)

Code: Select all
         $sql = "INSERT INTO " . USERS_TABLE . "   (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey, user_gender)
            VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, '$gender', ";


Can someone please correct my SQL query, or tell what might cause this problem ?
Many thanks! :)
Figti
Poster
Poster
 
Posts: 5
Joined: Tue 04. Jun, 2002 03:31

Postby Figti on Tue 04. Jun, 2002 15:51

Problem solved!

Be carefull with the 4th VALUE in the SQL query:
in the 2.0.0 query, variable $password is used...
in the 2.0.1 query, variable $new_password is used...

That's the reason why my users had a wrong password, and could not log in...
Now it works perfectly...!

Woaw... after several hours on this, I'm felling better...! :D
Figti
Poster
Poster
 
Posts: 5
Joined: Tue 04. Jun, 2002 03:31

I have too

Postby Mobilniy on Tue 04. Jun, 2002 16:35

Hello. I have a problem... Users can login, but can't register. What's wrong? I have PhpBB 2.0.1 too... Hacks: gender, birthday...
Mobilniy
Poster
Poster
 
Posts: 3
Joined: Sun 02. Jun, 2002 12:58

Re: I have too

Postby Niels on Thu 06. Jun, 2002 16:20

Mobilniy wrote:Hello. I have a problem... Users can login, but can't register. What's wrong? I have PhpBB 2.0.1 too... Hacks: gender, birthday...


you will have to check your usercp_register.php file, there is a problem with the line starting with
$sql = "INSERT INTO " . USERS_TABLE .

note that the order is VERY importent, do NOT place the added mods in the end of the (), it MUST be ending with
, user_active, user_actkey)

later in the end of the line it ends with
, 0, 1, '$gender','$birthday','$next_birthday_greeting',";

if in doubt, then download my pre-loaded pack, and open the file to see
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby MJ on Tue 11. Jun, 2002 19:30

works fine on 2.0.1!!! :D Not one problem!!!
MJ
Poster
Poster
 
Posts: 90
Joined: Fri 19. Apr, 2002 13:46

Postby ralphlei on Wed 19. Jun, 2002 23:16

i was trying to install the gender mod on 2.0.1
and everything seems fine but just when user tries to register, the error msg
Code: Select all
Warning: Cannot add header information - headers already sent by (output started at /home/ralphlei/public_html/test/testforum/includes/usercp_avatar.php:673) in /home/ralphlei/public_html/test/testforum/includes/page_header.php on line 449

Warning: Cannot add header information - headers already sent by (output started at /home/ralphlei/public_html/test/testforum/includes/usercp_avatar.php:673) in /home/ralphlei/public_html/test/testforum/includes/page_header.php on line 450

Warning: Cannot add header information - headers already sent by (output started at /home/ralphlei/public_html/test/testforum/includes/usercp_avatar.php:673) in /home/ralphlei/public_html/test/testforum/includes/page_header.php on line 451
will appear. but after that, everything is fine again.
Niels, do u know what i did wrong? the url is
http://test.myoldfriends.com/testforum/index.php

thanks
ralphlei
Poster
Poster
 
Posts: 83
Joined: Mon 12. Aug, 2002 22:52

Postby Niels on Thu 20. Jun, 2002 12:04

I have tryed to register at your site, and did succes without any error messages, I gues you have already solved this

Usual thise "can not add header" have to do with the language files, but not always, sometimes it is also different
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby ralphlei on Thu 20. Jun, 2002 14:09

thx for visiting my site :)
i have removed the code for gender mod, that's why there is no more error when u register. i will try to install it again later
ralphlei
Poster
Poster
 
Posts: 83
Joined: Mon 12. Aug, 2002 22:52

Next

Return to Gender [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron