vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - Profile Fields in a Postbit Dropdown (https://vborg.vbsupport.ru/showthread.php?t=208360)

Wired1 03-14-2009 10:00 PM

Profile Fields in a Postbit Dropdown
 
1 Attachment(s)
If you use this mod please hit INSTALL!


With this mod you can allow profile fields to show up in a dropdown below a user's name and user's title under each post. There are two ways to use this product, and each has its own plugin (and template): Dropdown - Manual (enabled by default), and Dropdown - Automated (disabled by default).

NOTE: The dropdown's title shows up as [username]'s [dropdown_title]. Yes, the 's is hardcoded into the mod. Figured if I didn't hardcode it, someone wouldn't be able to figure out how to add it :)

To edit the title:

Go to AdminCP -> Languages & Phrases -> Search in Phrases. Search for the phrase's title: [dropdown_title] (no brackets). Edit and save!

The dropdown is dependent on Profile Field 5 being filled. If the user does not have this profile field filled out, then the dropdown will not show. To edit or remove this restriction:

Go to the Dropdown Call Template. Find and edit, or remove these 2 lines of code (so that the dropdown will always show):
Code:

<if condition="$post['field5']">
...
</if>



The "Dropdown - Manual" template allows you to manually create the dropdown. Some examples of how to do this are already provided within the template. This template is the default.

To edit it, go to AdminCP -> Styles & Templates -> Style Manager -> [STYLE NAME]
Edit Style: Dropdown Information - Manual

The "Dropdown - Automated" template / plugin combo will automatically create the dropdown for ALL custom fields (it will skip the first 4 default ones).

To use the automated dropdown, DISABLE Plugin "Dropdown - Manual" and ENABLE Plugin "Dropdown - Automated". Simple!


To sum it up:
Plugin: Dropdown - Manual
PRO: You select which fields, what descriptions, and in what order you want the fields to show up.
CON: Lots of typing


Plugin: Dropdown - Automatic
PRO: Automatic!
CON: no real control, Profile fields 5 and up will show up in order. NOTE: if it is a HIDDEN profile field, apparently only the DATA is hidden, not the field name, so the field name will show up as well. To block a profile field from showing up in the Automatic Dropdown, check out this post.


Version History:
3.0.0 - Initial Release
3.0.1 - Added plugin to cache templates, courtesy of ssslippy.
3.1.0 - Updated for 3.8.x, no code changes made.

NOTE: Support will only be given to those who have hit install.

If you use this mod please hit INSTALL!

Wired1 03-14-2009 10:52 PM

Some have asked how to place links in the dropdown, so here's how to do it.

Change the conditionals in the Manual template like so:

Code:

        <if condition="$post['field6']">
                <tr><td class="vbmenu_option">Processor: <a href="ENTER URL HERE" rel="nofollow">$post[field6]</a></td></tr>
        </if>


Wired1 03-14-2009 10:59 PM

Reserved for future use.

Saviour 03-15-2009 03:11 AM

Been waiting for this...

Thanks, bunches, Wired! Installed!

Saviour 03-17-2009 01:59 PM

1 Attachment(s)
I've asked this before, however, I haven't been able to fix the problem...

I'm hoping someone sees this and can recommend a fix. (See attached image)

The problem is the drop down wants to make itself the width of the username...and I want to bypass this and use a fixed width for the dropdown.

Any suggestions...anyone?

Saviour 03-18-2009 07:38 PM

Bump...:D

MjrNuT 03-18-2009 09:11 PM

Hey Wired1,

I had your mod installed previously for vb v.3.7.x. Couple odd things occurred when upgraded to v3.8.x, which caused me to uninstall it.

I have gone to reinstall your mod now and have it working...sort of. The drops downs all appear and contain all the information that users had entered before. The problem and I don't know exactly how, but those created profile fields are no longer in the User CP to edit. This is confirmed in the ACP as well.

My first thought was that..ok, all the data is there and in the right places, however, access to the data is nonexistent. I was thinking that I go and create those User Profile fields again, making sure I try to make them exactly as before, and then the data would be accessible.

Idk if this matters, but I previously had your Extra Profile Fields Tab mod as well. Also removed it for similar reasons. Memory is bad on exactly what prompted me to do this, but I recall that the link ...Edit Extra Options was gone. I believe that is b/c I did not modify the profilefield.php file upon upgrading.

For now, I'd just like this mod to work such that people can edit their data. What's your take?

Thanks in advance

Wired1 03-19-2009 04:49 AM

Quote:

Originally Posted by Saviour (Post 1771365)
Bump...:D

As I said before, it's due to vB's dropdown code. Not going to recode it myself to fix their problems :)


Quote:

Originally Posted by MjrNuT (Post 1771420)
For now, I'd just like this mod to work such that people can edit their data. What's your take?

Nothing to do with this mod. You need to reinstall EPFP mod, and follow ALL of the instructions. The special profile fields will show up then.

TigerC10 03-19-2009 07:05 AM

Quote:

Originally Posted by Saviour (Post 1771365)
Bump...:D

In the Dropdown Call template

Does changing
Code:

<div id="specs_$post[postid]" class="vbmenu_control">
to
Code:

<div width="150px" id="specs_$post[postid]" class="vbmenu_control">
not have any impact on the width of the bar?


If that doesn't work I would try doing it with this...
Code:

<div style="position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control">
or
Code:

<div style="float: left; display: inline-block;" id="specs_$post[postid]" class="vbmenu_control">

Saviour 03-19-2009 07:15 AM

TigerC10...

Thank you for your reply. It would seem the following recommendation made all the difference:
Code:

<div style="position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control">
I'm very grateful for your support, my friend.

Issue resolved!

Jasem 03-19-2009 08:11 PM

Quote:

Originally Posted by Wired1 (Post 1768308)
Some have asked how to place links in the dropdown, so here's how to do it.

Change the conditionals in the Manual template like so:

Code:

        <if condition="$post['field6']">
                <tr><td class="vbmenu_option">Processor: <a href="ENTER URL HERE" rel="nofollow">$post[field6]</a></td></tr>
        </if>


Thank you very much!

Installed:

Arachnophiles 03-20-2009 06:59 AM


TigerC10
, would you by any chance know how to fix the problem wherein the dropdown extends off the page? Appears only to happen in Firefox.

Wired1 03-22-2009 05:21 PM

Quote:

Originally Posted by Saviour (Post 1771680)
TigerC10...

Thank you for your reply. It would seem the following recommendation made all the difference:
Code:

<div style="position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control">
I'm very grateful for your support, my friend.

Issue resolved!

Good to know! What determines the length now though?

TigerC10 03-23-2009 10:40 PM

Well, the length is determined by the CSS handler for each browser with that code segment. Because of the "position: absolute" property, it acts independently from the CSS of the items containing it. This might be why Firefox makes it go off the screen... But the "width: auto" is supposed to automatically size the div to the size of its contents.

You could try switching it to "position: relative" instead, but I think that would invalidate the "width: auto" property. I've never been a fan of CSS because of how it is handled differently between different browsers.

Saviour 03-23-2009 10:47 PM

Even though I know there's the ability to add a link using the afore mentioned process...it would be better if this mod allowed the use of the url bbcode tag in the profile field, since someone may want to link to something different then what can be coded in the template.

Say with what our site uses it for...I could enter my processor name and then link it to the manufacturer's website. Since everyone doesn't have the same processor...what was mentioned before about adding a link (by Jasem) is moot.

Wired1 03-23-2009 11:21 PM

Quote:

Originally Posted by Saviour (Post 1775397)
Say with what our site uses it for...I could enter my processor name and then link it to the manufacturer's website. Since everyone doesn't have the same processor...what was mentioned before about adding a link (by Jasem) is moot.

Heh, had that idea since day 1. Main problem is that when spammers enter in URLs for random computer parts (e.g. I always find porn sites as their CPU), I sure as hell don't want that link to be live.

Can't remember, but can you moderate profile fields/ I don't think you can (although you can moderate new accounts).

Saviour 03-24-2009 01:35 AM

Well...

We can moderate new users...and their posts...but the profile fields can't be moderated. However...isn't that what Moderators and Admins are for anyway? LOL! Keeps us honest...

This is actually one of the best mods on this site...and I'm glad you're letting us use it for free. However...I would think about incorporating links into these profile fields...and giving admin the ability to turn this feature on/off per user/usergroup.

We can dream can't we?

Thanks, again, Wired...

Steve

Wired1 03-24-2009 03:27 AM

I may look into making an alternate version of this, or an addon or something, where that's possible. The problem is where to store the URL for each profile field. It could be in a separate field, but then you've just doubled the # of profile fields, and this starts to get unwieldly in the admin area where you browse user info.

If the whole mod was moved over to its own table, that would solve some problems, but create some new ones. Kinda gets away from the KIS method.

Saviour 03-24-2009 04:05 AM

Ya know...thinking about this, I may have come up with a solution...

Why not just have one profile field...or just a user editable box, so a user can enter data, link it...then go to a new line and repeat the process for each item they'd like to add.

You could then take the data they entered and add it to the ajax menu.

For instance...

I'm using this Quick Reply box...and I can enter whatever I want for my System Specs...

Compaq Presario SR5507F
Iris8-GL6
Next Item
Next Item

And so on and so forth...

Then just parse this info into the menu...wouldn't that work?

TigerC10 03-24-2009 04:25 AM

Doing it that way would mean it wouldn't be standard. Someone could enter their CPU on the last line instead of the first. Can you dig it?

Although I've got a more elegant solution. Just enable the BBCode parser. Add these lines to the top of both of your plugins (automatic and manual):

Code:

require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$post[fieldxx] = $parser->do_parse($post[fieldxx], false, false, true, false, false, true);


This will allow you to enable bbCode for only certain profile fields, which will in turn let you use something like:
[url=http://www.tigerdirect.com/someproduct]My Awesome Computer Part[/url]
in the profile field.

It goes without saying, that the profile field would have to be "hidden" so it doesn't mess up on the user's profile page (you know how if it's visible, it adds it to a tab in the user's profile data). Of course, if you have some crazy bbcodes that do things with images... Those would be allowed. Somewhat not cool. You would have to replace the function call "fetch_tag_list()" with an array of the tags you want to allow to get around that.

Wired1 03-24-2009 05:34 AM

Quote:

Originally Posted by TigerC10 (Post 1775573)
Code:

require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$post[fieldxx] = $parser->do_parse($post[fieldxx], false, false, true, false, false, true);


Haven't looked at that function yet, but I'd guess those are 2 different fields mentioned?

TigerC10 03-24-2009 05:47 AM

No no, they're the same field. It's replacing the bbcode version of itself with the HTML version of itself.

You would want to repeat it for a second profile field if you want to enable the bbcode for something else.

Ex:
Code:

$post[field15] = $parser->do_parse($post[field15], false, false, true, false, false, true);
$post[field18] = $parser->do_parse($post[field18], false, false, true, false, false, true);


Wired1 03-24-2009 05:05 PM

So you're simply talking about turning a field that contains a URL into a clickable link with that URL in the display area. You earlier stated:
[url=http://www.tigerdirect.com/someproduct]My Awesome Computer Part[ /url ]

Where does it get the display text (e.g. "My Awesome Computer Part")? I wouldn't recommend using the profile name, as everyone's profile would just have a bunch of links that say Motherboard, Memory, etc. Not descriptive at all.

Or are you talking about having both the URL and the descriptor in the same post field, e.g.

www.asus.com;Asus P6T Deluxe

and then the parser identifies the semicolon (or whatever separator is used), and then uses the first half for the link and the 2nd half for the descriptor?

Not ideal while viewing someone's profile on the backend, on the other hand, the EPFP page could probably be tweaked to have 2 data entry boxes for each profile. OTOH, this comes back to helping URL spammers. My personal solution would be to not allow end users to enter in URLs, and only allow admins to do so in a way that the user couldn't (e.g. replacement variables).

TigerC10 03-24-2009 06:34 PM

No, the entire profile field entry is:

[url=http://www.tigerdirect.com/someproduct]My Awesome Computer Part[/url]

You would manually insert a bbcode into the value for the profile field. This means they could specify the name of the component at their own disgression... Like

[url=http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=3867865&Sku=CP2-AM2-9550]AMD Phenom X4 9550 Quad Core Processor[/url]

The parser will change that into a regular link, with the name of the part and then if you click on it, it will take you to the URL for more information. Furthermore, if someone doesn't enter any bbCode to the profile field data, it will just display regular text like it does without the change to the plugin.

So for your example, if the field is named "Motherboard" and someone enters "MSI Media Live DIVA 5.1" for the value then it will display like so

Motherboard: MSI Media Live DIVA 5.1

My change to the plugins lets someone enter "[url=http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=4408790&CatId=2838]MSI Media Live DIVA 5.1[/url]" for their value and it will display like so

Motherboard: MSI Media Live DIVA 5.1


It's better than duplicating all of your profile fields to add a URL for a detailed description of each field. Can you dig it?

EDIT:
I've created a customization for this mod and sent it to you via PM, Wired1. It takes out the reliance on "automatic" and "manual" and instead displays all of the profile fields in a profile field category (specified through vboptions). It has the bbCode feature I was talking about too - so you can see how it works.

Saviour 03-24-2009 09:54 PM

Wired...

Is it possible to use a background image for the Dropdown Call? I know this may require some customization...and I'm not sure where one would begin...having already edited the Dropdown Call to "autowidth".

TigerC10 03-24-2009 10:15 PM

That's easy, just change the template like so:

Code:

<div style="background-image: url('path/to/image'); position:absolute; width:auto;" id="specs_$post[postid]" class="vbmenu_control">

Saviour 03-24-2009 11:00 PM

Thanks, TigerC10...but that didn't work...it cropped the image length...and didn't turn out the way I had expected.

Reverted back to the old code.

TigerC10 03-24-2009 11:05 PM

Yeah, normally when people do background images like that it's an image that repeats. You'd have to set the div's width to the size of the image if you want it to be a static size. Generally that's not a good idea because the vB username length can change drastically.

Saviour 03-24-2009 11:20 PM

But I'm not using the username...just the title "Computer Specs".

TigerC10 03-24-2009 11:49 PM

Well, then change

Code:

width: auto;
to
Code:

width: 250px;
Or however wide the picture is.

Saviour 03-25-2009 12:27 AM

With a little bit of finagling...I think I finally have it right.

Thanks for your time.

TigerC10 03-25-2009 12:32 AM

That's good news. Let's hope Wired1 likes my customizations enough to add some (or all) of them to the next version. :)

Wired1 03-25-2009 03:05 AM

Quote:

Originally Posted by TigerC10 (Post 1776025)
You would manually insert a bbcode into the value for the profile field. This means they could specify the name of the component at their own disgression... Like

[url=http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=3867865&Sku=CP2-AM2-9550]AMD Phenom X4 9550 Quad Core Processor[/url]

It's better than duplicating all of your profile fields to add a URL for a detailed description of each field. Can you dig it?

Gotcha. The ultimate idea of my mods is to keep it simple for both the end user and admin. Being in IT I can see lots of people screwing up entering in BBCODE manually, and admins having to edit everyone's profiles manually. Considering I do that a lot on a daily basis for typos and the like w/ system specs on my forum, I wouldn't wish that on other forum staff :)

However, I'm now wondering if (and I'm pretty sure this would be possible) a small WYSIWYG button for just the link could be added to the EPGP page. Hrm... I think I know how to do it, I'll attempt to mess with it tomorrow. However considering today turned from an 8 hr to a 14 hr day, I'm pretty sure I'm not gonna want to do anything after work tomorrow :)


