Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Thanked 0 Times in 0 Posts

    Prefetching an image from database (£5 paypal)


    I run a pixelpost photoblog and would like to prefetch the next image from the database.

    How it works: the user is given a random image at first page view and this image is hyperlinked to another random image.

    What i would like: for the next image to load silently (hidden) for instant loading on the next page.

    here is the addon that generates the next page link:

    PHP Code:

    "Random Image ";
    $addon_description "This addon will enables the tag &lt;IMAGE_RANDOM&gt;
     which is the ID of a random image of your Pixelpost photoblog. Using this ID, you can link to a random image easily.
     &lt;a href='index.php?showimage=&lt;IMAGE_RANDOM&gt;' &gt; Random photo &lt;/a&gt; <br>
    The above tag links to your photoblog with a random photo."

    $addon_version "0.3";

    // Get the number of thumbnails shown at once from the admin config
    $cfgquery mysql_query("select * from ".$pixelpost_db_prefix."config");
    $cfgrow mysql_fetch_array($cfgquery);


    $thmb_numb_r ;

        if (isset(
    $thumbs_ahead mysql_query("select DISTINCT id,headline,image from ".$pixelpost_db_prefix."pixelpost where id!=".$image_id." and datetime<='$cdate' order by rand() asc limit 0,$thmb_numb_r");
    $thumbs_ahead mysql_query("select DISTINCT id,headline,image from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by rand() asc limit 0,$thmb_numb_r");

        if (list(
    $id,$headline,$image) = mysql_fetch_row($thumbs_ahead)) {
    $rnd_img_id $id;


    $tpl ereg_replace("<IMAGE_RANDOM>",$rnd_img_id,$tpl);

    and the index.php

    Ideally it would work as an addon generating a tag such as <NEXT_IMAGE> so the image location.jpg can be added in a hidden iframe (or a better way if you can think of one).

    I think it would need to work as part of the random image addon in order for the image ID to be the same as the next page link..

    £5 paypal to whoever can get this working for me

    thanks in advance

    Last edited by lemonchicken; 01-05-2012 at 10:25 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts