The MU forums have moved to WordPress.org

A suggenstion on user editable template (2 posts)

  1. Korora
    Member
    Posted 19 years ago #

    I got an idea of a possibility of secure user-editable template for WPMU. Now I think it is not difficult to make templates editable for each user without php template tags.
    What I mean is that, to layout their own blog it will be enough if users can edit css files. And if you change wp-includes/links.php a little, users can select the contents of sidebar.

    And here are examples which I thought:

    *template files*
    headers.php will contain something like following line:

    <link rel="stylesheet" href="<?php get_settings('fileupload_url'); ?>/files/css/custom.css" type="text/css" />

    Users will upload custom stylesheet on their own file-uploading folder.
    And sidebar.php will call only links, not anything else.

    */wp-includes/links.php*
    function get_links will be changed like following:
    -Change sql command on line 194 to get also content of link_description collumn.
    -Add something like following codes in the beginning of foreach construction after line 206:

    /*calendar*/
    if($row->link_description=="ext:calendar"){
    $output .= $before.get_calendar().$after;
    }
    /*archives*/
    else if($row->link_description=="ext:archives"){
    $output .= $before.wp_get_archives('type=monthly').$after;
    }
    /*custom fields*/
    else if($row->link_description=="ext:custom_field"){
    $l_note = $row->link_notes;
    $l_note = str_replace("<","<",$l_note);
    $l_note = str_replace(">",">",$l_note);
    $l_note = str_replace("\\\"","\"",$l_note);
    $l_note = str_replace("\\'","'",$l_note);
    $output .= $l_note;
    }

    With these changes, users can modify sidebar contents with writing something especially in "short description" field in link-manager.php.
    My English is not good att all so I just hope that someone understands what I want to say. And I hope also that there would be someone who feels this idea sounds nice:)

  2. TomK32
    Member
    Posted 19 years ago #

    Mediawiki has a nice solution for that. Registered user can go to [[User:username/Monobook.css]] to edit the style of the monobook stylesheet and only username will see the changes he makes.

    Instead of having os many different files on the disk I'd prefer storing it in the database and deliver a static copy for a) the blog and b) the user.

    Also, it would be a nice step forward to general naming conversion for style elements of themes.

About this Topic