Additional Settings For Custom Profile Fields [1.2]
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #51
RE: Additional Settings For Custom Profile Fields
The latests RateU.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
06-17-2012 06:36 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #52
RE: Additional Settings For Custom Profile Fields
In which line you use the is_array? Line #729?

06-17-2012 06:38 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #53
RE: Additional Settings For Custom Profile Fields
Yes, just before the foreach().

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
06-17-2012 07:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #54
RE: Additional Settings For Custom Profile Fields
May I know how you put it there? This is the line #729 from the plugin:

PHP Code:
729
break;


06-17-2012 07:11 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #55
RE: Additional Settings For Custom Profile Fields
You got me there RateU, will check the latest version.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
06-17-2012 07:54 AM
Visit this user's website Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #56
RE: Additional Settings For Custom Profile Fields
Hi RateU,

Thanks very much for your support. I was able to add a few things. However, for example, I don't understand how to add variable to a plugin file like you did for "threads per page." I don't know any PHP at all ...

Can you please post how you did it just for those two? Hopefully, I can learn how to do it for the rest from your example.
06-19-2012 04:09 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #57
RE: Additional Settings For Custom Profile Fields
You can find most of them in usercp.php file.

This is for example only:
  • Bio custom profile field (fid2) - {$xtpf_minp['fid2']}:
    • Custom Input:

      HTML Code
      <br />
      <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
      	<tr><td class="thead"><strong>{$xtpf_data['name']}</strong></td></tr>
      	<tr><td class="trow2">{INPUT}</td></tr>
      </table>

    • Display Format:

      Code:
      {VALUE}

  • Sex custom profile field (fid3) - {$xtpf_minp['fid3']}:
    • Custom Input:

      HTML Code
      <tr>
      	<td class="trow2">{$xtpf_data['name']}:</td>
      	<td class="trow2">{INPUT}</td>
      </tr>

    • Display Format:

      Code:
      {VALUE}

  • Facebook custom profile field (fid4) - {$xtpf_minp['fid4']}:
    • Regular Expression:

      Code:
      ^[A-Za-z0-9]{5,}$

    • Custom Input:

      HTML Code
      1
      2
      3
      4
      5
      6
      <tr>
      	<td style="width:1px">
      		<img src="images/facebook.png" alt="" title="<func htmlspecialchars_uni>{$xtpf_data['description']}</func>" />
      	</td>
      	<td>{INPUT}</td>
      </tr>

    • Display Format:

      HTML Code
      <a href="http://facebook.com/{VALUE}" target="_blank"><img src="images/facebook_button.png" alt="" /></a>

  • Twitter custom profile field (fid5) - {$xtpf_minp['fid5']}:
    • Regular Expression:

      Code:
      ^[A-Za-z0-9_]+$

    • Custom Input:

      HTML Code
      1
      2
      3
      4
      5
      6
      <tr>
      	<td style="width:1px">
      		<img src="images/twitter.png" alt="" title="<func htmlspecialchars_uni>{$xtpf_data['description']}</func>" />
      	</td>
      	<td>{INPUT}</td>
      </tr>

    • Display Format:

      HTML Code
      <a href="http://twitter.com/{VALUE}" target="_blank"><img src="images/twitter_button.png" alt="" /></a>


usercp template:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<html>
<head>
<title>{$lang->user_cp}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" border="0" align="center">
<tr>
{$usercpnav}
<td valign="top">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="{$colspan}"><strong>{$lang->account_summary}</strong></td>
</tr>
<tr>
{$avatar}
<td class="trow2">
<span class="largetext">{$username}</span><br />
<strong>{$lang->postnum}</strong> <a href="search.php?action=finduser&amp;uid={$mybb->user['uid']}">{$mybb->user['posts']}</a> {$lang->posts_day}<br />
{$reputation}
<strong>{$lang->email}</strong> {$mybb->user['email']}<br />
<strong>{$lang->registration_date}</strong> {$regdate}<br />
<strong>{$lang->primary_usergroup}</strong> {$usergroup}<br />
{$referral_info}
</td>
</tr>
</table>
<br class="clear" />
{$errors}
<form action="usercp.php" method="post">
	<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
	<div class="float_right" style="width:49%">
		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
			<tr>
				<td class="thead" colspan="2"><strong>{$lang->edit_options}</strong></td>
			</tr>
			<tr>
				<td class="trow2">{$lang->tpp}</td>
				<td class="trow2">
					{$threadperpage}
				</td>
			</tr>
			<tr>
				<td class="trow2">{$lang->ppp}</td>
				<td class="trow2">
					{$postperpage}
				</td>
			</tr>
			<tr>
				<td class="trow2">Time Zone:</td>
				<td class="trow2">{$tzselect}</td>
			</tr>
			<tr>
				<td class="trow2" colspan="2">
					<div>{$showsig}</div>
					<div>{$showavatar}</div>
				</td>
			</tr>
			<tr>
				<td class="trow2" colspan="2">
					<div>{$allownotices}</div>
					<div>{$receivepms}</div>
					<div>{$pmnotice}</div>
					<div>{$pmnotify}</div>
				</td>
			</tr>
		</table>
	</div>
	<div style="width:49%">
		<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
			<tr>
				<td class="thead" colspan="4"><strong>{$lang->edit_profile}</strong></td>
			</tr>
			{$xtpf_minp['fid3']}
			<tr>
				<td class="trow2">{$lang->birthday}</td>
				<td class="trow2">
					{$birth_day}
				</td>
			</tr>
			<tr>
				<td class="trow2">{$lang->birthdayprivacy}</td>
				<td class="trow2">
					{$bdprivacy}
				</td>
			</tr>
			<tr>
				<td class="trow2" colspan="2">
					<table border="0" style="margin:auto">
						{$xtpf_minp['fid4']}
						{$xtpf_minp['fid5']}
						<tr>
							<td><img src="images/www.png" alt="" title="{$lang->website_url}" /></td>
							<td>
								{$userwebsite}
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		{$xtpf_minp['fid2']}
	</div>
	<br class="clear" />
	<div class="clear" style="text-align:center">
		<input type="hidden" name="action" value="do_update_xt_proffields" />
		<input type="submit" class="button" value="Update Profile" />
	</div>
</form>
<br class="clear" />
{$latest_subscribed}
{$latest_threads}
{$latest_warnings}
{$user_notepad}
</td>
</tr>
</table>
{$footer}
</body>
</html>


   



Attached File(s)
.php  xt_ucp_main.php (Size: 10.03 KB / Downloads: 491)

(This post was last modified: 07-27-2012 02:46 AM by RateU.)
06-19-2012 08:20 AM
Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #58
RE: Additional Settings For Custom Profile Fields
Great, thank you so much! I'll spend some time with this.

For what it's worth, here's where I'm at right now:

[Image: ob56W.png]
06-19-2012 10:42 PM
Find all posts by this user Quote this message in a reply
brad-t Offline
Member
***
Posts: 120
Joined: Apr 2011
Post: #59
RE: Additional Settings For Custom Profile Fields
Using RateU's file, here's what I've created so far:

[Image: RjGUAl.png]
[Image: Y2t8El.png]

Would be happy to share the template and css with anyone who is interested -- just send me a message.

Now, I am wondering if it's possible to do Avatar upload and Signature edit in this page as well ... since these are other form calls I have no clue how to do it. I feel bad to ask for any more help here as well, so maybe I'll just leave it as is for now ... haha.

RateU, you should consider contracting yourself as an xThreads developer, I'm sure many MyBB admins are interested! Wink
06-20-2012 08:05 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #60
RE: Additional Settings For Custom Profile Fields
Alright, the problem seems to be gone But a new one arises.

This:

PHP Code:
if($pa['xt_proffields_fml'][$v]){


Since "$pa['xt_proffields_fml']" is not aa array, I had to change it to this:

PHP Code:
if(is_array($pa['xt_proffields_fml']) && $pa['xt_proffields_fml'][$v]){


Since , but I don't know if that is really a fix or it just hides the error.

The same happens at line #580 and I suppose the same will happen in lines #598, #627, and #711.

Also, just noticed that "Editable By Usergroup" only hides the input code in the UCP, but users are still able to save it (ie: user was editing his/her options while you changed the setting).


Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
06-20-2012 03:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: