Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 05-16-2015, 09:33 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It may also be possible to accomplish what you want using a hidden custom profile field, and is editable only by certain groups (who along with the user are the only ones who can see the this field). Then, based on the value in that field, a conditional statement in the postbit template (or in a plugin) can be used to display the correct badge.
Reply With Quote
  #12  
Old 05-17-2015, 05:55 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Guardian Hope View Post
[B]Your rudeness not withstanding
So sorry you took my answer as rude. Can't be helped, though, be my guest.

Your answer now just tells me that you did not bother to read (or understand) my answer, and that indeed you have not fully understood how permissions work in vB. Of course, its entirely up to you to ignore my advice and replicate complete permission sets (see, that's what I was talking about). Of course you will have to create those 42 usergroups, I never said otherwise. If you replicate permission sets, I just hope you never decide to change anything with those permissions. Because then you'll realize that you may have to replicate that change in 42 secondary usergroups, too.

But since my advice is clearly not wanted, I'm out of here.
Reply With Quote
  #13  
Old 05-17-2015, 04:37 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It sounds like you just want to be able to give individuals some 'ranks'/'titles' that you pick and that they really have nothing to do with 'ranks' themselves? If so, you may want to create a new Profile Field that is not editable by the user and is private. Then enter some image name - image.png - into the field for those that deserve this new image. Then just put in the postbit something like"
HTML Code:
<vb:if condition="$post['fieldx']"><img src="path/to/images/{vb:raw post.field2}" alt="something" height="yyy" width="zzz" ></vb:if>
I've never tried this, so I don't know if it works. Try it on your test site before implementing it on your live site.
Reply With Quote
  #14  
Old 05-17-2015, 07:17 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
It sounds like you just want to be able to give individuals some 'ranks'/'titles' that you pick and that they really have nothing to do with 'ranks' themselves? If so, you may want to create a new Profile Field that is not editable by the user and is private. Then enter some image name - image.png - into the field for those that deserve this new image. Then just put in the postbit something like"
HTML Code:
<vb:if condition="$post['fieldx']"><img src="path/to/images/{vb:raw post.field2}" alt="something" height="yyy" width="zzz" ></vb:if>
I've never tried this, so I don't know if it works. Try it on your test site before implementing it on your live site.
We have been discussing it some and this is essentially what we are going to do (and it works well ), although I am going to render a custom template at:

Code:
$template_hook['postbit_userinfo_left']
just so the OP won't have to edit the postbit template.

The custom profile field will only be editable in the AdminCP.
Reply With Quote
Благодарность от:
Lynne
  #15  
Old 05-17-2015, 08:59 PM
Guardian Hope Guardian Hope is offline
 
Join Date: Mar 2015
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, Mark has been very helpful and we are working to get a solution to this. At first it seemed we were going to attempt it via numbers but since the images are actually named (and so we won't have to remember what number applies to what) it looks like we're going to go with the approach where it calls the image by name.

I was at the doctors as I told him but now that I'm back and will have a remarkable amount of free time being ill, I am going to start inserting what Mark has suggested so far.

42 ranks; it's a lot of typing but it seems it will be worth it in the end as it will ease the burden for people who need the administrate the ranks to this one usergroup.
Reply With Quote
  #16  
Old 05-19-2015, 03:28 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, here's what I did:

1.) Edit the custom profile field so that its length can contain multiple file names (I like powers of 2 so I used 2^7 = 128)



2.) On my dev site, I went to a random user's profile in the User Manage within the AdminCP and entered the names of two image files I created for testing (separated by a comma):



Note: The add-on assumes the images have the extension "jpg" and are located off the root directory at "static/ranks". The images are stacked from top to bottom in the order in which they are entered into the profile field.

3.) Then I went to a thread where that user has posts, and made sure the images show up in the postbit:



So, please download the attached XML file and install it by following:

AdminCP ► Plugins & Products ► Manage Products ► Add/Import Product.

Click on "Choose File" and browse to the product xml file that you downloaded.

