[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.
mbuna303
Registered User
Posts: 2
Joined: Sun Apr 22, 2007 7:03 pm

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

Post by mbuna303 »

So XDATA was my first attempt at modding our Offroad forum. Seemed to go pretty well except for one thing. I'm hoping I made a common mistake.

http://cootanet.com/forum/viewtopic.php?p=745#745

As you can see, I've only added 1 new custom field "rig make" it seems to be showing up at the top of the topic page once for each post by the user (I'm the only user using this field at the moment)

Worse, Our messages are showing up inside the author column, and our message columns are showing up blank.

What did I do? I thought maybe I added code incorrectly in the viewtopic_body.tpl, but when I preview it locally, it seems to be rendering correctly. (see attachment)

Your phpBB board URL: http://cootanet.com/forum
Template(s) used: subSilver
Any and all MODs: I'm pretty sure just a live chat mod implemented by another admin
Do you use a port of phpBB: no
Version of phpBB: 2.0.22
Version of PHP: ack, I don't know for sure, can find out if necessary
Which database server and version: MySQL - 5.0.24a-standard
Host: not sure
Did someone install this for you/who: yes, another admin
Is this an upgrade/from what to what: no
Is this a conversion/from what to what: no
Have you searched for your problem: yes
If so, what terms did you try: author, message, incorrect
Do you have a test account for us: no
Attachments
preview-viewtopic_body-tpl.gif
preview-viewtopic_body-tpl.gif (21.82 KiB) Viewed 726 times

mbuna303
Registered User
Posts: 2
Joined: Sun Apr 22, 2007 7:03 pm

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

Post by mbuna303 »

lol sorry, I tried re-uploading viewtopic_bidy.tpl, it's working beautifully now. Thanks to the makers of XDATA, it was very easy to implement this mod, having no prior experience really.

momoftwo
Registered User
Posts: 188
Joined: Mon Mar 05, 2007 4:07 pm

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

Post by momoftwo »

if i use this MOD, will it allow me to have selected information show up under the users avatar on posts?

thanks

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 »

you can select from teh acp what cpf's show up in the user's profile and in viewtopic. you can't decide on a user to cpf basis what shows and what doesn't though.
Image

User avatar
45ish
Registered User
Posts: 81
Joined: Sun Nov 26, 2006 6:38 am
Location: usa canada uk - where ever the english language takes me!
Contact:

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

Post by 45ish »

Hi,
Can I install this to prevent new registrations from putting their website into their profile? Also, is this okay to use with phpbb 2022? Thanks.

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 »

i think you can, i don't remember, but you should be able to go into the ACP then switch off the display for website where you don't want it to display. and it should work with phpbb2.0.22. If your souly looking to stop the website field being displayed there are other mods out there for this ;)
Image

momoftwo
Registered User
Posts: 188
Joined: Mon Mar 05, 2007 4:07 pm

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

Post by momoftwo »

you can't decide on a user to cpf basis what shows and what doesn't though.
sorry, but what do you mean by this?

thanks

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 »

basically in teh acp you can configure only the custom field. so you can decide for EVERYONE whether or not it appears in teh profile or in viewtopic. however you can't say have it for one user and not the other, this is what i meant by a cpf per user basis ;)
Image

User avatar
End of a Shadow
Registered User
Posts: 1557
Joined: Sun Apr 27, 2003 6:39 pm
Location: Washington
Name: J G
Contact:

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

Post by End of a Shadow »

I'm a bit confused on how to do something which may be easy that I'm just blind.

What I want to do is make a field that is just a link to an image say like http://www.address.com/image.jpg and that this image is then displayed as not a link but the image itself with the img HTML code.

I would think just using that TPL option when creating and adding in a new line on profile_view_body.tpl would do the trick, but I've attempted several times and failed thus hoping someone here has an answer.

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 »

well simply put in the ACP > Manage Fields set the display type (for profile) to TPL Variable. You then need to set the TPL Variable to something, i usually just use the same name as the field name.

Then in the TPL file add something as follows:

Code: Select all

<!-- BEGIN switch_testing -->
{testing}
<!-- END switch_testing -->
testing was my test tpl variable. So if i put testing into my TPL Variable field then this is the code i would use. The switch first tests to see if the user has inputted something then {testing} is the value. So in your case if you set the TPL variable to offsite_image you could use:

