View Full Version : External Profile Links
AlexisMedia
12-31-2010, 05:49 PM
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/4702/lpgprofilebutton.png (http://img406.imageshack.us/i/lpgprofilebutton.png/)
I would then like it linked to an external user profile using this 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?
<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
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:
<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 ;).
<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? {vb:raw post.field2}
And your displaying the link included. But shouldn't it be this in the template:
<vb:if condition="$post['field6']"></vb:if>
and this in the single text line profile field 6?
<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:
<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 1294004227 at 1294004227 ---------------
Currently I have:
Postbit Template
<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":
http://mysite.com/profile-whatever.php
Lynne
01-02-2011, 07:54 PM
Um... I just pasted your <a> tag in there without looking at it. You can't have the img src stuff in there - it's invalid html. Put in some valid html and it should show up:
<vb:if condition="$post['field6']"><a href="{vb:raw post.field6}"><img src="button.png" alt="" /></a></vb:if>
Then modify it to add other properties to the <a> tag.
AlexisMedia
01-02-2011, 10:30 PM
Sorry...
Shouldn't this work?
<vb:if condition="$post['userid']">
<div class="userinfo_extra">
<vb:if condition="$post['field6']"><a href="{vb:raw post.field6}"><img src="profilebutton.png" alt="Profile Button" /></vb:if>
<dl class="userstats">
<vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></vb:if>
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></vb:if>
<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
It doesn't seem to be and isn't showing up anything in the source code?
BTW, am a silly to keep saying this source code statement? If it was being activated at all then shouldn't it be showing up there?
TheLastSuperman
01-02-2011, 10:45 PM
Sorry...
Shouldn't this work?
<vb:if condition="$post['userid']">
<div class="userinfo_extra">
<vb:if condition="$post['field6']"><a href="{vb:raw post.field6}"><img src="profilebutton.png" alt="Profile Button" /></vb:if>
<dl class="userstats">
<vb:if condition="$post['joindate']"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></vb:if>
<vb:if condition="$post['field2']"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></vb:if>
<vb:if condition="$post['age']"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></vb:if>
<dt>{vb:rawphrase posts}</dt> <dd>{vb:raw post.posts}</dd>
It doesn't seem to be and isn't showing up anything in the source code?
BTW, am a silly to keep saying this source code statement? If it was being activated at all then shouldn't it be showing up there?
Your only calling the field though that way.. in your first post in the URL it had:
<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>
Should read:
<vb:if condition="$post['field6']"><a href="http://website.com/{vb:raw post.field6}"><img src="profilebutton.png" alt="Profile Button" /></vb:if>
IF your providing them the link i.e. the name only not the full url, as you said initially:
I would then like it linked to an external user profile using this code... The users aren't going to have that exact code unless I provide it for them individually.
So basically you provide them the name to their off-site "profile" however your making them and they key in just the name so this:
http://website.com/users-profile
Becomes this:
http://website.com/{vb:raw post.field6}
Yet shows the link in the postbit to their off-site type of profile :D and that way they only enter in the name not a full URL ;).
AlexisMedia
01-03-2011, 12:07 AM
I didn't realize that I put the 1st code like that. The url is actually
http://mysite.com/category/name-of-business-city.php
Not knowing anything of what I was doing I tried doing this:
<div class="userinfo_extra">
<vb:if condition="$post['field6']"><a href="http://mysite.com/{vb:raw post.field6}.php"><img src="profilebutton.png" alt="Profile Button" /></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 then in the profile field:
category/name-of-business-city
but nothing again :(
Could I have the wrong profile field? Should it be a "radio" field or something rather then a normal text one?
I'm sorry, I'm getting extremely embarrassed about my stupidity with this. Really been a humbling experience that's for sure.
--------------- Added 1294021155 at 1294021155 ---------------
and do I have this inserted into the correct location of the template?
TheLastSuperman
01-03-2011, 12:28 AM
I didn't realize that I put the 1st code like that. The url is actually
http://mysite.com/category/name-of-business-city.php
Not knowing anything of what I was doing I tried doing this:
<div class="userinfo_extra">
<vb:if condition="$post['field6']"><a href="http://mysite.com/{vb:raw post.field6}.php"><img src="profilebutton.png" alt="Profile Button" /></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 then in the profile field:
category/name-of-business-city
but nothing again :(
Could I have the wrong profile field? Should it be a "radio" field or something rather then a normal text one?
I'm sorry, I'm getting extremely embarrassed about my stupidity with this. Really been a humbling experience that's for sure.
--------------- Added 1294021155 at 1294021155 ---------------
and do I have this inserted into the correct location of the template?
That looks right however do they need a category and a filename? If not use this:
<div class="userinfo_extra">
<vb:if condition="$post['field6']"><a href="http://mysite.com/category/{vb:raw post.field6}.php"><img src="profilebutton.png" alt="Profile Button" /></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>
You were missing the </a> I have added it, also you do have something in the field correct?
Edit: Also if your not good w/ knowing paths simply use the FULL URL to the image, the img src="profilebutton.png" will not work however http://www.yoursite.com/images/profilebutton.png OR images/profilebutton.png would.
AlexisMedia
01-03-2011, 12:48 AM
I PM'd you exactly what I have and with screenshots so hopefully we can nail this as it's not working.
Feel free to reply here or via PM just change my site details if you reply here.
I know you guys don't want PM's for help but I thought it was necessary to give you exactly what I'm doing code/screenshot wise...
Thanks!
Lynne
01-03-2011, 12:54 AM
You are forgetting the </a> in your code.
But, try just doing this to see if you get anything:
<vb:if condition="$post['field6']">{vb:raw post.field6}</vb:if>
that way you see if it's just your html
AlexisMedia
01-03-2011, 01:05 AM
I did try that and PM'd LastSuperman exactly what I have now with screenshots including that. Would you like the details as well?
TheLastSuperman
01-03-2011, 01:49 AM
I did try that and PM'd LastSuperman exactly what I have now with screenshots including that. Would you like the details as well?
In your pm the url would resolve to this...
http://yoursite.com/photographers/belly-beautiful-maternity-sa
There's nothing there, give us an exact example of a finished profile, we need a link not http://the link you sent me in pm.com/photographers/belly-beautiful-maternity-sa so we can simply paste the code for you as I feel your almost there just leaving out something or not giving us valid url or when you enter it in it's not valid so your not seeing it could be part of it as well but as I said give us the url to a finished off-site profile.
AlexisMedia
01-03-2011, 02:26 AM
:(
sorry but sent you another PM
TheLastSuperman
01-03-2011, 02:30 AM
You have it entered into your profile and your viewing a post made by you correct? Just to be clear otherwise if no one else has entered in a name into that field in their settings it won't show...
AlexisMedia
01-03-2011, 02:45 AM
Yes, I'm testing this in a private forum with my own mod account and that link. I'm even posting a brand new post every single time to test...
--------------- Added 1294030126 at 1294030126 ---------------
It still seems like if the conditional itself was working then I'd get a broken link or something in my source code?
Lynne
01-03-2011, 02:54 AM
Try just entering {vb:raw post.field6} if you think it's the condition that isn't working. In fact, put an X before it, that way you know the template is the correct one and you are actually modifying where you think you are.
AlexisMedia
01-03-2011, 03:13 AM
I'm not seeing my x in the template or any indication of anything?
I'm modifying the template named "Postbit" and right after these 2 lines:
<vb:if condition="$post['userid']">
<div class="userinfo_extra">
?
--------------- Added 1294031625 at 1294031625 ---------------
I mean my x in the old or new posts I'm making...
Lynne
01-03-2011, 03:15 AM
You told us you were using the postbit_legacy on your site, so that is the template you should be modifying, not the postbit template. (Or I could have sworn you said that, but now don't see that post in here.)
TheLastSuperman
01-03-2011, 03:17 AM
In your style settings in Settings > Options > Style & Language Options
What is this:
Use Legacy (Vertical) Postbit Template
Set to yes or no?
AlexisMedia
01-03-2011, 03:19 AM
no, I never said that.
But looks like I have a new option to try as I've just tried removing the "joindate" area and it still appears in my new posts...
TheLastSuperman
01-03-2011, 03:23 AM
no, I never said that.
But looks like I have a new option to try as I've just tried removing the "joindate" area and it still appears in my new posts...
LOL well here's the skinny...
In that area where the setting is I said to check for yes or no, that makes it to where posts either show up with user info at the top running all the way across in a horizontal fashion OR using postbit_legacy it shows the posts like you see on vbulletin.com where your user info is within it's own box on the left of each post.
If your making changes to no avail your either editing the wrong template OR you've accidentally clicked on another style in the admincp and your seeing the site in that style not the one your editing.
AlexisMedia
01-03-2011, 03:23 AM
I am using that though in the options. I never mentioned it because I didn't know what it even was...
Anyways, testing...
TheLastSuperman
01-03-2011, 03:25 AM
I am using that though in the options. I never mentioned it because I didn't know what it even was...
Anyways, testing...
Well if it works this can be one we look back on and laugh :D.
AlexisMedia
01-03-2011, 03:31 AM
We are in business! Yes!!!!
Now all I got to do is figure out how to add the popup script thing back into it so that it opens a proper sized popup window rather then going to the url. Might need to figure out styling too. I'll play I guess :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.