The MU forums have moved to WordPress.org

1 2 3

Let your users customise any theme? (80 posts)

  1. mrball
    Member
    Posted 13 years ago #

    I wrote this plugin for my Wordpress MU site and am releasing it as GPL with the hope that some might find it useful. It allows your users to customise any theme on your site, changing images and colours in the CSS. It's still pretty raw but I do have plans to make it much prettier in the future.

    Jason's Customciser

  2. amnesiak
    Member
    Posted 13 years ago #

    if someone customizes a theme, will it change ALL themes?

    So lets say three people are using a theme called Iktib.
    If one person customizes it, will all three have to live with it? Or does it customize the theme just for that person?

    If so, how does it work? Does it backup the theme, and customize it for that person.

    Also if so, will that added customized theme show up in the Presentation tab (theme selector)?

    Sorry for the many questions, just wanted to get a better understanding before using it

  3. andrea_r
    Moderator
    Posted 13 years ago #

    Ditto.

  4. jcow
    Member
    Posted 13 years ago #

    I really cannot wait to take a look. This is exactly the idea i am currently working on. Nice to see somebody doing something in this area. I will let you know any feedback.

  5. mrball
    Member
    Posted 13 years ago #

    Q&A

    Q: If someone customises a theme, will everyone else using the theme be affected?
    A: No. Each user’s customisation will affect only his/her own theme. In future versions, we might allow users to ‘share’ their customisations.

    Q: How does it work?
    A: Briefly: When the plugin is run, it scans through the currently used theme and parses the CSS. It identifies images and colours and stores them as options that the user can change. It then injects these changes back into the theme.

  6. aferraz
    Member
    Posted 13 years ago #

    I have this error:
    URL file-access is disabled in the server configuration

    How can I change the code to bypass the URL file-access restrictions ?

    Thanks

  7. mrball
    Member
    Posted 13 years ago #

    aferraz: Updated it, should work now for disabled URL wrappers.

  8. samchng
    Member
    Posted 13 years ago #

    Nice work Jason! Joy for Singapore! :))
    Will let you know if there are any bugs.

  9. amnesiak
    Member
    Posted 13 years ago #

    if it only applies to the person who customizes it, I guess it must duplicate the theme somewhere for that person and only display it for that person on the presentation tab?

  10. mrball
    Member
    Posted 13 years ago #

    the plugin stores the options for each user in the user's options table in the DB. When the pages are called up, the plugin injects these options as CSS into the head tags.

    the themes are not duplicated, everything is kept as clean as possible :)

  11. jcow
    Member
    Posted 13 years ago #

    I installed. activated plugins. the new tab shows up under presentation, but there is nothing to customize. Is there something else I need to do?

  12. mrball
    Member
    Posted 13 years ago #

    jcow: have u tried changing to the default theme? what do you see in the admin tab- do the reset and update options buttons appear?

  13. jcow
    Member
    Posted 13 years ago #

    I haven't tried to change to the default theme, I will give that go in a bit and get back to you. I do see:

    Images
    [Hide]

    Colours
    [Hide]

    Update Options

    Reset Options

    EDIT: It doesn't seem to matter if I use the default theme...

  14. mrball
    Member
    Posted 13 years ago #

    any errors/warnings/notices in your logs?

  15. jcow
    Member
    Posted 13 years ago #

    Not that i can tell...

  16. mrball
    Member
    Posted 13 years ago #

    jcow: sounds like something is preventing your server from retrieving pages via http from itself. it could be a spam plugin, a firewall, etc. if you didn't install anything like this, it would be your server provider you need to ask.

    it might be something else but I would need to look at your site/server to diagnose it.

  17. andrea_r
    Moderator
    Posted 13 years ago #

    mrball: haven't tried it yet, but it sounds pretty slick. Kudos. :)

  18. voodoolove1
    Member
    Posted 13 years ago #

    I got this error:

    Parse error: syntax error, unexpected T_STATIC, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/name/public_html/wp-inst/wp-content/plugins/Jason_Customciser/Jason_Customciser.php on line 39

  19. mrball
    Member
    Posted 13 years ago #

    Needs PHP5 :)

  20. NickR
    Member
    Posted 13 years ago #

    Please keep us posted on any updates :)

  21. donncha
    Key Master
    Posted 12 years ago #

    I got it working in PHP4. I search/replaced the PHP5isms with PHP4 code, and changed a couple of things like adding get_header() to grab the style sheet loader code.
    Looks good, and I'll throw it up somewhere later!

  22. donncha
    Key Master
    Posted 12 years ago #

    Here's a download link to my new version. This one works in PHP4 and uses get_header() as described above.
    Anyone want to put a nice graphical front end on this so users can easily change their theme's colours?

    http://inphotos.org/wordpress/Jason_Customciser-doc.zip

  23. quenting
    Member
    Posted 12 years ago #

    hi, this sounds promising.
    Is the css parsed for sanity (as far as security is concerned ?).

  24. mrball
    Member
    Posted 12 years ago #

    donncha: thanks for doing the php4 port! don't know about calling get_header() directly though... assumes too much from theme writers?

    quenting: it should be ;)

  25. amanzi
    Member
    Posted 12 years ago #

    donncha - any chance you could just let me know what the get_header changes were? I'd like to use this with PHP5 but your get_header fix sounded important.

    Cheers - Stuart.

  26. donncha
    Key Master
    Posted 12 years ago #

    amanzi - the simplest thing to do is just download the PHP4 compatible version and search through the code for get_header(), it's a straight replacement for the same line in the original file!

    Quenting - you should test it yourself, I can't guarantee that someone can't import another style sheet by typing the right code into one of the textboxes.

    mrball - all the themes I've seen load the style sheet from the header. Any that don't are hopefully obscure and not used much!

  27. amanzi
    Member
    Posted 12 years ago #

    Cheers - I had a look at the original file but just wanted to check that it was just that one line that had been changed.

  28. quenting
    Member
    Posted 12 years ago #

    I have the same issue as jcow. Installed the php4 version, tab show up under themes, but nothing in there but:
    Images
    [Show]
    [Hide]
    Colours
    [Show]
    [Hide]

    Whatever the template used.
    Does it matter if you install in plugins and activate or just in mu-plugins ?

  29. donncha
    Key Master
    Posted 12 years ago #

    Did you install the HTML_CSS Pear package? If Pear is installed, then as root you can do "pear install HTML_CSS" I think. It wasn't installed on my box but use Google as there's plenty of documentation out there.

  30. quenting
    Member
    Posted 12 years ago #

    no, i thought there was a class specificly included to handle if it wasn't installed.
    I'm not sure that's it though, because i installed another plugin (image manager) on my test env, and suddenly this one found some css to edit, but, it was the css of the plugin itself, rather than the css of the theme.
    Curious things happening :)

1 2 3

About this Topic