|
|
Due to the volume of spam happening on our forums, posting is now restricted to verified members only. If you're not verified, drop us a note with your username.
|
|
Home > FlexCMS Support Forum > Recent Messages
FlexCMS Support Forum
Recent Messages
|
|
|
|
| May 24, 2010 @ 1:00pm | Need another period before the $ on BaseURL but yes that's where I meant to put it. The location in the files table is a relative path, such as /newsletters/, so depending on the URL you're at and how the browser interprets it you may end up with bad links. Adding the BaseURL variable (contains something like http://www.flexcms.com or http://somesite.com/installationfolder) in there will give you an absolute URL that will always be correct no matter what.
Dave |
|
|
|
| |
|
|
|
|
Thanks and a question... | May 24, 2010 @ 12:04pm | Dave,
Thanks!
I'd assumed that since File Manager created the info it would contain the necessary full path info. Is that not always the case?
Is this what you suggest?
Quote
$query = "SELECT `Location` , `Filename` FROM `core-Files` WHERE `Location` = \"/newsletters/pdf/\" ORDER BY Filename asc";
$result = mysql_query($query) or die (mysql_error());
print '# Newsletters: ' . number_format(mysql_num_rows($result),0) . '<br><br>';
while ($row = mysql_fetch_array($result)) { print '<a href="'.$BaseURL.$row['Location'].$row['Filename'].'" target="_blank">'.$row['Filename'].'</a><br>'; }
|
|
Thanks! Wolf |
|
|
|
| |
|
|
|
|
| May 24, 2010 @ 10:58am | Hey Wolf,
Neat script, thanks for sharing. One small change I would suggest is adding $BaseURL to the beginning of your link URL in the HREF argument of the link (ie: $BaseURL.$row['Location'].$row['Filename']). That way you'll always get the absolute link you intended, rather than relying on the browser to come up with the correct relative one (there may be issues with some browsers on deeper pages on the site because it may mistake "/pages/something" as folders and add your download link onto the end of that).
Dave |
|
|
|
| |
|
|
|
|
Automagically Generate Clickable File Links | May 24, 2010 @ 12:14am | I have a client who wanted to upload newsletters in PDF format so that clients could then click on a link to download them.
The catch is we didn't want the client to have to maintain hard coded links to the newsletters, so I came up with this little ditty...
Using File Manager, I created a directory structure called "/newsletters/pdf".
Then set permissions on the directory so that only the newsletter guy could upload to it via the new File Manager.
I created the following code snippet, then included the snippet in a block:
Quote
$query = "SELECT `Location` , `Filename` FROM `core-Files` WHERE `Location` = \"/newsletters/pdf/\" ORDER BY Filename asc";
$result = mysql_query($query) or die (mysql_error());
print '# Newsletters: ' . number_format(mysql_num_rows($result),0) . '<br><br>';
while ($row = mysql_fetch_array($result)) { print '<a href="'.$BaseURL.$row['Location'].$row['Filename'].'" target="_blank">'.$row['Filename'].'</a><br>'; }
|
|
Now all the newsletter editor has to do is upload/delete/rename files as he chooses and the links are generated dynamically.
Cheers, Wolf
PS - Be careful about naming your files... it's probably NOT a good idea to include spaces or special characters. |
|
|
|
| |
|
|
|
|
phpinfo | May 14, 2010 @ 11:13am | Dave,
I checked phpinfo and it's set to 2M upload size... and I'm only trying to upload 3Kb
Wolf |
|
|
|
| |
|
|
|
|
| May 14, 2010 @ 10:17am | Wolf,
There are a couple things that set limits, FlexCMS itself and also PHP. The file manager reads both of them and picks the lowest limit, since that's the one that's going to be in effect. Have a look at your PHP Info and see what that says for the file upload caps, I'm guessing they'll be 2M. The good news is they should be easy enough to change.
I think everything is working correctly there but if you think there's something wrong with how FlexCMS is reading or comparing the limits let us know and we'll look into it for you.
Dave |
|
|
|
| |
|
|
|
|
Another item? | May 14, 2010 @ 12:14am | Dave,
Thanks for the file manager fix, my test account is now able to see the file manager link in it's control panel.
I increased the File Manager Upload Size Limit first to 3072 and then 4000 KBytes.
But the File Manager Window displays this text at the bottom: Maximum File Size: 2048 KBytes
As a test, I am attempting to upload a PDF file of 2715 KBytes to the /newsletter/pdf/ directory.
I receive this error message from File Manager and the upload fails...:
File could not be uploaded (unknown reason) -- most likely it exceeds the limit of 2097152 bytes (2,048 Kbytes) and couldn't be uploaded
It seems as if file manager might not be honoring the filesize set in the site settings field.
Or perhaps I'm looking in the wrong place to increase the limit?
Thanks, Wolf
|
|
|
|
| |
|
|
|
|
Awsome | May 13, 2010 @ 11:20pm | David,
Again, thanks for the wonderful support! U Rock, buddy.
Wolf |
|
|
|
| |
|
|
|
|
Thank you | May 13, 2010 @ 11:19pm | David,
Thanks for the update and the fix! Hope you have a great evening.
Cheers, Wolf |
|
|
|
| |
|
|
|
|
| May 13, 2010 @ 6:30pm | Wolf,
It looks like we have a small bug where that option doesn't display even when they have the correct permission unless they have either blocks or pages permissions as well. I've fixed that on your site and we'll include that in the next release.
David |
|
|
|
|
|
|
| MEMBERS
|
|
|