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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2017, 04:53 AM
Inked_Mono Inked_Mono is offline
 
Join Date: Jan 2015
Location: Canada
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Raw Block Data? Responding variable to width change?

Hey there, everyone!

So I've been playing around with the vBExperience plugin, and I've hit a bit of a hard spot. I'm adjust the width of the progression bars, but unfortunately the part that would "fill in" to match the appropriate percentage isn't keeping up.

Image: http://i.imgur.com/g6iInau.png

I've taken a look into the code, and it seems the green part is responsible;

Code:
<dt class="aboutme_left">
			<div title="{vb:raw block_data.xperience_gfx_level}" style="width:130px; height:11px; margin-bottom:2px; background-image:url({vb:raw vboptions.bburl}/xperience/progress/{vb:raw vboptions.xperience_bar_colour_level}_faded.png);">
				<div title="{vb:raw block_data.xperience_gfx_level}" style="width:1px; height:11px; margin-bottom:2px; background-image:url({vb:raw vboptions.bburl}/xperience/progress/{vb:raw vboptions.xperience_bar_colour_level}_left.png); display:inline; float:left;"></div>
				<div title="{vb:raw block_data.xperience_gfx_level}" style="width:1px; height:11px; margin-bottom:2px; background-image:url({vb:raw vboptions.bburl}/xperience/progress/{vb:raw vboptions.xperience_bar_colour_level}_right.png); display:inline; float:right;"></div>
				<img alt="{vb:raw block_data.xperience_gfx_level}" src="{vb:raw vboptions.bburl}/xperience/progress/{vb:raw vboptions.xperience_bar_colour_level}.png" width="{vb:raw block_data.xperience_levelp}" height="11" />
			</div>
Does anybody know where I would find this within vBulletin to edit it to account for the new width changes?

Thank you in advance!
Reply With Quote
  #2  
Old 01-12-2017, 08:47 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Without knowing vBExperience, one can hardly tell you more than: In a plugin. You need to find the plugin that registers that variable for the postbit (I assume) template.

Such questions are really better asked in the thread for that specific addon.
Reply With Quote
Благодарность от:
Inked_Mono
  #3  
Old 01-12-2017, 09:09 AM
Inked_Mono Inked_Mono is offline
 
Join Date: Jan 2015
Location: Canada
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
Without knowing vBExperience, one can hardly tell you more than: In a plugin. You need to find the plugin that registers that variable for the postbit (I assume) template.

Such questions are really better asked in the thread for that specific addon.
Well, I've learned that each point in the progress is accounted for by the initial width. In other words, the original width was at 102px, knocking off 2px for the borders on each side, and the scale itself gave 1px per 1%. I think... I might be boned on this one, seeing as how I don't imagine I could rewrite the algorithm for counting in parts of a pixel (with my modified width being at 130px).
Reply With Quote
  #4  
Old 01-12-2017, 09:39 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You know you can do math in templates? You may not even have to tamper with the PHP side of things at all.

If you want examples, just search your templates for {vb:math in AdminCP.

Perhaps this will work for you?
Code:
{vb:math {vb:raw block_data.xperience_levelp} * 1.3 - 2}
Although I have no idea how that will work out regarding the decimals, rounding etc.
Reply With Quote
Благодарность от:
MarkFL
  #5  
Old 01-12-2017, 09:25 PM
Inked_Mono Inked_Mono is offline
 
Join Date: Jan 2015
Location: Canada
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
You know you can do math in templates? You may not even have to tamper with the PHP side of things at all.

If you want examples, just search your templates for {vb:math in AdminCP.

Perhaps this will work for you?
Code:
{vb:math {vb:raw block_data.xperience_levelp} * 1.3 - 2}
Although I have no idea how that will work out regarding the decimals, rounding etc.
Thank you! I'll give it a shot and see what happens.

Edit: It doesn't seem to have worked. Thanks anyways!
Reply With Quote
  #6  
Old 01-13-2017, 06:16 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What did not work? What's the result of the equation (should be visible in the page source)?
Reply With Quote
  #7  
Old 01-13-2017, 07:36 AM
Inked_Mono Inked_Mono is offline
 
Join Date: Jan 2015
Location: Canada
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The equation itself doesn't seem to pan out. I'd amended all necessary instances of the above line to match yours and the width still pulls to 1% = 1px.

I can PM you the forum link if that would help!
Reply With Quote
  #8  
Old 01-13-2017, 11:46 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:

Replace
Code:
width="{vb:raw block_data.xperience_levelp}"
with
Code:
style="width: {vb:raw block_data.xperience_levelp}%;"
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 06:23 PM.


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.10230 seconds
  • Memory Usage 2,238KB
  • Queries Executed 13 (?)
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
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (2)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete