MyBB Community Forums

Full Version: Need a custom profile field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
<div id="ShelfariWidget162681"><a href='http://www.shelfari.com/'>Shelfari: Book reviews on your book blog</a><script src="http://www.shelfari.com/ws/162681/widget.js" type="text/javascript" language="javascript"></script></div><noscript><ul><li><a href="http://www.shelfari.com/books/19935/The-Bourne-Trilogy?widgetId=162681">The Bourne Trilogy</a> by Robert Ludlum</li><li><a href="http://www.shelfari.com/books/44988/Split-Second?widgetId=162681">Split Second</a> by David Baldacci</li><li><a href="http://www.shelfari.com/books/50000/The-Monk-Who-Sold-His-Ferrari?widgetId=162681">The Monk Who Sold...</a> by Robin Sharma</li></ul></noscript>
I've got a solution for this, but users need to grab their widget ID from the widgets page. It can be found in the first line of code:

Quote:<div id="ShelfariWidget162681">

After grabbing their widget ID (in the example, 162681 is the widget ID), users only need to insert it on their profiles. For this, you need to create a custom profile field and then call that profile field in the widget's code. Instructions below:

1. Admin CP > Configuration > Custom Profile Fields > Add New Profile Field.
2. Name it, add a description, etc. and remeber that custom profile field's ID.
3. In the member template, instead of what you currently have, use this:

<div id="ShelfariWidget{$userfields['fidX']}"><a href='http://www.shelfari.com/'>Shelfari: Book reviews on your book blog</a><script src="http://www.shelfari.com/ws/{$userfields['fidX']}/widget.js" type="text/javascript" language="javascript"></script></div>

4. Replace X in {$userfields['fidX']} with the ID you found in step 2 (please note there are two instances of X).

Then go to User CP > Edit Profile, look for the custom profile field you just created and insert your own widget ID. I don't know if there is an easier solution (like just by using their username), but this one works perfectly.
Man I Love you !!!!!!!!
Pages: 1 2 3