![]() |
Using User Profile Fields on a different part of the site
Is it possible to use User Profile Fields (e.g. field5) on a different part of the site (not the forum) like my homepage. If so, how would I make it work?
|
Yes, you should be able to. I use it in my navbar with the variable $bbuserinfo[fieldx]
|
looking for this too...
Lynne, will that also bring the little editing icon next to the field as well? |
If its not a forumpage(as you wrote*g*) you'll have to grab it yourself from the db(table userfield) or include the global.php from the forum and use it like lynne wrote.
--------------- Added [DATE]1237759165[/DATE] at [TIME]1237759165[/TIME] --------------- Quote:
|
thanks lynne, that worked!!!
All I need is to also have the edit button next to it, and when its pressed, the info becomes editable and you can just re-write the entry...like when they do it in their profile! |
Can you help me with grabbing it from the db?
|
If you need to grab it from the db, you'll have to write a plugin. You'll have to be much more specific about where you need to use it if you want help with that.
As for the edit button, steal the code from the template and make sure you include the same files included on the member page and see what happens. |
I wish to use it on a script that I already have and submit field5 into the script which is located on the homepage.
|
That isn't telling us anything. Post your script and tell us which plugin you are using for it and tell us where - which template or line - you wish to use it on the homepage. I assume by homepage you mean the forum index? If not, you need to explain it better.
|
Code:
<!-- ########## WHATS ON YOUR MIND ######### --> Does anyone have an idea of what the javascript is to have the little edit pencil show up? |
Quote:
Take a look at the page source and see what is going on. If you did, you'd see something like this: HTML Code:
<dt class="shade" id="profilefield_title_1">Biography</dt> Also, since this is shown on the member.php page, it's a good idea to see what scripts get added on that page that don't get added on all the other pages. When looking at the page source, search for any scripts on there and you'll come across a couple scripts that have the word "edit" in them - "vbulletin_quick_edit_generic.js" and "vbulletin_profilefield_edit.js" And, right under where you find those scripts, you'll see some more lines that look useful that have the word "Edit" in them. Grab that too. Do I know if you need all that? No, I don't know, but it's a good place to start. |
Quote:
I wish to insert field5 (one of my User Profile Fields) into a sentence. I don't have a code yet as I'm not sure where to start. I know that if I was doing it on any forum page, then I'd use "$post[field5]" however this won't work and I'd like to know what I need to add to make that work. Hopefully that's a little more understandable :) |
Well, what query are you using to get the userinfo? You'll have to add to that query to get the field5 info.
|
1 Attachment(s)
Ok, got the pencil to show up and it links to the users 'edit details' page. Wanted it to just do an instant inline editing with the javascript... wondering if anyone's figured out exactly what I need in terms of the coding to do that... it kind of sucks that by clicking the icon they leave the page and have to search for that field to change it.
|
You really need to start your own thread about this and post the code you are using and template changes, etc. We really can't help when we have no clue what you have done and where, etc.
|
Quote:
|
All times are GMT. The time now is 11:33 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|