Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorpostme
    • CommentTimeMar 25th 2006
     
    I made some enhancements to plogger for controlling the slideshow settings (interval between screen updates en prefetching).

    First add two new columns to the plogger_config table, using phpmyadmin you can execute the following SQL statements:

    ALTER TABLE `plogger_config` ADD `slideshow_prefetch` TINYINT( 4 ) DEFAULT '-1' NOT NULL ;
    ALTER TABLE `plogger_config` ADD `screen_interval` INT( 11 ) DEFAULT '4000' NOT NULL ;


    Open /admin/plog-options.php and change the $query string on line 14 to:

    $query = "UPDATE `".$TABLE_PREFIX."config` SET
    `truncate`='".intval($_POST["truncate"])."',
    `feed_title`='".mysql_escape_string($_POST["feed_title"])."',
    `rss_thumbsize`='".intval($_POST["rss_thumbsize"])."',
    `feed_language`='".mysql_escape_string($_POST["feed_language"])."',
    `feed_num_entries`='".intval($_POST["feed_num_entries"])."',
    `allow_dl`='".intval($allow_dl)."',
    `allow_comments`='".intval($allow_comments)."',
    `allow_print`='".intval($allow_print)."',
    `max_thumbnail_size`='".intval($_POST["max_thumbnail_size"])."',
    `max_display_size`='".intval($_POST["max_display_size"])."',
    `default_sortby`='".mysql_escape_string($_POST["default_sortby"])."',
    `default_sortdir`='".mysql_escape_string($_POST["default_sortdir"])."',
    `thumb_num`='".intval($_POST["thumb_num"])."',
    `compression`='".intval($_POST["image_quality"])."',
    `admin_username`='".mysql_escape_string($_POST["admin_username"])."',
    `admin_email`='".mysql_escape_string($_POST["admin_email"])."',
    `date_format`='".mysql_escape_string($_POST["date_format"])."',
    `use_mod_rewrite`='".intval($_POST["use_mod_rewrite"])."',
    `square_thumbs`='".intval($square_thumbs)."',
    `comments_notify`='".intval($_POST["comments_notify"])."',
    `slideshow_interval`='".intval($_POST["slideshow_interval"])."',
    `slideshow_prefetch`='".intval($_POST["slideshow_prefetch"])."',
    `gallery_name`='".mysql_escape_string($_POST["gallery_name"])."'";


    Around line 78 add the following:

    $slideshow_prefetches = array(
    'preload all images' => '-1',
    'load each image as it is used' => '0',
    'pre-fetch 1 image ahead of the current image' => '1',
    'pre-fetch 2 images ahead of the current image' => '2',
    'pre-fetch 3 images ahead of the current image' => '3',
    'pre-fetch 4 images ahead of the current image' => '4',
    'pre-fetch 5 images ahead of the current image' => '5'
    );


    Around line 274 add the following:

    $output .= '</td>
    </tr>
    </table>
    <h1>Slideshow Options</h1>
    <table style="width:550px;text-align:right;font:georgia">
    <tr>
    <td><strong>Screen refresh</strong> (milliseconds):</td>
    <td>
    <input type="text" name="slideshow_interval" value="'.stripslashes($config['slideshow_interval']).'"/>
    </td>
    </tr>
    <tr>
    <td><strong>Screen prefetch</strong>:</td>
    <td>
    <select name="slideshow_prefetch">';

    foreach ($slideshow_prefetches as $key => $value){
    $output .= '<option value="'.$value.'"';
    if ($config["slideshow_prefetch"] == $value) $output .= ' selected="selected"';
    $output .= '>'.$key.'</option>';
    }

    $output .= ' </select>
    </td>
    </tr>
    </table>';

    And lastly in gallery.php on line 1168:

    $output .= 'slides.prefetch = '.$config["slideshow_prefetch"].';
    slides.timeout = '.$config["slideshow_interval"].'; ';

    That's all, now you can configure some important settings for the slideshow.

    Cheers,

    Meint