vB 4 "profile link" help

Discussion in 'Web Development and Programming' started by AlexisMedia, Dec 27, 2010.

  1. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    Hello, I'm also 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.

    It's easy to create the button but how would I link it differently for each different user since it is not some part of a vBulletin integrated system? Does that make sense?

    Thanks!
     
  2. Brandon

    Brandon Regular Member

    Joined:
    Jun 1, 2009
    Messages:
    6,602
    Likes Received:
    1,706
    Location:
    Topeka, Kansas
    First Name:
    Brandon
    It sounds like a profile field would work
    you can add a field to just place a link, or you can add 2 and have one as the anchor text for the link
    Does this sound like it'll work for you?
     
  3. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    It's a rich media link so that the profile is a pop-up with fixed widths. Would that work for that you think? I'll look into what a "profile field" is...
     
  4. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    Profile fields seem to be just visible inside a profile. What I need is a link button just below their name inside an actual post in the forum. Does that make sense?

    ---------- Post added at 01:51 PM ---------- Previous post was at 12:44 PM ----------

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

    aimg406.imageshack.us_img406_4702_lpgprofilebutton.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?

    If this is too much on this forum then I can post at vB.org but thought I'd try and see what you thought...

    Thanks!
     
  5. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    Well can you link us to a profile thats offsite that your trying to link to? Also, how are the users getting these profiles? Are they created when they joined? Or are they complete separate from the VB? I would need more info but I could prolly help
     
  6. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    On the same website but nothing to do with vB. I'm not wanting to put public links but I'll PM you...

    Thanks!
     
  7. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    I thought about this some more and I think you can just use a conditional. I ripped this out of another site I was helping with. I knew I had seen this or used this before. I think it should work like that, but may need to edit it for VB4

    User Control Panel Templates --> userfield_wrapper

    Code:
    <if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(FIELD NUMBER)) OR is_member_of($bbuserinfo, USER GROUP ID))">
    </if>
    Obviously you change Field Number and Usergroup ID. They are using it for some vip deal where you get more fields once you subscribe. This really should be an option in Vbulletin. And maybe it is and I dont know..LOL
     
  8. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    I'm not sure what the userfield_wrapper is all about but the rest of it just seems like a way to get the actual button to appear am I wrong? I mean, I can get the button to appear based off a condition to have it appear if its a member of a certain group but how do I get each one to link to a different off-site profile?

    Am I understanding this all wrong? Sorry, I'm confused.
     
  9. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    If you wrap that code around that template only the people in the usergroup of your choosing will have it in their profile. Then you would simply add the link manually via the admin panel. And because empty profile fields do not show up in posts, they would be the only ones to have them in their postsbit. It's really that simple.
     
  10. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    Ok, I'm gonna try what I think your saying to do after lunch and post back. Thanks for the help.. I'll probably have questions so stay tuned :)
     
  11. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    No idea what I'm doing...LOL.

    Ok, I'm not sure if this is what you were wanting me to do but the 1st and only thing I've done so far is located this template "userfield_wrapper" and installed this code into it:

    Code:
    <vb:if condition="is_member_of($bbuserinfo, 11,12)"></vb:if>
    So now the entire contents of that template are:
    <
    Code:
    label>{vb:raw profilefield.title}:</label>
    	<div class="rightcol">
    		{vb:raw custom_field_holder}
    	</div>
    </div>
    <vb:if condition="is_member_of($bbuserinfo, 11,12)"></vb:if>
    The top part being the code that was in there by default.

    So, what did that actually do and where do I go now? Baby step #2 please :)
     
  12. AlexisMedia

    AlexisMedia Regular Member

    Joined:
    Dec 27, 2010
    Messages:
    12
    Likes Received:
    0
    One last cry/beg for help on baby step #2 then I guess I'll give vB.org a try or something.

    Thanks!
     

Share This Page