Hey everyone,
I've been working on a plugin for a while now and I'm starting to wonder if I'm trying to do something that just isn't meant to work with Bludit.
The idea is pretty simple: I'm tired of uploading the same images over and over again for different posts. Right now if I want to use my logo or a photo in multiple posts, I have to upload it separately each time or copy the link. So I thought, why not build a central media library?
What I'm trying to build:
One place to upload all my images
When writing a post, instead of uploading new images, I can just pick from what's already there
Manage everything from one screen - delete old images, see what I've got, etc.
Sounds reasonable, right? Well, I've been banging my head against this for weeks now.
The problems:
Every time I try to make the plugin actually DO something (upload files, delete files), it breaks the session and kicks me back to the login screen. I've tried AJAX, regular forms, different approaches - same result every time.
I can display all the existing images just fine, but the moment I try to modify anything, boom - logged out.
Has anyone else tried building something like this? Is there some secret to making plugins handle file operations that I'm missing?
Also, even if I get the file handling working, how would I integrate a "pick from library" button into the post editor? Is that even possible without hacking core files?
I'm starting to think maybe Bludit just isn't designed for this kind of cross-post media sharing. Maybe each post having its own images is just how it's supposed to work?
Before I spend more time on this, I wanted to check - has anyone successfully built something similar? Or am I fighting against the way Bludit fundamentally works?
Any thoughts or reality checks would be appreciated. I don't want to keep spinning my wheels if this is impossible.
Thanks!
Building a central media library plugin - am I crazy?
-
- Master Bludit
- Posts: 156
- Joined: Tue Jul 04, 2017 4:31 am
- Location: New Zealand
- Has thanked: 13 times
- Been thanked: 26 times
@koroner
>> it breaks the session and kicks me back to the login screen.
Are you going through your plugin plugin.php file? – via: public function adminController()
Let me know if you need some clarification on this.
AJAX is certainly an approach but needs to be set up correctly. Have a read of my:
viewtopic.php?t=3077
I hope this helps.
kusalo
>> it breaks the session and kicks me back to the login screen.
Are you going through your plugin plugin.php file? – via: public function adminController()
Let me know if you need some clarification on this.
AJAX is certainly an approach but needs to be set up correctly. Have a read of my:
viewtopic.php?t=3077
I hope this helps.
kusalo