&sk=f
to the URIs, i.e.: Code: Select all
https://www.phpbb.com/community/search.php?search_id=egosearch&sk=f
Code: Select all
case 'newposts':
$l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 't';
$sort_dir = 'd';
t
(for topic) and d
(descending) to f
(for forum) and a
(ascending) to change the behaviour of the existing link. If you want your own parallel link it's just a matter of copying the whole block (from case
to break
) and give it a different label, i.e. case 'newpostsforumsort'
.Code: Select all
SQL ERROR [ mysql4 ]
Unknown column 'f.forum_id' in 'order clause' [1054]
SQL
SELECT t.topic_id FROM phpbb_topics t WHERE t.topic_last_post_time > 1391635750 AND t.topic_moved_id = 0 ORDER BY f.forum_id ASC LIMIT 1001
BACKTRACE
FILE: [ROOT]/includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()
FILE: [ROOT]/includes/db/mysql.php
LINE: 222
CALL: dbal_mysql->sql_query()
FILE: [ROOT]/includes/db/dbal.php
LINE: 170
CALL: dbal_mysql->_sql_query_limit()
FILE: [ROOT]/search.php
LINE: 491
CALL: dbal->sql_query_limit()
t
to f
): Code: Select all
$sort_by_sql[$sort_key]= 'forum_id';
Code: Select all
case 'newposts':
$l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 'f';
$sort_by_sql[$sort_key]= 'forum_id';
$sort_dir = 'a';
Code: Select all
SQL ERROR [ mysql4 ]
Column 'forum_id' in order clause is ambiguous [1052]
SQL
SELECT t.*, f.forum_id, f.forum_name, tp.topic_posted, tt.mark_time, ft.mark_time as f_mark_time FROM phpbb_topics t LEFT JOIN phpbb_forums f ON (f.forum_id = t.forum_id) LEFT JOIN phpbb_topics_posted tp ON (tp.user_id = 29 AND t.topic_id = tp.topic_id) LEFT JOIN phpbb_topics_track tt ON (tt.user_id = 29 AND t.topic_id = tt.topic_id) LEFT JOIN phpbb_forums_track ft ON (ft.user_id = 29 AND ft.forum_id = f.forum_id) WHERE t.topic_id IN (73456, 73348, 73320, 71809, 73446, 54283, 73475, 73477, 73318, 73385, 73444, 73460, 71520, 73383) ORDER BY forum_id DESC
BACKTRACE
FILE: [ROOT]/includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()
FILE: [ROOT]/search.php
LINE: 697
CALL: dbal_mysql->sql_query()
Code: Select all
case 'newposts':
$l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 't';
$sort_dir = 'd';
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
Code: Select all
case 'newposts':
$l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 't';
/*** 2014-02-06 BEGIN AmigoJack
http://www.phpbb.com/community/viewtopic.php?t=2225741 ***/
$sort_key= 'f';
/*** 2014-02-06 END ***/
$sort_dir = 'd';
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
/*** 2014-02-06 BEGIN AmigoJack
http://www.phpbb.com/community/viewtopic.php?t=2225741 ***/
$sql_sort= preg_replace( '#f\\.forum_id#i', 'forum_id', $sql_sort );
/*** 2014-02-06 END ***/