The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Is it possible in a query to sort by more than one value ?
I wanted to edit the sort by order options in the forumdisplay so that when I sort by user name it will sort by username but also then sort them into the date of last post. Is this possible ? :rambo: |
#2
|
||||
|
||||
![]()
ORDER BY username, dateline DESC
the priority is from left to right ![]() |
#3
|
||||
|
||||
![]()
nice one Xenon, can you possibly help me further I am have problems doing what I want.
I wanted to make a link on the forum threads ( in the forumdisplay ) so that users can click on them and sort them in set order. Ie a link next to the thread starters name that when pressed sorts the posts in that thread but also sorts them in the order of lastpost. So the link I have tried is /forumdisplay.php?s=&forumid=$forumid&sortfield=pos tusername,%20lastpost&sortorder=asc It dont work, so I tried this /forumdisplay.php?s=&forumid=$forumid&sortfield=tes t&sortorder=asc then in forumdisplay found PHP Code:
PHP Code:
PHP Code:
PHP Code:
Parse error: parse error, unexpected ',', expecting ']' in C:\Network\Apache2\htdocs\request\forumdisplay.php (702) : eval()'d code on line 1 It dont seem to work even with the error there ? Can you point me in the direction as to what I need to change ? Thanks ![]() |
#4
|
||||
|
||||
![]()
put
PHP Code:
PHP Code:
|
#5
|
||||
|
||||
![]()
why dont you try forumdisplay.php?sortfield=username,lastpost&order =asc
then change in the query PHP Code:
|
#6
|
||||
|
||||
![]()
@mr_e: it wouldn work because of this switch case:
PHP Code:
|
#7
|
||||
|
||||
![]()
but then couldn't he eliminate the switch all i thought the switch did was switch it between different querys, so it'd perform one query instead of another...that's what i thought anyway
|
#8
|
||||
|
||||
![]()
thanks once again it works fine, one problem I'm getting the following error at the top
Parse error: parse error, unexpected ',', expecting ']' in C:\Network\Apache2\htdocs\request\forumdisplay.php (705) : eval()'d code on line 1 Any ideas ? |
#9
|
||||
|
||||
![]()
what's line 705 and probably a few lines before and after
|
#10
|
||||
|
||||
![]()
line 705 is
PHP Code:
If i "//" out the eval the error disappears. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|