Topic: [Release] Portrait Panel (version 1.5)

A simple plugin I wrote to fit my need for a daily featured image panel in my blog. It's nothing much, but I hope it may be useful for you in anyway.

Features:
• Set the name of the person in the image.
• Set the origin of the person in the image.
• Set the original source (URL) of the image uploaded.
• Automatically add the 'alt' attribute for the image with the saved inputs from the plugin.
• Image is clickable and points to the defined source URL.
• Show a message about the current image: "Character Name from Character Origin."

To-do list:
• Have the ability to set custom messages through the plugin dashboard instead of manually editing the plugin's code.
• Automatically determine the type of image uploaded.

An example of how the panel looks like is available in my sidebar, the Daily Dose of Kawaii panel. This plugin is useful for showing artworks or photos of characters from anime, TV shows, movies, games, etc.

Current version: 1.5
Available language(s): English (US) only.
Download and demo is available here.

Re: [Release] Portrait Panel (version 1.5)

Greate work acroxx999!

this is an interesting warning, some idea to prevent this ?
WARNING: Save changes first before uploading any image or your image won't be loaded!

I will check more your code and try to improve the extension, and translate to spanish big_smile

regards

Re: [Release] Portrait Panel (version 1.5)

Well, I'm not sure how to fix it. Actually, that was because I previously set the plugin to save the image file using the name of the defined character in the character name text box. Because if you change the name and upload the image at the same time, the name of the image will be named as the name of the old character.

Previous name: Ha
New Name: Lel

If upload at the same time as change to new name, image will be Ha.jpg and not Lel.jpg, because the image was uploaded first before the name is updated in the database. I've been trying to find a way so that the database is updated first before the image is uploaded, but the only way right now is to save changes first before uploading image. But to prevent all that hassle, I made it so that the image is loaded using the same name all the time, 'image'.

4 (edited by jaceeisme 11-01-2014 06:51:41)

Re: [Release] Portrait Panel (version 1.5)

Perhaps it is not my place, since I have not even looked at your code, nor have I ever made a plugin for this, (I'm also a brand new user of Nibbleblog, so take this unsolicited advice or not) but can't you use a php rename($oldname,$newname) statement after you have moved the uploaded file (I'm assuming you use a php upload to a temp directory, and then move it wherever you are going to keep it permanently) since you have both variables already? Or, ask for the new name when selecting the image, pass it thru a $_post from the upload form. You can do that regardless of whether the form is html, php, JavaScript, or whatever else. Heck, even if it's an Ajax setup, you can pass it thru the HttpRequest. (Remember, I've already admitted that I am shooting my mouth off without any experience with Nibbleblog plugins in general, or your plugin code specifically, so naturally it all seems easy to me! I'm not the one that has to make it work! LOL)

In the past, I worked on a setup for keeping track of files for a project that would have several files needing to be uploaded for each task of a project, (120+ tasks, each with up to 20 files each. Not easy when you had a dozen people supplying the files and named whatever made sense to them at the time. I ended up renaming them as <task-number>-01.pdf, -02.pdf, etc, with a description supplied by the uploader) and display them on demand. I didn't care what the original names were, just what I was needing to call them to keep them straight, inside of the system. The files were reviewed to see how the files fit the task, not what they were originally called, so that didn't matter at all to the reviewers.

Good luck, and I hope to try out your plugin, because it looks really neat!

Jim

Re: [Release] Portrait Panel (version 1.5)

Thank you, jaceeisme. Actually, I have tried that before releasing this plugin, but I can't seem to be able to do it. Not with my limited knowledge. The actual method that I want to do is some random number, but by doing this, the random number that gets saved in the database changes every time you reload this plugin's settings page. If only I could somehow save the number that was used on the uploaded image instead of generating the number before uploading the image.

Re: [Release] Portrait Panel (version 1.5)

Have you checked into the php glob() function? If you base your filename on date and time uploaded, you can use a descending sort on an array produced by glob() to find latest file name in the directory. That gives current name, and upload function gives a new name.

Maybe?
Good luck!