SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: WasdMan on February 21, 2013, 04:59:32 AM

Title: Download Block
Post by: WasdMan on February 21, 2013, 04:59:32 AM
I use the following code ...

Code: [Select]
global $smcFunc, $scripturl;

 echo'Recent Links:<br />';

$dbresult = $smcFunc['db_query']('', '
   SELECT id_file , title
   FROM {db_prefix}down_file
   WHERE approved=1
   ORDER BY id_file DESC
   LIMIT 5');
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
   echo'<a href="'.$scripturl.'?action=downloads;sa=view;down='. $row['id_file'] . '">'.$row['title'].'</a><br />';
}
$smcFunc['db_free_result']($dbresult);

Alphabetical order, how do I put the lists?
Title: Re: Download Block
Post by: phantomm on February 21, 2013, 06:34:39 AM
Use:
Code: [Select]
ORDER BY title ASCinstead of
Code: [Select]
ORDER BY id_file DESC
Title: Re: Download Block
Post by: WasdMan on February 22, 2013, 08:20:26 AM
Not so good either. No alphabetical order.
Title: Re: Download Block
Post by: phantomm on February 22, 2013, 09:00:25 AM
Then what you want to have?
Title: Re: Download Block
Post by: WasdMan on February 22, 2013, 12:15:23 PM
I would have loved if the list is displayed in alphabetical order.
Title: Re: Download Block
Post by: phantomm on February 22, 2013, 03:54:36 PM
If you edited code as I wrote then there's no way that it is not working..
Code: [Select]
global $smcFunc, $scripturl;

 echo'Recent Links:<br />';

$dbresult = $smcFunc['db_query']('', '
   SELECT id_file , title
   FROM {db_prefix}down_file
   WHERE approved=1
   ORDER BY title ASC
   LIMIT 5');
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
   echo'<a href="'.$scripturl.'?action=downloads;sa=view;down='. $row['id_file'] . '">'.$row['title'].'</a><br />';
}
$smcFunc['db_free_result']($dbresult);
Title: Re: Download Block
Post by: WasdMan on February 23, 2013, 10:38:01 AM
(http://s17.postimage.org/pe54t38nj/sorrend.png)

As the attached picture shows, was not in the alphabet list.
Title: Re: Download Block
Post by: WasdMan on March 13, 2013, 04:56:07 AM
I would like to put in a new column. For example: Views. To be carried out?
SimplePortal 2.3.8 © 2008-2024, SimplePortal