Code: Select all

<!-- BEGIN switch_offsite_image -->
<img src="{offsite_image}" />
<!-- END switch_offsite_image -->
hope that helps,
chu
Image

FeedBack
Registered User
Posts: 2
Joined: Wed Jul 05, 2006 2:20 am

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

Post by FeedBack »

Aloha-

I'm having problems with the XData mod and our user registration screen, my custom fields won't show on the registration form....

Site: hawaiiminiclub.org/forum
PHPBB Ver: Powered by phpBB 2.0.22 © 2001 phpBB Group
XData Ver: xdata_cpf_104
Other Mods: Better captcha, Log IP Address on Registration, Hide User's WebSite Button, Easy assign user to groups, User Shield, EasyMod

Any thoughs where I should look?

Thanks for your help.

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 »

i get this error when trying to view someones profile after i installed this: Fatal error: Cannot redeclare multi_bbcode() (previously declared in /home/evancole/public_html/forum/includes/bbcode.php:37) in /home/evancole/public_html/forum/includes/bbcode.php on line 35

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 »

bump anyone?

User avatar
End of a Shadow
Registered User
Posts: 1557
Joined: Sun Apr 27, 2003 6:39 pm
Location: Washington
Name: J G
Contact:

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

Post by End of a Shadow »

How would I go about making a check list that would be used for something like if user has this this this this this, they check those that apply to them, and those they checked only would be displayed on their profile.

For example, the options were the most current game consoles, the user checked the ones they owned, and in their profile as text the ones they selected only would be shown of the available options?

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 »

@fiftyfour123: your error is caused by multiple includes of bbcode.php. on a default installation this wouldn't be a problem as there are no prior includes to bbcode.php but its most probably a conflict with another mod that needs bbcode.php. but less jibberjabber here's your fix:

Code: Select all

OPEN: includes/usercp_viewprofile.php

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

REPLACE WITH: 
/* XData MOD :: START */
// include($phpbb_root_path.'includes/bbcode.'.$phpEx);
@End of a Shadow: this should be a simple template change, but i've found some bugs in teh checkbox's coding. here's the main edit you need to make to the PHP side:

Code: Select all

OPEN includes/usercp_viewprofile.php

FIND
	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() );
   		}

REPLACE WITH
	elseif ( $info['display_viewprofile'] == XD_DISPLAY_ROOT )
	{
		if ( isset($xdata[$code_name]) && ( ($info['field_type'] == 'checkbox' && $value != 'False') || $info['field_type'] != 'checkbox' ))
		{
	       		$template->assign_vars( array( $code_name => $value ) );
	        	$template->assign_block_vars( "switch_$code_name", array() );
 		}
that will basically make sure that the checkbox is checked before assigning it as set. this will matter later.

now go into your ACP and under manage fields, with each field set its display type (in viewprofile) to TPL Variable, then set its template name to whatever is easiest to remeber.

now open profile_view_body.tpl. the basic concept of displaying the field is simple you do the following

Code: Select all

	<!-- BEGIN switch_{tpl_variable} -->	
	{text}<br />
	<!-- END switch_{tpl_variable} -->
where {tpl_variable} is the tpl variable you set in the acp. and {text} is what you want to display. you can then add this to the template as you want with more of the checkbox fields. i did it as follows

Code: Select all

FIND:
<!-- 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 -->

AFTER, ADD:
<tr>

	<td calign="top" align="right" nowrap="nowrap"><span class="gen">Checks:</span></td>
	<td><b><span class="gen">
	<!-- BEGIN switch_check1 -->	
	Check 1<br />
	<!-- END switch_check1 -->
	<!-- BEGIN switch_check2 -->	
	Check 2<br />
	<!-- END switch_check2 -->
	<!-- BEGIN switch_check3 -->	
	Check 3<br />
	<!-- END switch_check3 -->
	</span></b></td>

</tr>
and i had fields check1, check2, check3. so basically in the profile it would show:
Checks: along with all the fields that were checked. simple eh :D


hope that helps,
anthony
Image

Post Reply

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