5 Random Images....

Is it possible to drag 5 random images from the Gallery, and display them on the forum index?
Home of phpBB Integrated Modifications
http://www.integramod.com/forum/
if(!function_exists(imp_album_block_func)){ function imp_album_block_func() { global $template, $phpbb_root_path, $phpEx, $db, $board_config, $lang, $portal_config; $album_root_path = $phpbb_root_path . 'album_mod/'; include($album_root_path . 'album_common.'.$phpEx); $sql = "SELECT c.*, COUNT(p.pic_id) AS count FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id ".(($portal_config['md_pics_all2'] == '1') ? '' ], $row, 1, 0, 0, 0, 0, 0); // VIEW if ($album_user_access['view'] == 1) { $catrows[] = $row; } } if ( $portal_config['md_pics_all2'] == '1' ) { $allowed_cat = '0'; // For Recent Public Pics below } else { $allowed_cat = ''; } // // $catrows now stores all categories which this user can view. Dump them out! // for ($i = 0; $i <count>sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql); } $recentrow = array(); while( $row = $db->sql_fetchrow($result) ) { $recentrow[] = $row; } if (count($recentrow) > 0) { for ($i = 0; $i <count>assign_block_vars('recent_pics2', array()); for ($j = $i; $j <40>= count($recentrow) ) { break; } if (!$recentrow[$j]['rating']) { $recentrow[$j]['rating'] = $lang['Not_rated']; } else { $recentrow[$j]['rating'] = round($recentrow[$j]['rating'], 2); } if( ($recentrow[$j]['user_id'] == ALBUM_GUEST) or ($recentrow[$j]['username'] == '') ) { $recent_poster = ($recentrow[$j]['pic_username'] == '') ? $lang['Guest'] : $recentrow[$j]['pic_username']; } else { $recent_poster = '<a>'. $recentrow[$j]['username'] .'</a>'; } $template->assign_block_vars('recent_pics2.recent_detail', array( 'U_PIC' => ($album_config['fullpic_popup']) ? append_sid("album_pic.$phpEx?pic_id=". $recentrow[$j]['pic_id']) : append_sid("album_showpage.$phpEx?pic_id=". $recentrow[$j]['pic_id']), 'THUMBNAIL' => append_sid("album_thumbnail.$phpEx?pic_id=". $recentrow[$j]['pic_id']), 'DESC' => $recentrow[$j]['pic_desc'], ) ); $template->assign_block_vars('recent_pics2.recent_detail2', array( 'TITLE' => $recentrow[$j]['pic_title'], 'POSTER' => $recent_poster, 'TIME' => create_date($board_config['default_dateformat'], $recentrow[$j]['pic_time'], $board_config['board_timezone']), 'VIEW' => $recentrow[$j]['pic_view_count'], 'RATING' => ($album_config['rate'] == 1) ? ( $lang['Rating'] . ': ' . $recentrow[$j]['rating'] . '<br>') : '', 'COMMENTS' => ($album_config['comment'] == 1) ? ( $lang['Comments'] . ': ' . $recentrow[$j]['comments'] . '<br>') : '') ); } } } else { // No Pics Found $template->assign_block_vars('no_pics', array()); } } else { // No Cats Found $template->assign_block_vars('no_pics', array()); } // End add - Photo Album Block $template->assign_vars(array( // Start add - Photo Album Block 'S_COL_WIDTH' => (100/$album_config['cols_per_page']) . '%', 'TARGET_BLANK' => ($album_config['fullpic_popup']) ? 'target="_blank"' : '', 'L_NO_PICS2' => $lang['No_Pics2'], 'L_PIC_TITLE' => $lang['Pic_Title'], 'L_VIEW' => $lang['View'], 'L_POSTER' => $lang['Poster'], 'L_POSTED' => $lang['Posted'], 'L_PICS_NUMBER' => $portal_config['md_pics_number2'] // End add - Photo Album Block ) ); }} imp_album_block_func(); $block_count_variables = 4; // array( <Field>, <Field>, <Config>, <Options>, <Field>, <Control>, <Block>, <Default>); $block_variables = array( array('Category to retrieve pics from', 'Enter 0 for all categories or comma delimited entries', 'md_cat_id', '', '', '1', 'album', '0'), array('Number of Images to Display', '', 'md_pics_number', '', '', '1', 'album', '2'), array('Random or Newest Pics?', '', 'md_pics_sort', 'Newest,Random', '0,1', '3', 'album', '0'), array('Display from what galleries?', '', 'md_pics_all', 'Public,Public and Personal', '0,1', '3', 'album', '0') );
<table><BEGIN><tr> <td><span>{L_NO_PICS2}</span></td></tr><END><BEGIN><tr><BEGIN> <td><a><img></a></td><END></tr><tr><BEGIN> <td> <table><tr><td> <span>{L_PIC_TITLE}]</span></td></tr></table>