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
Have you clicked on the “Preferences” button on the admin_themes page and saved your preferences yet?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#77 2009-11-05 18:04:12
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Good point “thebombsite”! :)
Offline
#78 2009-11-09 18:15:35
- mlarino
- Member
- Registered: 2007-06-29
- Posts: 367
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
I am still having a problem:
I see this in the tab
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/sites/mlarino.com/public_html/santy/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 324
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/sites/mlarino.com/public_html/santy/textpattern/lib/txplib_misc.php(594) : eval()’d code on line 324
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
mlarino wrote:
I am still having a problem:
Ah, that’s because I just found out that Stuart has put Textgarden into maintenance mode and he’s moving things around. I’ve updated the plugin to make it more robust so you won’t see those warnings in this eventuality in future. Just waiting for confirmation of the final URL structure from Stuart and I’ll upload the new version.
Last edited by Bloke (2009-11-09 19:57:49)
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
New maintenance version v0.14 is out. It simply improves robustness in the event Textgarden is down, and the admin theme list URLs have been altered in line with the changes Stuart is making to the site (thanks for the heads-up, Sir).
Anyone who’s getting the errors mlarino posted above, upgrade to the latest version to silence them. When Textgarden comes back online the feeds will resume from their new location.
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
Two (for me) important questions…
- Is there a posibility to change the order of elements without modifying files in includes folder? For example, I want to put “text/html/preview” horizontally above “body” textarea in write tab…
- Is there a posibility to use a div’s instead of tables? Cos I see that everything is wrapped in tables
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
pogonik wrote:
Is there a posibility to change the order of elements… Is there a posibility to use a div’s instead of tables?
Both depend on your level of cunning. Technically, admin_themes are only supposed to change stuff in the header and footer of the page; everything in the middle is down to plugins. So your second point about employing divs instead of tables depends on which tables you want to change :-)
If you want to change the tables in the navigation tabs at the top then you can do that fairly easily. Look at Stuart’s excellent classic2 for an example of how to do this.
Swapping elements around can be done in a theme if you wish but it’s not advisable to do so without careful consideration of any plugins that might rely on the whereabouts of that particular feature. Moving the html/preview/text segment is not trivial but you might be able to do it with CSS (though currently I doubt it) or jQuery. Alternatively you could probably do something using the pluggable_ui() callback in the core. There’s one with event = article_ui / step = view which directly addresses the vertical tab bar. You could simply clear that part of the interface, then write your own tab bar and inject it into some other pluggable_ui() position (e.g. in front of step=body).
Does that kind of answer your questions?
Last edited by Bloke (2009-12-31 01:51:54)
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
As always, very extensive and detailed answer.
Thanks!
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
So relating back to the other thread, when I suggested that zip was more universal I was talking about on a computer rather than in the website environment. Essentially the files on Textgarden are intended for “download” to a computer rather than “import” directly to a site. I have no problem with the import idea, but I want to supply a download file that everyone can unpack without too much trouble. At the end of the day, whilst importing is no doubt quicker, downloading,unpacking and uploading really doesn’t take long and everyone can do it.
I’m going to have another go at importing the various file types myself. Your suggestion that I should be able to use tar bothers me so I shall give it another go.
One thing is for sure though. I shall only offer one type of file on Textgarden. For one thing splitting a theme into 2 or 3 file types will pose a problem for the “popularity” listing which is an integral part of the site but another reason is that I think it will pose a problem for the “feed” side of things. You would probably know more about that than me though. ;)
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
Now call me a liar. I’m too grounded to care. ;)
There have been 2 major changes with my host over recent months. First off, I host with a reseller which I haven’t changed, but they have moved host themselves which effectively means I have. Second, my server was PHP4.* based although I could call up PHP5.* with a bit of .htaccess magic but it is now fully PHP5.* plus MySQL 5.* as well (not sure if that makes any difference).
Anyway it would seem that somewhere amongst that lot certain PHP facilities I was previously denied have now been enabled. What it all means is that I can now import .zip, .tar and .tgz files. Whoopee!
I can’t import a .tbz2, though I should mention that the plugin does tell me I have installed successfully. It is telling me fibs. ;)
So where does that leave us? The problem is still the fact that most users probably don’t use your plugin and most of those will be Windows users. Windows natively supports .zip compression/decompression. Anything else requires installing an application, my own preference being 7-zip, but how many of them are likely to install something they probably won’t use much?
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:
Anyway it would seem that somewhere amongst that lot certain PHP facilities I was previously denied have now been enabled.
Haha, web hosts have a habit of changing things when you least expect it. In my case, they actually downgraded my service and removed --with-zip from my version of PHP; reasons unknown. That’s what started this whole compression thing off in the first place: I had zip built into the plugin during beta testing that utilised (what I thought was) PHP’s built-in ZIP functionality. Turns out it’s an extension and midway during development the plugin stopped working on my own site. If it hadn’t been for that simple act of treason from my hoster I’d have been blissfully unaware that we’d need any other type of compression format at all!
I can’t import a .tbz2, though I should mention that the plugin does tell me I have installed successfully. It is telling me fibs. ;)
We can’t have my software lying to you. Naughty. I’ll look into it, but…
*fanfare*
I’ve just found a kind soul who has recently updated a library that purports to manage zip decompression without PHP’s zip extension. The downsides are that a) it’s 24KB so including it will take the plugin to well over 100KB in size (eeek!), and b) it still requires --with-zlib to be enabled on your server. The author of the library cheerily notes in the documentation:
Requirements:
This class requires extension ZLib Enabled. It is default
for most site hosts around the world, and for the PHP Win32 dist.
If that’s to be believed, we’re in the clear. Hosters being hosters though, it doesn’t fill me with complete confidence. Curiously, in the next paragraph of the docs we find:
To do:
- Error handling
- Write a PHP-Side gzinflate, to completely avoid any external extensions
- Write other decompress algorithms
Ahem, so there’s no error handling built in, which is going to be fun if the zip file is somehow mangled. Could be a sticking point.
If he manages to incorporate gzinflate functionality in future, it means we’re sorted in terms of PHP requirements but it’ll boost the file size yet again. Also, if he decides to add other decompression algorithms it opens the avenue of later incorporating others again, if necessary. But, as Stuart points out, zip is arguably the defacto standard for Operating Systems (heck, even OSX from 10.3 onwards has zip decompression built in) so it makes sense to find a way to use it exclusively.
What I’ll probably end up doing is trying to consolidate what’s on offer in the plugin. If this library does what it claims on the tin I’ll add it and make the plugin use it for zip decompression. That will help in the short term. I’ll then see if I can strip out all the other encoding file formats, but for backwards compatibility I’ll quietly make v0.2 of the plugin still able to read the existing formats — it just won’t be able to create anything other than zip. After significant time has elapsed I’ll then probably remove the non-zip support entirely and see if that brings the plugin size down. Alternatively I may elect to keep it — perhaps using this new library if it’s been written — but lock it away as an ‘advanced’ feature for those that really really really have a need for something other than zip. I’d hate to lock out a bunch of potential TXP themers for the sake of 30KB of code.
Watch this space for developments.
Last edited by Bloke (2010-02-07 22:23:44)
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
What’s the maximum size for plugins these days? It got upped recently didn’t it?
Could it have a separate library file like Postmaster and one or two others?
And another nasty thought I just had. The Textgarden server and I also think the Textpattern server will not allow the installation of compressed plugins. If that is the case does it suggest they wouldn’t be able to import a compressed theme or is that something entirely different?
Last edited by thebombsite (2010-02-07 23:07:06)
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:
What’s the maximum size for plugins these days? It got upped recently didn’t it?
Yeah, 16MB1. Got a way to go yet before I hit that ceiling :-)
Could it have a separate library file like Postmaster and one or two others?
Yes, at the expense of having to upload and activate two plugins at installation time. Swings/roundabouts I guess.
The Textgarden server and I also think the Textpattern server will not allow the installation of compressed plugins. If that is the case does it suggest they wouldn’t be able to import a compressed theme
Oooh, now you’re talking. Compressed plugins are gzipped — which implies using the gzinflate() function, which in turn is a component of ZLib and thus the server’s PHP has to be compiled --with-zlib. If both those servers can’t import compressed plugins it follows they won’t be able to install gzip compressed themes. And since the library I’m looking at requires ZLib in order to make the zip functionality work, well, it’s potentially a problem.
I’m going to have to do some heavy testing offline in XAMPP to check server configurations with and without the various libraries compiled in before I choose a route. On one hand, TAR is attractive because it only uses the pack() function which is a core component of PHP. People using smd_admin_themes will be fine; people who don’t and want to install by hand may need a non-built-in tool on their OS to read theme packages and upload them to their server manually.
On the flipside, using ZIP means pretty much anyone can read the archive on their OS natively, but only people with zlib installed can create and install them if using smd_admin_themes. Dilemma alert!
1 In theory at least; it’ll depend on your server’s maximum upload file size and/or the maximum size of a POST request to determine whether that plugin limit is practically attainable.
Last edited by Bloke (2010-02-07 23:30: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
‘ave it! 8o)
Native zip support is built in to the (now much larger) plugin v0.2. Zip is the default export type on new installations — alter your plugin prefs if you’re upgrading.
I opted to leave all the formats intact because I found a better mechanism for kicking out unsupported types. With luck that should (untested on a live site) stop the plugin saying it’s OK to upload a bzip file when your system can’t support it, Stuart! Please report on the success or otherwise of my wranglings.
I’ve also made it a lot clearer which types your system supports via a little info line beneath the Upload box. By separating the ‘import’ and ‘export’ operations — they both use different sets of PHP functions — my checker now makes sure you have the right functions depending on which direction you’re doing things. And if you try to upload an unsupported type it’ll complain.
See how that one tickles your respective fancies.
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 something not right Stef. It tells me under the import browse field “Supported import types: Tar, GZip, Zip, BZip” but it still will not import Bzip and when I try it still reports “Installation successful”.
I maybe should mention that I can export all 4 formats no problem. Maybe I only have half a library. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline