Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > Programming Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How to 'Hide' the member's URL throughout the forum
timetunnel
Join Date: Sep 2005
Posts: 86

 

Show Printable Version Email this Page Subscription
timetunnel timetunnel is offline 10-26-2005, 10:00 PM

Hello.

Some forum admins don't want to allow their members to indirectly 'advertise' nor do they want to have to monitor WHERE members are linking to through their USERCP panel therefore, the question has been raised in the vB forum re: how to hide the URL. Here's my take on it...

To hide the member 'Homepage URL' thus preventing it from being an option, here's what I've discovered:

there are 2 template files that control the homepage URL:

(1) Modify User Option Templates->modifyprofile
AND
(2) Member Info Templates->MEMBERINFO.

Note: hacking of the 'member.php' file is not needed to do this

'MEMBERINFO' template controls the look, etc. of the 'View Profile' page that comes up when someone clicks on a member's name e.g. in a post or elsewhere, and then selects 'View Public Profile'.. This means, it USES the profile information IF the data is available. If a profile field is empty, this page treats that field as if it is non-existent.

The data originates from USERCP->edit profile. The 'modifyprofile' template controls the look, etc. for this portion of the page. From what I can tell, this is the only place that requires editing to hide the 'Homepage URL' since if the data doesn't exist here, it won't exist anywhere else (of course, unless the URL field is added to the default fields in the registration page in the future - hope not; hopefully, it becomes an option in AdminCP, though).

To hide the URL field, in the 'modifyprofile' template, find the homepage-related section that's surrounded by the <fieldset..> </fieldset> tags. You can do a template search for 'homepage' to find this section of code.

Once there, you have 2 basic options but several ways to accomplish them. Option 1 is to hide the code so that the field is hidden in USERCP->edit profile and therefore uneditable to the user but it's code is visible via the browser's 'View Source'. To do this, surround the code with comment tags (<!-- before the code and --> after the code)

Option 2 is a slight revision to Option 1 whereby the code is to be hidden from the browser's 'View Source'. I prefer Option 2 therefore, that's the one I'll present here. (Note: this method is arbitrary; you may choose to use a different method that accomplishes the same result)

Step 1:
go to AdminCP->Plugin Manager->[Add New Plugin] ->fill in the fields using 'Hook Location' of 'global_start', etc. In the 'Plugin PHP Code' box, add the following variable (without the quotes shown here), e.g. '$show_homepage=0;' (I like to use '0' and '1' to represent 'off' and 'on', respectively, though any value you chose can be used). Select 'Yes' for 'Plugin is Active' so this variable now becomes available throughout your vBulletin forum.

Step 2:
on the line BEFORE the <fieldset> tag to the 'Homepage URL' code section, ADD the following code:

'<if condition="$show_homepage==1">'
and AFTER the matching </fieldset>
ADD '</if>' again without the quotes.

Since from the plugin, the '$show_homepage' is not equal to 1, this statement renders 'false' and therefore, the data between the <if...></if> tags won't be interpreted/evaluated.

NOTE: If at anytime in the future you want the 'Homepage URL' to show again, go back to the 'Plugin Manager' and change the variable from '0' (off) to '1' (on). This essentially acts like an 'ON/OFF' switch. No code modification would be required.

If you want to make a note in this template to remind yourself where you made the revision e.g. if you have to revert the template in the future due to a vB upgrade, etc., use 'comment' tags e.g.

<!-- begin revision -->
<if...>
<fieldset>
...
</fieldset>
</if>
<!-- end revision -->

On the browser's 'View Source', you'll just see the comment code with nothing in-between.

Make sure you have a backup copy (file or hardcopy) of the revised template. :nervous:

Step 3:
Save the template and then go to the 'USERCP->edit profile' and that field should no longer exist, nor should it show up on the 'View Profile' page.

Hope this helps. :squareeyed:
Reply With Quote
  #2  
Old 10-28-2005, 12:15 AM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It'd rather go to tutorial forum.
Reply With Quote
  #3  
Old 10-28-2005, 01:22 AM
Guest190829
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by tnguy3n
It'd rather go to tutorial forum.
Moved to the correct forum.
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 07:12 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.03721 seconds
  • Memory Usage 2,204KB
  • Queries Executed 18 (?)
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
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (3)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete