| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| [ C ] Favourite colour BBCode | |
|---|---|
| Tweet Topic Started: Jan 15 2015, 03:57 PM (296 Views) | |
| HIRP | Jan 15 2015, 03:57 PM Post #1 |
|
Member
![]() ![]() ![]()
|
Board Address: Link Board Software: ZB Description: I feel like this should be pretty simple but I could be wrong. I'm looking for a custom BBCode that can insert a [ color = x ] tag into a post and use a preset colour that is set in a user's profile. I imagine using a custom profile field would be easiest. Example: I set up a "Post Color" custom profile field. I then go to my profile and put "red" into the field. Then, in a post, I write this:
Which would come out looking like this:
Essentially what I'm looking to do is have my members select a post colour in their profiles, which will then be substituted into their posts whenever they use the [c] tag. Any help would be appreciated! Edit: the profile field input should accept anything that would be acceptable within a [ color = ] tag, so names ("red", "seagreen") and hexcodes ("#cc0000"). Edited by HIRP, Jan 15 2015, 03:59 PM.
|
![]() |
|
| Cory | Jan 16 2015, 04:02 PM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Admin CP Users & Groups Profile FieldsCreate a 1 line text field with these settings: Title: Post Color On Registration: Your Choice Show field in topics: Yes Admin Only Edit: No Maximum input length: Your Choice Admin CP Themes Board Template Below the Board
|
![]() |
|
| HIRP | Jan 16 2015, 09:27 PM Post #3 |
|
Member
![]() ![]() ![]()
|
Thanks a lot, Cory. I'm wondering, is it possible to either hide the profile field from plain view in threads or otherwise make it so that the "Show field in topics" option does not need to be enabled? Right now I've got another piece of code that manually re-orders the profile fields I've got set up (you actually wrote it for me a few years ago), and because it doesn't account for the new "Post Color" field, it seems to be hidden away as far as I can tell, but I'm wondering if it would be possible to move forward with the option disabled so I can avoid anything on my forum exploding in the future. Example thread here. Notice how the "Custom Color" profile is not displayed? It is enabled in the admin CP, but not shown probably due to the other piece of code that's swapping the fields around. Would it be possible to make the code above work without the "Show field in topics" option enabled just to be safe? Edit: Here's the code I'm running that also dinks with the profile fields.
Edited by HIRP, Jan 16 2015, 09:28 PM.
|
![]() |
|
| Cory | Jan 16 2015, 09:37 PM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That's what is hiding the field from appearing in the mini profile. I'm not entirely understanding what the issue is and why it would conflict with that code. It's essential the "Show field in topics" option is enabled, otherwise a lot of AJAX would have to be used. |
![]() |
|
| HIRP | Jan 16 2015, 10:03 PM Post #5 |
|
Member
![]() ![]() ![]()
|
Ah! I hadn't realized that the code you gave to me hid it by itself. Good thinking. I was just worried that there might have been something conflicting with the existing code. Great work as always. Thanks again. |
![]() |
|
| Helena | Jan 22 2015, 07:55 PM Post #6 |
![]()
M is for Mod
![]()
|
Completed! Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Closed Requests · Next Topic » |
| Track Topic · E-mail Topic |
8:31 PM Jul 10
|


![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)


Users & Groups 

8:31 PM Jul 10