[RC] XData CPF [Custom Profile Fields (MMW)]

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
FeedBack
Registered User
Posts: 2
Joined: Wed Jul 05, 2006 2:20 am

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by FeedBack » Thu May 31, 2007 1:02 pm

Help Please! Bump!

fiftyfour123
Registered User
Posts: 157
Joined: Tue Aug 09, 2005 10:59 pm
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by fiftyfour123 » Thu May 31, 2007 7:23 pm

thanks it works, but is there a way to have these fields show up on the registration page?

fiftyfour123
Registered User
Posts: 157
Joined: Tue Aug 09, 2005 10:59 pm
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by fiftyfour123 » Thu May 31, 2007 7:25 pm

nevermind they do show up. but is there a way to make it so they enter it at registration and its required and they cant edit it in their profile.

fiftyfour123
Registered User
Posts: 157
Joined: Tue Aug 09, 2005 10:59 pm
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by fiftyfour123 » Thu May 31, 2007 11:48 pm

anyone?

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by Noobarmy » Fri Jun 01, 2007 5:47 am

@feedback: make sure all the info is both in the template and php files. if this is so, check in teh acp that you've set the display type to normal.

@fiftyfour123: ok this is a bit of a bodge job one. didn't realise i hadn't build this in.


OPEN includes/usercp_register.php

FIND

Code: Select all

			$template->assign_block_vars('xdata', array(
				'CODE_NAME' => $code_name,
				'NAME' => $info['field_name'],
				'DESCRIPTION' => $info['field_desc'],
    			'VALUE' => isset($xdata[$code_name]) ? str_replace('"', '"', $xdata[$code_name]) : '',
				'MAX_LENGTH' => ( $info['field_length'] > 0) ? ( $info['field_length'] ) : ''
				)
			);
BEFORE, ADD

Code: Select all

			if ( (!in_array($code_name, array(LIST_OF_CODE_NAMES)) && $mode == 'editprofile') || $mode == 'register')
			{
REPLACE {LIST_OF_CODE_NAMES} with the code names of the fields you want only to appear upon register.

FIND

Code: Select all

	                	$template->assign_block_vars('xdata.switch_type_select.options', array(
	                		'OPTION' => $option,
	                		'SELECTED' => ($xdata[$code_name] == $option) ? 'selected="selected"' : ''
							)
	                	);
					}
					break;
			}
AFTER, ADD

Code: Select all

}
that should make it work.
Image

fiftyfour123
Registered User
Posts: 157
Joined: Tue Aug 09, 2005 10:59 pm
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by fiftyfour123 » Sun Jun 03, 2007 4:12 am

have you made a fix for the "The value you entered for Entry Statement is invalid." error?

fiftyfour123
Registered User
Posts: 157
Joined: Tue Aug 09, 2005 10:59 pm
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by fiftyfour123 » Sun Jun 03, 2007 4:46 pm

anyone?

User avatar
jh0nny
Registered User
Posts: 123
Joined: Thu Apr 01, 2004 1:53 am

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by jh0nny » Wed Jun 13, 2007 6:23 pm

I am sorry for the bumb, but I have a question concerning the switch tags to show the content on the profile (view) page.
I choose the TPL variable 'length' in the admin panel for a question (text) and set the options "Display Type
When viewing profiles" into TPL variable (length), with the handle input on "yes".

But what do I have to enter into the profile_view_body file?
I had something like this:

Code: Select all

<!-- BEGIN xdata -->
<!-- BEGIN switch_length -->

<tr> 
<td valign="middle" align="left" class="row1" nowrap="nowrap" colspan="1" width="30%"><span class="gen"><b>{xdata.NAME}:</b></span></td>
 <td class="row1" colspan="3" width="70%"><span class="gen">{xdata.VALUE}</span> </td>
</tr>

<!-- END switch_length -->

<!-- END xdata -->
But it doesn't work, anyone who can help me out?
Thanks, :mrgreen:
:: Sex is just like software, it's better when it's free ::

jbpilot
Registered User
Posts: 7
Joined: Tue Jun 05, 2007 1:51 pm

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by jbpilot » Wed Jun 13, 2007 7:04 pm

