Форумы / Cotonti / Core Labs / Archive / Some enhancement for list.php

Some enhancement for list.php

Asmo
#1 14.09.2008 23:47
This improvement is clear extra variables in the URL string in the sorting and pagination, if they are not used. And add highlight active arrows in sorting bar.
This looks very interesting and + clear URL string.



// At the very top, before the hook list.first
$url_string     = "list.php?c=$c";
$sort_string   .= (!empty($s) && !empty($w)) ? "&s=$s&w=$w" : "";
$filter_string .= (!empty($o) && !empty($p)) ? "&o=$o&p=$p" : "";


Pagination:
$pagination = sed_pagination($url_string.$sort_string.$filter_string, $d, $totallines, $cfg['maxrowsperpage']);
list($pageprev, $pagenext) = sed_pagination_pn($url_string.$sort_string.$filter_string, $d, $totallines, $cfg['maxrowsperpage'], TRUE);



The next hack adds highlight active arrows in sorting bar


You will also need to add two different colour images of arrows, for highlight
img/system/arrow-up-active.gif
img/system/arrow-down-active.gif

So, it looks very interesting and + clear URL string.

Heh, P.S. PFS and smiles not work Call to undefined function sed_htmlmetas()
Last core revision was very brutal :)
Отредактировано: Asmo (15.09.2008 01:22, 15 лет назад)
Orkan
#2 15.09.2008 13:51
I like arrows highlighting :) ...but maybe in more compact way?

$arrows = array();
$params = array('title','key','date','author','owner','count','filecount');
foreach($params as $val)
{
	$arrows[$val]['asc']  = $sed_img_down;
	$arrows[$val]['desc'] = $sed_img_up;
}
$arrows[$s]['asc']  = $sed_img_down_active;
$arrows[$s]['desc'] = $sed_img_up_active;
Perl - the only language that looks the same before and after RSA encryption.
Asmo
#3 15.09.2008 23:54
Good decision.
I do not coder, but I try :)

But better this :)

$arrows = array();
$params = array('title','key','date','author','owner','count','filecount');
foreach($params as $val)
{
	$arrows[$val]['asc']  = $sed_img_down;
	$arrows[$val]['desc'] = $sed_img_up;
}

$arrow[$s]['asc'] = ($s && $w=='asc') ? $sed_img_down_active : $sed_img_down;
$arrow[$s]['desc'] = ($s && $w=='desc') ? $sed_img_up_active : $sed_img_up;	
Отредактировано: Asmo (16.09.2008 00:13, 15 лет назад)
Orkan
#4 16.09.2008 01:25
ahh, yes :)

haha! The power of Arrays !!!
$sed_img_active['asc'] = "<img src=\"skins/".$usr['skin']."/img/system/arrow-up-active.gif\" alt=\"\" />";
$sed_img_active['desc'] = "<img src=\"skins/".$usr['skin']."/img/system/arrow-down-active.gif\" alt=\"\" />";

$arrows = array();
$params = array('title','key','date','author','owner','count','filecount');
foreach($params as $val)
{
	$arrows[$val]['asc']  = $sed_img_down;
	$arrows[$val]['desc'] = $sed_img_up;
}
$arrows[$s][$w]  = $sed_img_active[$w];
Perl - the only language that looks the same before and after RSA encryption.
Отредактировано: Orkan (16.09.2008 01:32, 15 лет назад)
Trustmaster
#5 17.09.2008 00:57
Feel free to commit it to trunk. But for longer term, we want to put all icons outta core, don't we?
May the Source be with you!
Kilandor
#6 17.09.2008 14:31
Correct I think would be best to pull anything that has hardcoded names like that out, or if for some reason we can't, make them configurable.