• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[1.0.0 b1] Basic RTL

Msharry

Active member
#1
This is just Basic RTL, it will do must of the job.

Open library/XenForo/CssOutput.php

Before:
PHP:
        //rgba translation - only for IE
Add:
PHP:
        $output = str_replace(array('left','right' ,'ri_ght'), array('ri_ght','left','right'), $output);
        $output = preg_replace('#(margin|padding):\s?([0-9]+px) ([0-9]+px) ([0-9]+px) ([0-9]+px);#i', '\1: \2 \5 \4 \3', $output);
 
#2
Hi Msharry .


RTL support should be built-in feature, with out doing any file edits ,


I tried this code and it did work.


Thanks for sharing though , I guess no need to rush for us the RTL'ers :p since we won't be using it in a live eviroment until declared stable and I believe most of people won't .
 
#4
I added it .

it doesn't look as it should. :(


I guess I need to play with admincp just to get used to the navigation and some other options there .
 

Omri.L

Active member
#5
Fantastic!
How can I control it only to specific style ?

Which variable contains the styleid in this function?
 

Msharry

Active member
#6
I added it .

it doesn't look as it should. :(


I guess I need to play with admincp just to get used to the navigation and some other options there .
Or you can just ignore post #3 if you are using Firefox and right clinking on the page and choose Switch text direction.
 

Msharry

Active member
#7
Fantastic!
How can I control it only to specific style ?

Which variable contains the styleid in this function?
You need to do more editing:
find:
PHP:
protected $_styleId = 0;
add after it:
PHP:
private static $styleId_ = 0;
find:
PHP:
        if (!empty($input['d']))
        {
            $this->_inputModifiedDate = intval($input['d']);
        }
add after it:
PHP:
self::$styleId_ = $this->_styleId;
then use this:
PHP:
       // 2 is your style Id
       if (self::$styleId_ == 2)
        {
            $output = str_replace(array('left','right' ,'ri_ght'), array('ri_ght','left','right'), $output);
            $output = preg_replace('#(margin|padding):\s?([0-9]+px)  ([0-9]+px) ([0-9]+px) ([0-9]+px);#i', '\1: \2 \5 \4 \3', $output);
        }
instead of (post#1):
PHP:
        $output = str_replace(array('left','right' ,'ri_ght'), array('ri_ght','left','right'), $output);
        $output = preg_replace('#(margin|padding):\s?([0-9]+px)  ([0-9]+px) ([0-9]+px) ([0-9]+px);#i', '\1: \2 \5 \4 \3', $output);
 

Omri.L

Active member
#8
Firstly, Thanks for giving your time!
But it doesn't seem to work.

Before, it worked but on every style. now it doesn't.

And the style id I need to change is really 2
 

Omri.L

Active member
#9
OK, the strangest thing...
It seem to work now after few tries... I have no clue what causing it not to work sometimes.
anyways it's perfect now, I just don't have any scroller to navigate the page width, only for down and up
 

Msharry

Active member
#10
OK, the strangest thing...
It seem to work now after few tries... I have no clue what causing it not to work sometimes.
anyways it's perfect now, I just don't have any scroller to navigate the page width, only for down and up
Maybe caching (Control+F5)?!

Anyway as I said, it just basic, this will break any inline JavaScript CSS, I may need more time to look into it,