Quick code Question?
Posted: Mon Oct 23, 2006 10:14 am
Everah | Please use
------------------------------------------------------
------------------------------------------------------
------------------------------------------------------
Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Sorry if i am on the wrong forum to ask this question.
I currently have 2 sections of code to sort items by a price field and when the item was last modified. You can chose 1 or the other but i need to combine both. Below is the two sections of code so basically i need to order it by "price" but if the price is the same for two items it should be ordered by "modified". Thanks for any help.
Niel
------------------------------------------------------Code: Select all
<?php if (!empty($hp_use_sort_price) && !empty($caption['price']->caption)) { ?>
<a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=viewtype&id='.$prop[0]->typeid.'&sort=price&order=asc&limit='.$pageNav->limit.'&limitstart='.$pageNav->limitstart.'&Itemid='.$Itemid); ?>" title="<?php echo _HP_SORT_LOWEST_PRICE; ?>"> <?php echo _HP_SORT_ASC; ?> </a> <?php echo $caption['price']->caption; ?> <a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=viewtype&id='.$prop[0]->typeid.'&sort=price&order=desc&limit='.$pageNav->limit.'&limitstart='.$pageNav->limitstart.'&Itemid='.$Itemid); ?>" title="<?php echo _HP_SORT_HIGHEST_PRICE; ?>"> <?php echo _HP_SORT_DESC; ?> </a> |
<?php } ?>------------------------------------------------------
Code: Select all
<?php if (!empty($hp_use_sort_modified) && !empty($caption['modified']->caption)) { ?>
<a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=viewtype&id='.$prop[0]->typeid.'&sort=modified&order=asc&limit='.$pageNav->limit.'&limitstart='.$pageNav->limitstart.'&Itemid='.$Itemid); ?>"> <?php echo _HP_SORT_ASC; ?> </a> <?php echo $caption['modified']->caption; ?> <a href="<?php echo sefRelToAbs('index.php?option=com_hotproperty&task=viewtype&id='.$prop[0]->typeid.'&sort=modified&order=desc&limit='.$pageNav->limit.'&limitstart='.$pageNav->limitstart.'&Itemid='.$Itemid); ?>"> <?php echo _HP_SORT_DESC; ?> </a> |
<?php } ?>Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]