This post was last edited by u010801782 on 2013-07-30 23:32:15
<title>Demo</title>
$value) {Array_multisort ($sTime, SORT_ASC, $value);? >
|
|
$v) {$sTime [$key] = $v [' stime '];? >
|
|
|
$v [' stime '] && time () < $v [' etime ']) {echo ' open ';} if (Time () < $v [' stime ']) {echo ' temporarily not open ';} if (Time () > $v [' etime ']) {echo ' expired ';} ?> |
| Has expired |
The final effect, ask how the front-end display when the time-size descending and already expired line moved to the expired under.
Reply to discussion (solution)
Sort by expiration first, then by time, and order by expires
If the order is only sequential, the expired next side does not expire at the top of each of the reverse chronological order
$sql = ' SELECT * ' from News order by Guoqi Desc,time desc
If you need to categorize it for two cycles, the list position that has not expired is cycled once, the expired list position is cycled once, and the field that is determined to expire directly when the content is looped out
If the order is only sequential, the expired next side does not expire at the top of each of the reverse chronological order
$sql = ' SELECT * ' from News order by Guoqi Desc,time desc
If you need to categorize it for two cycles, the list position that has not expired is cycled once, the expired list position is cycled once, and the field that is determined to expire directly when the content is looped out
Need to classify the loop output, how can I do? Do you have an example?
$value) {Array_multisort ($sTime, SORT_ASC, $value);? >
|
|
$V) {if (Time () <= $v [' etime ']) {$sTime [$key] = $v [' stime ']; ?>
|
|
|
$v [' stime '] && time () < $v [' etime ']) {echo ' open ';} if (Time () < $v [' stime ']) {echo ' is temporarily open ';}? > |
| Has expired |
$value) {Array_multisort ($sTime, SORT_ASC, $value);? >
|
|
$V) {if (Time () > $v [' etime ']) {$sTime [$key] = $v [' stime ']; ?>
|
|
|
Has expired |
Two cycles in the loop to determine whether the expiration has expired the bottom display other top display