From what I have read, xData is easymod compatible but I keep getting an "Could not open [./mods/xData_CPF/xData.mod] for reading" error message. Any thoughts? I tried changing the xData file name to install and that did not work either. Have also uploaded another copy of the file with the same results.

I've found similar problems posted but no replies...

JB

Paintballkev812
Registered User
Posts: 12
Joined: Mon Jan 30, 2006 4:48 am

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by Paintballkev812 » Wed Jun 20, 2007 5:17 am

I would like to select certain fields to be added to the memberlist so it can be sorted by one of the custom profile fields. Anyone know the code required to do this?

EDIT: Also found a bug, when using the drop down box and you set it the "manditory" option no, it still requires it.(could be a mess-up in my code i suppose, but I used Easy Mod)

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by Noobarmy » Thu Jun 21, 2007 7:56 pm

jh0nny: your code should look as follows:

Code: Select all

<!-- BEGIN switch_length -->

<tr> 
<td valign="middle" align="left" class="row1" nowrap="nowrap" colspan="1" width="30%"><span class="gen"><b>Length:</b></span></td>
<td class="row1" colspan="3" width="70%"><span class="gen">{switch_length}</span> </td>
</tr>

<!-- END switch_length -->
that should now work.

fiftyfour123: i can recreate the error so i haven't tested this. but try it anyway:

FIND

Code: Select all

	if ( $meta['handle_input'] && ( ($mode == 'register' && $meta['default_auth'] == XD_AUTH_ALLOW) || ($mode != 'register' ? xdata_auth($code_name, $user_id) : 0) || $userdata['user_level'] == ADMIN ))
IN-LINE FIND

Code: Select all

 || $userdata['user_level'] == ADMIN
IN-LINE AFTER, ADD

Code: Select all

( (!in_array($code_name, array(LIST_OF_CODE_NAMES)) && $mode == 'editprofile') || $mode == 'register')
where LIST_OF_CODE_NAMES is what you put in before. and now try it out.

jbpilot: as i've said on other stupport topics i don't know what this is caused by. most probably an easymod problem as i can install and others can install fine with this version.

Paintballkev812: i beleive ramonfinckan made a mod for this : link, this however has nothing to do with me, and is the work of ramon, so go to him for support on this.

as for the manditoy option you can't not select an option anyway. it only lists the options available (which may need to be fixed, it a bug imo) but yeah so it classifies as a value anyway. so i couldn't recreate this error sorry.

hope that helps those who've been waiting for help, sorry for the delays
anthony
Image

TPIMaster
Registered User
Posts: 25
Joined: Fri May 04, 2007 10:39 pm

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by TPIMaster » Sat Jun 23, 2007 12:17 pm

Hmmm, it seems that after installing this mod, the profile page is, well, broken. You can edit your profile, but you can't view one's profile. It gives this error:
Fatal error: Cannot redeclare multi_bbcode() (previously declared in /usr/export/www/vhosts/funnetwork/hosting/tomwollaert/forum/includes/bbcode.php:37) in /usr/export/www/vhosts/funnetwork/hosting/tomwollaert/forum/includes/bbcode.php on line 35
Here's my profile_view_body, as I'm guessing it's this one that's causing it and not multi_bbcode:

Code: Select all

 
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
  </tr>
</table>

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
  <tr> 
	<th class="thHead" colspan="2" height="25" nowrap="nowrap">{L_VIEWING_PROFILE}</th>
  </tr>
  <tr> 
	<td class="catLeft" width="40%" height="28" align="center"><b><span class="gen">{L_AVATAR}</span></b></td>
	<td class="catRight" width="60%"><b><span class="gen">{L_ABOUT_USER}</span></b></td>
  </tr>
  <tr> 
	<td class="row1" height="6" valign="top" align="center">{AVATAR_IMG}<br /><span class="postdetails">{POSTER_RANK}</span></td>
	<td class="row1" rowspan="3" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3">
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_JOINED}:&nbsp;</span></td>
		  <td width="100%"><b><span class="gen">{JOINED}</span></b></td>
		</tr>
		<tr> 
		  <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>
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_WEBSITE}:&nbsp;</span></td>
		  <td><span class="gen"><b>{WWW}</b></span></td>
		</tr>
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_OCCUPATION}:&nbsp;</span></td>
		  <td><b><span class="gen">{OCCUPATION}</span></b></td>
		</tr>
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>
<!-- BEGIN xdata -->
<tr>
  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{xdata.NAME}:</span></td>
  <td> <b><span class="gen">{xdata.VALUE}</span></b></td>
