Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: recent articles
Does Jakobs plugin actually work?
- I downloaded the
php
file (raw.githubusercontent.com/jools-r/jcr_writenav_buttons/main/jcr_writenav_buttons.php) and uploaded to one test install locally (PHP 8.3.2/MySQL 8.0.28, TXP-dev latest) - The plugin installs but the version is set to
1
and Author is set tomy_username
, not Jakob. - I of course enable the plugin at this point.
Heading over to the Write tab, there is no “recent articles” list nor the expected prev/next buttons.
PS – other plugins install properly regarding version/author using the same method
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: recent articles
Installing a raw PHP file will do that because there is no manifest or metadata present. To get the version info and a proper install, you need to first install the compiled version, a zip, or a full PHP template version. After that, installing a raw PHP file should update the existing code. In theory, at least.
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
Offline
Re: recent articles
Bloke wrote #336541
Thanks for explaining that part. Is that also the reason why the plugin fails at its task?
Tia.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: recent articles
Yes, I’ve yet to make an installer out of that. In the meantime, just put all the files in a folder called jcr_writenav_buttons
in the /textpattern/plugins/
folder and then import via the dropdown on the plugins panel.
TXP Builders – finely-crafted code, design and txp
Offline
Re: recent articles
jakob wrote #336543:
Yes, I’ve yet to make an installer out of that. Just put all the files in a folder in tour @/textpattern/plugins/folder and then import via the dropdown on the plugins panel.
Ok, that way I went somewhere farther. After enabling the plugin: no prev/next
and a lovely warning at the top of the page:
A problem occurred while loading the plugin: jcr_writenav_buttons (0.2) -> Warning: Undefined variable $event on line 9
textpattern/lib/txplib_misc.php:1550 include()
textpattern/index.php:200 load_plugins()
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: recent articles
It lacks global $event;
declaration at the beginning, works great otherwise.
Incidentally, this was my 5000th post.
Offline
Re: recent articles
etc wrote #336551:
It lacks
global $event;
declaration at the beginning, works great otherwise.
Thanks. I’ve corrected that. And congratulations on the 5000!
phiw13 wrote #336538:
Does Jakobs plugin actually work? … I downloaded the
php
file …
Bloke wrote #336541:
To get the version info and a proper install, you need to first install the compiled version, a zip, or a full PHP template version.
This was just a quick trial, a kind of proof of concept if you like, hence not yet made into a bona-fide plugin.
Regarding an installer: making a plugin by simply creating a folder, manifest.json, and the plugin itself is now much simpler. Also the way textpacks, help and data.txp files are included is much simpler than filling out the correct parts of the textpattern-plugin-template. But currently there’s not a way to make a txt or php installer from this plugin pattern as the zem_tpl.php compiler script doesn’t yet work with the individual files. There’s only the zip, which is what the “export” button on the plugin panel produces.
Would it be possible to convert zem_tpl.php to work from the individual file parts – or alternatively to add that to the “export” options in the plugin panel?
(gocom has a standalone script for his own plugin format that compiles from parts and has hooked it up to a GitHub action to automatically publish releases when setting a version tag in git. His plugin format is a little different to the standard one, though.)
TXP Builders – finely-crafted code, design and txp
Offline
Re: recent articles
jakob wrote #336552:
Would it be possible to convert zem_tpl.php to work from the individual file parts – or alternatively to add [compiled .txt output] to the “export” options in the plugin panel?
Both are possible. The former is easier, probably. Putting the plugin bits into a template isn’t tricky (ied_plugin_composer has a routine that could be stolen). The hard part is where to get the template from.
I’m loathe to include it in Txp. Don’t really want to embed it as a string in a core file as it’ll get out of sync with the one in the github repo. But at least we can guarantee the format will be correct. Which we won’t be able to do if the Plugins panel goes and fetches it on demand from the repo when you want to export.
There’s no “nice” way to do it, hence why I buried my head in the sand and only exported zip from the Plugins panel.
If anyone has any neat idea on how best to do this, please raise your paw.
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
Offline
Re: recent articles
etc wrote #336551:
It lacks
global $event;
declaration at the beginning, works great otherwise.
ah yes, that was it, I had a nagging feeling it was all that simple…
The plugin works as expected. Perfect.
Now I’ll ask the lady who was slightly worried about that removal, given her usual workflow if shee really wants the recent articles list back.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: recent articles
Bloke wrote #336553:
[…] There’s no “nice” way to do it, hence why I buried my head in the sand and only exported zip from the Plugins panel. […]
I like the zip file (folder) format, personally. And I imagine security conscious people might prefer it as it gives the opportunity to inspect the payload before TXP admin touches it (unzip folder and inspect from the file system, then upload).
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: recent articles
phiw13 wrote #336556:
I like the zip file (folder) format, personally.
I do too, but some systems automatically unpack .zip files and the person downloading may not be aware of the original zip file that they will need to upload.
TXP Builders – finely-crafted code, design and txp
Offline