Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » rvm_css (v1.2)

#109 2010-09-17 23:21:27

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: rvm_css (v1.2)

Just realized I didn’t have this plugin working because I hadn’t created the css directory. Now that I have my css files are coming out wacky. What did I do wrong?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#110 2010-09-18 12:59:09

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

I see a few extra line endings (no problem, really), but I suppose that’s how it’s stored in the database as well, since rvm_css doesn’t edit the contents of the style sheet; it just stores it as-is in a static file.

Offline

#111 2010-09-19 07:24:39

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: rvm_css (v1.2)

Strange, From my office, where we have IE, I was getting garbage. Looks good from here at home. I’ll have to see how it looks Monday.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#112 2010-11-06 18:58:28

MyOtheHedgeFox
Member
From: Russia
Registered: 2010-11-06
Posts: 10
Website

Re: rvm_css (v1.2)

Erm, will this plugin work correctly with TxP 4.3.0?

Last edited by MyOtheHedgeFox (2010-11-06 19:07:07)

Offline

#113 2010-11-07 18:56:54

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

Yes, since version 0.5 the plugin is prepared for TXP versions that do not store CSS in base64 encoding in the database.

Offline

#114 2010-11-08 15:21:02

MyOtheHedgeFox
Member
From: Russia
Registered: 2010-11-06
Posts: 10
Website

Re: rvm_css (v1.2)

Then the only problem is “n” attribute used by txp:rvm_css. =)

Offline

#115 2010-11-08 16:33:17

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: rvm_css (v1.2)

For those who hate to wait :D

This fixed the “n” attribute issue for me:

Edit the plugin. Find:

extract(lAtts(array(
    'format' => 'url',
    'media'  => 'screen',
    'n'      => '',
    'rel'    => 'stylesheet',
    'title'  => '',
  ), $atts));

change to

extract(lAtts(array(
    'format' => 'url',
    'media'  => 'screen',
    'name'      => '',
    'rel'    => 'stylesheet',
    'title'  => '',
  ), $atts));

Offline

#116 2010-11-08 18:13:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

If I were to change the plugin that way, it would break existing installs that still use the ‘n’ attribute ;)
Sticking with ‘n’ isn’t a problem.

Offline

#117 2010-11-09 11:59:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

Re: rvm_css (v1.2)

ruud wrote:

Sticking with ‘n’ isn’t a problem.

For now… but the css($atts) call on line 39 might cause problems in future TXP versions as it triggers the deprecated warning when passing n to the function.

Just off the top of my head (largely untested), can it be approached this way:

14a15,20
>   if (isset($atts['n'])) {
>     $atts['name'] = $atts['n'];
>     trigger_error(gTxt('deprecated_attribute', array('{name}' => 'n')), E_USER_NOTICE); // optional
>     unset($atts['n']);
>   }
> 
18c24
<     'n'      => '',
---
>     'name'   => '',
23c29
<   if (!$n)
---
>   if (!$name)
27c33
<       $n = safe_field('css', 'txp_section', "name='".doSlash($s)."'");
---
>       $name = safe_field('css', 'txp_section', "name='".doSlash($s)."'");
31c37
<       $n = 'default';
---
>       $name = 'default';
35c41
<   $file = $rvm_css_dir.'/'.strtolower(sanitizeForUrl($n)).'.css';
---
>   $file = $rvm_css_dir.'/'.strtolower(sanitizeForUrl($name)).'.css';

There’s probably a neater method if this eventually becomes desirable / necessary.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#118 2010-11-10 23:47:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: rvm_css (v1.2)

Version 0.6 released. See topic start for changelog and download link.

Offline

#119 2010-11-11 12:33:39

MyOtheHedgeFox
Member
From: Russia
Registered: 2010-11-06
Posts: 10
Website

Re: rvm_css (v1.2)

Thank you very much!

Offline

#120 2010-12-08 11:14:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,243
Website GitHub

Re: rvm_css (v1.2)

Many thanks for the update Ruud.

Is it just me or does anyone else get a couple of warnings under 4.3.0 (debugging mode) when using the name attribute:

Notice: Use of undefined constant txp_version - assumed 'txp_version'  on line 45
Notice: n attribute is deprecated  on line 63

My stab in the dark seems to be that txp_version is only defined on the admin side so trying to test it elsewhere fails. Quick and dirty solution is to alter line 45 from:

if (version_compare(txp_version, '4.3.0', '>='))

to:

if (version_compare(get_pref('version'), '4.3.0', '>='))

But maybe it’s just me?

Last edited by Bloke (2010-12-08 11:15:36)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

  1. Index
  2. » Plugin support
  3. » rvm_css (v1.2)

Board footer

Powered by FluxBB