https://www.icyphoenix.com/viewtopic.php?f=26&t=2762 ----------------------------------- newguy78 Sat 08 Sep, 2007 14:20 FAP CUSTOMIZATION - Restricting Personal Galleries From Being Displayed ----------------------------------- Hello, I am using the photo outside pics mod but I'm noticing that personal gallery pics are showing up, but I do not want them to. At one point of time, I was using the smartor portal with kooky's photo album block, which allowed you to restrict personal gallery pics from being displayed. Does anyone know how I can achieve this? Below I have attached the code to the photo album outside pics mod. Thank you [code linenumbers=false]"; print "". $lang['Random_Pics'] .""; print ""; for ($i=0;$i<4;$i++) //set number of pictures for the displayed line { while ($cat['cat_view_level'] != '-1') { $sql = "SELECT pic_id, pic_desc, pic_cat_id FROM ". ALBUM_TABLE ." ORDER BY RAND() LIMIT 1"; $result = $db->sql_query($sql) or die ("SQL Error"); $row = $db->sql_fetchrow($result); $sql = "SELECT * FROM ". ALBUM_CAT_TABLE ." WHERE cat_id = '". $row['pic_cat_id'] ."'"; $result = $db->sql_query($sql) or die ("SQL Error"); $cat = $db->sql_fetchrow($result); } $cat['cat_view_level'] = '0'; print "
" . $row['pic_title'] . "
" . $row[
"; } print ""; print ""; print ""; print ""; for ($i=0;$i<4;$i++) //set number of pictures for the displayed line { while ($cat['cat_view_level'] != '-1') { $sql = "SELECT pic_id, pic_desc, pic_cat_id FROM ". ALBUM_TABLE ." ORDER BY RAND() LIMIT 1"; $result = $db->sql_query($sql) or die ("SQL Error"); $row = $db->sql_fetchrow($result); $sql = "SELECT * FROM ". ALBUM_CAT_TABLE ." WHERE cat_id = '". $row['pic_cat_id'] ."'"; $result = $db->sql_query($sql) or die ("SQL Error"); $cat = $db->sql_fetchrow($result); } $cat['cat_view_level'] = '0'; print ""; } print ""; print "
" . $row['pic_title'] . "
" . $row[
"; ?> [/code] ----------------------------------- lefty74 Sat 08 Sep, 2007 23:35 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- i just looked at mine and i have find $cat['cat_view_level'] = '0'; replace with $cat['cat_view_level'] = '1'; ----------------------------------- newguy78 Tue 11 Sep, 2007 21:04 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- Thanks for the reply, looks like the personal galleries pics are still showing up. ----------------------------------- Artie Wed 12 Sep, 2007 02:43 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- I don't make any guarantees, but this may work FIND [codeblock]for ($i=0;$i<4;$i++) //set number of pictures for the displayed line { while ($cat['cat_view_level'] != '-1') {echo $cat['cat_view_level'].' CVL'; $sql = "SELECT pic_id, pic_desc, pic_cat_id FROM ". ALBUM_TABLE ." ORDER BY RAND() LIMIT 1"; $result = $db->sql_query($sql) or die ("SQL Error"); $row = $db->sql_fetchrow($result); $sql = "SELECT * FROM ". ALBUM_CAT_TABLE ." WHERE cat_id = '". $row['pic_cat_id'] ."'"; $result = $db->sql_query($sql) or die ("SQL Error"); $cat = $db->sql_fetchrow($result); } $cat['cat_view_level'] = '0'; print "
" . $row['pic_title'] . "
" . $row[
"; }[/codeblock] REPLACE WITH [codeblock]$limit_sql = 4; //set number of pictures for the displayed line $sql = "SELECT c.*, p.* FROM " . ALBUM_CAT_TABLE . " AS c LEFT JOIN " . ALBUM_TABLE . " AS p ON c.cat_id = p.pic_cat_id WHERE c.cat_user_id = 0 AND c.cat_view_level = -1 AND ( p.pic_approval = 1 OR c.cat_approval = 0 ) ORDER BY RAND() LIMIT $limit_sql"; $result = $db->sql_query($sql) or die ("SQL Error"); while( $row = $db->sql_fetchrow($result) ) { $randrow[] = $row; } for ($i=0;$i<$limit_sql;$i++) { print "
" . $randrow[$i]['pic_title'] . "
" . $randrow[$i][
"; } [/codeblock] ----------------------------------- newguy78 Sat 15 Sep, 2007 06:46 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- Thank you, I will try your code tomorrow. ----------------------------------- newguy78 Mon 17 Sep, 2007 17:20 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- Hey, I applied your code, and I noticed that the personal gallery pics don't appear. The only problem is there is a pic description on top the thumbnail, and since I have this code repeated twice (so that I have two rows of 4 pics each) both rows display the same pics instead of them all being random. I have a testing site at www.mysite.a1forums.com/index5.php if you need to see what I'm talking about. Do you know how I can make all the photos random like before, with restricting the personal gallery pics? Also, sometimes if you refresh the screen it will show a broken thumb which leads to a pic that doesn't exist. :? ----------------------------------- Artie Wed 19 Sep, 2007 17:49 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- If you don't want the pic title to display just remove this [codeblock]" . $randrow[$i]['pic_title'] . "
[/codeblock] Hmmm, don't know what's causing the empty thumbnail. When I get some free time, I'll try to come up with something that will do what you want. ----------------------------------- 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] ----------------------------------- newguy78 Sat 22 Sep, 2007 17:40 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- Thank you so very much, I believe your code worked :mryellow: I've refreshed at least 10 times, and don't see any personal gallery pics. Thank you again! ----------------------------------- Artie Mon 24 Sep, 2007 02:50 Re: Restricting Personal Galleries From Being Displayed ----------------------------------- You're very welcome :wink: