The MU forums have moved to WordPress.org

Smarty with WPµ (7 posts)

  1. lissyx
    Inactive
    Posted 16 years ago #

    As you should be aware, recent wpµ "release" don't use anymore Smarty.

    But, it's a great template engine, and it's usefull for user to have the hability to (use|make) their own templates.

    That's why i've installed Smarty template system in one of these recent nightly, getting it to works perfectly. The only problem is with CSS. Yes, i nfact, the CSS are located in wp-inst/wp-content/blogs.dir/INT/templates/ (with INT an integer) :
    infos-du-net:/home/blogs-unstable# ls wp-inst/wp-content/blogs.dir/2/templates
    total 24K
    drwxr-xr-x 2 webusers 4,0K 2005-09-25 17:11 .
    drwxr-xr-x 6 webusers 4,0K 2005-09-25 17:31 ..
    -rw-r--r-- 1 webusers 2,6K 2005-09-25 17:13 comments.html
    -rw-r--r-- 1 webusers 3,6K 2005-09-25 17:10 index.html
    -rw-r--r-- 1 webusers 595 2005-09-25 17:13 post.html
    -rw-r--r-- 1 webusers 3,5K 2005-09-25 17:17 wp-layout.css

    So, problem is that i'm unable to make a RewriteRule to access the CSS. So I ask you to help me ;)
    When it'll work, i'llm take time to write some tutorial about using Smarty with WPµ.

  2. donncha
    Key Master
    Posted 16 years ago #

    Look at the wp-content/blogs script as every files/* request goes through that.

  3. lissyx
    Inactive
    Posted 16 years ago #

    Err, http://lissyx.unstable.idnaute.com/files/wp-layout.css don't give me the file ;)

    -rw-r--r-- 1 webusers 3,5K 2005-09-25 17:32 wp-inst/wp-content/blogs.dir/2/files/wp-layout.css

  4. lissyx
    Inactive
    Posted 16 years ago #

    Ok, in fact I need to request for http://lissyx.unstable.idnaute.com/lissyx/templates/wp-layout.css to get the template.

    But also need to change wp-inst/wp-content/blogs to seek in templates/ and not only in dir/ ;)

  5. lissyx
    Inactive
    Posted 16 years ago #

    Here what i've changed in blogs file :

    if(eregi("templates/", $_SERVER[ 'REQUEST_URI' ])) { $dir = "templates"; }
    else { $dir = "files"; }

    $file = ABSPATH . "wp-content/blogs.dir/" . $blog_id . '/' . $dir . '/' . $file;

    and,

    $ext_list = array( "css" => "text/css", "jpg" => "image/jpeg", "mp3" => "audio/mpeg", "mov" => "video/quicktime" );

  6. NetAndif
    Inactive
    Posted 16 years ago #

    Hi lissyx. I love smarty, too.
    So i'm very interested in your hack.
    Will try it this weekend...

  7. lissyx
    Inactive
    Posted 16 years ago #

    It's not really hard, i've took many parts of code from the old release of wpmu :)

About this Topic