SimplePortal
Customization => Blocks and Modifications => Block Requests => Topic started by: WasdMan on February 21, 2013, 04:59:32 AM
-
I use the following code ...
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?
-
Use:
ORDER BY title ASC
instead of
ORDER BY id_file DESC
-
Not so good either. No alphabetical order.
-
Then what you want to have?
-
I would have loved if the list is displayed in alphabetical order.
-
If you edited code as I wrote then there's no way that it is not working..
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);
-
(http://s17.postimage.org/pe54t38nj/sorrend.png)
As the attached picture shows, was not in the alphabet list.
-
I would like to put in a new column. For example: Views. To be carried out?