PDA

View Full Version : Why bother with style="float:$stylevar[right]"


doob
03-06-2014, 12:54 PM
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.


$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: $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.

Max Taxable
03-20-2014, 04:41 AM
Alot of the stuff you find is also for MSIE compliance.