Gender MOD

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
35
67%
Very Good
7
13%
Good
4
8%
Fair
1
2%
Poor
5
10%
 
Total votes: 52

spaja
Registered User
Posts: 3
Joined: Sun Jan 28, 2007 4:11 pm

Post by spaja »

after editing usecp_register , in the problematic part of the code i have:

Code: Select all

if ( $mode == 'register' )
	{
		$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];

		$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $board_config['allow_html'];
		$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $board_config['allow_bbcode'];
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies'])
		// Gender MOD
		$user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : 0;
		// Gender MOD ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];

}
	else
	{
		$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig'];

		$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
		$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
		$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']
		// Gender MOD
		$user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : $userdata['user_gender'];
		// Gender MOD
) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];
	}

	$user_style = ( isset($HTTP_POST_VARS['style']) ) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];
is this correct?
When i go to profile, browser give me this error: Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\forum\includes\usercp_register.php on line 157
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

I'm haveing a bit of a problem with this mod myself. It was working just fine, then by chance I was viewing my profile and noticed that the mod doesnt show up in profiles anymore. So anyone that registers now always has the unknown graphic, or whatever it was, now. no way to select gender. I've double and triple checked usercp_viewprofile and all the code is correct and in the correct place. Does one of the other files have anything to do with it showing up in profiles? Or could another mod be conflicting with it? If someone needs to see my files plz let me know.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

spaja wrote: Well, in includes/usercp_register i have
$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']

in 2 diferent lines (one in 155, and second in 168). They are identical , and they are both after code if ( $mode == 'register' )

I did something wrong while editing this file.
Help?


They are not identical, but i think this post may help you: http://www.phpbb.com/phpBB/viewtopic.ph ... 62#2790262

EDIT:

Replace that with this:

Code: Select all

if ( $mode == 'register' )
   {
      $attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];

      $allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $board_config['allow_html'];
      $allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $board_config['allow_bbcode'];
      $allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];
      // Gender MOD
      $user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : 0;
      // Gender MOD
   }
   else
   {
      $attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig'];

      $allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
      $allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
      $allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];
      // Gender MOD
      $user_gender = ( isset($HTTP_POST_VARS['user_gender']) ) ? intval( $HTTP_POST_VARS['user_gender'] ) : $userdata['user_gender'];
      // Gender MOD
   }

   $user_style = ( isset($HTTP_POST_VARS['style']) ) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];
Last edited by igorw on Tue Jan 30, 2007 12:29 am, edited 1 time in total.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
jaloopa
Registered User
Posts: 12
Joined: Tue Dec 19, 2006 2:32 pm

Post by jaloopa »

eviL<3 wrote: jaloopa, is been mentioned here: http://www.phpbb.com/phpBB/viewtopic.ph ... 88#2678088

I saw that, but a mod I had already installed has code in between ththe two parts already

Code: Select all

}


//
// Simple Quick Reply MOD
//
if ( ($is_auth['auth_reply'] && ($forum_topic_data['forum_status'] != FORUM_LOCKED) && ($forum_topic_data['topic_status'] != TOPIC_LOCKED) ) || ($userdata['user_level'] == ADMIN) )
{
	$template->assign_vars(array(
		'L_EMPTY_MSG' => $lang['Empty_message'],
		'L_PREVIEW' => $lang['Preview'],
		'L_QUICK_REPLY' => $lang['Quick_Reply'],
		'L_SUBMIT' => $lang['Submit'],
		'L_USERNAME' => $lang['Username'],

		'S_ATTACH_SIG' => (( $userdata['session_logged_in'] ) ? $userdata['user_attachsig'] : 0) ? '1' : '',
		'S_NOTIFY' => (( $userdata['session_logged_in'] ) ? $userdata['user_notify'] : 0) ? '1' : '',
		'S_POSTING' => 'posting.'.$phpEx,
		'S_SID' => $userdata['session_id'],
		'S_TOPIC_ID' => $topic_id)
	);

	$template->assign_block_vars('switch_quick_reply', array() );

	if( !$userdata['session_logged_in'] )
	{
		$template->assign_block_vars('switch_quick_reply.switch_user_logged_out', array() );
	}
}
//
// Simple Quick Reply MOD
//



$template->pparse('body');
If you have simple quick reply you need to add the gender code before all of that.
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

I've read that post and it does seem that thats the same problem I'm haveing but I dont have that same line of code. I tried switching some stuff around but had no luck. So I decided to do as youve instructed others to do and put my usercp_viewprofile on pastebin. http://pastebin.com/870748

cheers
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

jaloopa, okay thanks for posting :)

acidified, make sure it's also in the template file (profile_view_body.tpl).

Did you activate the MOD in the ACP? EDIT: And run the sql query?
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

eviL<3 wrote: acidified, make sure it's also in the template file (profile_view_body.tpl).

Did you activate the MOD in the ACP? EDIT: And run the sql query?


yea, it was working fine. im guessing another mod did something to it. I just cant think of what I've installed since then. but ill check profile_view_body.tpl now

Yea, profile_view_body.tpl is correct as well.

Code: Select all

 <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_POSTS}:&nbsp;</span></td>
		  <td valign="top"><b><span class="gen">{POSTS}</span></b><br /><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
		</tr>
        <!-- Gender MOD -->
        <!-- BEGIN switch_gender_display -->
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_GENDER}:&nbsp;</span></td>
		  <td><b><span class="gen">{GENDER} {GENDER_IMG}</span></b></td>
		</tr>
		<!-- END switch_gender_display -->
        <!-- Gender MOD -->
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_LOCATION}:&nbsp;</span></td>
		  <td><b><span class="gen">{LOCATION}</span></b></td>
		</tr>
I dunno, I've gone over the install instructions quite a few times and I dont see anything wrong.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Can you pastebin the whole template file please? And perhaps a link to your board (you can also pm it, if you dont want to post it publically)?
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

http://pastebin.com/870817 for profile_view_body.tpl

and PM of site + acct info sent

also, and this is strange, I can see it when i go through ACP and edit a users acct. but not when i click on profile.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Looks alright, now please pastebin usercp_register.php :P
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

I've added an FAQ to the first page. Hope it's helpful for some :)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

http://pastebin.com/870831 :)

oh oops you said usercp_register i posted usercp_viewprofile :P

http://pastebin.com/870841 :P
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Very strange, those edits are all correct... your profile_add_body.tpl please...
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
acidified
Registered User
Posts: 25
Joined: Fri Sep 02, 2005 11:31 pm

Post by acidified »

http://pastebin.com/870849


btw, thank you for the quick replies:)
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Found it, you're using drathbuns EZ reg mod...

Open:

Code: Select all

includes/usercp_register.php
Find:

Code: Select all

$template->assign_block_vars('switch_gender_display', array());
Replace with:

Code: Select all

$template->assign_block_vars('switch_user_logged_in.switch_gender_display', array());
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
Post Reply

Return to “[2.0.x] MOD Database Releases”