General discussion
Sort ASC DESC for Topics Subscriptions

Need to change sorting - top new, bottom old


Edit Account > Subscriptions


63514d7393677


How to do it?


I google php for sort ASC / DESC and try some code. But nothing works.


I feel that I need to add only one line of code, but I don’t understand where and which one. help pleasesmile


Need to change sorting - top new, bottom old **Edit Account > Subscriptions** ![63514d7393677](serve/attachment&path=63514d7393677) How to do it? I google php for sort ASC / DESC and try some code. But nothing works. I feel that I need to add only one line of code, but I don’t understand where and which one. help pleasex(

Hi Mate, smile


you did a google serach for a PHP command or script but sorting of ASC ( The result is sorted in ascending order) and DESC ( The result is sorted in descending order) are SQL Database commands.


Honestly, if I were you, I wouldn't mess around with the database myself and wouldn't necessarily try to use PHP in the functions and templates of the Codoforum system - you can scrap the whole script with it.


You have to have real knowledge about it and since I'm not good enough with it either, we should ask @admin or @adesh to help you here.



If you still want some more info on SQL sorting yourself, here's a quick explanation:


SQL ORDER BY syntax


The SQL syntax of a select query with ORDER BY can be structured as follows:


SELECT column name
FROM tablename
ORDER BY column name sorting parameters


The 'sorting parameter' can be built up according to the following structures:


ASC: The result is sorted in ascending order
DESC: The result is sorted in descending order


I hope that will explain it a bit to you.
Lets wait now for the Codo Team.


Kind regards, WebCrew smile


Hi Mate, :) you did a google serach for a PHP command or script but sorting of **ASC** ( The result is sorted in ascending order) and **DESC** ( The result is sorted in descending order) are **SQL** Database commands. Honestly, if I were you, I wouldn't mess around with the database myself and wouldn't necessarily try to use PHP in the functions and templates of the Codoforum system - you can scrap the whole script with it. You have to have real knowledge about it and since I'm not good enough with it either, we should ask @admin or @adesh to help you here. ---------------------------------- If you still want some more info on SQL sorting yourself, here's a quick explanation: ### SQL ORDER BY syntax **The SQL syntax of a select query with ORDER BY can be structured as follows:** **SELECT** column name **FROM** tablename **ORDER** BY column name sorting parameters The '**sorting parameter**' can be built up according to the following structures: **ASC**: The result is sorted in ascending order **DESC**: The result is sorted in descending order I hope that will explain it a bit to you. Lets wait now for the Codo Team. Kind regards, WebCrew ;)

Join: Net-Twin Community

Visit my GitHub: @WebCrew

we should ask @admin or @adesh to help you here.

Dear @admin and @adesh, help me pleasesmile

[quote="pid:26111, uid:8261"]we should ask @admin or @adesh to help you here.[/quote] Dear @admin and @adesh, help me please(blush)

Hi


If you do not mind editing a core file to do this then its quite easy.


Open sys/CODOF/Forum/Notification/Subscriber.php


Around line 540, replace


->where('n.tid', '<>', '0')

with


->where('n.tid', '<>', '0')
->orderBy('t.last_post_time', 'DESC')

You can use any other ordering field here


Hi If you do not mind editing a core file to do this then its quite easy. Open sys/CODOF/Forum/Notification/Subscriber.php Around line 540, replace ```` -&gt;where(&#039;n.tid&#039;, &#039;&lt;&gt;&#039;, &#039;0&#039;) ```` with ```` -&gt;where(&#039;n.tid&#039;, &#039;&lt;&gt;&#039;, &#039;0&#039;) -&gt;orderBy(&#039;t.last_post_time&#039;, &#039;DESC&#039;) ```` You can use any other ordering field here
Necessity is the mother of all inventions!
22
3
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft