Center Downloads Block

Support for IntegraMOD 141

Moderator: Integra Moderator

Center Downloads Block

PostAuthor: Khimaira » Sun Mar 25, 2007 7:57 am

I am using the Center Downloads Block that shows Top and New downloads. Is it possible for it to also show which category the download is from?
Last edited by Khimaira on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Khimaira
Newbie
Newbie
 
Posts: 17
Likes: 0 post
Liked in: 0 post
Joined: Fri Aug 25, 2006 4:40 am
Cash on hand: 0.00

Re: Center Downloads Block

PostAuthor: Frost » Mon Mar 26, 2007 7:36 am

I'm looking into this for you <img>
Last edited by Frost on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[size=99px]PhpBB3 Themes[/url] ]PhpBB3 Development Center[/url] [/size]

Frost
Sr Integra Member
Sr Integra Member
 
Posts: 776
Likes: 0 post
Liked in: 0 post
Joined: Wed Sep 13, 2006 2:04 am
Cash on hand: 0.00
Location: Photoshop CS3

Re: Center Downloads Block

PostAuthor: Helter » Mon Mar 26, 2007 6:12 pm

ive almost got this working, but im having trouble. No matter what syntax I use, I cannot get it to querry the pa_cat table. Can anyone show me the proper edit to this
Code: Select all
          $sql = "SELECT * FROM " . $table_prefix."pa_files ORDER BY file_dls DESC LIMIT 0," . $portal_config['md_num_top_downloads'];           if ( !($result = $db->sql_query($sql)) )



here is the full block

Code: Select all
 <php> 'category');                          if(!function_exists(imp_center_downloads2_block_func)){     function imp_center_downloads2_block_func()     {         global $template, $portal_config, $table_prefix, $phpEx, $db, $lang, $board_config, $theme;           $sql = "SELECT * FROM " . $table_prefix."pa_files ORDER BY file_dls DESC LIMIT 0," . $portal_config['md_num_top_downloads'];           if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Could not query database for the most downloads');         }           $i = 1;         while ($file_most = $db->sql_fetchrow($result))         {               $row_class = ( !($i % 2) ) ? 'row1'],                 'FILECATNAME_MOST' => $file_most['cat_name'],                 'ROW_CLASS' => $row_class,                 'FILELINK_MOST' => append_sid("dload." . $phpEx . "?action=file&file_id=" . $file_most['file_id']),                 'FILENAME_MOST' => $file_most['file_name'],                 'DESCRIP_MOST' => $file_most['file_desc'],                 'INFO_MOST' => $file_most['file_dls'] . ' ' . $lang['Dls'])             );                             $i++;         }           $sql = "SELECT * FROM " . $table_prefix."pa_files ORDER BY file_time DESC LIMIT 0," . $portal_config['md_num_new_downloads'];           if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Could not query database for the most downloads');         }           $i = 1;         while ($file_latest = $db->sql_fetchrow($result))         {               $row_class = ( !($i % 2) ) ? 'row1': 'row2';             $template->assign_block_vars('dlrow2', array(                 'NUMBER_LATEST' => strval($i),                 'FILECATID_LATEST' => $file_latest['file_catid'],                 'FILECATNAME_LATEST' => $file_latest['cat_name'],                 'FILELINK_LATEST' => append_sid("dload." . $phpEx . "?action=file&file_id=" . $file_latest['file_id']),                 'ROW_CLASS' => $row_class,                 'FILENAME_LATEST' => $file_latest['file_name'],                 'DESCRIP_LATEST' => $file_latest['file_desc'],                 'INFO_LATEST' => create_date($board_config['default_dateformat'], $file_latest['file_time'], $board_config['board_timezone']))             );                             $i++;         }           $template->assign_vars(array(             'FILE_CATAGORY' => $lang['File_catagory'],             'TOP_DOWNLOADS' => $lang['Top_downloads'],             'NEW_DOWNLOADS' => $lang['New_downloads']             )         );     }}  imp_center_downloads2_block_func();?>  


you can see what ive got so far at the bottom of this page http://www.duiplayground.com/forum/portal.php
Last edited by Helter on Tue Mar 27, 2007 4:20 pm, edited 1 time in total.
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: Center Downloads Block

PostAuthor: Frost » Tue Mar 27, 2007 5:13 am

Hmm, if I had the tpl file and cfg (if exists) i could do a trial and error but maybe try this?

Code: Select all
<php>sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Could not query database for the most downloads');         }           $i = 1;         while ($file_most = $db->sql_fetchrow($result))         {               $row_class = ( !($i % 2) ) ? 'row1'],                 'FILECATNAME_MOST' => $file_most['cat_name'],                 'ROW_CLASS' => $row_class,                 'FILELINK_MOST' => append_sid("dload." . $phpEx . "?action=file&file_id=" . $file_most['file_id']),                 'FILENAME_MOST' => $file_most['file_name'],                 'DESCRIP_MOST' => $file_most['file_desc'],                 'INFO_MOST' => $file_most['file_dls'] . ' ' . $lang['Dls'])             );                             $i++;         }           $sql = "SELECT * FROM " . $table_prefix."pa_files ORDER BY file_time DESC LIMIT 0," . $portal_config['md_num_new_downloads'];           if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Could not query database for the most downloads');         }           $i = 1;         while ($file_latest = $db->sql_fetchrow($result))         {               $row_class = ( !($i % 2) ) ? 'row1': 'row2';             $template->assign_block_vars('dlrow2', array(                 'NUMBER_LATEST' => strval($i),                 'FILECATID_LATEST' => $file_latest['file_catid'],                 'FILECATNAME_LATEST' => $file_latest['cat_name'],                 'FILELINK_LATEST' => append_sid("dload." . $phpEx . "?action=file&file_id=" . $file_latest['file_id']),                 'ROW_CLASS' => $row_class,                 'FILENAME_LATEST' => $file_latest['file_name'],                 'DESCRIP_LATEST' => $file_latest['file_desc'],                 'INFO_LATEST' => create_date($board_config['default_dateformat'], $file_latest['file_time'], $board_config['board_timezone']))             );                             $i++;         }           $template->assign_vars(array(             'FILE_CATAGORY' => $lang['File_catagory'],             'TOP_DOWNLOADS' => $lang['Top_downloads'],             'NEW_DOWNLOADS' => $lang['New_downloads']             )         );     }}  imp_center_downloads2_block_func();?>


Note: Removed
Code: Select all
'category');
as I did not know what it was for, and tried testing, without luck for lack of tpl/cfg

Also, looks like you're almost there, I thought I saw some cat id #s <img>
Last edited by Frost on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[size=99px]PhpBB3 Themes[/url] ]PhpBB3 Development Center[/url] [/size]

Frost
Sr Integra Member
Sr Integra Member
 
Posts: 776
Likes: 0 post
Liked in: 0 post
Joined: Wed Sep 13, 2006 2:04 am
Cash on hand: 0.00
Location: Photoshop CS3

Re: Center Downloads Block

PostAuthor: Frost » Fri Apr 06, 2007 10:34 am

I just looked back at your site Helter, almost there lol

I asked some guys at phpbbmodders but no reply, that seems to be a popular thing over there <img>
Last edited by Frost on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[size=99px]PhpBB3 Themes[/url] ]PhpBB3 Development Center[/url] [/size]

Frost
Sr Integra Member
Sr Integra Member
 
Posts: 776
Likes: 0 post
Liked in: 0 post
Joined: Wed Sep 13, 2006 2:04 am
Cash on hand: 0.00
Location: Photoshop CS3


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]