Click "Import"

Let me know about any changes you would like or if something doesn't work as expected.
Attached Images
File Type: jpg bellarankspfieldedit.jpg (11.9 KB, 0 views)
File Type: png bellaranksuserprofile.png (16.3 KB, 0 views)
File Type: png bellarankspostbit.png (13.8 KB, 0 views)
Attached Files
File Type: xml product-bellasranksvb4.xml (1.9 KB, 3 views)
Reply With Quote
2 благодарности(ей) от:
Guardian Hope, Lynne
  #17  
Old 05-19-2015, 08:13 AM
Guardian Hope Guardian Hope is offline
 
Join Date: Mar 2015
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This appears accurate; allowing for the rank badge and the appropriate wings to appear.

To clarify one thing from our correspondences, you had me create a radio selection as opposed to a single line text box. I assume I should convert the radio selection to single line?

After that, all one will have to do is type "admiral,redwings" to get badge 1 as Admiral and Badge 2 as the Red Wings so as long as the images are in /static/ranks (with jpg extensions of course)
Reply With Quote
Благодарность от:
MarkFL
  #18  
Old 05-19-2015, 08:19 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This was what I originally sent:

Title: User Rank Level
Description: Used to determine which rank badge to display in user postbits.
Profile Field Category: Ranking (radio button option)
Default Value: 0
Max length of allowed user input: 2
Field Length: 2
Profile Field Type: Single-Line Text Box
Display Order: 5
Field Required: No
Field Editable by User: No
Private Field: Yes
Field Searchable on Members List: No
Show on Members List: No
Regular Expression: (leave blank)
Display Page: Options: Other

But, yes it should be:

Profile Field Type: Single-Line Text Box

And then change the following:

Max length of allowed user input: 128
Field Length: 128

Everything else is correct.
Reply With Quote
  #19  
Old 05-19-2015, 08:49 AM
Guardian Hope Guardian Hope is offline
 
Join Date: Mar 2015
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent. I will get this installed this evening and let you know if everything is working.

And again, I do appreciate the effort you've gone through to create this for me.

--------------- Added [DATE]1432094459[/DATE] at [TIME]1432094459[/TIME] ---------------

Hey Mark,

I got your plugin installed and working though I did have to make two modifications to the XML file:
  • The image source referenced it as /forums/static/ranks; easy fix - changed it to ../static/ranks
  • I had to change 'field6' to 'field7' since it is now a single line text box.

However, I was wondering if there was a way to get it to display directly under the username and above the user title. Right now it displays like this:



The only reason you don't see the wings yet is I didn't specify them as I haven't pulled them from the phpBB forums yet.

This however is an excellent modification and will make the lives of so many people on our board easier once we make the switch to vBulletin in June.

(Yes, I got to be that person who double posts; I feel so ashamed; that's always bad forum etiquette.

--------------- Added [DATE]1432106733[/DATE] at [TIME]1432106733[/TIME] ---------------

One final post which will be merged with the one above it.

Mark has been excellent in helping me get this setup. I even built on his extension to separate the wings since it looked nicer below the user title.

Here's the final result:

Reply With Quote
  #20  
Old 05-21-2015, 10:47 AM
thetechgenius's Avatar
thetechgenius thetechgenius is offline
 
Join Date: Jun 2014
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you mean something like this :




I setup my forum with custom ranks based on post count, but instead of ranks they are Levels. The first image is the Usergroup image, the image at the bottom is the user Rank Level. I custom coded my postbit legacy just for my forum though, so that feature its not in vBulletin by default. But if you need help with the code, I could help you. Just let me know.

In your case you could change the levels with your own images.

I am not sure what you mean by you don't want the ranks to be based on Post Count. How do you want them to work or increase in rank? If you just want only a few people in a usergroup to have a specific rank/badge image, I think the only way to do that is to edit the users rank yourself via AdminCP. As far as I know anyway, but I could be wrong.
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:12 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.04775 seconds
  • Memory Usage 2,307KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete