Sortare ?

Pentru întrebări legate de facilităţile forumului phpBB 2.0.x, acest loc este cel mai potrivit.
Închis
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

Sortare ?

Mesaj 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
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

sortare

Mesaj de tonis »

deci chiar nu stie nimeni ?
Avatar utilizator
seelview
Fost coleg
Mesaje: 2146
Membru din: 13-Apr-2005, 21:24:50
Versiune: 3.x
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Foarte experimentat
Localitate: Cu curu' pe scaun
Contact:

Mesaj 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';
}
"Don't have fear, I is here"
Seelview Photography / Blog this
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

Mesaj 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.
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

observatie-ca sa fie mai explicit

Mesaj 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
Avatar utilizator
seelview
Fost coleg
Mesaje: 2146
Membru din: 13-Apr-2005, 21:24:50
Versiune: 3.x
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Foarte experimentat
Localitate: Cu curu' pe scaun
Contact:

Mesaj 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.
"Don't have fear, I is here"
Seelview Photography / Blog this
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

Mesaj 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.
Avatar utilizator
seelview
Fost coleg
Mesaje: 2146
Membru din: 13-Apr-2005, 21:24:50
Versiune: 3.x
Ext: Da
Server: UNIX/Linux
Nivel phpBB: Foarte experimentat
Localitate: Cu curu' pe scaun
Contact:

Mesaj 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
"Don't have fear, I is here"
Seelview Photography / Blog this
Avatar utilizator
tonis
Utilizator înregistrat
Mesaje: 13
Membru din: 24-Feb-2006, 14:47:15

mersi

Mesaj de tonis »

am facut modificarile si e ok
thx
Închis

Înapoi la “2.0.x Cum pot să...?”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator