The MU forums have moved to WordPress.org

Proof Of Concept: User Editable Themes (2 posts)

  1. rustybroomhandle
    Member
    Posted 15 years ago #

    Here's something I spent only a few minutes on, but I think it is a good thought starter. NOTE: THE CODE IS UUUUGLY - don't judge/laugh. :)

    Anyway. Allowing users to edit their themes is dangerous because theme templates are PHP and therefore can pose a security risk. What I am busy with is making a theme that has all the template HTML separated from the PHP into files (I gave it an extension .moo).

    Two files in the archive you should look at:

    body.moo

    [[BLOGNAME]]
    <BR /><BR />
    Hello, welcome to <strong>[[BLOGDESCRIPTION]]</strong>!!!
    
    <BR /><BR />
    
    [[POSTS]]

    ... the tags in that code then get interpreted by some code in index.php ... at the moment nothing complicated, just a simple replace, and the code will definitely get better.

    $a = str_replace('[[BLOGNAME]]',$blogname,$a);

    In addition I also imagine a Dashboard interface that shows the editable header.moo, body.moo, footer.moo, scripts.js and style.css ... all of these would go in a directory that matches your blogID when you activate the theme.

    Anyhoo.. your thoughts?

    http://efx3.com/moo-testtheme.tar.gz

  2. easysleeper
    Member
    Posted 15 years ago #

    I have editable themes working well on my site, I use a custom theme that just loads the users configuration

    Style Sheet
    Layout
    Entry
    Comments
    Menu (sidebars)

    there is a place for the users to edit the files and save them and share them.

    I strip scripts from it, and they have full customization with no php.

    The only problem is I made lots of core mods to make this happen. but it could be done entirely in plugins, in fact the bulk of it is.

About this Topic

  • Started 15 years ago by rustybroomhandle
  • Latest reply from easysleeper