Posts by dazglaser

    Resolved with:


    Code
    1. // Scan the directory - removes any .. (dots) & checks if files exist
    2. $mDir = '/home/sites/secure/';
    3. $mFiles = array_diff(scandir($mDir), array('..', '.'));
    4. if ($mFiles) {
    5. foreach ($mFiles as $mF) {
    6. echo '<a class="hover-2 more" href="/download?file=/' . $mF . '">' . $mF . '</a><br />';
    7. }
    8. } else {
    9. echo '<h3 class="text-red">No Documents Found</h3>';
    10. }

    Hope this is useful for somebody.

    Hi,


    Anybody know how you show a list of all the files/documents in a secure bucket, and provide a link to download each one?


    To give a little more detail:


    If I upload the assets in the back end - perch console by using the following 'FileUploadDownload' template:

    Code
    1. perch_content('FileUploadDownload');

    Which contains...

    Code
    1. <a href="<perch:content id="docs" type="file" label="File" bucket="secure" order="2">"><perch:content type="text" id="docTitle" label="Title" order="1" required title></a>

    Then I have no problem showing a list of the files to download by just calling the same template on any page that I want to show the links, with:

    Code
    1. perch_content('FileUploadDownload');

    Which is all fine.


    I've also allowed logged in members (front end) to upload files to the same secure bucket with perch forms, using the same ID ("docs"): with:

    Code
    1. perch_form('document-upload.html');

    Which contains the following...

    Then in the forms app I've pointed the File upload path to the same secure bucket ( /home/sites/secure ) which all works fine.


    The problem is...


    I can't seem to show ALL the files in this secure bucket regardless of where they are uploaded (backend console or logged in members in the front end)


    I want to give my logged in (front end) members the ability to see and download all the documents in this particular secure bucket.


    Hope that makes sense.


    Any ideas or pointers would be massively appreciated.

    Hi Clive,


    For anyone else with the same issue...


    Figured it out. It was the php version. I've set it back to php 7.3 from php 8 and the forms app auto response html emails are correctly formatted again.

    Cheers Clive,


    Already seen that page. It tells you nothing of any value.


    But thanks for the feedback. It's much appreciated.


    While I've got you, don't suppose you've ever seen perch_forms response emails arriving unformatted rather than the html email template?


    I've started getting this...


    This is a multi-part message in MIME format.



    --b1_27930be6775adbef94371528f84abe32

    Content-Type: text/plain; charset=us-ascii


    It's only started happening since I upgraded from Runway 3 to the subscription (Runway 4)


    Daz

    Hi,


    Does anyone know where I can get detailed information about the 'Booking' aspect of perch events app?


    I'm wondering how people make a booking through the front end of the website and can't seem to find any documentation.


    I can't even seem to make a booking through the control panel.


    In the 'Events' control panel, I have created some categories, time slots and added an event, but have know idea how you go about creating a booking.


    The booking control panel remains empty and there's no '+ Add Booking' button in the top right corner as there is on the 'Categories' & 'Time Slots' panels.

    Is this correct?


    Many thanks in advance


    Daz

    Thanks pal, All sorted & everything behaving correctly now.


    For others with the same problem:


    This was what I used in 'archive.php' template, which worked for me.


    because this didn't work.

    Code
    1. 'category' => perch_get('cat'),

    perch_get('cat') was only returning the category (general) and not the whole category slug (news/general). Hope that makes sense.


    I'd just like to thank Hoops78 for his input and help, it's very much appreciated.

    Hi Hoops78,


    Thanks for that, I've now sorted the clean post url problem however, It seems to have generated a further problem.


    Now my Category links return seem to be not returning all the articles within that category. Have you ever seen this behaviour before?


    You can take a look here: https://edwardshoyle.co.uk/news


    Hi Hoops78,


    Thanks for your reply, it's very much appriciated.


    I can confirm it is Runway v3.2 & I have now updated post title to reflect that.

    I followed your instructions & removed all the rewrite rules in the htaccess file.

    used the settings you illustrated in your example but still get a 404 error.


    Can I just confirm the setting for 'Blog post page path' is '/news/{postSlug}' & 'Slug format' is '{postTitle}'?


    I really have no idea what is going on here. These are my settings:


    Hi all,


    I'm trying to get the clean URLs working for the blog post urls. I've added

    Code
    1. RewriteRule ^news/([a-zA-Z0-9-/]+)$ /news/post.php?p=$1 [L]

    to my .htaccess file. and also changed the 'Blog post page path' setting to '/news/{postSlug}' as per the instructions, but just get a 404 message when I click through to the 'post' page. This is my full .htaccess file:

    Might be also worth mentioning that I've renamed the folder containing the blog page templates to 'news' (perch/templates/pages/news). So the page location and routes for the 'news list' page is '/news' which works fine. The page location and routes for the 'post' page is '/news/post.php'. Any help or guidance would be very much appreciated.


    Daz

    Hi All,


    I'm wanting to set a default values for all products already in my Perch Shop and then update all the products once I've updated & uploaded 'product.html' file.


    I'd like to have all products 'requires_shipping' set to true (yes).


    I'd also like to know how I set dynamic fields to do the same i.e. <perch:shop id="show_productrating" type="checkbox" label="Show Product Rating" value="1" default="1">


    Many thanks in advance


    Daz

    I'm having problems getting an order to show in the 'Orders' app if I apply any 'status' within checkout.php:

    Any help and direction here would be very much appreciated.


    Actually, if I change the status to 100 or below the order disappears from the 'Orders' app. Is this supposed to happen?


    Also, what relevance/effect do the index numbers have?

    Hi,


    If you change the name of the default category:


    1. // default template
    2. $template = 'categorylevel_1.html';

    it doesn't actually use that template, it only uses category.html for level 1.


    If I then put my level 1 code into category.html it breaks the actual category system in Perch CMS.


    Does that make sense?


    I'm just trying to specify another template for level 1 other than the default category.html

    I thought it was just me being stupid.


    I'm surprised that such a simple thing (correctly formatted nested lists ) be so difficult to implement.


    This was Perch's original selling point - "A CMS should not be dictating your front-end code. With Perch, you bring your own code to your project.".


    Think this is why I went down this route, maybe the answer is something similar?