Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default truncate file download name help please?

    im trying to use the zen_trunc_string on the tpl modules downloads page so that i can limit the characters in my filenames for download as they are stretching the tables on that page and altering the layout.

    the original was this:

    Code:
          $is_downloadable = ( (file_exists(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']) && (($downloads->fields['download_count'] > 0 && $download_timestamp > time()) || $downloads->fields['download_maxdays'] == 0)) ) ? true : false;
    and i have changed it to this:

    Code:
    $is_downloadable = ( (file_exists((zen_trunc_string(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'], 25))) && (($downloads->fields['download_count'] > 0 && $download_timestamp > time()) || $downloads->fields['download_maxdays'] == 0)) ) ? true : false;
    but it doesnt seem to be working? am i doing something wrong?

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: truncate file download name help please?

    Yes, you are doing something wrong. You are truncating the filename before the cart checks to see if it exists - that check for file_exists will always return false.

    You need to be editing much further down the file, where it is actually displaying the filename on the page:
    Code:
    <td class=""><?php echo $downloads->fields['orders_products_filename']; ?></td>
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: truncate file download name help please?

    wow, what a ridiculous mistake lol thanks so much, i think i need to stop working so late lol

    thanks again

 

 

Similar Threads

  1. Download fetch changes the file name
    By davidwenkuisz in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Mar 2010, 01:20 AM
  2. mass way to add download file name...?
    By Durtdawber in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 3 Aug 2009, 10:33 AM
  3. Truncate Product Name in Packing Slip
    By maineiac13 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Jun 2009, 03:09 PM
  4. Some help please with file name manipulation
    By chalfontgifts in forum General Questions
    Replies: 0
    Last Post: 12 Aug 2008, 05:29 PM
  5. How to change download file name
    By carlitog in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 14 Mar 2007, 08:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR