Pagina 1 din 1
Sortare ?
Scris: 28-Iun-2006, 14:03:22
de tonis
Salut all,
Cum pot sa sortez "posturile" pe un forum in ordine
crescatoare a aparitiei lor.
Adica ultimul post sa fie tot timpul cel mai de sus.
Thx
sortare
Scris: 29-Iun-2006, 15:12:41
de tonis
deci chiar nu stie nimeni ?
Scris: 29-Iun-2006, 16:28:53
de seelview
Deschide fisierul
viewtopic.php, cauta codul
Cod: Selectaţi tot
if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? htmlspecialchars($HTTP_POST_VARS['postorder']) : htmlspecialchars($HTTP_GET_VARS['postorder']);
$post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
}
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
si inlocuieste cu urmatorul
Cod: Selectaţi tot
if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? htmlspecialchars($HTTP_POST_VARS['postorder']) : htmlspecialchars($HTTP_GET_VARS['postorder']);
$post_time_order = ($post_order == "desc") ? "DESC" : "ASC";
}
else
{
$post_order = 'desc';
$post_time_order = 'DESC';
}
Scris: 08-Iul-2006, 09:36:19
de tonis
seelview scrie:Deschide fisierul
viewtopic.php, cauta codul
Cod: Selectaţi tot
if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? htmlspecialchars($HTTP_POST_VARS['postorder']) : htmlspecialchars($HTTP_GET_VARS['postorder']);
$post_time_order = ($post_order == "asc") ? "ASC" : "DESC";
}
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
si inlocuieste cu urmatorul
Cod: Selectaţi tot
if ( !empty($HTTP_POST_VARS['postorder']) || !empty($HTTP_GET_VARS['postorder']) )
{
$post_order = (!empty($HTTP_POST_VARS['postorder'])) ? htmlspecialchars($HTTP_POST_VARS['postorder']) : htmlspecialchars($HTTP_GET_VARS['postorder']);
$post_time_order = ($post_order == "desc") ? "DESC" : "ASC";
}
else
{
$post_order = 'desc';
$post_time_order = 'DESC';
}
salut, mersi de ajutor.
Dar problema e ca are efect si la asupra mesajelor din interiorul unui topic
eu as fi vrut doar topicurile sa fie sortate asa.
Acuma dupa aplicare din cauza ca are efect si asupra mesajelor daca pe unu o deschis un topic cu o intrebare anume si doi au raspuns intrebarea aceluia e ultima si apar prima data raspunsurile.
observatie-ca sa fie mai explicit
Scris: 08-Iul-2006, 09:45:12
de tonis
uite vreau sa fac exact cu e aici pe sectiunea cum pot sa?
adica topicurile sunt sortate in ordinea aparitiei lor adica cel mai nou
topic este cel mai de sus iar cand intri pe el mesajele din topic sunt sortate in ordinea crescatoare a aparitiei lor adica primul post pe un topic e cel mai de sus si raspunsurile in jos in ordiena postarii lor.
thx
Scris: 08-Iul-2006, 11:03:41
de seelview
O sa-ti caut si un cod pentru asta... dar tu ai spus in postul original ... ca vrei sa sortezi postarile... iar postarile nu este egal cu topic.
Scris: 08-Iul-2006, 13:18:11
de tonis
seelview scrie:O sa-ti caut si un cod pentru asta... dar tu ai spus in postul original ... ca vrei sa sortezi postarile... iar postarile nu este egal cu topic.
Scuze, m-am exprimat gresit.
Atunci astept o veste buna.
Inca o data mersi anticipat.
Scris: 11-Iul-2006, 16:37:34
de seelview
Codul este foarte simplu si in acest caz.
Deschide fisierul
viewforum.php, apoi cauta codul:
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
si inlocuieste cu urmatorul:
ORDER BY t.topic_type DESC, t.topic_first_post_id DESC
mersi
Scris: 14-Iul-2006, 00:01:35
de tonis
am facut modificarile si e ok
thx