Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Profile Fields in a Postbit Dropdown Details »»
Profile Fields in a Postbit Dropdown
Version: 3.1.0, by Wired1 Wired1 is offline
Developer Last Online: Dec 2021 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.x Rating:
Released: 03-14-2009 Last Update: 03-14-2009 Installs: 103
Uses Plugins
 
No support by the author.

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!

Download Now

File Type: xml product-dropdown.xml (4.4 KB, 501 views)

Screenshots

File Type: jpg dropdown_open.JPG (49.1 KB, 0 views)
File Type: jpg dropdown_closed.JPG (3.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-19-2009, 08:11 PM
Jasem's Avatar
Jasem Jasem is offline
 
Join Date: Feb 2006
Location: www.menokia.com
Posts: 594
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wired1 View Post
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:
Reply With Quote
  #13  
Old 03-20-2009, 06:59 AM
Arachnophiles Arachnophiles is offline
 
Join Date: Mar 2006
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


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.
Reply With Quote
  #14  
Old 03-22-2009, 05:21 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Saviour View Post
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?
Reply With Quote
  #15  
Old 03-23-2009, 10:40 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #16  
Old 03-23-2009, 10:47 PM
Saviour's Avatar
Saviour Saviour is offline
 
Join Date: Apr 2007
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 03-23-2009, 11:21 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Saviour View Post
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).
Reply With Quote
  #18  
Old 03-24-2009, 01:35 AM
Saviour's Avatar
Saviour Saviour is offline
 
Join Date: Apr 2007
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #19  
Old 03-24-2009, 03:27 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #20  
Old 03-24-2009, 04:05 AM
Saviour's Avatar
Saviour Saviour is offline
 
Join Date: Apr 2007
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #21  
Old 03-24-2009, 04:25 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04779 seconds
  • Memory Usage 2,347KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete