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
mrdale wrote:
Have your plugin grab all the titles of Admin themes at textgarden dynamically and offer a 1-click install/download to activate.
That was kind of where I thought of going in the first place.
Short version: it’s certainly possible in various guises.
Long version: The plugin uses a custom RSS feed that Stuart kindly constructed on Textgarden for me. That feed just returns the name of each theme, its version and a link to its article page. I figured this was safest because — for whatever reason — you might not want to install the latest and greatest version. Perhaps someone doesn’t particularly like the theme “walla_inmate” v3 but liked v2.4, well, that’s their prerogative so the link to Textgarden gives you the ability to download it if you like what you see.
But I can appreciate that a one-click install is seductive in its own flirtatious way. There is nothing to stop the feed also harbouring the direct link to the latest version of the actual theme package; the plugin then has the option of using either. I could perhaps offer a pref to pick whether you want to visit the site or simply be presented with a download link or perhaps even to auto-install the theme (not sure if this’ll work but it’s worth a shot eh?)
[ The auto-install option does assume you have, for example, zip support built into your PHP — there are stupid issues with zip as it is not a default feature of PHP and needs explicitly enabling at compile time; something some hosts will not do without a fight. What’s even more stupid and confusing is that you can create zip files without having the zip package installed, but you can’t install/open them. I don’t make the rules ]
I could perhaps also offer a separate page where all available themes are listed and you can click to install. Or Textgarden could offer an ‘archive’ page with a condensed Article list of all the themes and the download links proffered for your wanton clickage.
As a side-note, if you really hate the idea of downloading the package to your machine first, you can try this:
- Middle click the hyperlinked theme version number to take you to Textgarden in a separate browser tab (Mac people may need more than one finger here, sorry, but at least your computers are shiny)
- Copy the download link to the clipboard
- Flip back to the smd_admin_themes tab and paste the URL into the Install theme box. N times out of 10 this’ll grab the theme directly and install it straight away, where N is reliant on the weighted standard deviation of the number of short gauge bosons in the room at the time you do it1
1 probably.
Last edited by Bloke (2009-08-19 21:59:43)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Which is why I’ve always preferred the Higgs boson, even though no one has seen one yet. My personal belief is that it is the prime cause of all Windows crashes. ;)
I also thought of simply copying the download URL to the clipboard and pasting it into the input. Simple enough even if you need two fingers and I’m thinking that auto-install is just going to increase the plug-in size even more. As you say it would always be wise to go look at the new version first just in case you prefer what you already have. Sometimes a new theme version can contain quite radical changes can’t it?
Plus my idea of offering both zip and gzip file downloads might confuse the issue.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#51 2009-09-08 18:20:24
- Gerich
- Member
- Registered: 2009-08-30
- Posts: 35
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
I have installed the plugin, but when I’m go to Extensions -> Admin themes tab, I get an error:
Notice: Undefined variable: smd_at_prefs in C:\AppServ\www\textpattern\lib\txplib_misc.php(594) : eval()’d code on line 107
Notice: Undefined variable: smd_at_prefs in C:\AppServ\www\textpattern\lib\txplib_misc.php(594) : eval()’d code on line 108
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Gerich wrote:
I have installed the plugin, but when I’m go to Extensions -> Admin themes tab, I get an error:
Oops, sorry, this is fixed in v0.11 but I’m still tweaking it so it’s not ready quite yet. Hopefully in the next day or two. In the meantime, go to line 100 of the plugin where it reads:
global $smd_at_event, $prefs, $theme, $smd_core_themes, ... etc
and add , $smd_at_prefs
to the list. That’ll stop the plugin whining.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#53 2009-09-09 12:51:07
- Gerich
- Member
- Registered: 2009-08-30
- Posts: 35
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Ok. I did it and no have that errors, but have a new one:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\AppServ\www\textpattern\lib\txplib_misc.php(594) : eval()’d code on line 291
:)
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Gerich wrote:
Ok. I did it and no have that errors, but have a new one:
Rats, that’s a problem as it tries to get the feed from Textgarden. Either Textgarden was down when you tried (unlikely) or your version of PHP can’t read the URL for whatever reason (is allow_url_fopen
on?)
Either way I’ll have to build in a shorter timeout and/or degrade if it can’t find the feed. Thanks for bringing this to my attention. For now you could try adding this at line 270 (before $feed = '';
):
$transport = '';
Though it’s untested, that should hopefully stop it trying to get feed info and, with luck, won’t cause any errors further down the line.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Howdy Bloke.
Just downloaded and installed the plugin… but i got all the errors noted above re line 107 , 108 etc… Have I downloaded the wrong file? what is the latest number available?
many thnx
cheers
Last edited by bici (2009-09-15 04:41:10)
…. texted postive
Offline
#56 2009-09-15 07:43:11
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Hi Stef,
On a upgraded site (last 420) : no problem.
On a fresh new site :
Notices Undefined index: smd_at_global_skin and smd_at_crush
Also : “option” is not there on the plugin tab, near your plugin.
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
bici wrote:
i got all the errors noted above re line 107 , 108 etc…
You have the right version. v0.11 is getting there; but since it contains a new shortcut mechanism for using css constants I want to be sure I’ve got it right before I unleash it on the world.
The warnings you see are only warnings: either apply the one-line patch noted above or ignore them :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
jpdupont wrote:
Notices Undefined index: smd_at_global_skin and smd_at_crush. Also : “option” is not there on the plugin tab, near your plugin.
Odd. Sounds like the plugin hasn’t auto-installed the prefs and is not responding to the ‘prefs’ event. It should have done that. I’ll check it out — maybe I forgot to set the flags in the version I distributed, d’oh!
If you go to the ‘Setup’ page (it’s correctly called Preferences in the next version, btw) does it show the prefs have been installed? If not, install them and the warnings should go away. Even though they’re only notices, I’ve tracked down a couple of places where I assumed the prefs were installed and have fixed them, so hopefully this won’t occur in the next version. Thanks for letting me know.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#59 2009-09-15 08:35:11
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Stef,
I see now the setup button !
If I clik on the button, and save the settings, no more notice messages. Thanks.
Actually all is ok, but I don’t see the “options” link in the plugins tab/list.
Offline
Re: smd_admin_themes: Manage, edit, switch and share admin-side themes
Stef, I get the following when importing a theme
Warning: fopen(/home/user/public_html/site/textpattern/theme/txpcoder/) [function.fopen]: failed to open stream: Is a directory in /home/user/public_html/site/textpattern/lib/txplib_misc.php(594) : eval()'d code on line 672
Warning: fclose(): supplied argument is not a valid stream resource in /home/user/public_html/site/textpattern/lib/txplib_misc.php(594) : eval()'d code on line 678
It still seems to work though.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline