vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Why bother with style="float:$stylevar[right]" (https://vborg.vbsupport.ru/showthread.php?t=309241)

doob 03-06-2014 12:54 PM

Why bother with style="float:$stylevar[right]"
 
Is there any good reason to use float:$stylevar[right] rather than just using float:right?

Its not like float:right could possibly be any other thing.

There's still a lot about the coding in the templates (not to mention the php files) that confounds me and I'm never quite sure if I'm missing some fundamental point about the way vbulletin was programmed when I make decisions like abandoning phrases by just inserting my own or tidying up what seems like a pointless use like $stylevar[right].

tbworld 03-06-2014 01:07 PM

If you needed to change the direction or flow of something you would want it a variable. Without knowing where it is being used I cannot advise you. :)

doob 03-06-2014 02:06 PM

If you wanted an object to float left, you'd use either style="float:left" or style="float:$stylevar[left]" if you wanted an object to float right it would be either style="float:right" or style="float:$stylevar[right]".

Float only has left, right, none, inherit (and the very obscure center which I don't think much supports).

I see the $stylevar[left] or right used in almost every template, but it just seems so pointless. When would left ever be something other than left? Any why bother with a phrase at all when plain css is shorter, does the same job, is easier to edit, and because of the simplicity of the function could only possibly ever be right-for-right and left-for-left.

Thus, that's why I'm confused by the use of a global phrase in this case for something that seems like you'd never ever redefine it. What am I missing?

tbworld 03-06-2014 02:18 PM

Give me the name of a template where this has you puzzled (to save me time).

doob 03-06-2014 02:28 PM

It occurs in every single template that uses a float. So pretty much every single template.

I'm not confused by the function...just the reasoning behind the development of Vbulletin to do it this way.

I've got blog_member_block open, but you could literally find something like style="$stylevar[right]" in almost every single template.

tbworld 03-06-2014 02:52 PM

Look at "functions.php", function fetch_stylevars() around line #5000

It will answer your question.

Code:

$stylevar['left'] = 'right';
$stylevar['right'] = 'left';

I was originally confused because I thought this was vb4 templates and I didn't remember seeing that code used, but I was guessing it was for
directional layout reasons.

doob 03-06-2014 03:00 PM

It doesn't really say:
HTML Code:

$stylevar['left'] = 'right'
haha.

PinkMilk 03-17-2014 08:05 PM

Your not alone doob, I've always wondered this aswell :D

Zachery 03-17-2014 08:11 PM

Its for RTL languages, like Arabic.

doob 03-20-2014 04:36 AM

Brilliant Zachary. Now THAT makes sense as a reason to use a phrase for this.


All times are GMT. The time now is 02:09 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.01299 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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