MyBB Hacks

Full Version: Additional Settings For Custom Profile Fields [1.2]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
You have no obligation to do that, Lee Smile
I've been working converting some of my forums from MyBB 1.4 to MyBB 1.6.
I don't want two steps behind when MyBB 1.8 released later Biggrin
Wow, this looks incredible. Looking forward to trying it out.

Here's my mock-up (not complete, obviously fields missing) for new edit profile page. Hoping this can help me accomplish it.

http://i.imgur.com/AuJMR.jpg
In the screenshot above, it seems that you want to pull out some fields (not only custom profile fields) into your main User CP page. Although with some modifications (I think) this plugin can pull out custom profile fields input into the main User CP page, but you still need to pull out the other fields (non custom profile fields) manually.
So I think it's better to do that with a custom plugin.

I'm really sorry for my very late reply.
Yeah, I figured this plugin would not be able to do everything I want to accomplish here, but it can probably help a bit at least Smile
Updated:
Add {INPUT} element to custom input.
To upgrade, just replace the plugin file.

(05-02-2012 03:36 AM)brad-t Wrote: [ -> ]Yeah, I figured this plugin would not be able to do everything I want to accomplish here, but it can probably help a bit at least Smile
I don't know whether you still want to use the default Edit Profile page or not. Assuming you don't want to use it (based on your screenshot), try this:
Install the plugin in the first post, then install the plugin attached to this post (I think it's better to do that with a separated plugin than sticking the codes into the original plugin).
It uses do_update_xt_proffields as $mybb->input['action'], so you need to wrap the input fields with a form in usercp template. Something like this:

HTML Code
<form action="usercp.php" method="post">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
Contents and input fields
<input type="hidden" name="action" value="do_update_xt_proffields" />
<input type="submit" class="button" value="Update Profile" />
</form>

Use {INPUT} (minimum setup) in the Custom Input setting and {VALUE} in the Display Format setting.
For displaying the input in the main user cp page, put {$xtpf_minp['fidX']} manually in usercp template (inside the form above), where X is the custom profile field id.
You need to "load" the non custom profile fields manually. Just add the code in the plugin attached to this post.

Here is a simple example for that:
[attachment=803]
I've loaded the threads per page and posts per page options manually there.

I have text it and it really is very cool, we can even use the mybb editor in the fields right?

Still testing it Smile
(05-03-2012 11:21 AM)Sama34 Wrote: [ -> ]we can even use the mybb editor in the fields right?
Unfortunately, we need to do this manually.
Something like this (Custom Input setting):

HTML Code
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
	<tr>
		<td class="thead">
			<div class="float_right smalltext">
				<em><strong><func htmlspecialchars_uni>{$xtpf_data['description']}</func></strong></em>
			</div>
			<strong><func htmlspecialchars_uni>{$xtpf_data['name']}</func></strong>
		</td>
	</tr>
	<tr>
		<td class="trow1">
			<textarea id="message" name="profile_fields[fid2]" rows="15" cols="100">{VALUE}</textarea>
			<script type="text/javascript" src="jscripts/editor.js?ver=1600"></script>
			<script type="text/javascript"> 
			<!--
				var editor_language = {
					title_bold: "Insert bold text",
					title_italic: "Insert italic text",
					title_underline: "Insert underlined text",
					title_left: "Align text to the left",
					title_center: "Align text to the center",
					title_right: "Align text to the right",
					title_justify: "Justify text",
					title_numlist: "Insert numbered list",
					title_bulletlist: "Insert bulleted list",
					title_image: "Insert image",
					title_hyperlink: "Insert hyperlink",
					title_email: "Insert email address",
					title_quote: "Insert quoted text",
					title_code: "Insert formatted code",
					title_php: "Insert formatted PHP code",
					title_close_tags: "Close any open MyCode tags that you currently have open",
					enter_list_item: "Enter a list item. Click cancel or leave blank to end the list.",
					enter_url: "Please enter the URL of the website.",
					enter_url_title: "Optionally, you can also enter a title for the URL.",
					enter_email: "Please enter the email address you wish to insert.",
					enter_email_title: "Optionally, you may also enter a title for the email address.",
					enter_image: "Please enter the remote URL of the image you wish to insert.",
					enter_video_url: "Please enter the URL of the video.",
					video_dailymotion: "Dailymotion",
					video_googlevideo: "Google Video",
					video_metacafe: "MetaCafe",
					video_myspacetv: "MySpace TV",
					video_vimeo: "Vimeo",
					video_yahoo: "Yahoo Video",
					video_youtube: "YouTube",
					size_xx_small: "XX Small",
					size_x_small: "X Small",
					size_small: "Small",
					size_medium: "Medium",
					size_large: "Large",
					size_x_large: "X Large",
					size_xx_large: "XX Large",
					font: "Font",
					size: "Text Size",
					color: "Text Color"
				};
				var clickableEditor = new messageEditor("message", {lang: editor_language, rtl: 0, theme: "default"});
			// -->
			</script>
		</td>
	</tr>
</table>

[attachment=805]

WOW RateU! That sample edit profile page is amazing! Thank you!
Yeah, the screenshot looks pretty awesome Smile
Too bad MyBB doesn't allow more that one editor in the same page, we need to choose what field will use the editor :/
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Reference URL's