Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
thebombsite wrote:
will not import Bzip and when I try it still reports “Installation successful”.
Dang, must have missed a function call that it requires. Thought I’d caught them all. Thanks for the feedback, I’ll trawl the code a bit harder (and test that bit on XAMPP if I can next time!)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Well I can easily test on thebombsite. Just install a new version and away I go. As I say I can export a Bzip file no problem so I obviously have access to that side of the function, just can’t import it back again. I wonder if that is confusing the plugin.
I did a bit of a check on the exported file by unzipping it (twice because it has to go through the tar format) then re-zipping it again but in .zip format and importing that file. It imported fine and when I switched themes to use it everything was hunky-dory. This suggests to my uncomplicated mind that there was no file corruption getting in the way.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
thebombsite wrote:
I can export a Bzip file no problem… just can’t import it back again.
Thanks for your extra diagnostics. Good to know the bzip export is definitely working.
Just took a more detailed lookie in the plugin. I had made a small oversight insofar as I thought the import was using bzdecompress()… but that was in the new library — and I’m not actually using that part of it. So I went through the existing library and it seems it first uses bzopen() and then a standard tar decompression routine to extract the files inside. If tar works (which it does) then the only difference it seems is bzopen().
My “import” checker just tests for the existence of bzdecompress() — it should instead check for bzopen(). BUT the “export” routine checks for bzopen() and a host of other ‘bz’ functions, and not only reports success it can also export fine. Therefore I’m betting it’s actually something deeper in the bzip decompression routine that’s going sideways and not merely the existence of the required functions that’s fouling things up.
Please would you e-mail me a bzipped theme, and EDIT: Scratch that, can you try something for me please — I can’t test it on xampp for some reason, but I have found a warning message issued by PHP. Visit line 2337 of the plugin. It should read:
return @bzopen($this->options['name'], "rb");
Change it to:
return bzopen($this->options['name'], "r");
i.e. remove the ‘at’ sign and also the binary flag, which my version of PHP is complaining about. See if that makes any difference. If it fails for some reason you shold now see an error message so we can at least see if it’s that.
I’ll see if I can find a way of setting up a local environment here that will accept them and run the bzimport routine in debug mode to track down why that particular portion fails. It might be a bug in the guy’s library (in which case I’ll either fix it or try and use the other library for decompression of bzips!) or it could be some weird permissions thing in that type of file that’s preventing extraction…. that’s a long shot though as it uses the same tar functions as gzip for decompression and that works fine on your system… very curious.
Sorry for the false start, and thanks for your continued patience while I iron this odd one out.
Last edited by Bloke (2010-02-10 20:13:09)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Still the same result Stef.
OT – but whilst I’m thinking about it, cuz you look after Plugin Composer now don’t you? It might be handy if we could have line numbers. Is that possible?
Last edited by thebombsite (2010-02-10 22:02:32)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
thebombsite wrote:
Still the same result Stef.
Working on it. Might not be able to look at it in more detail until after the weekend though. ‘tis a puzzler for sure.
It might be handy if we could have line numbers. Is that possible?
OT: Not really, unless you install a syntax highlighter (there are loads out there). But a poor-man’s version of a line number assistant has popped in for a chat
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Bloke wrote:
OT: Not really, unless you install a syntax highlighter (there are loads out there). But a poor-man’s version of a line number assistant has popped in for a chat
That works nicely thanks. Now you can throw line numbers at me all day. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
How can I rename a theme? And/or what’s my best option if I’ve made edits to an existing theme but now want to give my version a new name and keep the original version around with its original name?
Forgive me if this was answered already (if so, I couldn’t find it).
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
floodfish wrote:
How can I rename a theme?
Currently it’s a bit involved. Make sure the theme you are intending to rename is not being used, then either:
- Export the theme to a zip file
- Extract it to your hard drive
- Rename the base directory to
your_new_theme - Rename the php file to
your_new_theme.php - Edit the PHP file and alter
class your_old_theme extends classic_themetoclass your_new_theme extends classic_theme - Edit the
manifest()information as well to suit - Save the changes, rezip the archive from the main directory downward, and upload it via smd_admin_theme’s interface
- Delete the old theme from the interface any time after you’ve exported it
OR
- Click [Base] of the theme you want to rename (or [Create new theme])
- Enter the name of the renamed theme
- [Edit] the original, copy the old PHP file contents, switch to the new theme and paste it into the PHP file
- Alter the line
class your_old_theme extends classic_themetoclass your_new_theme extends classic_theme - Save the changes
- Copy over the CSS file and upload any graphics again
- Delete the old theme at will
You can rename the theme’s PHP file in the [Edit] window but it doesn’t keep the directory name in sync. I think that’s perhaps a plugin failure, and a feature I should add so that if you rename a PHP file it automatically renames the base directory if it can. Hmmm.
I used to have a [Clone] option which would have been useful to you here, but it got sidelined when wet made the theme mechanism class-based. If the auto rename I mentioned above doesn’t work, I suppose I could find some way to [Rename] themes. It’s a bit involved because I have to essentially do parts of the above techniques in code, but it’s probably nothing a few regexes and some skulduggery can’t handle.
Leave it with me and I’ll see what I can do.
Last edited by Bloke (2010-02-15 23:11:57)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Scratch my previous post, floodfish. Install v0.22, [Edit] the theme of your choice and before you save the core theme’s PHP file, just alter its name in the upper box. It’ll rename the theme folder as well to keep things in step (thanks for spotting that). Note that it will not change the contents of the PHP file itself so it’s your responsibility to keep the class your_theme extends classic_theme line in sync with the current theme’s folder name. A small price to pay considering this version makes renaming a theme a one-stop process instead of a convoluted series of 7 or 8 steps.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#100 2010-02-16 06:08:45
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Seems to have worked great! Thanks!
Offline
#101 2010-03-01 00:53:05
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Maintenance release v0.23 adds no new functionality but it does:
- Fix a stupid bug with displaying the wrong export options
- Check (if you upload a zip file) that it conforms to the right sort of directory structure
The dir verification is very simplistic and only for .zip file types but it should catch most malformed archives, e.g. ones that don’t ‘start’ at the correct directory level or ones that have a misnamed PHP file inside the archive.
Last edited by Bloke (2010-03-01 00:53:37)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#102 2010-08-06 09:28:33
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Another couple of retarded programming errors fixed in v0.24
- Shut up the warnings if you’re not connected to the Internet when it tries to get the theme feed from Textgarden
- Fixed a few ‘undefined index’ warnings if the prefs aren’t installed (happens when running the plugin out of the cache dir)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#103 2010-10-21 16:18:34
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Hi Bloke
I’m not sure if the following is related to my setup, my error, or “other”. . . .
I was having an issue installing Philippe’s new version of sandSpace
As noted in that thread, I now have it installed and working w/ smd_admin_themes, but was never able to upload the zipped file Philippe posted.
In the process I noticed something strange.
- In several of my themes I had one or more files that had been duplicated with a prefix of “._”
- When I tried uploading sandSpace as a .tar compressed file, the “._” issue really showed up.
- The theme directory showed up as expected, but inside ALL the files in the theme duplicated with the prefix of “._”
- and strangely the compress tar file also showed up with a “._” prefix (at the same directory level as the non-compressed themes)
It seems related to the upload process of smd_admin_themes, but I’m not sure how . . .
some other observations, thoughts, and questions . . . fwiw
- Would it be difficult to include the version when export a theme ala ied_plugin_composer?
- Is it difficult to allow multiple image import when authoring a theme?
- Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?
- Do the screenshot only show up in the Theme Grid if it is explicitly named “screenshot” as opposed to, say, “sandSpace_screenshot”?
- By accident I found that if you edit a theme and click the image “upload” w/ no file selected, it creates what appears to be two instances of the plugin edit page . . . . on the same page. Kinda of strange.
- I thought several times as I was editing a theme how convenient it was to be able to manage the images, js, css, and php files all from one unified interface. And my thoughts wondered to managing front end templates in a similar way. . . . :D
fwiw, and thanks for a sweet plugin!
Mike
Offline
#104 2010-10-24 03:34:16
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
maverick wrote:
In several of my themes I had one or more files that had been duplicated with a prefix of “._”
Isn’t this a Mac thing? I think the resource fork is automatically included. Not usually a problem on Mac as it’s hidden, but on Windows it shows up as an extra directory. Perhaps I should explicitly ignore this type of directory but I’m not sure if that has any repurcussions in Mac land? (I’m not the world’s most Macliterate person). Perhaps someone else can shed some light on this and I can improve the plugin.
Would it be difficult to include the version when export a theme ala ied_plugin_composer?
Not difficult. I omitted it because version numbers might get in the way and since upgrades can be handled fairly seamlessly from the plugin by clicking on any highlighted version number I felt the file name wasn’t that important. Maybe I was wrong. What does everyone else think?
Is it difficult to allow multiple image import when authoring a theme?
Probably not difficult, but requires thought. It’s on the TODO list, just need to make some time for it.
Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?
From memory I think readme files and instructions.txt or whatever are acceptable files. Stuart flagged this ages ago and I’m pretty sure I made allowances. But maybe I missed some use cases. I’ll check out sandSpace and see what’s in there, but if there are any other specific filename exceptions/conventions you can think of then I’ll consider adding them or relaxing the rules a little.
Do the screenshot only show up in the Theme Grid if it is explicitly named “screenshot” as opposed to, say, “sandSpace_screenshot”?
Yes. It’s in the admin themes spec that screenshots should be named screenshot.[jpg|png|gif]. That’s simply the shot used in the admin theme’s tab. Multiple or alternate screenies are permitted, though only one can be displayed on the tab and the name is pretty inflexible.
By accident I found that if you edit a theme and click the image “upload” w/ no file selected, it creates what appears to be two instances of the plugin edit page . . . . on the same page. Kinda of strange.
Probably a bug. I have a new version that works better under more varied themes ready to go. I’ll try and investigate this and sneak a fix in for ya before I release the next version. Thanks for the report.
I thought several times as I was editing a theme how convenient it was to be able to manage the images, js, css, and php files all from one unified interface. And my thoughts wondered to managing front end templates in a similar way. . . . :D
Be careful what you wish for. You just never know… :-D
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#105 2010-10-24 12:07:03
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Bloke wrote:
Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?
From memory I think readme files and instructions.txt or whatever are acceptable files. Stuart flagged this ages ago and I’m pretty sure I made allowances. But maybe I missed some use cases. I’ll check out sandSpace and see what’s in there, but if there are any other specific filename exceptions/conventions you can think of then I’ll consider adding them or relaxing the rules a little.
There is actually nothing special in Sandspace, the zipped structure was a bit unexpected for smd_admin_themes.
phw_sandspace.zip
|- readme.txt
|- sandspace
|- screenshot
|- sandspace.css
|- sandspace.min.css <!-- in use -->
|- sandspace.php
|- images....
|- js
I’ll make sure I have the expected structure when I push the final release out.
——-
And my thoughts wondered to managing front end templates in a similar way. . . . :D
hmmm ……….. :?:-D ?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline