Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Users Can Hide Posts From Unregistered Browsers Details »»
Users Can Hide Posts From Unregistered Browsers
Version: 1.00, by TygerTyger TygerTyger is offline
Developer Last Online: Jul 2012 Show Printable Version Email this Page

Version: 3.6.0 Beta 3 Rating:
Released: 07-12-2006 Last Update: 07-12-2006 Installs: 8
Template Edits
 
No support by the author.

Requested by a forum member because of someone who had been banned continuing to nose around the forum as a Guest and I thought it was a sufficiently neat idea to be worth making known to the masses. All users have to do is choose to hide their posts to unregistered browsers (and search engines) in their UserCP. Sort of like a custom Tachy for privacy. Screenshot at the bottom!



INSTRUCTIONS

OPEN:
AdminCP > User Profile Fields > Add New User Profile Field

Add a new Single-Selection Menu then fill in the following settings:

Title: Hide my posts from Unregistered Browsers and Search Engines
Options: (Make sure they are in this order!)
No
Yes
Set Default: Yes, but no First Blank option
Field Required: No but display at registration
Field Editable by User: Yes
Private Field, Field Searchable on Members List, Show on Members List: All No. (Unfortunately you must make this a non-private field or the change won't register with Guests)

Display Page: Options: Log In/Privacy

Save the page and make a note of the field number assigned to your Custom Field, which is shown on the User Field Manager page next to the display number. If this is your first Custom Field then your field number will be 6. In the following template edit, change the X in fieldX to the number of your Custom Field.



OPEN:
UserCP > Styles & Templates > Edit Templates > Postbit(_legacy)

FIND: (shouldn't be tricky, it's the first lines )
Code:
<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="thead" $post[scrolltothis]>
REPLACE WITH:
Code:
<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<if condition="$post['fieldX'] == Yes AND is_member_of($bbuserinfo, 1)">
<tr>
<td>
This user has chosen to hide their posts from Guest browsers.
</td>
</tr>
</table>
<else />
<tr>
	<td class="thead" $post[scrolltothis]>
FIND: (Should be equally difficult, it's the last lines)
Code:
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
	</if>
	</table>
</div>
<!-- / post $post[postid] popup menu -->
REPLACE WITH:
Code:
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=addlist&amp;userlist=buddy&amp;u=$post[userid]"><phrase 1="$post[username]">$vbphrase[add_x_to_buddy_list]</phrase></a></td></tr>
	</if></if>
	</table>
</div>
<!-- / post $post[postid] popup menu -->


And you're done! You can of course change the post-subtitute message to anything you like but you can't hide a post entirely because it breaks the formatting of the page so the table row must remain.


Demo:



Feedback, bugs, complaints to the usual address on the back of a postcard. You're going to hell if you use this hack and don't click install.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-13-2006, 10:10 AM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, nuts to this. Why did the similar thread not appear when I searched for it? Freaking vBulletin search engine...

Oh well, I guess now you have choice of doing it with a plugin using the other guy's method or a purely a template edit using mine.

His deals with the threadbit, mine does not. Mine doesn't trouble the database either, of course.
Reply With Quote
  #3  
Old 07-14-2006, 03:23 PM
rob30UK rob30UK is offline
 
Join Date: Oct 2005
Location: UK
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

TygerTyger...

You have made here a fairly reasonable attempt at a mod, but I feel maybe you could make it far better. With a little thought behind why this would be used, it could have been made slightly differently. Think about it this way instead - I think this should be a native feature:-

Ability for users to hide their 'THREADS' from non members (not posts, as it would make convos non-sensical)....

This would however happen on a PER THREAD basis, not a global switch in usercp (bad idea)

The ability to hide threads or not should be controlled by the permissions system and an admin should be able to specify which groups can and cant do this.

The above, in my opinion would be the best implementation of any mod along these lines and would result in a very very popular and usable (even practical) mod.

I'm sure someone will do this very soon.... wonder who'll be first?
Reply With Quote
  #4  
Old 07-14-2006, 04:46 PM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well if you check the other guy's method I linked to in the post above yours, his isn't too far off doing that.

The reason I left this one here (aside from the fact the search didn't pick it up until after I'd posted it :rolleyes) is because it's a quick-n-easy template-only edit and would still be useful for someone who wants to keep their posts out of the search engines which apparently some do.

I'm inclined to think that a global thread-switch would be what most people are after though, I think that a per-thread mod would have a more limited use. If not because what I personally would do is a make a forum section for "Secrets" or whyever people would want to hide their thread and just hide the section from Guests.
Reply With Quote
  #5  
Old 07-15-2006, 02:57 AM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would rather see something like used here on vb.org were code is only visible for licensed user ..
Reply With Quote
  #6  
Old 07-15-2006, 07:06 AM
TygerTyger TygerTyger is offline
 
Join Date: Aug 2005
Posts: 182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To be honest I'm astonished they don't already do that, I assumed they did.

Edit: They do.
Reply With Quote
  #7  
Old 08-30-2006, 04:59 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the hack! I'll install it right away...
Reply With Quote
  #8  
Old 09-17-2006, 05:50 PM
txsbmw txsbmw is offline
 
Join Date: May 2006
Posts: 238
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tried this on 3.6.1 and cannot get it to work. Is there any way to make this work with 3.6.1?
Reply With Quote
  #9  
Old 11-27-2006, 12:46 AM
jilly jilly is offline
 
Join Date: Jul 2002
Location: central maryland
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so how exactly would I modify this so that a user hides their posts from all usergroups, not just guests?
Reply With Quote
  #10  
Old 11-27-2006, 01:47 AM
jilly jilly is offline
 
Join Date: Jul 2002
Location: central maryland
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

someone told me to remove the bbuser condition at the end, and just use

<if condition="$post['fieldxx'] == Yes">

instead, and it works fine!!! Thank you so much Tyger, this is a great option for my users when they need to hide their posts from general view for whatever reason, and what the freedom to hide or unhide their posts whenever they need to.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:35 AM.


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.04586 seconds
  • Memory Usage 2,296KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete