TwelvestoneBack End

Wordpress: pull image URL from DB


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
X-DUD!!!11~~
 
2011-02-08

So I'm using this WP theme which is 99% awesome... however, I just found out last night, every time someone visits the home page it generates new image thumbnails.

So, like, if my site has 1000 visitors, it makes the server go through the process of generating thumbnails 1000 times. No idea what'd happen if 2 people accessed the site at the same time.

Anyway, I know Jack Schitt about pulling records from the DB with PHP; is there a quick/obvious fix here?

Instead of Mobility_Image::getResizedAttachmentTag($slide['third'], $galleryParams['thirdWidth'], $galleryParams['thirdHeight']) how do I have it simply get the file name of the original image?

<?php if (Mobility::getThemeOption('sliderType') == 'threeWaySlider'): ?> <?php $slides = Mobility::getThemeOption('slides') ?> <?php if (!empty($slides)): ?> <?php foreach ($slides as $slide): ?> <?php $slidePost = (int) $slide['slidePost'] ?> <?php if ($slidePost && is_object($postData = get_post($slidePost))): ?>

                    <div class="opacity-box6">
                        <h2><a href="<?php echo get_permalink($slidePost) ?>"><?php echo wp_specialchars($postData->post_title) ?></a></h2>
                        <p><?php echo wp_specialchars($postData->post_excerpt) ?></p>
                    </div>

                    <?php endif ?>
                    <?php wp_reset_query() ?>
                    <?php echo Mobility_Image::getResizedAttachmentTag($slide['main'], $galleryParams['mainWidth'], $galleryParams['mainHeight']) ?>
                </div>
                <div class="second"><?php echo Mobility_Image::getResizedAttachmentTag($slide['second'], $galleryParams['secondWidth'], $galleryParams['secondHeight']) ?></div>
                <div class="third"><?php echo Mobility_Image::getResizedAttachmentTag($slide['third'], $galleryParams['thirdWidth'], $galleryParams['thirdHeight']) ?></div>
            </li>
            <?php endforeach ?>
        </ul>
        <div class="overlay"><a href="#"> </a></div>
    </div>
</div>
<?php endif ?>

<?php endif ?>

<3

X-DUD!!!11~~
 
2011-02-11

Decided to just say fuggit and code the shit manually. I won't be updating it often enough to need a DB-fed version.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneBack End

Wordpress: pull image URL from DB