Modify filmstrip Modify filmstrip
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Modify filmstrip

Started by coopersita, October 18, 2006, 06:12:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

coopersita

I want to add a div into the filmstrip aroun each thumbnail as:

<div class="images"><a href="displayimage.php?album=10&amp;pos=1"><img src="albums/userpics/10001/thumb_gs.gif" class="image"  height="50" border="0" alt="gs.gif" title="Filename=gs.gif
Filesize=4KB
Dimensions=216x334
Date added=Oct 16, 2006" /></a></div>


But I can't find where to add the div in the theme.php file. I would also like to remove the class="image" if possible.

This is the code for the filmstrip function:

// Added to display flim_strip
function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb')
{
    global $CONFIG, $THEME_DIR;
    global $template_film_strip, $lang_film_strip;

    static $template = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $spacer = '';

    if ((!$template)) {
        $template = $template_film_strip;
        $thumb_cell = template_extract_block($template, 'thumb_cell');
        $empty_cell = template_extract_block($template, 'empty_cell');
    }

    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;

    $thumbcols = $CONFIG['thumbcols'];
    $cell_width = ceil(100 / $CONFIG['max_film_strip_items']) . '%';

    $i = 0;
    $thumb_strip = '';
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );
        } else {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => '',
                '{ADMIN_MENU}' => ''
                );
        }
        $thumb_strip .= template_eval($thumb_cell, $params);
    }

    if (defined('THEME_HAS_FILM_STRIP_GRAPHICS')) {
        $tile1 = $THEME_DIR . 'images/tile1.gif';
        $tile2 = $THEME_DIR . 'images/tile2.gif';
    } elseif (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        $tile1=$tile2=$THEME_DIR . 'images/tile.gif';
    } else {
        $tile1=$tile2= 'images/tile.gif';
    }

    $params = array('{THUMB_STRIP}' => $thumb_strip,
        '{COLS}' => $i,
        '{TILE1}' => $tile1,
        '{TILE2}' => $tile2,
        );

    ob_start();
    starttable($CONFIG['picture_table_width']);
    echo template_eval($template, $params);
    endtable();
    $film_strip = ob_get_contents();
    ob_end_clean();

    return $film_strip;
}


Thanks.

Sami

copy $template_film_strip from themes/sample/theme.php to your theme.php and change it the way you want to
‍I don't answer to PM with support question
Please post your issue to related board

coopersita

thanks. I finally found the html part that does that:

<!-- BEGIN thumb_cell -->
                <td valign="top" align="center">
                                        <div class="images"><a href="{LINK_TGT}">{THUMB}</a></div>
                                        {CAPTION}
                                        {ADMIN_MENU}
                </td>
<!-- END thumb_cell -->


But now my problem is that I don't want the current image to have the div around it, just the other ones.

Sami

Try this :


<!-- BEGIN thumb_cell -->
                <td valign="top" align="center">
                                    {MYDIV}<a href="{LINK_TGT}">{THUMB}</a>{MYDIVEND}
                                        {CAPTION}
                                        {ADMIN_MENU}
                </td>
<!-- END thumb_cell -->


and then under theme_display_film_strip function on your theme.php just after this :


    foreach($thumb_list as $thumb) {


put this:


if ($thumb['pos'] == $_GET['pos']){
$mydiv = '<div class="images">';
$mydivend = '</div>';
}else{
$mydiv= '';
$mydivend = '';
}


and then replace this:


            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => '',
                );


with this:


            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => '',
                '{MYDIV}' => $mydiv,
                '{MYDIVEND}' => $mydivend,
                );
‍I don't answer to PM with support question
Please post your issue to related board

coopersita

Awsome!!!

Thanks so much Sami.