</tr>
<!-- END xdata -->

<!-- BEGIN switch_upload_limits -->
		<tr> 
			<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_UPLOAD_QUOTA}:</span></td>
			<td> 
				<table width="175" cellspacing="1" cellpadding="2" border="0" class="bodyline">
				<tr> 
					<td colspan="3" width="100%" class="row2">
						<table cellspacing="0" cellpadding="1" border="0">
						<tr> 
							<td bgcolor="{T_TD_COLOR2}"><img src="templates/subSilver/images/spacer.gif" width="{UPLOAD_LIMIT_IMG_WIDTH}" height="8" alt="{UPLOAD_LIMIT_PERCENT}" /></td>
						</tr>
						</table>
					</td>
				</tr>
				<tr> 
					<td width="33%" class="row1"><span class="gensmall">0%</span></td>
					<td width="34%" align="center" class="row1"><span class="gensmall">50%</span></td>
					<td width="33%" align="right" class="row1"><span class="gensmall">100%</span></td>
				</tr>
				</table>
				<b><span class="genmed">[{UPLOADED} / {QUOTA} / {PERCENT_FULL}]</span> </b><br />
				<span class="genmed"><a href="{U_UACP}" class="genmed">{L_UACP}</a></span></td>
			</td>
		</tr>
<!-- END switch_upload_limits -->

		<!-- BEGIN warnings -->
		<tr>
		  <td align="right" nowrap="nowrap" valign="top" class="gen">{warnings.L_WARNINGS}:&nbsp;</td>
		  <td class="gen"><b>{warnings.WARNINGS}</b> &nbsp; {warnings.YELLOW_IMG} {warnings.RED_IMG}
		  <!-- BEGIN details -->
		  <br /><span class="genmed"><a href="{warnings.details.U_SEARCH}" class="genmed">{warnings.details.L_SEARCH}</a></span>
		  <!-- END details -->
		  <!-- BEGIN expired -->
  		  <br /><br /><span class="genmed">[{warnings.expired.L_EXPIRED}]</span>
  		  <br /><span class="genmed"><a href="{warnings.expired.U_SEARCH}" class="genmed">{warnings.expired.L_SEARCH}</a></span>
		  <!-- END expired -->
		</tr>
		<!-- END warnings -->
		<!-- BEGIN reputation -->
		<tr>
		  <td align="right" nowrap="nowrap" valign="top" class="gen">{reputation.L_REPUTATION}:&nbsp;</td>
		  <td class="gen"><b>{reputation.REPUTATION}</b> &nbsp; {reputation.APPROVE_IMG}&nbsp;&nbsp;{reputation.DISAPPROVE_IMG}
		  <!-- BEGIN power -->
		  <br /><span class="genmed">[{reputation.power.L_POWER}]</span>
		  <!-- END power -->
		  </td>
		</tr>
		<!-- BEGIN bonuses -->
		<tr>
		  <td>&nbsp;</td>
		  <td><span class="gensmall"><b>{reputation.bonuses.L_INCLUDING}</b>:</span><br />
		  <!-- BEGIN list -->
		  <span class="gensmall" title="{reputation.bonuses.list.TYPE_EXP}"><img src="{reputation.bonuses.list.TYPE_IMG}" alt="" border="" /> {reputation.bonuses.list.TYPE}: {reputation.bonuses.list.VALUE}</span><br />
		  <!-- END list -->
		  </td>
		</tr>
		<!-- END bonuses -->
		<!-- BEGIN details -->
		<tr>
		  <td>&nbsp;</td>
		  <td><span class="genmed"><a href="{reputation.details.U_SEARCH}" class="genmed">{reputation.details.L_SEARCH}</a></span></td>
		</tr>
		<!-- END details -->
		<!-- END reputation -->

	  </table>
	</td>
  </tr>
  <tr> 
	<td class="catLeft" align="center" height="28"><b><span class="gen">{L_CONTACT} {USERNAME} </span></b></td>
  </tr>
  <tr> 
	<td class="row1" rowspan="3" valign="top"><table width="100%" border="0" cellspacing="1" cellpadding="3">
		<tr> 
		  <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_EMAIL_ADDRESS}:</span></td>
		  <td class="row1" valign="middle" width="100%"><b><span class="gen">{EMAIL_IMG}</span></b></td>
		</tr>
		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_PM}:</span></td>
		  <td class="row1" valign="middle"><b><span class="gen">{PM_IMG}</span></b></td>
		</tr>
		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_MESSENGER}:</span></td>
		  <td class="row1" valign="middle"><span class="gen">{MSN}</span></td>
		</tr>
		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_YAHOO}:</span></td>
		  <td class="row1" valign="middle"><span class="gen">{YIM_IMG}</span></td>
		</tr>
		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_AIM}:</span></td>
		  <td class="row1" valign="middle"><span class="gen">{AIM_IMG}</span></td>
		</tr>
		<tr> 
		  <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_ICQ_NUMBER}:</span></td>
		  <td class="row1"><script language="JavaScript" type="text/javascript"><!-- 

		if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
			document.write(' {ICQ_IMG}');
		else
			document.write('<table cellspacing="0" cellpadding="0" border="0"><tr><td nowrap="nowrap"><div style="position:relative;height:18px"><div style="position:absolute">{ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{ICQ_STATUS_IMG}</div></div></td></tr></table>');
		  
		  //--></script><noscript>{ICQ_IMG}</noscript></td>
		</tr>
	  </table>
	</td>
  </tr>
		<!-- BEGIN switch_signature -->
	<tr> 
		<td class="catRight" width="60%"><b><span class="gen">{L_SIGNATURE}</span></b></td>
	</tr>
	<tr>
		<td class="row1"> <span class="postbody">{USER_SIG}</span></td>
	</tr>
		<!-- END switch_signature -->
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
	<td align="right"><span class="nav"><br />{JUMPBOX}</span></td>
  </tr>
