Page 1 of 1

5 Random Images....

PostPosted: Sun Aug 06, 2006 3:04 am
Author: napukjon
Is it possible to drag 5 random images from the Gallery, and display them on the forum index?

PostPosted: Mon Aug 07, 2006 12:48 pm
Author: napukjon
No one then <img>

Re: 5 Random Images....

PostPosted: Mon Aug 07, 2006 1:17 pm
Author: Helter
im sure it would be fairly easy to hard code one of the album blocks to the index_body.tpl and set it to display random images

PostPosted: Mon Aug 07, 2006 1:35 pm
Author: napukjon
Yeah i know, but i dont have the brains for it. I would use the Horizontal block but they dont display on the index where i want... If someone could find out how to do it i would be greatful! <img>

Il have a look myself, see and see what i can spot and see if i can do it myself!

PostPosted: Tue Aug 08, 2006 5:03 am
Author: napukjon
I had a go at this and all i got was the bottom bar from the block that links to the gallery <img> lol

Re: 5 Random Images....

PostPosted: Fri Aug 11, 2006 12:29 pm
Author: napukjon
This is what ive got so far....

[flash=,:2b5yeoz6]http://community.napuk.co.uk/photos.JPG[/flash:2b5yeoz6]

But i cant for the life of me get the images to work....Dont know if anyone knows how i would get them to show, what code i use? Im inpressed with myself so far lol! <img>

Cheers

Jon

PostPosted: Fri Aug 11, 2006 1:37 pm
Author: napukjon
All the links say for the photos when i look at them in the properties is

http://[mysite.com/album_thumbnail.php?pic_id=

So the images arent being picked up....hmm...confusing... <img>

PostPosted: Fri Aug 11, 2006 2:17 pm
Author: napukjon
Im at lose end now...

This is the code ive used for index.php

Code: Select all
 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')     );  


And this for index_body

Code: Select all
 <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>  


Anyone have a look through those and see what im doing wrong!

Thanks!