Well, I’m working on this myself now, using http://www.ilfilosofo.com/blog/old-style-upload/ π
Can any plugin authors help me?
I have some code, which will output a list of pdfs/docs in a directory… but how can I make this a plugin that will add the resulting dropdown menu next to my quicktags?
<?
echo "<form>";
//Looks into the directory and returns the files, no subdirectories
echo "<select name='yourfiles'>";
echo "<option value=''>Select document</option>";
//The path to the style directory
$dirpath = "/home/blahblahblah/media";
$dh = opendir($dirpath);
while (false !== ($file = readdir($dh))) {
//Don't list subdirectories
if (!is_dir("$dirpath/$file")) {
//Check that the file extension is .pdf or .doc
$ext = substr($file, strrpos($file, '.')); // Get the extension of the file
if ($ext == ".pdf" || $ext == ".doc") {
//Truncate the file extension and capitalize the first letter
echo "<option value='$file'>" . $file . '</option>';
}
}
}
closedir($dh);
//Close Select
echo "</select>";
echo "</form>";
?>
I wish I could help develop this. I’m not quite at that level of expertise yet. But I’m definitely interested in tracking your progress. This is something very near and dear to my heart!! I would like to be able to have pdf and doc versions of each post available for download, simply showing links to them in the sidebar of the post. Getting the existing upload manager to function well and consistently seems to be quite a challenge, although I did get it to do what I wanted once, and I was thrilled with the result. I just can’t duplicate it! I hope others will contribute to make this a reality. Thanks for bringing it up and for your efforts so far.
kalico: i have this working fine… but not as a plugin – it’s hard coded into the write post pages.
if i can work out how to wrap it up as a plugin, we’re in business π
Have you tried GaMerZ’s File Explorer at http://www.lesterchan.net/ ?
Not quite what I’m after – read my first post again!
3stripe,
Send me your existing code and I’ll see if I can help.
chrisATsilpstreamDOTcom
Cheers!
Did this ever go anywhere? It’s a really sweet idea and one I could use right now.
I am new to wordpress, and this sort of plug would be great. I do wonder where this has gone.