</table>

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by Noobarmy » Tue Jun 26, 2007 6:47 pm

the error is caused by a double inclusion of the bbcode.php file, which multi_bbcode and xdata both use which causes some silly screw ups. i need the php file file includes/usercp_viewprofile.php and i can show you the fix (it is somewhere in this topic but it was a while ago i don't remember where it is).
Image

TPIMaster
Registered User
Posts: 25
Joined: Fri May 04, 2007 10:39 pm

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by TPIMaster » Tue Jun 26, 2007 7:15 pm

Here you go. Thanks for taking the time to help me, I really appreciate it.

Code: Select all

<?php
/***************************************************************************
 *                           usercp_viewprofile.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: usercp_viewprofile.php,v 1.5.2.6 2005/09/14 18:14:30 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}

if ($board_config['warnings_enabled'] || $board_config['reputation_enabled'])
{
	include($phpbb_root_path . 'includes/functions_reputation.' . $phpEx);
}


if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
	message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);

if (!$profiledata)
{
	message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
}


// BEGIN ADD Signature in Profile
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
// END ADD Signature in Profile

$sql = "SELECT *
	FROM " . RANKS_TABLE . "
	ORDER BY rank_special, rank_min";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain ranks information', '', __LINE__, __FILE__, $sql);
}

$ranksrow = array();
while ( $row = $db->sql_fetchrow($result) )
{
	$ranksrow[] = $row;
}
$db->sql_freeresult($result);

//
// Output page header and profile_view template
//
$template->set_filenames(array(
	'body' => 'profile_view_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);

//
// Calculate the number of days this user has been a member ($memberdays)
// Then calculate their posts per day
//
$regdate = $profiledata['user_regdate'];
$memberdays = max(1, round( ( time() - $regdate ) / 86400 ));
$posts_per_day = $profiledata['user_posts'] / $memberdays;

// Get the users percentage of total posts
if ( $profiledata['user_posts'] != 0  )
{
	$total_posts = get_db_stat('postcount');
	$percentage = ( $total_posts ) ? min(100, ($profiledata['user_posts'] / $total_posts) * 100) : 0;
}
else
{
	$percentage = 0;
}

$avatar_img = '';
if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
	switch( $profiledata['user_avatar_type'] )
	{
		case USER_AVATAR_UPLOAD:
			$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
		case USER_AVATAR_REMOTE:
			$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
		case USER_AVATAR_GALLERY:
			$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" alt="" border="0" />' : '';
			break;
	}
}

$poster_rank = '';
$rank_image = '';
if ( $profiledata['user_rank'] )
{
	for($i = 0; $i < count($ranksrow); $i++)
	{
		if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
		{
			$poster_rank = $ranksrow[$i]['rank_title'];
			$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
		}
	}
}
else
{
	for($i = 0; $i < count($ranksrow); $i++)
	{
		if ( $profiledata['user_posts'] >= $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
		{
			$poster_rank = $ranksrow[$i]['rank_title'];
			$rank_image = ( $ranksrow[$i]['rank_image'] ) ? '<img src="' . $ranksrow[$i]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
		}
	}
}

$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $profiledata['user_id']);
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';

if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
	$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $profiledata['user_id']) : 'mailto:' . $profiledata['user_email'];

	$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
	$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
}
else
{
	$email_img = '&nbsp;';
	$email = '&nbsp;';
}

$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '&nbsp;';
$www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $profiledata['user_website'] . '</a>' : '&nbsp;';

if ( !empty($profiledata['user_icq']) )
{
	$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
	$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
	$icq =  '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
	$icq_status_img = '&nbsp;';
	$icq_img = '&nbsp;';
	$icq = '&nbsp;';
}

$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '&nbsp;';
$aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '&nbsp;';

$msn_img = ( $profiledata['user_msnm'] ) ? $profiledata['user_msnm'] : '&nbsp;';
$msn = $msn_img;

$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';

$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';

// BEGIN Signature in Profile
$user_sig = '';
if ( $profiledata['user_attachsig'] && $board_config['allow_sig'] )
{
    $user_sig = $profiledata['user_sig'];
    $user_sig_bbcode_uid = $profiledata['user_sig_bbcode_uid'];
	if ( $user_sig != '' )
    {
    	$template -> assign_block_vars('switch_signature', array());
        if ( !$board_config['allow_html'] || !$profiledata['user_allowhtml'])
       	{
       		$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig);
       	}
    	if ( $user_sig_bbcode_uid != '' && $profiledata['user_allowbbcode'] )
   		{
   			$user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:$user_sig_bbcode_uid/si", '', $user_sig);
   		}

   		$user_sig = make_clickable($user_sig);

        if ( $profiledata['user_allowsmile'] && $board_config['allow_smilies'] )
        {
            $user_sig = smilies_pass($user_sig);
        }

   		if (count($orig_word))
		{
   			$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
   		}

		$user_sig = str_replace("\n", "\n<br />\n", $user_sig);
    }
}
// END Signature in Profile

$style_color = ($user_color = color_groups_user($profiledata['user_id'])) ? ' style="font-weight:bold;color: #' . $user_color . '"' : '';

//
// Gender MOD
switch ( $profiledata['user_gender'] )
{
	case GENDER_M:
		$user_gender_img =    $images['gender_m'];
		$l_user_gender =      $lang['gender_m'];
	break;
	
	case GENDER_F:
		$user_gender_img =    $images['gender_f'];
		$l_user_gender =      $lang['gender_f'];
	break;
	
	default:
		$user_gender_img =    $images['gender_x'];
		$l_user_gender =      $lang['gender_x'];
}
$gender_img = '<img src="' . $user_gender_img . '" border="0" alt="' . $l_user_gender . '" title="' . $l_user_gender . '" />';
// Gender MOD

// Generate page
//
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
display_upload_attach_box_limits($profiledata['user_id']);


if (function_exists('get_html_translation_table'))
{
	$u_search_author = urlencode(strtr($profiledata['username'], array_flip(get_html_translation_table(HTML_ENTITIES))));
}
else
{
	$u_search_author = urlencode(str_replace(array('&', ''', '"', '<', '>'), array('&', "'", '"', '<', '>'), $profiledata['username']));
}
/////democracy///////////////////
if ($board_config['warnings_enabled'] || $board_config['reputation_enabled'])
{
	$is_auth = reputation_auth(NO_ID, $userdata, $profiledata);

	if ($board_config['warnings_enabled'] && $is_auth['auth_view_warns'] && !$is_auth['no_warn'])
	{
		$banned = user_banned($profiledata['user_id']);

		$template->assign_block_vars('warnings', ($banned ? array() : reputation_buttons_tpl($profiledata, $is_auth, false, true)) + array(
			'L_WARNINGS' => $lang['Warnings'],
			'WARNINGS' => reputation_warnings($profiledata, $banned, 'text', false),
		));

		if ($profiledata['user_warnings'])
		{
			$template->assign_block_vars('warnings.details', array(
				'U_SEARCH' => append_sid("profile.$phpEx?mode=warnings&" . POST_USERS_URL . '=' . $profiledata['user_id']),
				'L_SEARCH' => sprintf($lang['reputation_search_warnings'], $profiledata['username']),
			));
		}

		if ($profiledata['user_warnings_total'] + $profiledata['user_bans_total'] > $profiledata['user_warnings'])
		{
			$warnings_expired = $profiledata['user_warnings_total'] - $profiledata['user_warnings'] + intval($banned);
			$bans_expired = $profiledata['user_bans_total'] - intval($banned);
			$template->assign_block_vars('warnings.expired', array(
				'L_EXPIRED' => sprintf($lang['reputation_expired_details'], $warnings_expired, $bans_expired),
				'U_SEARCH' => append_sid("profile.$phpEx?mode=expired&" . POST_USERS_URL . '=' . $profiledata['user_id']),
				'L_SEARCH' => sprintf($lang['reputation_search_expired'], $profiledata['username']),
			));
		}
	}
	if ($board_config['reputation_enabled'] && $is_auth['auth_view_rep'] && !$is_auth['no_rep'])
	{
		$template->assign_block_vars('reputation', reputation_buttons_tpl($profiledata, $is_auth, true, false) + array(
			'L_REPUTATION' => $lang['Reputation'],
			'U_VIEW_REPUTATION' => append_sid("profile.$phpEx?mode=reputation&" . POST_USERS_URL . '=' . $profiledata['user_id']),
			'REPUTATION' => reputation_display($profiledata, $board_config['reputation_display'], false),
		));

		if ($board_config['reputation_giving'])
		{
			$template->assign_block_vars('reputation.power', array('L_POWER' => sprintf($lang['reputation_giving_power'], reputation_giving_power($profiledata))));
		}

		if ($board_config['reputation_auto_data'])
		{
			if ($bonuses = reputation_bonuses_tpl($profiledata, true))
			{
				$template->assign_block_vars('reputation.bonuses', array(
					'L_INCLUDING' => $lang['reputation_including']
				));
				foreach ($bonuses as $bonus)
				{
					$template->assign_block_vars('reputation.bonuses.list', $bonus);
				}
			}
		}

		if ($profiledata['user_has_reviews'])
		{
			$template->assign_block_vars('reputation.details', array(
				'U_SEARCH' => append_sid("profile.$phpEx?mode=reputation&" . POST_USERS_URL . '=' . $profiledata['user_id']),
				'L_SEARCH' => sprintf($lang['reputation_search_reputation'], $profiledata['username']),
			));
		}
	}
}
///////////////////////////////////



// Gender MOD
if ( $board_config['gender_display'] )
{
	$template->assign_block_vars('switch_gender_display', array());
}
// Gender MOD

$template->assign_vars(array(
	'USERNAME' => '<span' . $style_color . '>' . $profiledata['username'] . '</span>',

	'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
	'POSTER_RANK' => $poster_rank,
	'RANK_IMAGE' => $rank_image,
	'POSTS_PER_DAY' => $posts_per_day,
	'POSTS' => $profiledata['user_posts'],
	'PERCENTAGE' => $percentage . '%', 
	'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day), 
	'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), 

	'SEARCH_IMG' => $search_img,
	'SEARCH' => $search,
	'PM_IMG' => $pm_img,
	'PM' => $pm,
	'EMAIL_IMG' => $email_img,
	'EMAIL' => $email,
	'WWW_IMG' => $www_img,
	'WWW' => $www,
	'ICQ_STATUS_IMG' => $icq_status_img,
	'ICQ_IMG' => $icq_img, 
	'ICQ' => $icq, 
	'AIM_IMG' => $aim_img,
	'AIM' => $aim,
	'MSN_IMG' => $msn_img,
	'MSN' => $msn,
	'YIM_IMG' => $yim_img,
	'YIM' => $yim,

	'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;',
	'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : '&nbsp;',
	'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',
	'AVATAR_IMG' => $avatar_img,

	// Gender MOD
	'GENDER' => $l_user_gender,
	'GENDER_IMG' => ( $board_config['gender_display'] == GENDER_IMG ) ? $gender_img : '',
	// Gender MOD

    'USER_SIG' => $user_sig,

	'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], '<span' . $style_color . '>' . $profiledata['username'] . '</span>'), 

	'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']), 
	'L_AVATAR' => $lang['Avatar'], 
	'L_POSTER_RANK' => $lang['Poster_rank'], 
	'L_JOINED' => $lang['Joined'], 
	'L_TOTAL_POSTS' => $lang['Total_posts'], 
	'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], '<span' . $style_color . '>' . $profiledata['username'] . '</span>'), 

	'L_CONTACT' => $lang['Contact'],
	'L_EMAIL_ADDRESS' => $lang['Email_address'],
	'L_EMAIL' => $lang['Email'],
	'L_PM' => $lang['Private_Message'],
	'L_ICQ_NUMBER' => $lang['ICQ'],
	'L_YAHOO' => $lang['YIM'],
	'L_AIM' => $lang['AIM'],
	'L_MESSENGER' => $lang['MSNM'],
	'L_WEBSITE' => $lang['Website'],
	'L_LOCATION' => $lang['Location'],
	'L_OCCUPATION' => $lang['Occupation'],
	'L_INTERESTS' => $lang['Interests'],
	// Gender MOD
	'L_GENDER' => $lang['gender'],
	// Gender MOD

	'L_SIGNATURE' => $lang['Signature'],

	'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),

	'S_PROFILE_ACTION' => append_sid("profile.$phpEx"))
);
/* XData MOD :: START */
include($phpbb_root_path.'includes/bbcode.'.$phpEx);

$xd_meta = get_xd_metadata();
$xdata = get_user_xdata($HTTP_GET_VARS[POST_USERS_URL]);
while ( list($code_name, $info) = each($xd_meta) )
{
	$value = $xdata[$code_name];

	if ( !$info['allow_html'] )
	{
		$value = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $value);
	}

	if ( $info['allow_bbcode'] && $profiledata['user_sig_bbcode_uid'] != '')
	{
		$value = bbencode_second_pass($value, $profiledata['user_sig_bbcode_uid']);
	}

	if ($info['allow_bbcode'])
	{
		$value = make_clickable($value);
	}

	if ( $info['allow_smilies'] )
	{
		$value = smilies_pass($value);
	}

	$value = str_replace("\n", "\n<br />\n", $value);

	if ( $info['display_viewprofile'] == XD_DISPLAY_NORMAL )
	{
		if ( isset($xdata[$code_name]) )
		{
			$template->assign_block_vars('xdata', array(
				'NAME' => $info['field_name'],
				'VALUE' => $value
				)
			);
		}
	}
	elseif ( $info['display_viewprofile'] == XD_DISPLAY_ROOT )
	{
		if ( isset($xdata[$code_name]) )
		{
       		$template->assign_vars( array( $code_name => $value ) );
        	$template->assign_block_vars( "switch_$code_name", array() );
   		}
		else
		{
                $template->assign_block_vars( "switch_no_$code_name", array() );
		}
	}
}
/* XData MOD :: END */


$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

User avatar
Noobarmy
Registered User
Posts: 2388
Joined: Tue Apr 04, 2006 6:15 pm
Location: London
Contact:

Re: [RC] XData CPF [Custom Profile Fields (MMW)]

Post by Noobarmy » Thu Jun 28, 2007 5:48 pm

thsi should fix the error:

FIND

Code: Select all

/* XData MOD :: START */
include($phpbb_root_path.'includes/bbcode.'.$phpEx);
REPLACE WITH

Code: Select all

/* XData MOD :: START */
// include($phpbb_root_path.'includes/bbcode.'.$phpEx);
simple :ugeek:
Image

Post Reply

Return to “[2.0.x] MODs in Development”