https://www.icyphoenix.com/viewtopic.php?f=26&t=2762&p=19837#p19837 ----------------------------------- Artie Wed 19 Sep, 2007 19:52 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- Give this a try .... [codeblock]if(!defined('IN_PHPBB')) { define('IN_PHPBB', true); $phpbb_root_path = './forum/'; //set your path $album_root_path = $phpbb_root_path . 'album_mod/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); } else { $album_root_path = $phpbb_root_path . 'album_mod/'; } $language = $board_config['default_lang']; if ( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_album_main.'.$phpEx) ) { $language = 'english'; // set your default language } include($phpbb_root_path . 'language/lang_' . $language . '/lang_album_main.' . $phpEx); //total number of pictures for display is 8 (2 rows of 4) $sql = "SELECT p.* FROM ". ALBUM_TABLE ." AS p LEFT JOIN ". ALBUM_CAT_TABLE ." AS c ON p.pic_cat_id = c.cat_id WHERE c.cat_user_id = 0 AND c.cat_view_level = -1 AND ( p.pic_approval = 1 OR c.cat_approval = 0 ) GROUP BY p.pic_id ORDER BY RAND() LIMIT 8"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query rand pics information', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $randrow[] = $row; } echo '
'; for ($i = 0; $i < 8 ; $i++) { if ($i == 4){ echo ''; } echo ''; } echo '
' . $lang['Random_Pics'] . '
 
';[/codeblock]