Adding random images along the top of the gallery? Adding random images along the top of the gallery?
 

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

Adding random images along the top of the gallery?

Started by keaton29, January 31, 2006, 02:59:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

keaton29

So far, I've added this to my theme.php based on searching these forums.

function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    user_save_profile();

//grab a single random image
$custom_pic_data_random=get_pic_data('random', $count, $album_name,0, 1, false);
//returns an array even if its only one item
$custom_pic_data_random=current($custom_pic_data_random);
//grabs the first item
$url_random=get_pic_url($custom_pic_data_random, 'thumb');

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
        '{CHARSET}' => $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset'],
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
'{RANDOM_IMAGE}' => "<a href=\"displayimage.php?pos=-{$custom_pic_data_random['pid']}\"><center><img src=\"$url_random\"/ class=\"image\" ></center></a>",
        );

    echo template_eval($template_header, $template_vars);
}



Then I added the {RANDOM_IMAGE} to my template.html and it works fine.  The only problem is, it displays only one image.  I want it to display 6 images.  How can I increase this?