vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   External Profile Links (https://vborg.vbsupport.ru/showthread.php?t=256269)

AlexisMedia 12-31-2010 05:49 PM

External Profile Links
 
I'm looking for the best way to add a profile link below some of my users "usernames" in their posts. These are not vB profile links but rather a link to an external webpage of their profile.

Here is exactly what I want to do. I want to add this button directly below the users avatar/img in the post bit.

http://img406.imageshack.us/img406/4...filebutton.png

I would then like it linked to an external user profile using this code:

Code:

<a href="http://website.com/users-profile" target="slideshow" onclick="window.open(this.getAttribute('href'), this.getAttribute('target'), 'width=770,height=800,scrollbars=yes,resizable=yes').focus(); return false;"></a>
The users aren't going to have that exact code unless I provide it for them individually.

This button and code will only be available to members of a specific usergroup.

Is there a way I can add a profile field that is visible/edible only by admin for each individual so that I can personally put this code into their profile.

Then use the postbit template and put a conditional in there so that this button option is only for a specific usergroup and to pull the info from their profile field 5?

If it's not possible for me to get access myself to their profile then I can email them the specific code I guess but would this work? If so can I get a step by step for the template and conditionals etc I need to edit?


Thanks!

AlexisMedia 01-02-2011 03:04 AM

Really hoping to get this going. Thanks for looking : )

Lynne 01-02-2011 04:23 PM

You can make a User Profile Field and set it to not be editable by the user. Then you, the admin, can change it in the admincp.

Then, in the postbit, just put the html code in there and put a condition around it to only show it to usergroup xx.

AlexisMedia 01-02-2011 04:34 PM

How do I connect the button part? Through the link code like twitter badges or something just minus the script?

Thanks!

Lynne 01-02-2011 04:37 PM

You mean what html to use?
HTML Code:

<a href="link.php"><img src="button.png" alt="" /></a>

AlexisMedia 01-02-2011 04:42 PM

Oh, ok. I'm a dope and was thinking this whole time that I needed to code a button separately and then attach it. I don't know... I'll try it and see what happens. I've had a splitting headache for 3 days strait now so nothing I'm saying or thinking makes much sense I guess. Sorry. I'll report back if it works out (surely it will).

Thanks again Lynne!

TheLastSuperman 01-02-2011 04:44 PM

Quote:

Originally Posted by AlexisMedia (Post 2142801)
How do I connect the button part? Through the link code like twitter badges or something just minus the script?

Thanks!

I believe he means how to use the variables Lynne, so AlexisMedia let's say the new user profile filed you create is hmm Field 12 then a link would resemble this:

Code:

<vb:if condition="$post['field12']"><a href="YOUR URL">{vb:raw post.field2}</a></vb:if>
As you can see you can wrap it in a conditional that way let's say your adding in a link to something.. if they don't have info in field 12 then it won't show ;).

Code:

<vb:if condition="$post['field12']"><a href="http://website.com/users-profile" target="slideshow" onclick="window.open(this.getAttribute('href'), this.getAttribute('target'), 'width=770,height=800,scrollbars=yes,resizable=yes').focus(); return false;"></a></vb:if>
Or similar however how your going to associate their forum account with their offsite account would be the primary question here imo!

Edit: And the headache... 3 days that's a migraine imo... visit your doctor and ask if he/she recommends immitrex it's the only thing that can make mine go away. Alternatively all the lights off in the bathroom and a warm bath soaking your head under water usually "helps" mine not cure but anything to help it subside!

AlexisMedia 01-02-2011 07:00 PM

what does this part do?
Code:

{vb:raw post.field2}
And your displaying the link included. But shouldn't it be this in the template:

Code:

<vb:if condition="$post['field6']"></vb:if>
and this in the single text line profile field 6?

Code:

<a href="http://website.com/users-profile" img src="button.png" alt="" target="slideshow" onclick="window.open(this.getAttribute('href'), this.getAttribute('target'), 'width=770,height=800,scrollbars=yes,resizable=yes').focus(); return false;"></a>
Although this isn't workin...

Lynne 01-02-2011 07:05 PM

Most likely you want to do something more along the lines of....

Insert "http://website.com/users-profile" (no quotes) into the field6 for the user.

Then, put something like this in the template:
HTML Code:

<vb:if condition="$post['field6']"><a href="{vb:raw post.field6}" img src="button.png" alt="" target="slideshow" onclick="window.open(this.getAttribute('href'), this.getAttribute('target'), 'width=770,height=800,scrollbars=yes,resizable=yes').focus(); return false;"><img src="button.png" alt="" /></a></vb:if>

AlexisMedia 01-02-2011 07:31 PM

Lynne, that does look exactly like what I'd like to do but for some reason it's not even trying to show it. I have the conditional entered exactly as you've instructed and the web address in profile 6 but when I look at the source code from a page with that users posts it's not showing up at all in there as if the conditional isn't being activated?

--------------- Added [DATE]1294004227[/DATE] at [TIME]1294004227[/TIME] ---------------

Currently I have:

Postbit Template
Code:

<vb:if condition="$post['userid']">


<div class="userinfo_extra">

<vb:if condition="$post['field6']"><a href="{vb:raw post.field6}" img src="../../images/profilebutton.png" alt="Profile Button" target="slideshow" onclick="window.open(this.getAttribute('href'), this.getAttribute('target'), 'width=770,height=800,scrollbars=yes,resizable=yes').focus(); return false;"><img src="../../images/profilebutton.png" /></a></vb:if>

                                        <dl class="userstats">
                                                <vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></vb:if>

And user profile field 6 made with a single text line option and named "Profile Button":
Code:

http://mysite.com/profile-whatever.php


All times are GMT. The time now is 10:00 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.01119 seconds
  • Memory Usage 1,750KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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