Quote:

I've created a customization for this mod and sent it to you via PM, Wired1. It takes out the reliance on "automatic" and "manual" and instead displays all of the profile fields in a profile field category (specified through vboptions). It has the bbCode feature I was talking about too - so you can see how it works.
I remember looking at categories when they first came out, and there was a reason I didn't want to use them, can't remember ATM though. Something to do with duplication of fields on other tabs I think, although IIRC I had figured out a workaround for that. Something to look at tomorrow / Thurs.

TigerC10 03-25-2009 04:41 AM

Quote:

Originally Posted by Wired1 (Post 1776388)
Gotcha. The ultimate idea of my mods is to keep it simple for both the end user and admin.

Well, the mod customization I made makes bbCode optional for the admin. Furthermore, they could just type what they would normally do without bbCode and the bbCode parser won't care. I don't think it's a big enough deal to actually worry about.

Quote:

Originally Posted by Wired1 (Post 1776388)
I remember looking at categories when they first came out, and there was a reason I didn't want to use them, can't remember ATM though. Something to do with duplication of fields on other tabs I think, although IIRC I had figured out a workaround for that. Something to look at tomorrow / Thurs.

I'm not sure what you mean by that. I think that if you put a profile field in a category, it is removed from the "about me" tab and put in a tab for that category instead. Profile fields can only be in 1 category at a time, so I don't think that's what you were talking about.

Saviour 03-30-2009 12:28 PM

Wired...

If I wanted to change the font on the Dropdown Call image...where and what would I add?

or

If I include my own image with a font...

How would I disable the font from automatically appearing over the new image I'm using for the Dropdown Call?

arekieh 04-05-2009 05:35 AM

hey, i installed this but its not showing up in my user cp :/????

Wired1 04-05-2009 06:37 AM

Tiger: gotta remember to check out those mods when I have some free time.
Saviour: there's no images in my mods. Do you mean changing the arrow for the dropdown?

arekieh: This mod has NOTHING to do with the userCP.

Saviour 04-05-2009 07:00 AM

Quote:

Originally Posted by Wired1 (Post 1784143)
Tiger: gotta remember to check out those mods when I have some free time.
Saviour: there's no images in my mods. Do you mean changing the arrow for the dropdown?

arekieh: This mod has NOTHING to do with the userCP.


Never mind, Wired...

I got it sorted. Sorry...I should have come back here and updated, but forgot.

Thanks for the reply.

arekieh 04-05-2009 01:46 PM

THen how do people input stuff into the custom fields????????????

arekieh 04-05-2009 05:34 PM

k well now i got it working along with its own page in usercp for editing. Everthing shows up. but when i fill out the form, the specs dont appear in the drop down. The drop down just shows each category

EDIT* Fixed. Thanks alot, this mod is awesome :)


All times are GMT. The time now is 06:44 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
  • Page Generation 0.02202 seconds
  • Memory Usage 1,863KB
  • 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
  • (15)bbcode_code_printable
  • (12)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
  • (40)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