Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter beneficialmedia

    (@beneficialmedia)

    The layout works perfectly! I’m very happy with that, now onto a new issue. It seems that document gallery times out before it generates all the thumbs. I changed the timeouts from 30 secs and 60 secs to 3600 secs. This kinda worked… The plugin generated many more thumbnails than before, but still there are many that didn’t generate. I guess my question is, how do I generate all the thumbnails? I’d like to hack a solution, then undo the hack for all the one-off PDFs in the future, allowing your plugin to do its job. The PDFs all have read and write permissions and all seem to be capable. Would the pdf file sizes make a difference? Some are 5-7 megs. Maybe the PDFs need to be exported with some setting to allow the generation of these pngs?

    Thread Starter beneficialmedia

    (@beneficialmedia)

    This is very close…

    <!-- attachment thumbnail -->
    <?php if (wp_get_attachment_url($attachment_id) != null) : // Check if doc gallery thumbnail exists ?>
      <a href="<?php the_permalink(); ?>" class="inheritssomeclass" style="position: absolute; top: 0; left: 0; width: 88px; height: 114px; background: #CCCCCC; border: 1px solid #000000; text-decoration: none; overflow: hidden;">
        <img src="<?php echo DG_Thumber::getThumbnail(get_the_ID()); // We display pdf and word thumbnails ?>" style="width: 100%; height: auto;"/>
      </a>
    <?php endif; ?>
    <!-- /attachment thumbnail -->

    get_the_id() returns the attachment id. However, I noticed that many of the pdf’s only show the default thumbnail. Is there a special setting in a pdf that works with Imagick/GhostScript?

    Thread Starter beneficialmedia

    (@beneficialmedia)

    So I figured out that I need to do something like DG_Thumber::getThumbnail(3205, 1);

    the number 3025 is the attachment id. What variable returns this number? I may figure it out soon, but if you know that would be cool too.

    Thread Starter beneficialmedia

    (@beneficialmedia)

    Here’s my block:

    <!-- attachment thumbnail -->
    <?php if (wp_get_attachment_url($attachment_id) != null) : // Check if doc gallery thumbnail exists ?>
      <a href="<?php the_permalink(); ?>" class="inheritssomeclass" style="position: absolute; top: 0; left: 0; width: 88px; height: 114px; background: #CCCCCC; border: 1px solid #000000; text-decoration: none; overflow: hidden;">
        <img src="<?php echo DG_Thumber::getThumbnail(); // We display pdf and word thumbnails ?>" style="width: 100%; height: auto;"/>
      </a>
    <?php endif; ?>
    <!-- /attachment thumbnail -->
    Thread Starter beneficialmedia

    (@beneficialmedia)

    I’ve almost got it. How do I ensure it returns the fancy thumber path and not the default if I’m using this as an img src path?

    Thread Starter beneficialmedia

    (@beneficialmedia)

    I’m developing a custom theme. For this case, I’m editing loop.php to support the search everything plugin along with the Media Library Assistant plugin to return a list of tagged pdf and word docs from the media library. My goal is to adapt your plugin to return a thumbnail of the search results in the loop.

    //Dylan

    Thread Starter beneficialmedia

    (@beneficialmedia)

    I understand the concept, but I don’t have any experience directly accessing methods. Would you please provide more details of how to do this?

    Thread Starter beneficialmedia

    (@beneficialmedia)

    Thanks, Dan!

    The absolute path did the trick.

    However, when I use in loop.php:

    <div class="inheritssomeclass">
      <?php echo do_shortcode('[dg fancy=true]'); // We display pdf and word thumbnails ?>
    </div>

    …it returns something like 600 thumbnails in the loop. How do I reference this short code like a post thumbnail? So that it only returns the search results I want?

    //Dylan

Viewing 8 replies - 1 through 8 (of 8 total)