vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   user profile fields (https://vborg.vbsupport.ru/showthread.php?t=297163)

rgreene1971 04-13-2013 02:46 PM

user profile fields
 
I have added a user profile field for all of my members to add a link to a thread in my forum which is a review of their product or ad. How can I make this link clickable instead of the members needing to copy the link and pasting it in a browser?

Thanks for any help

Lynne 04-13-2013 03:26 PM

What is an example of what they enter into the field? And where is it (what template?) that you want it to show as clickable?

rgreene1971 04-13-2013 03:43 PM

An example of what they would enter is a link to a thread on the forum.

example: https://xxxxxxxxxxxx.com/vbforum/sho...30079-myreview

I would like it to show on all templates and be found in the users about me tab of their profile.

Lynne 04-13-2013 03:49 PM

Well, you aren't being that specific, so I really can't be too specific either. But, you'd do something like this in the template:

HTML Code:

<vb:if condition="$post['fieldx']"><a href="{vb:raw post.fieldx}">My Link</a> </vb:if>
(That's for in a post, the variable will be different depending on the template you put it in.)

rgreene1971 04-14-2013 02:55 AM

1 Attachment(s)
Here is a clip section of the about me page of my profile. I have highlighted the profile field I would like to make a link

rgreene1971 04-14-2013 03:01 AM

I am using the bp- light styles from bluepearl skins

http://www.bluepearl-skins.com/forum...ulletin-skins/

Lynne 04-14-2013 03:01 AM

You would have to manually add it to the template there instead of allowing it to automatically be added if you want it to be a link. (Well, you may be able to do a plugin, but I haven't looked into that for that page - maybe someone else has.)

rgreene1971 04-14-2013 04:02 AM

Quote:

Originally Posted by Lynne (Post 2416255)
You would have to manually add it to the template there instead of allowing it to automatically be added if you want it to be a link. (Well, you may be able to do a plugin, but I haven't looked into that for that page - maybe someone else has.)

I would have to add the code you supplied or the code and the link? Assuming just the code you provided?

Lynne 04-14-2013 02:39 PM

You would need to add the code I posted only using the variable availabe on that page (and the html formatting may be a bit different, so you would make it similar to the code above it).

vBNinja 04-14-2013 05:32 PM

Add a new plugin:

Product: vBulletin
Hook Location: member_profileblock_profilefieldbit
Name: Show Profile Field as link
Execution Order: 5
PHP Code:

if($profilefield['profilefieldid'] == X){
$profilefield['value'] = "<a href=\"{$profilefield['value']}\">{$profilefield['value']}</a>";


Change X to your own profiled field ID
Plugin is active: yes


this can bring some security issues depending on what the user sets the field to

rgreene1971 04-18-2013 04:54 AM

PERFECT! Thank you!

Greatly appreciated.




Quote:

Originally Posted by vBNinja (Post 2416357)
Add a new plugin:

Product: vBulletin
Hook Location: member_profileblock_profilefieldbit
Name: Show Profile Field as link
Execution Order: 5
PHP Code:

if($profilefield['profilefieldid'] == X){
$profilefield['value'] = "<a href=\"{$profilefield['value']}\">{$profilefield['value']}</a>";


Change X to your own profiled field ID
Plugin is active: yes


this can bring some security issues depending on what the user sets the field to


jb-net 04-10-2014 05:32 PM

Quote:

Originally Posted by vBNinja (Post 2416357)
Add a new plugin:

Product: vBulletin
Hook Location: member_profileblock_profilefieldbit
Name: Show Profile Field as link
Execution Order: 5
PHP Code:

if($profilefield['profilefieldid'] == X){
$profilefield['value'] = "<a href=\"{$profilefield['value']}\">{$profilefield['value']}</a>";


Change X to your own profiled field ID
Plugin is active: yes

Thanks!

Do you have an idea how to change the link to the value of the selected option in case of an drop down menu? If I make an advanced member search by using a custom field and a dropdown menu I get the value of the selected option in the url. Is there a way to modify this code in the same way to get the value of the dropdown option?

Lynne 04-10-2014 05:53 PM

Please see this article - https://vborg.vbsupport.ru/showthread.php?t=250418

jb-net 04-11-2014 06:57 AM

Quote:

Originally Posted by Lynne (Post 2492492)

Thanks for this link. The problem is that I can't use $post['fieldx'] because I want to link the profilfields in the profile and not within the postbit.

blind-eddie 04-11-2014 10:45 AM

Quote:

Originally Posted by jb-net (Post 2492603)
Thanks for this link. The problem is that I can't use $post['fieldx'] because I want to link the profilfields in the profile and not within the postbit.

What are you going to show in member profile field pages, links, images, video?

Try,
Code:

$userinfo['fieldxx']

Lynne 04-11-2014 05:53 PM

Quote:

Originally Posted by jb-net (Post 2492603)
Thanks for this link. The problem is that I can't use $post['fieldx'] because I want to link the profilfields in the profile and not within the postbit.

The code would be the same - just the variable name changed.

HM666 06-28-2016 09:11 PM

Quote:

Originally Posted by vBNinja (Post 2416357)
Add a new plugin:

Product: vBulletin
Hook Location: member_profileblock_profilefieldbit
Name: Show Profile Field as link
Execution Order: 5
PHP Code:

if($profilefield['profilefieldid'] == X){
$profilefield['value'] = "<a href=\"{$profilefield['value']}\">{$profilefield['value']}</a>";


Change X to your own profiled field ID
Plugin is active: yes


this can bring some security issues depending on what the user sets the field to

That works great! I have two questions. 1. How do you make the field open in a new window. I tried adding target="_blank" and got some nifty PHP errors lol. Tried it a couple of different ways which leads me to believe that either I had put the code in incorrectly or in PHP it would use some other bit of code all together and 2. How can you add it in an array for more than one profile field, ssay you have several profile fields you want to do this with. Thanks

mokujin 06-29-2016 05:55 AM

Try:
HTML Code:

target=\"_blank\"

HM666 06-29-2016 11:49 AM

Quote:

Originally Posted by mokujin (Post 2572606)
Try:
HTML Code:

target=\"_blank\"

Ah yes of course, I forgot to escape the quotes. I'll give that a try thanks.


All times are GMT. The time now is 06:27 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.01173 seconds
  • Memory Usage 1,772KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (19)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete