Adam Bissonnette
Forum Replies Created
-
Forum: Plugins
In reply to: [Mmm Simple File List] Filename and DateA really simple way to do this is with the “li” format instead of a table like this:
[MMFileList format=’li’ types=’pdf’ dateformat=’d-m-Y’]{name} ({date})[/MMFileList]
If you want to accomplish the same with a table you’ll need to use the
custom
format.You should be able to do it like this:
<table> <tr> <th>Filename</th> <th>Date</th> </tr> [MMFileList format='custom' types='pdf' dateformat='d-m-Y'] <tr><td><a href='{url}'>{name}</a></td><td>{date}</td></tr> [/MMFileList] </table>
Here is an example of it on my site:
https://www.mediamanifesto.com/uncategorized/test-shortcode/Let me know if this helps – cheers!
Forum: Plugins
In reply to: [Mmm Simple File List] Adding Different File Types to Same Row of TableI think you could maybe use the custom template functionality to put a list in your list. So you could list the midi files in one and then the template could have a list filtered specifically to your list of PDFs and regex matches to the related file – filenames would have to be similar which it sounds like they are.
This is entirely hypothetical though – I’m not sure if it would work and it would probably take more resources to render – you’ll want good caching on your site ??
I’m pretty sure this shortcode support sub-shortcodes so the solution could look something like this:
[MMFileList folder="/cats/" removeextension="1" types="midi" format="li"]{name}.midi ({size})<br />
[MMFileList folder="/cats/pdfs/" types="pdf" format="li"regexfilter="/{name}/" regexfilterinclusive="1"]{name} ({size})[/MMFileList][/MMFileList]
This could create an infinite loop if done wrong so you might have to disable the plugin to undo any mistakes.
Forum: Plugins
In reply to: [Mmm Simple File List] Remove index.phpYou should be able to use a regexfilter like this:
[MMFileList ... regexfilter=”/index.php/” /]
Lemme know if it works.
Forum: Plugins
In reply to: [Mmm Simple File List] Use of capitol letters and spacingI’m happy to help and if the plugin is providing value then that’s payment enough :)!
Can you share the original filename with me? It looks like you’re using “pretty filename” which should run the following regex:
/-|_| |\.[a-zA-Z0-9]*$/
I think the problem is that that first dash needs to be escaped. I’ll have to troubleshoot later here though and maybe push a new update to the plugin to fix it. I’ll keep you posted!
Forum: Plugins
In reply to: [Mmm Simple File List] Use of capitol letters and spacingStrange! What does your shortcode look like? Are you using regex to rewrite some stuff? I thought it would be a font issue but there is definitely something wonky here.
Forum: Plugins
In reply to: [Mmm Simple File List] Filtering & regexSorry for missing this. I’d need to see this in action – I don’t think the regexfilter should be fighting with the format and types parameters. Are you still trying to get this working?
Forum: Plugins
In reply to: [Mmm Simple File List] logged in usernameYou could write a wrapper shortcode for it for dynamic folders. Something like this:
<?php function ListUserFilesFunc($atts, $content="") { $output = "User is not logged in"; $current_user = wp_get_current_user(); if ( $current_user->exists() ) { $folder = '/wp-content/uploads/folders/' . $current_user->name; $shortcode_template = '[MMFileList folder="%s" format="table" /]'; $output = do_shortcode(sprintf($shortcode_template, $folder)); } return $output; } add_shortcode('ListUserFiles', 'ListUserFilesFunc');
That could go into your functions.php file if you have a child theme – alternatively it’d be easy to put the above code into a mini plugin. Lemme know if this helps.
Forum: Plugins
In reply to: [Mmm Simple File List] How does this plugin update the display?Hey – it checks the directory on every page load. There is no built in caching. A caching tool could cache it but this one won’t offhand.
Forum: Plugins
In reply to: [Mmm Simple File List] Error, Says Path not FoundSorry for missing your note here I was off on holidays.
Looking at the path in that error statement:
/home4/jeepthin/public_html/wp-content/uploads/2022/04/../../../../../wp-content/ojt-files/newsletters
it look like there are five ../ sections I believe are coming from the shortcode. This will move it up past the folders 04/, 2022/, uploads/, wp-content/ and also public_html/ – I think this is problem because it’s looking for your content in jeepthin/wp-content/ojt-files/newsletters/.If you change it to use just four “../../../../wp-content/ojt-files/newsletters” then that should work. Alternatively you could use just three and remove the wp-content from your shortcode too “../../../ojt-files/newsletters” because wp-content is already in your path you don’t need to go past it then back up.
Let me know if this works. I can do a quick hangout call or screenshare session if you want to try figuring this out together too.
Cheers,
AdamForum: Plugins
In reply to: [Mmm Simple File List] Error, Says Path not FoundLooks like your upload settings were maybe changed to put your media files into year/month folders. Try using the shortcodes like this [MMFileList folder=”/../../../wp-content/ojt-files/newsletters” orderby=”name” order=”desc” /]
You might need more or fewer /../’s in there. You could also swap out the wp-content for one fewer /../
Forum: Plugins
In reply to: [Mmm Simple File List] filter files by name?Heya I’ve added a new version with this feature just for you. You can use the
regexfilter
parameter to exclude any filenames with “xyz” and then if you use theregexfilterinclusive
parameter you can flip the behaviour so it only shows files that match.Here are some examples on my test site:
https://mediamanifesto.com/skunkworks/file-list-tests/The readme was also updated with some examples but for your example specifically where you want to
list all files contains “xyz”
you can use the shortcode with parameters as follows:
[MMFileList regexfilter=”/abc/” regexfilterinclusive=”1″ /]You can play around with regex formatting here to get a pattern that works for your use case:
https://regex101.com/Or if you want to keep the discussion in the forums feel free to add another message and I will try to help as soon as I can ??
Cheers and good luck!
Forum: Plugins
In reply to: [Mmm Simple File List] Still maintained?Hi there! It still works. I haven’t published an update in two years because it hasn’t needed one. The key with being a “simple” plugin is that it doesn’t embed scripts or mess with your admin interfaces. It’s just a shortcode and some helper functions so it should be safe to use. I’ll try updating here and hopefully that clears this issue up for people. Thanks for using the plugin and good luck with the site.
Forum: Plugins
In reply to: [Mmm Simple File List] Error linkI think by default it’s trying to grab stuff out of your default media folder. If you go to settings -> media and then deselect “Organize my uploads into month- and year-based folders” you should be good.
Can you share a copy of the shortcode you’re using just in case?
Forum: Plugins
In reply to: [Mmm Simple File List] Download filesSorry for the late reply. You can definitely add a “download” button using the custom template functionality. If you shoot me a link to the website I can walk you through the process!
Forum: Plugins
In reply to: [Mmm Simple File List] Error 404 – when linking to fileVery strange – can you share a link to the site? If it finds the files it should be able to open those links directly – my only guess is that that subfolder maybe has strange .htaccess permissions or something.