TinyPortal

Development => Support => Topic started by: dimdom on November 24, 2008, 01:14:18 PM

Title: Exclude categories from a gallery block
Post by: dimdom on November 24, 2008, 01:14:18 PM
I use this code to a front page block in Tiny Portal  ( 0.9.8 ) to show recent images in SMF Gallery.


global $scripturl,$db_prefix,$modSettings,$boardurl;
 echo'<table cellspacing="0" cellpadding="3" border="0" align="center" width="90%"><tr>';
 if(empty($modSettings['gallery_url']))
 {
   $modSettings['gallery_url'] = $boardurl . '/gallery/';
 }
 $request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY date DESC LIMIT 6", __FILE__,__LINE__);
 while ($row = mysql_fetch_assoc($request))
 echo' <center><td align="center" colspan="3"><a href="', $scripturl, '?action=gallery;sa=view;id=',
 $row['ID_PICTURE'], '"><img src="',  $modSettings['gallery_url'] .

 $row['thumbfilename'] ,'" /></a></center>';
 echo'</td></tr>';
 echo'</table></br>';
 mysql_free_result($request);


How can I exclude certain categories from fetching pictures to that block?


Thank you in advance!
Title: Re: Exclude categories from a gallery block
Post by: G6Cad on November 24, 2008, 01:17:44 PM
By using Thurnoks code for the SMF gallery he have posted in our block code and snippets board, search his posts in that board and you will find it  :up:
Title: Re: Exclude categories from a gallery block
Post by: dimdom on November 24, 2008, 02:05:20 PM
Thanks!

I found it.