vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   End-User Options - Allow user to select what is shown in their postbit. (https://vborg.vbsupport.ru/showthread.php?t=215277)

RC Attacker 06-02-2009 09:00 PM

Allow user to select what is shown in their postbit.
 
1 Attachment(s)
Description
This template modification will allow the user to select what they want shown in their own postbit via their control panel. This can be done with anything in your postbit (i.e. user title, avatar, rank, location, post count, join date, custom profile field(s), etc).

Screenshot
Check the attachments at the bottom of this post for an example.

Install
A) Admin CP > User Profile Fields > Add New User Profile Field
A.1) Choose Multiple-Selection Checkbox (you may use multiple-selection menu).

A.2) Put "Hidden Post Information" in Title (you may write whatever you want).

A.3) Put whatever you intend to have the option to hide in Options ("Avatar", "User Title", "Join Date", "*Custom profile field name*", etc). Remember the order they are in!

A.4) The rest is irrelevant. I suggest you give some kind of description so your members know what this is for. I would probably either put this on the "Edit Details" page or "Thread Viewing" section on the options page. You will probably want to hide this from your members list.

A.5) After you save, remember the the field ID. This will be in Name column. You will see "fieldx", 'x' being the ID number.
B) Styles & Templates > Style Manager > Edit Templates > Postbit Templates > postbit_legacy
B.1) Replace 'x' with the field ID and 'y' with the ID of the option.
PHP Code:

<if condition="!($post['fieldx'] & y)"

The ID of the option is multiplied by two for each one. The first option on your list would be 1, the second would be 2, the third is 4, the fourth is 8, the fifth is 16, the sixth is 32, and so on.

B.2) In postbit_legacy, take the conditional you just made and post it before the conditional of the first option that you listed. I will use the avatar for my example.

Find:
PHP Code:

<if condition="$show['avatar']">
                <
table align="center" cellpadding="6" cellspacing="0">
                <
tr>
                  <
td valign="top"><div><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]$post[avwidth$post[avheightalt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                </
div></td></tr></table>
            </if> 

Add above from what you have in step B.1:
PHP Code:

<if condition="!($post['fieldx'] & y)"

Add below:
PHP Code:

</if> 


B.3) Repeat this process on everything you made an option for. Remember to put in the right option ID in your conditional. The field ID will remain the same.
C) Done. Go into your control panel and choose what you want hidden from your posts.

------
Please Mark as Installed if you've found this useful. This is my first time posting a mod and I would appreciate any feedback you have for it. If you need help, I'll try to help you here, but you're more likely to receive a quicker response at AdminAddict. :)

gothicuser 06-03-2009 06:54 PM

Nice idea. Thanks

goxy63 06-04-2009 03:11 PM

cool

Thanks

htscpl 06-09-2009 09:40 AM

Good idea for more user control, Thanks!

Kolbi 06-09-2009 11:59 AM

A short question, why are these steps:
Quote:

A.1) Choose Multiple-Selection Checkbox (you may use multiple-selection menu).

A.2) Put "Hidden Post Information" in Title (you may write whatever you want).
necessary?

letsjoy 06-12-2009 09:05 AM

cool mod thnx for share :)

mikey1991 06-12-2009 08:55 PM

Any chance you cold integrate this with this: https://vborg.vbsupport.ru/showthread.php?t=213395 to make them "Show Signature"

RC Attacker 06-14-2009 03:54 AM

Quote:

Originally Posted by Kolbi (Post 1826354)
A short question, why are these steps:

necessary?

If you do not do that (or some form of it), the user will have no way to choose what they want shown in their postbit.

Crashh 06-19-2009 06:13 PM

RC Attacker, thx for your hack! is it possible to add an option hide all users information in postbit with mine?

RC Attacker 06-23-2009 05:29 PM

Quote:

Originally Posted by Crashh (Post 1832887)
RC Attacker, thx for your hack! is it possible to add an option hide all users information in postbit with mine?

I believe you are asking if the changes you make in your own User CP can affect everyone, correct?


All times are GMT. The time now is 01:34 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02221 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete